id stringlengths 21 132 | codebase stringclasses 57 values | c_file stringlengths 3 108 | function stringlengths 3 74 | sloc stringclasses 134 values | c_code stringlengths 25 52.1k | c_constructs dict |
|---|---|---|---|---|---|---|
make-4.4.1#posixos_prep#jobserver_post_child.c | make-4.4.1 | posixos.c | jobserver_post_child | 9 | void
jobserver_post_child (int recursive)
{
if (recursive && js_type == js_pipe)
{
fd_noinherit (job_fds[0]);
fd_noinherit (job_fds[1]);
}
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
gprolog-1.5.0#stream_c_prep#Pl_Open_Output_Term_Stream_1.c | gprolog-1.5.0 | stream_c.c | Pl_Open_Output_Term_Stream_1 | 7 | void
Pl_Open_Output_Term_Stream_1(WamWord stm_word)
{
int stm;
stm = Pl_Add_Str_Stream(((void *)0), (pl_sys_var[0]));
Pl_Get_Integer(stm, stm_word);
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
less-633#lesskey_prep#lesskey_parse_error.c | less-633 | lesskey.c | lesskey_parse_error | 4 | void lesskey_parse_error(char *s)
{
fprintf(stderr, "%s\n", s);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
make-4.4.1#hash_prep#hash_delete_items.c | make-4.4.1 | hash.c | hash_delete_items | 13 | void
hash_delete_items (struct hash_table *ht)
{
void **vec = ht->ht_vec;
void **end = &vec[ht->ht_size];
for (; vec < end; vec++)
*vec = 0;
ht->ht_fill = 0;
ht->ht_collisions = 0;
ht->ht_lookups = 0;
ht->ht_rehashes = 0;
ht->ht_empty_slots = ht->ht_size;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#MAXIMUM_PROFIT_BY_BUYING_AND_SELLING_A_SHARE_AT_MOST_K_TIMES_prep#len.c | transcoder-set | MAXIMUM_PROFIT_BY_BUYING_AND_SELLING_A_SHARE_AT_MOST_K_TIMES.c | len | 1 | int len (int arr [ ]) {return ((int) (sizeof (arr) / sizeof (arr)[0]));}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#NUMBER_N_DIGITS_NON_DECREASING_INTEGERS_prep#min.c | transcoder-set | NUMBER_N_DIGITS_NON_DECREASING_INTEGERS.c | min | 1 | int min(int x, int y) { return (x < y)? x: y; }
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libxml2#xmlunicode_prep#xmlUCSIsCat.c | libxml2 | xmlunicode.c | xmlUCSIsCat | 8 | int
xmlUCSIsCat(int code, const char *cat) {
xmlIntFunc *func;
func = xmlUnicodeLookup(&xmlUnicodeCatTbl, cat);
if (func == ((void *)0))
return (-1);
return (func(code));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libxml2#encoding_prep#xmlOpenCharEncodingHandler.c | libxml2 | encoding.c | xmlOpenCharEncodingHandler | 5 | int
xmlOpenCharEncodingHandler(const char *name, int output,
xmlCharEncodingHandler **out) {
return(xmlCreateCharEncodingHandler(name, output, ((void *)0), ((void *)0), out));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
rcs-5.10.1#rcsrev_prep#take.c | rcs-5.10.1 | rcsrev.c | take | 14 | struct cbuf
take (size_t count, char const *ref)
{
struct cbuf rv;
char const *end = ref;
if (!count)
count = -2 + (1U | (1 + countnumflds (ref)));
while (count--)
while (*end && '.' != *end++)
continue;
accumulate_range (single, ref, *end ? end - 1 : end);
rv.string = finish_string (single, &rv.size);
return rv;
}
| {
"array_type": 0,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 2
} |
transcoder-set#DIFFERENCE_MAXIMUM_SUM_MINIMUM_SUM_N_M_ELEMENTSIN_REVIEW_prep#min.c | transcoder-set | DIFFERENCE_MAXIMUM_SUM_MINIMUM_SUM_N_M_ELEMENTSIN_REVIEW.c | min | 1 | int min(int x, int y) { return (x < y)? x: y; }
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
tinycc#tccpp_prep#free_defines.c | tinycc | tccpp.c | free_defines | 19 | void free_defines(Sym *b)
{
while (define_stack != b) {
Sym *top = define_stack;
define_stack = top->prev;
tok_str_free_str(top->d);
define_undef(top);
sym_free(top);
}
while (b) {
int v = b->v;
if (v >= 256 && v < tok_ident) {
Sym **d = &table_ident[v - 256]->sym_define;
if (!*d)
*d = b;
}
b = b->prev;
}
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 2
} |
libcsv#libcsv_prep#csv_set_term_func.c | libcsv | libcsv.c | csv_set_term_func | 5 | void
csv_set_term_func(struct csv_parser *p, int (*f)(unsigned char))
{
if (p) p->is_term = f;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 1,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#MAXIMUM_SUM_BITONIC_SUBARRAY_prep#f_filled.c | transcoder-set | MAXIMUM_SUM_BITONIC_SUBARRAY.c | f_filled | 1 | int f_filled ( int arr [ ], int n ) {}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
tmux#key-bindings_prep#key_tables_RB_FIND.c | tmux | key-bindings.c | key_tables_RB_FIND | 1 | struct key_table * key_tables_RB_FIND(struct key_tables *head, struct key_table *elm) { struct key_table *tmp = (head)->rbh_root; int comp; while (tmp) { comp = key_table_cmp(elm, tmp); if (comp < 0) tmp = (tmp)->entry.rbe_left; else if (comp > 0) tmp = (tmp)->entry.rbe_right; else return (tmp); } return (((void *)0)); }
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 1
} |
mcsim-6.2.0#simi_prep#FreeMCVar.c | mcsim-6.2.0 | simi.c | FreeMCVar | 7 | int FreeMCVar (PVOID pData, PVOID pUserInfo)
{
PMCVAR pMCVar = (PMCVAR) pData;
FreeList(&pMCVar->plistDependents, ((void *)0), 1);
free(pMCVar->pszName);
return 0;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 1,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#SWAP_BITS_IN_A_GIVEN_NUMBER_prep#max.c | transcoder-set | SWAP_BITS_IN_A_GIVEN_NUMBER.c | max | 1 | int max(int x, int y) { return (x > y)? x: y; }
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
dap-3.10#daprun_prep#ask.c | dap-3.10 | daprun.c | ask | 13 | int ask(char *question)
{
int c;
do {
fprintf(stderr, "%s? [y/q] ", question);
c = getchar();
while (getchar() != '\n')
;
if (c != 'y' && c != 'q')
fprintf(stderr, "Invalid response. ");
} while (c != 'y' && c != 'q');
return (c == 'y');
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 2
} |
gprolog-1.5.0#g_var_inl_c_prep#Pl_Blt_G_Dec.c | gprolog-1.5.0 | g_var_inl_c.c | Pl_Blt_G_Dec | 7 | void
Pl_Blt_G_Dec(WamWord x)
{
Pl_Set_C_Bip_Name("g_dec", 1);
G_Inc_Dec(x, -1, ((PlLong) (0) + ((PlULong)0)), ((PlLong) (0) + ((PlULong)0)));
Pl_Unset_C_Bip_Name();
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libxml2#types_prep#libxml_xmlXPathObjectPtrWrap.c | libxml2 | types.c | libxml_xmlXPathObjectPtrWrap | 69 | PyObject *
libxml_xmlXPathObjectPtrWrap(xmlXPathObjectPtr obj)
{
PyObject *ret;
if (obj == ((void *)0)) {
_Py_INCREF(((PyObject*)((&_Py_NoneStruct))));
return ((&_Py_NoneStruct));
}
switch (obj->type) {
case XPATH_XSLT_TREE: {
if ((obj->nodesetval == ((void *)0)) ||
(obj->nodesetval->nodeNr == 0) ||
(obj->nodesetval->nodeTab == ((void *)0))) {
ret = PyList_New(0);
} else {
int i, len = 0;
xmlNodePtr node;
node = obj->nodesetval->nodeTab[0]->children;
while (node != ((void *)0)) {
len++;
node = node->next;
}
ret = PyList_New(len);
node = obj->nodesetval->nodeTab[0]->children;
for (i = 0;i < len;i++) {
PyList_SetItem(ret, i, libxml_xmlNodePtrWrap(node));
node = node->next;
}
}
return (ret);
}
case XPATH_NODESET:
if ((obj->nodesetval == ((void *)0))
|| (obj->nodesetval->nodeNr == 0)) {
ret = PyList_New(0);
} else {
int i;
xmlNodePtr node;
ret = PyList_New(obj->nodesetval->nodeNr);
for (i = 0; i < obj->nodesetval->nodeNr; i++) {
node = obj->nodesetval->nodeTab[i];
if (node->type == XML_NAMESPACE_DECL) {
PyObject *ns = PyCapsule_New((void *) node,
(char *) "xmlNsPtr",
libxml_xmlXPathDestructNsNode);
PyList_SetItem(ret, i, ns);
obj->nodesetval->nodeTab[i] = ((void *)0);
} else {
PyList_SetItem(ret, i, libxml_xmlNodePtrWrap(node));
}
}
}
break;
case XPATH_BOOLEAN:
ret = PyLong_FromLong((long) obj->boolval);
break;
case XPATH_NUMBER:
ret = PyFloat_FromDouble(obj->floatval);
break;
case XPATH_STRING:
ret = PyUnicode_FromString((char *) obj->stringval);
break;
default:
_Py_INCREF(((PyObject*)((&_Py_NoneStruct))));
ret = (&_Py_NoneStruct);
}
xmlXPathFreeObject(obj);
return (ret);
}
| {
"array_type": 1,
"break_continue_statement": 4,
"enum_type": 0,
"for_loop": 2,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 4,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 1,
"type_casting": 10,
"union_type": 0,
"while_loop": 1
} |
tar-1.34#create_prep#finish_header.c | tar-1.34 | create.c | finish_header | 16 | void
finish_header (struct tar_stat_info *st,
union block *header, off_t block_ordinal)
{
if (verbose_option
&& header->header.typeflag != 'K'
&& header->header.typeflag != 'L'
&& header->header.typeflag != 'x'
&& header->header.typeflag != 'g')
{
current_format = archive_format;
print_header (st, header, block_ordinal);
}
header = write_extended (0, st, header);
simple_finish_header (header);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 1,
"while_loop": 0
} |
libxml2#xmlunicode_prep#xmlUCSIsHighSurrogates.c | libxml2 | xmlunicode.c | xmlUCSIsHighSurrogates | 4 | int
xmlUCSIsHighSurrogates(int code) {
return(((code >= 0xD800) && (code <= 0xDB7F)));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
binn-3.0#binn_prep#binn_object_get_pair.c | binn-3.0 | binn.c | binn_object_get_pair | 3 | BOOL binn_object_get_pair(void *ptr, int pos, char *pkey, binn *value) {
return binn_read_pair(0xE2, ptr, pos, ((void *)0), pkey, value);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
nettle-3.9.1#ecdsa-keygen_prep#nettle_ecdsa_generate_keypair.c | nettle-3.9.1 | ecdsa-keygen.c | nettle_ecdsa_generate_keypair | 15 | void
nettle_ecdsa_generate_keypair (struct ecc_point *pub,
struct ecc_scalar *key,
void *random_ctx, nettle_random_func *random)
{
mp_limb_t *p;
const struct ecc_curve *ecc = pub->ecc;
mp_size_t itch = 3*ecc->p.size + ecc->mul_g_itch;
((void) sizeof ((key->ecc == ecc) ? 1 : 0), __extension__ ({ if (key->ecc == ecc) ; else __assert_fail ("key->ecc == ecc", "ecdsa-keygen.c", 54, __extension__ __PRETTY_FUNCTION__); }));
((void) sizeof ((ecc->h_to_a_itch <= ecc->mul_g_itch) ? 1 : 0), __extension__ ({ if (ecc->h_to_a_itch <= ecc->mul_g_itch) ; else __assert_fail ("ecc->h_to_a_itch <= ecc->mul_g_itch", "ecdsa-keygen.c", 55, __extension__ __PRETTY_FUNCTION__); }));
(p = __builtin_alloca (sizeof (*p) * (itch)));
_nettle_ecc_mod_random (&ecc->q, key->p, random_ctx, random, p);
ecc->mul_g (ecc, p, key->p, p + 3*ecc->p.size);
ecc->h_to_a (ecc, 0, pub->p, p, p + 3*ecc->p.size);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 0,
"struct_type": 3,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#COUNT_INDEX_PAIRS_EQUAL_ELEMENTS_ARRAY_prep#sort.c | transcoder-set | COUNT_INDEX_PAIRS_EQUAL_ELEMENTS_ARRAY.c | sort | 1 | void sort (int arr [ ], int n) {qsort (arr, n, sizeof(int), cmpfunc);}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
dap-3.10#daprun_prep#main.c | dap-3.10 | daprun.c | main | 81 | int main(int argc, char **argv)
{
int keep;
int debug;
int runstat;
fputs("\nDap, Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.\n",
stderr);
fputs("Dap comes with ABSOLUTELY NO WARRANTY;\n", stderr);
fputs("for details see the GNU Public License.\n", stderr);
fputs("This is free software, and you are welcome to\n", stderr);
fputs("redistribute it under certain conditions; see\n", stderr);
fputs("the GNU Public License for details.\n\n", stderr);
if (argc < 2)
{
fputs("dap: no files to process\n", stderr);
exit(1);
}
keep = 0;
debug = 0;
while (argv[1][0] == '-')
{
--argc;
argv++;
if (!strcmp(argv[0], "-k") || !strcmp(argv[0], "--keep"))
keep = -1;
else if (!strcmp(argv[0], "-d") || !strcmp(argv[0], "--debug"))
debug = 1;
else if (!strcmp(argv[0], "--help"))
{
fputs("Usage:\ndap [-k] [-d] FILE1.c [ FILE2.c ... ] [-a ARG1 ...]\n", stderr);
fputs("dap [--keep] [--debug] FILE1.c [ FILE2.c ... ] [--args] ARG1 ...]\n", stderr);
fputs("dap [-k] [-d] FILE1.sbs [ FILE2.c ... ]\n", stderr);
fputs("dap [--keep] [--debug] FILE1.sbs [ FILE2.c ... ]\n", stderr);
fputs("\nReport bugs to <bug-dap@gnu.org>\n", stderr);
exit(1);
}
else if (!strcmp(argv[0], "--version") || !strcmp(argv[0], "-v"))
{
fputs("Dap 3.6\n", stderr);
exit(1);
}
else
{
fprintf(stderr, "dap: bad option: %s\n", argv[0]);
exit(1);
}
}
if (!(pager = ecopy(getenv("DAPPAGER"))))
pager = "/bin/more";
if (!(pageopts = ecopy(getenv("DAPPAGEOPTS"))))
pageopts = ((void *)0);
if (!(compiler = ecopy(getenv("DAPCOMPILER"))))
compiler = "/usr/bin/gcc";
if (!(compopts = ecopy(getenv("DAPCOMPOPTS"))))
compopts = ((void *)0);
if (!(viewer = ecopy(getenv("DAPVIEWER"))))
viewer = "/usr/bin/X11/gv";
if (!(viewopts = ecopy(getenv("DAPVIEWOPTS"))))
viewopts = ((void *)0);
if (!(dappp = ecopy(getenv("DAPPP"))))
dappp = "/usr/local/bin/dappp";
if (!(incdir = ecopy(getenv("INCDIR"))))
incdir = "/usr/local/include";
if (!(libdir = ecopy(getenv("LIBDIR"))))
libdir = "/usr/local/lib";
if (!dappprun(argc, argv))
{
if (!gccrun(argc, argv, debug))
{
runstat = run(argc, argv, keep);
view(argv[1], ".err");
if (!runstat)
{
if (keep == -1)
keep = 1;
showps(argv[1]);
}
}
}
return 0;
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 18,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 1
} |
transcoder-set#K_TH_DISTINCT_OR_NON_REPEATING_ELEMENT_IN_AN_ARRAY_prep#len.c | transcoder-set | K_TH_DISTINCT_OR_NON_REPEATING_ELEMENT_IN_AN_ARRAY.c | len | 1 | int len (int arr [ ]) {return ((int) (sizeof (arr) / sizeof (arr)[0]));}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libosip2-5.3.1#osip_cseq_prep#osip_cseq_get_number.c | libosip2-5.3.1 | osip_cseq.c | osip_cseq_get_number | 3 | char *osip_cseq_get_number(osip_cseq_t *cseq) {
return cseq->number;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
tmux#session_prep#session_select.c | tmux | session.c | session_select | 7 | int
session_select(struct session *s, int idx)
{
struct winlink *wl;
wl = winlink_find_by_index(&s->windows, idx);
return (session_set_current(s, wl));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 2,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
tinycc#tccpp_prep#begin_macro.c | tinycc | tccpp.c | begin_macro | 9 | void begin_macro(TokenString *str, int alloc)
{
str->alloc = alloc;
str->prev = macro_stack;
str->prev_ptr = macro_ptr;
str->save_line_num = file->line_num;
macro_ptr = str->str;
macro_stack = str;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libxml2#xpath_prep#xmlXPathValueFlipSign.c | libxml2 | xpath.c | xmlXPathValueFlipSign | 7 | void
xmlXPathValueFlipSign(xmlXPathParserContextPtr ctxt) {
if ((ctxt == ((void *)0)) || (ctxt->context == ((void *)0))) return;
if ((ctxt->value != ((void *)0)) && (ctxt->value->type != XPATH_NUMBER)) xmlXPathNumberFunction(ctxt, 1);;
if ((ctxt->value == ((void *)0)) || (ctxt->value->type != XPATH_NUMBER)) { xmlXPathErr(ctxt, XPATH_INVALID_TYPE); return; };
ctxt->value->floatval = -ctxt->value->floatval;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 0
} |
less-633#output_prep#linenumtoa.c | less-633 | output.c | linenumtoa | 1 | void linenumtoa(LINENUM num, char *buf, int radix) { int neg = (num < 0); char tbuf[((sizeof(num) * 8 - 1) * 302 / 1000 + 1 + 1)+2]; char *s = tbuf + sizeof(tbuf); if (neg) num = -num; *--s = '\0'; do { *--s = "0123456789ABCDEF"[num % radix]; } while ((num /= radix) != 0); if (neg) *--s = '-'; strcpy(buf, s); }
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
tmux#window_prep#window_pane_cmp.c | tmux | window.c | window_pane_cmp | 5 | int
window_pane_cmp(struct window_pane *wp1, struct window_pane *wp2)
{
return (wp1->id - wp2->id);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
tinycc#tccgen_prep#type_size.c | tinycc | tccgen.c | type_size | 43 | int type_size(CType *type, int *a)
{
Sym *s;
int bt;
bt = type->t & 0x000f;
if (bt == 7) {
s = type->ref;
*a = s->r;
return s->c;
} else if (bt == 5) {
if (type->t & 0x0040) {
int ts;
s = type->ref;
ts = type_size(&s->type, a);
if (ts < 0 && s->c < 0)
ts = -ts;
return ts * s->c;
} else {
*a = 8;
return 8;
}
} else if (((type->t & (((1 << (6+6)) - 1) << 20 | 0x0080)) == (2 << 20)) && type->ref->c == -1) {
return -1;
} else if (bt == 10) {
*a = 16;
return 16;
} else if (bt == 9 || bt == 4) {
*a = 8;
return 8;
} else if (bt == 3 || bt == 8) {
*a = 4;
return 4;
} else if (bt == 2) {
*a = 2;
return 2;
} else if (bt == 13 || bt == 14) {
*a = 8;
return 16;
} else {
*a = 1;
return 1;
}
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 10,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 10,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
mcsim-6.2.0#simi_prep#McvFromLex.c | mcsim-6.2.0 | simi.c | McvFromLex | 36 | int McvFromLex (PSTR szLex)
{
int ikwcode = GetKeywordCode(szLex, ((void *)0));
int iReturn;
iReturn = (ikwcode == 210 ? 0
: ikwcode == 211 ? 1
: ikwcode == 212 ? 2
: ikwcode == 213 ? 3
: ikwcode == 229 ? 19
: ikwcode == 214 ? 4
: ikwcode == 215 ? 5
: ikwcode == 216 ? 6
: ikwcode == 217 ? 7
: ikwcode == 218 ? 8
: ikwcode == 219 ? 9
: ikwcode == 220 ? 10
: ikwcode == 221 ? 11
: ikwcode == 222 ? 12
: ikwcode == 223 ? 13
: ikwcode == 230 ? 20
: ikwcode == 224 ? 14
: ikwcode == 235 ? 25
: ikwcode == 225 ? 15
: ikwcode == 226 ? 16
: ikwcode == 236 ? 26
: ikwcode == 227? 17
: ikwcode == 228 ? 18
: ikwcode == 231 ? 21
: ikwcode == 232 ? 22
: ikwcode == 233 ? 23
: ikwcode == 234 ? 24
: ikwcode == 237 ? 27
: ikwcode == 238 ? 28
: (-1));
return iReturn;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libosip2-5.3.1#osip_port_prep#osip_clrncpy.c | libosip2-5.3.1 | osip_port.c | osip_clrncpy | 30 | char *osip_clrncpy(char *dst, const char *src, size_t len) {
const char *pbeg;
const char *pend;
char *p;
size_t spaceless_length;
if (src == ((void *)0) || len == 0) {
*dst = '\0';
return ((void *)0);
}
pbeg = src;
pbeg += strspn(pbeg, " \r\n\t");
pend = src + len - 1;
while ((' ' == *pend) || ('\r' == *pend) || ('\n' == *pend) || ('\t' == *pend)) {
pend--;
if (pend < pbeg) {
*dst = '\0';
return dst;
}
}
spaceless_length = pend - pbeg + 1;
memmove(dst, pbeg, spaceless_length);
p = dst + spaceless_length;
*p = '\0';
if (__builtin_expect(++spaceless_length < len, 0)) {
do
*++p = '\0';
while (++spaceless_length < len);
}
return dst;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 1,
"pointer_type": 3,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 2
} |
libxml2#libxml2-py_prep#libxml_xmlUCSIsCJKCompatibility.c | libxml2 | libxml2-py.c | libxml_xmlUCSIsCJKCompatibility | 13 | PyObject *
libxml_xmlUCSIsCJKCompatibility(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
int c_retval;
int code;
if (libxml_deprecationWarning("xmlUCSIsCJKCompatibility") == -1)
return(((void *)0));
if (!_PyArg_ParseTuple_SizeT(args, (char *)"i:xmlUCSIsCJKCompatibility", &code))
return(((void *)0));
c_retval = xmlUCSIsCJKCompatibility(code);
py_retval = libxml_intWrap((int) c_retval);
return(py_retval);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
libxml2#libxml2-py_prep#libxml_xmlUCSIsHangulJamo.c | libxml2 | libxml2-py.c | libxml_xmlUCSIsHangulJamo | 13 | PyObject *
libxml_xmlUCSIsHangulJamo(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
int c_retval;
int code;
if (libxml_deprecationWarning("xmlUCSIsHangulJamo") == -1)
return(((void *)0));
if (!_PyArg_ParseTuple_SizeT(args, (char *)"i:xmlUCSIsHangulJamo", &code))
return(((void *)0));
c_retval = xmlUCSIsHangulJamo(code);
py_retval = libxml_intWrap((int) c_retval);
return(py_retval);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
cflow-1.7#hash_prep#hash_get_max_bucket_length.c | cflow-1.7 | hash.c | hash_get_max_bucket_length | 19 | size_t
hash_get_max_bucket_length (const Hash_table *table)
{
struct hash_entry const *bucket;
size_t max_bucket_length = 0;
for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
{
if (bucket->data)
{
struct hash_entry const *cursor = bucket;
size_t bucket_length = 1;
while (cursor = cursor->next, cursor)
bucket_length++;
if (bucket_length > max_bucket_length)
max_bucket_length = bucket_length;
}
}
return max_bucket_length;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
gprolog-1.5.0#c_supp_prep#Pl_Check_For_Un_Number.c | gprolog-1.5.0 | c_supp.c | Pl_Check_For_Un_Number | 5 | void
Pl_Check_For_Un_Number(WamWord start_word)
{
WamWord word, tag_mask; do { WamWord deref_last_word; word = start_word; ; do { ; deref_last_word = word; tag_mask = ((PlLong) (word) & ((PlULong)0x7)); if (tag_mask != (PlULong)0) break; word = *(((WamWord *) (word))); } while (word != deref_last_word); } while (0); if (tag_mask != (PlULong)0 && tag_mask != (PlULong)0x7 && tag_mask != (PlULong)0x4) Pl_Err_Type(pl_type_number, word);
}
| {
"array_type": 0,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
binn-3.0#binn_prep#binn_map.c | binn-3.0 | binn.c | binn_map | 3 | binn * binn_map() {
return binn_new(0xE1, 0, 0);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
tar-1.34#buffer_prep#first_decompress_program.c | tar-1.34 | buffer.c | first_decompress_program | 12 | const char *
first_decompress_program (int *pstate)
{
struct zip_program const *zp;
if (use_compress_program_option)
return use_compress_program_option;
if (archive_compression_type == ct_none)
return ((void *)0);
*pstate = 0;
zp = find_zip_program (archive_compression_type, pstate);
return zp ? zp->program : ((void *)0);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
tmux#options_prep#options_array_assign.c | tmux | options.c | options_array_assign | 23 | void
options_array_assign(struct options_entry *o, const char *s)
{
const char *separator;
char *copy, *next, *string;
u_int i;
separator = o->tableentry->separator;
if (separator == ((void *)0))
separator = " ,";
copy = string = xstrdup(s);
while ((next = strsep(&string, separator)) != ((void *)0)) {
if (*next == '\0')
continue;
for (i = 0; i < 1000; i++) {
if (i >= o->arraysize || o->array[i] == ((void *)0))
break;
}
if (i == 1000)
break;
options_array_set(o, i, next, 0);
}
free(copy);
}
| {
"array_type": 1,
"break_continue_statement": 3,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 4,
"memory_management": 1,
"memory_operation": 0,
"pointer_type": 4,
"return_statement": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 1
} |
tulipindicators-0.9.1#linreg_prep#ti_linreg_start.c | tulipindicators-0.9.1 | linreg.c | ti_linreg_start | 3 | int ti_linreg_start(double const *options) {
return (int)options[0]-1;
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libxml2#xmlreader_prep#xmlTextReaderLookupNamespace.c | libxml2 | xmlreader.c | xmlTextReaderLookupNamespace | 17 | xmlChar *
xmlTextReaderLookupNamespace(xmlTextReaderPtr reader, const xmlChar *prefix) {
xmlNsPtr ns;
int result;
if (reader == ((void *)0))
return(((void *)0));
if (reader->node == ((void *)0))
return(((void *)0));
result = xmlSearchNsSafe(reader->node, prefix, &ns);
if (result < 0) {
xmlTextReaderErrMemory(reader);
return(((void *)0));
}
if (ns == ((void *)0))
return(((void *)0));
return(readerStrdup(reader, ns->href));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 4,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 5,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 7,
"union_type": 0,
"while_loop": 0
} |
libxml2#chvalid_prep#xmlIsIdeographic.c | libxml2 | chvalid.c | xmlIsIdeographic | 4 | int
xmlIsIdeographic(unsigned int ch) {
return((((ch) < 0x100) ? 0 : (((0x4e00 <= (ch)) && ((ch) <= 0x9fa5)) || ((ch) == 0x3007) || ((0x3021 <= (ch)) && ((ch) <= 0x3029)))));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
snudown#stack_prep#stack_free.c | snudown | stack.c | stack_free | 10 | void
stack_free(struct stack *st)
{
if (!st)
return;
free(st->item);
st->item = ((void *)0);
st->size = 0;
st->asize = 0;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 1,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
findutils-4.9.0#findutils-version_prep#display_findutils_version.c | findutils-4.9.0 | findutils-version.c | display_findutils_version | 11 | void
display_findutils_version (const char *official_name)
{
rpl_fflush (stderr);
version_etc (stdout,
official_name, "GNU findutils", version_string,
gettext ("Eric B. Decker"),
gettext ("James Youngman"),
gettext ("Kevin Dalley"),
(const char*) ((void *)0));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
dap-3.10#ps_prep#pict_page.c | dap-3.10 | ps.c | pict_page | 13 | void pict_page()
{
if (pageno)
{
fputs("gr\n", pict_out);
fputs("showpage\n", pict_out);
}
pageno++;
fprintf(pict_out, "%%%%Page: %d %d\n", pageno, pageno);
fputs("gs\n", pict_out);
if (orient == 'l')
fprintf(pict_out, "%d %d tr 90 rot %d %d tr\n", bboxy0 + bboxx1, bboxy0, -bboxx0, -bboxy0);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
json.h#allow_json5_prep#json_parse_string.c | json.h | allow_json5.c | json_parse_string | 102 | void json_parse_string(struct json_parse_state_s *state,
struct json_string_s *string) {
size_t offset = state->offset;
size_t bytes_written = 0;
const char *const src = state->src;
const char quote_to_use = '\'' == src[offset] ? '\'' : '"';
char *data = state->data;
unsigned long high_surrogate = 0;
unsigned long codepoint;
string->string = data;
offset++;
while (quote_to_use != src[offset]) {
if ('\\' == src[offset]) {
offset++;
switch (src[offset++]) {
default:
return;
case 'u': {
codepoint = 0;
if (!json_hexadecimal_value(&src[offset], 4, &codepoint)) {
return;
}
offset += 4;
if (codepoint <= 0x7fu) {
data[bytes_written++] = (char)codepoint;
} else if (codepoint <= 0x7ffu) {
data[bytes_written++] =
(char)(0xc0u | (codepoint >> 6));
data[bytes_written++] =
(char)(0x80u | (codepoint & 0x3fu));
} else if (codepoint >= 0xd800 &&
codepoint <= 0xdbff) {
high_surrogate = codepoint;
continue;
} else if (codepoint >= 0xdc00 &&
codepoint <= 0xdfff) {
const unsigned long surrogate_offset =
0x10000u - (0xD800u << 10) - 0xDC00u;
codepoint = (high_surrogate << 10) + codepoint + surrogate_offset;
high_surrogate = 0;
data[bytes_written++] =
(char)(0xF0u | (codepoint >> 18));
data[bytes_written++] =
(char)(0x80u | ((codepoint >> 12) & 0x3fu));
data[bytes_written++] =
(char)(0x80u | ((codepoint >> 6) & 0x3fu));
data[bytes_written++] =
(char)(0x80u | (codepoint & 0x3fu));
} else {
data[bytes_written++] =
(char)(0xe0u | (codepoint >> 12));
data[bytes_written++] =
(char)(0x80u | ((codepoint >> 6) & 0x3fu));
data[bytes_written++] =
(char)(0x80u | (codepoint & 0x3fu));
}
} break;
case '"':
data[bytes_written++] = '"';
break;
case '\\':
data[bytes_written++] = '\\';
break;
case '/':
data[bytes_written++] = '/';
break;
case 'b':
data[bytes_written++] = '\b';
break;
case 'f':
data[bytes_written++] = '\f';
break;
case 'n':
data[bytes_written++] = '\n';
break;
case 'r':
data[bytes_written++] = '\r';
break;
case 't':
data[bytes_written++] = '\t';
break;
case '\r':
data[bytes_written++] = '\r';
if ('\n' == src[offset]) {
data[bytes_written++] = '\n';
offset++;
}
break;
case '\n':
data[bytes_written++] = '\n';
break;
}
} else {
data[bytes_written++] = src[offset++];
}
}
offset++;
string->string_size = bytes_written;
data[bytes_written++] = '\0';
state->data += bytes_written;
state->offset = offset;
}
| {
"array_type": 1,
"break_continue_statement": 12,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 7,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 2,
"struct_type": 2,
"switch_statement": 1,
"type_casting": 10,
"union_type": 0,
"while_loop": 1
} |
libosip2-5.3.1#osip_authentication_info_prep#osip_authentication_info_init.c | libosip2-5.3.1 | osip_authentication_info.c | osip_authentication_info_init | 7 | int osip_authentication_info_init(osip_authentication_info_t **dest) {
*dest = (osip_authentication_info_t *) (osip_malloc_func ? osip_malloc_func(sizeof(osip_authentication_info_t)) : malloc(sizeof(osip_authentication_info_t)));
if (*dest == ((void *)0))
return -4;
memset(*dest, 0, sizeof(osip_authentication_info_t));
return 0;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 1,
"memory_operation": 1,
"pointer_type": 0,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libxml2#libxml2-py_prep#libxml_xmlXPathErr.c | libxml2 | libxml2-py.c | libxml_xmlXPathErr | 12 | PyObject *
libxml_xmlXPathErr(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
xmlXPathParserContextPtr ctxt;
PyObject *pyobj_ctxt;
int code;
if (!_PyArg_ParseTuple_SizeT(args, (char *)"Oi:xmlXPathErr", &pyobj_ctxt, &code))
return(((void *)0));
ctxt = (xmlXPathParserContextPtr) (((pyobj_ctxt) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyxmlXPathParserContext_Object *)(pyobj_ctxt))->obj));
xmlXPathErr(ctxt, code);
_Py_INCREF(((PyObject*)((&_Py_NoneStruct))));
return((&_Py_NoneStruct));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#CHECK_GIVEN_CIRCLE_LIES_COMPLETELY_INSIDE_RING_FORMED_TWO_CONCENTRIC_CIRCLES_prep#sort.c | transcoder-set | CHECK_GIVEN_CIRCLE_LIES_COMPLETELY_INSIDE_RING_FORMED_TWO_CONCENTRIC_CIRCLES.c | sort | 1 | void sort (int arr [ ], int n) {qsort (arr, n, sizeof(int), cmpfunc);}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
tar-1.34#misc_prep#blocking_write.c | tar-1.34 | misc.c | blocking_write | 16 | size_t
blocking_write (int fd, void const *buf, size_t count)
{
size_t bytes = full_write (fd, buf, count);
if (bytes < count && (*__errno_location ()) == 11)
{
int flags = rpl_fcntl (fd, 3);
if (0 <= flags && flags & 04000
&& rpl_fcntl (fd, 4, flags & ~04000) != -1)
{
char const *buffer = buf;
bytes += full_write (fd, buffer + bytes, count - bytes);
}
}
return bytes;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libxml2#xmlstring_prep#xmlStrcat.c | libxml2 | xmlstring.c | xmlStrcat | 9 | xmlChar *
xmlStrcat(xmlChar *cur, const xmlChar *add) {
const xmlChar *p = add;
if (add == ((void *)0)) return(cur);
if (cur == ((void *)0))
return(xmlStrdup(add));
while (*p != 0) p++;
return(xmlStrncat(cur, add, p - add));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 1
} |
sed-4.9#nanosleep_prep#rpl_nanosleep.c | sed-4.9 | nanosleep.c | rpl_nanosleep | 33 | int
rpl_nanosleep (const struct timespec *requested_delay,
struct timespec *remaining_delay)
{
if (requested_delay->tv_nsec < 0 || BILLION <= requested_delay->tv_nsec)
{
(*__errno_location ()) = 22;
return -1;
}
{
_Static_assert (((time_t) (! (! ((time_t) 0 < (time_t) -1)) ? (time_t) -1 : ((((time_t) 1 << ((sizeof (time_t) * 8) - 2)) - 1) * 2 + 1))) / 24 / 24 / 60 / 60);
const time_t limit = 24 * 24 * 60 * 60;
time_t seconds = requested_delay->tv_sec;
struct timespec intermediate;
intermediate.tv_nsec = requested_delay->tv_nsec;
while (limit < seconds)
{
int result;
intermediate.tv_sec = limit;
result = nanosleep (&intermediate, remaining_delay);
seconds -= limit;
if (result)
{
if (remaining_delay)
remaining_delay->tv_sec += seconds;
return result;
}
intermediate.tv_nsec = 0;
}
intermediate.tv_sec = seconds;
return nanosleep (&intermediate, remaining_delay);
}
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 3,
"struct_type": 2,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
heman#vec2_prep#kmVec2Div.c | heman | vec2.c | kmVec2Div | 7 | kmVec2* kmVec2Div( kmVec2* pOut,const kmVec2* pV1, const kmVec2* pV2 ) {
if ( pV2->x && pV2->y ){
pOut->x = pV1->x / pV2->x;
pOut->y = pV1->y / pV2->y;
}
return pOut;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#COUNT_PALINDROMIC_SUBSEQUENCE_GIVEN_STRING_prep#max.c | transcoder-set | COUNT_PALINDROMIC_SUBSEQUENCE_GIVEN_STRING.c | max | 1 | int max(int x, int y) { return (x > y)? x: y; }
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
gprolog-1.5.0#stream_supp_prep#Pl_Stream_Puts.c | gprolog-1.5.0 | stream_supp.c | Pl_Stream_Puts | 13 | int
Pl_Stream_Puts(char *str, StmInf *pstm)
{
char *p;
int c;
for (p = str; *p; p++)
{
c = *p;
Basic_Call_Fct_Putc(c, pstm);
if (c != (-1)) pstm->char_count++; if (c == '\n') { pstm->line_count++; pstm->line_pos = 0; } else pstm->line_pos++;
}
return p - str;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#SUM_FIBONACCI_NUMBERS_prep#min.c | transcoder-set | SUM_FIBONACCI_NUMBERS.c | min | 1 | int min(int x, int y) { return (x < y)? x: y; }
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#MAXIMUM_NUMBER_OF_SQUARES_THAT_CAN_BE_FIT_IN_A_RIGHT_ANGLE_ISOSCELES_TRIANGLE_prep#max.c | transcoder-set | MAXIMUM_NUMBER_OF_SQUARES_THAT_CAN_BE_FIT_IN_A_RIGHT_ANGLE_ISOSCELES_TRIANGLE.c | max | 1 | int max(int x, int y) { return (x > y)? x: y; }
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#DYNAMIC_PROGRAMMING_SET_10_0_1_KNAPSACK_PROBLEM_prep#len.c | transcoder-set | DYNAMIC_PROGRAMMING_SET_10_0_1_KNAPSACK_PROBLEM.c | len | 1 | int len (int arr [ ]) {return ((int) (sizeof (arr) / sizeof (arr)[0]));}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libxml2#libxml2-py_prep#libxml_htmlCreateMemoryParserCtxt.c | libxml2 | libxml2-py.c | libxml_htmlCreateMemoryParserCtxt | 13 | PyObject *
libxml_htmlCreateMemoryParserCtxt(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
htmlParserCtxtPtr c_retval;
char * buffer;
Py_ssize_t py_buffsize0;
int size;
if (!_PyArg_ParseTuple_SizeT(args, (char *)"s#i:htmlCreateMemoryParserCtxt", &buffer, &py_buffsize0, &size))
return(((void *)0));
c_retval = htmlCreateMemoryParserCtxt(buffer, size);
py_retval = libxml_xmlParserCtxtPtrWrap((xmlParserCtxtPtr) c_retval);
return(py_retval);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#MAXIMUM_HEIGHT_OF_TRIANGULAR_ARRANGEMENT_OF_ARRAY_VALUES_prep#len.c | transcoder-set | MAXIMUM_HEIGHT_OF_TRIANGULAR_ARRANGEMENT_OF_ARRAY_VALUES.c | len | 1 | int len (int arr [ ]) {return ((int) (sizeof (arr) / sizeof (arr)[0]));}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
mtools-4.0.43#privileges_prep#destroy_privs.c | mtools-4.0.43 | privileges.c | destroy_privs | 10 | void destroy_privs(void)
{
if(euid == 0) {
setuid(0);
setuid(ruid);
seteuid(ruid);
}
drop_privs();
print_privs("destroy_privs, no uid should be zero ");
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
findutils-4.9.0#pred_prep#pred_size.c | findutils-4.9.0 | pred.c | pred_size | 24 | _Bool
pred_size (const char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
{
uintmax_t f_val;
(void) pathname;
f_val = ((stat_buf->st_size / pred_ptr->args.size.blocksize)
+ (stat_buf->st_size % pred_ptr->args.size.blocksize != 0));
switch (pred_ptr->args.size.kind)
{
case COMP_GT:
if (f_val > pred_ptr->args.size.size)
return (1);
break;
case COMP_LT:
if (f_val < pred_ptr->args.size.size)
return (1);
break;
case COMP_EQ:
if (f_val == pred_ptr->args.size.size)
return (1);
break;
}
return (0);
}
| {
"array_type": 0,
"break_continue_statement": 3,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 4,
"struct_type": 1,
"switch_statement": 1,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
less-633#os_prep#supports_ctrl_x.c | less-633 | os.c | supports_ctrl_x | 4 | int supports_ctrl_x(void)
{
return (use_poll);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libxml2#libxml2-py_prep#libxml_xmlParserSetPedantic.c | libxml2 | libxml2-py.c | libxml_xmlParserSetPedantic | 14 | PyObject *
libxml_xmlParserSetPedantic(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
xmlParserCtxtPtr ctxt;
PyObject *pyobj_ctxt;
int pedantic;
if (libxml_deprecationWarning("xmlParserSetPedantic") == -1)
return(((void *)0));
if (!_PyArg_ParseTuple_SizeT(args, (char *)"Oi:xmlParserSetPedantic", &pyobj_ctxt, &pedantic))
return(((void *)0));
ctxt = (xmlParserCtxtPtr) (((pyobj_ctxt) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyparserCtxt_Object *)(pyobj_ctxt))->obj));
ctxt->pedantic = pedantic;
_Py_INCREF(((PyObject*)((&_Py_NoneStruct))));
return((&_Py_NoneStruct));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
json.h#allow_leading_or_trailing_decimal_point_prep#json_write_minified_get_object_size.c | json.h | allow_leading_or_trailing_decimal_point.c | json_write_minified_get_object_size | 18 | int json_write_minified_get_object_size(const struct json_object_s *object,
size_t *size) {
struct json_object_element_s *element;
*size += 2;
*size += object->length;
if (1 < object->length) {
*size += object->length - 1;
}
for (element = object->start; 0 != element; element = element->next) {
if (json_write_get_string_size(element->name, size)) {
return 1;
}
if (json_write_minified_get_value_size(element->value, size)) {
return 1;
}
}
return 0;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 3,
"struct_type": 2,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#MINIMUM_PERIMETER_N_BLOCKS_prep#f_filled.c | transcoder-set | MINIMUM_PERIMETER_N_BLOCKS.c | f_filled | 1 | int f_filled ( int n ) {}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
optipng-0.7.8#pnmout_prep#pnm_fput_values.c | optipng-0.7.8 | pnmout.c | pnm_fput_values | 102 | int pnm_fput_values(const pnm_struct *pnm_ptr,
const unsigned int *sample_values,
unsigned int num_rows,
FILE *stream)
{
unsigned int format = pnm_ptr->format;
unsigned int depth = pnm_ptr->depth;
unsigned int width = pnm_ptr->width;
unsigned int maxval = pnm_ptr->maxval;
size_t row_length = (size_t)depth * (size_t)width;
size_t num_samples = num_rows * row_length;
int ch, mask;
size_t i, j;
switch (format)
{
case PNM_P1:
for (i = j = 0; i < num_samples; ++i)
{
if (putc(((sample_values[i] != 0) ? '0' : '1'), stream) == (-1))
break;
if (++j == row_length)
{
j = 0;
if (putc('\n', stream) == (-1))
break;
}
}
break;
case PNM_P2:
case PNM_P3:
for (i = j = 0; i < num_samples; ++i)
{
if (++j == row_length)
j = 0;
if (fprintf(stream,
(j == 0) ? "%u\n" : "%u ", sample_values[i]) <= 0)
break;
}
break;
case PNM_P4:
for (i = j = 0; i < num_samples; )
{
ch = 0;
for (mask = 0x80; mask != 0; mask >>= 1)
{
if (sample_values[i++] == 0)
ch |= mask;
if (++j == row_length)
{
j = 0;
break;
}
}
if (putc(ch, stream) == (-1))
break;
}
break;
case PNM_P5:
case PNM_P6:
case PNM_P7:
if (maxval <= 0xffU)
{
for (i = 0; i < num_samples; ++i)
{
if (putc(sample_values[i] & 0xff, stream) == (-1))
break;
}
}
else if (maxval <= 0xffffU)
{
for (i = 0; i < num_samples; ++i)
{
if (putc((sample_values[i] >> 8) & 0xff, stream) == (-1) ||
putc((sample_values[i]) & 0xff, stream) == (-1))
break;
}
}
else if (maxval <= 0xffffffffU)
{
for (i = 0; i < num_samples; ++i)
{
if (maxval > 0xffffffU)
if (putc((sample_values[i] >> 24) & 0xff, stream) == (-1))
break;
if (putc((sample_values[i] >> 16) & 0xff, stream) == (-1) ||
putc((sample_values[i] >> 8) & 0xff, stream) == (-1) ||
putc((sample_values[i]) & 0xff, stream) == (-1))
break;
}
}
else
{
(*__errno_location ()) = 22;
return 0;
}
break;
default:
(*__errno_location ()) = 22;
return 0;
}
return (i == num_samples) ? 1 : -1;
}
| {
"array_type": 1,
"break_continue_statement": 13,
"enum_type": 0,
"for_loop": 7,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 16,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 1,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
nettle-3.9.1#write-le64_prep#_nettle_write_le64.c | nettle-3.9.1 | write-le64.c | _nettle_write_le64 | 23 | void
_nettle_write_le64(size_t length, uint8_t *dst,
const uint64_t *src)
{
size_t i;
size_t words;
unsigned leftover;
words = length / 8;
leftover = length % 8;
for (i = 0; i < words; i++, dst += 8)
do { (dst)[7] = ((src[i]) >> 56) & 0xff; (dst)[6] = ((src[i]) >> 48) & 0xff; (dst)[5] = ((src[i]) >> 40) & 0xff; (dst)[4] = ((src[i]) >> 32) & 0xff; (dst)[3] = ((src[i]) >> 24) & 0xff; (dst)[2] = ((src[i]) >> 16) & 0xff; (dst)[1] = ((src[i]) >> 8) & 0xff; (dst)[0] = (src[i]) & 0xff; } while (0);
if (leftover)
{
uint64_t word;
word = src[i];
do
{
*dst++ = word & 0xff;
word >>= 8;
}
while (--leftover);
}
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 2
} |
tulipindicators-0.9.1#tiamalgamation_prep#ti_kvo_start.c | tulipindicators-0.9.1 | tiamalgamation.c | ti_kvo_start | 4 | int ti_kvo_start(double const *options) {
(void)options;
return 1;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
enscript-1.6.6#prt_lpr_prep#printer_open.c | enscript-1.6.6 | prt_lpr.c | printer_open | 24 | FILE *
printer_open(char *cmd, char *options, char *queue_param, char *printer_name,
void **context_return)
{
Buffer pipe_cmd;
FILE *fp;
buffer_init(&pipe_cmd);
buffer_append(&pipe_cmd, cmd);
buffer_append(&pipe_cmd, " ");
if (options)
{
buffer_append(&pipe_cmd, options);
buffer_append(&pipe_cmd, " ");
}
if (printer_name)
{
buffer_append(&pipe_cmd, queue_param);
buffer_append(&pipe_cmd, printer_name);
}
fp = popen(buffer_ptr(&pipe_cmd), "w");
buffer_uninit(&pipe_cmd);
*context_return = fp;
return fp;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#SUM_OF_ALL_ELEMENTS_UP_TO_NTH_ROW_IN_A_PASCALS_TRIANGLE_1_prep#f_gold.c | transcoder-set | SUM_OF_ALL_ELEMENTS_UP_TO_NTH_ROW_IN_A_PASCALS_TRIANGLE_1.c | f_gold | 5 | long long int f_gold ( int n ) {
long long int sum = 0;
sum = 1 << n;
return ( sum - 1 );
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#FIND_THE_LARGEST_SUBARRAY_WITH_0_SUM_prep#min.c | transcoder-set | FIND_THE_LARGEST_SUBARRAY_WITH_0_SUM.c | min | 1 | int min(int x, int y) { return (x < y)? x: y; }
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
dap-3.10#dap5_prep#logreg.c | dap-3.10 | dap5.c | logreg | 164 | void logreg(
char *fname,
char *yspec,
char *x0list,
char *x1list,
char *marks,
char *xname,
double level
)
{
char *regname;
int *varv;
int *xvarv;
int nx0, nx1;
int nx;
int nxx;
int *markv;
int *xmarkv;
int nmark;
double *xmem;
double **x;
double *ymem;
double *y[2];
int v;
int nobs;
int more;
char *covset;
int param1n, param2n, covn;
int paramlen1, paramlen;
char paramstr[14];
char *partstr;
int *partv;
if (!fname)
{
fputs("(logreg) No dataset name given.\n", dap_err);
exit(1);
}
varv = (int *) dap_malloc(sizeof(int) * dap_maxvar, "dap_maxvar");
xvarv = (int *) dap_malloc(sizeof(int) * dap_maxvar, "dap_maxvar");
markv = (int *) dap_malloc(sizeof(int) * dap_maxvar, "dap_maxvar");
xmarkv = (int *) dap_malloc(sizeof(int) * dap_maxvar, "dap_maxvar");
partv = (int *) dap_malloc(sizeof(int) * dap_maxvar, "dap_maxvar");
regname = dap_malloc(strlen(fname) + 5, "");
dap_suffix(regname, fname, ".lgr");
inset(fname);
dap_vd("_intercept_ -1", 0);
nx0 = dap_list("_intercept_", varv, dap_maxvar);
nx0 += dap_list(x0list, varv + 1, dap_maxvar);
nx1 = dap_list(x1list, varv + nx0, dap_maxvar);
nx = nx0 + nx1;
dap_parsey(yspec, varv + nx);
xmem = (double *) dap_malloc(sizeof(double) * nx * dap_maxval, "dap_maxval");
x = (double **) dap_malloc(sizeof(double *) * nx, "");
for (v = 0; v < nx; v++)
x[v] = xmem + v * dap_maxval;
ymem = (double *) dap_malloc(sizeof(double) * 2 * dap_maxval, "dap_maxval");
y[0] = ymem;
y[1] = ymem + dap_maxval;
nmark = dap_list(marks, markv, dap_maxvar);
covset = dap_malloc(strlen(fname) + 5, "");
strcpy(covset, fname);
strcat(covset, ".cov");
for (v = 1, paramlen = strlen("_intercept_"); v < nx; v++)
{
paramlen1 = strlen(dap_obs[dap_ono].do_nam[varv[v]]);
if (paramlen1 > paramlen)
paramlen = paramlen1;
}
dap_ono = 2;
dap_clearobs((char *) ((void *)0));
sprintf(paramstr, "_param1_ %d", paramlen);
param1n = dap_vd(paramstr, 0);
sprintf(paramstr, "_param2_ %d", paramlen);
param2n = dap_vd(paramstr, 0);
covn = dap_vd("_cov_ -1", 0);
partstr = dap_malloc(strlen(marks) + 1, "");
for (v = 0; v < nmark; v++)
{
strcpy(partstr, dap_obs[0].do_nam[markv[v]]);
sprintf(partstr + strlen(partstr), " %d", dap_obs[0].do_len[markv[v]]);
partv[v] = dap_vd(partstr, 1);
}
outset(covset, "");
dap_ono = 1;
if (xname && xname[0])
{
inset(xname);
nxx = dap_list(x0list, xvarv, dap_maxvar);
nxx += dap_list(x1list, xvarv + nxx, dap_maxvar);
if (nxx != nx - 1)
{
fprintf(dap_err,
"(logreg) %s and %s have different numbers (%d and %d) of x-variables.\n",
fname, xname, nx - 1, nxx);
exit(1);
}
if (nmark)
{
for (v = 0; v < nmark; v++)
{
if ((xmarkv[v] = dap_varnum(dap_obs[0].do_nam[markv[v]])) < 0)
{
fprintf(dap_err,
"(logreg) Mark variable %s in %s not in %s.\n",
dap_obs[0].do_nam[markv[v]], fname, xname);
exit(1);
}
}
}
if (!step())
{
fprintf(dap_err, "(logreg) No data in %s.\n",
(xname[0] ? xname : fname));
exit(1);
}
}
else
{
xvarv[0] = -1;
xmarkv[0] = -1;
}
dap_ono = 0;
outset(regname, "");
for (nobs = 0, dap_mark(), more = 1; more; nobs++)
{
more = step();
if (dap_newpart(markv, nmark))
{
dap_swap();
dap_head(markv, nmark);
dap_swap();
logreg1(y, x, nx0, nx, nobs, varv, xvarv, markv, xmarkv, nmark, level,
param1n, param2n, covn, partv);
nobs = 0;
}
if (nobs < dap_maxval)
{
x[0][nobs] = 1.0;
for (v = 1; v < nx; v++)
x[v][nobs] = dap_obs[dap_ono].do_dbl[varv[v]];
y[0][nobs] = dap_obs[dap_ono].do_dbl[varv[nx]];
if (varv[nx + 1] >= 0)
y[1][nobs] = dap_obs[dap_ono].do_dbl[varv[nx + 1]];
else
y[1][nobs] = -(double) varv[nx + 1];
}
else
{
fputs("(logreg) Too many data.\n", dap_err);
exit(1);
}
}
dap_free(regname, "");
dap_free(varv, "");
dap_free(xvarv, "");
dap_free(markv, "");
dap_free(xmarkv, "");
dap_free(xmem, "");
dap_free(x, "");
dap_free(ymem, "");
dap_free(covset, "");
dap_free(partstr, "");
dap_free(partv, "");
}
| {
"array_type": 10,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 6,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 10,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 12,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 10,
"union_type": 0,
"while_loop": 0
} |
gawk-5.2.2#mpfr_prep#mpg_node.c | gawk-5.2.2 | mpfr.c | mpg_node | 10 | NODE *
mpg_node(unsigned int flags)
{
NODE *r = make_number_node(flags);
if (flags == MPFN)
mpfr_init(r->sub.val.nm.mpnum);
else
__gmpz_init(r->sub.val.nm.mpi);
return r;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#HORNERS_METHOD_POLYNOMIAL_EVALUATION_prep#sort.c | transcoder-set | HORNERS_METHOD_POLYNOMIAL_EVALUATION.c | sort | 1 | void sort (int arr [ ], int n) {qsort (arr, n, sizeof(int), cmpfunc);}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#MIDDLE_OF_THREE_USING_MINIMUM_COMPARISONS_2_prep#max.c | transcoder-set | MIDDLE_OF_THREE_USING_MINIMUM_COMPARISONS_2.c | max | 1 | int max(int x, int y) { return (x > y)? x: y; }
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
units-2.22#units_prep#hassubscript.c | units-2.22 | units.c | hassubscript | 13 | int
hassubscript(const char *str)
{
const char *ptr = &(*((str)+strlen(str)-1));
while (ptr>str){
if (!strchr(digits, *ptr))
return 0;
ptr--;
if (*ptr=='_')
return 1;
}
return 0;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
tulipindicators-0.9.1#tiamalgamation_prep#ti_sin.c | tulipindicators-0.9.1 | tiamalgamation.c | ti_sin | 1 | int ti_sin(int size, double const *const *inputs, double const *options, double *const *outputs) { const double *in1 = inputs[0]; (void)options; double *output = outputs[0]; int i; for (i = 0; i < size; ++i) { output[i] = (sin(in1[i])); } return 0; }
| {
"array_type": 4,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 3,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
gprolog-1.5.0#src_rdr_c_prep#Pl_SR_Check_Descriptor_1.c | gprolog-1.5.0 | src_rdr_c.c | Pl_SR_Check_Descriptor_1 | 5 | void
Pl_SR_Check_Descriptor_1(WamWord desc_word)
{
Get_Descriptor(desc_word, 0);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
mcsim-6.2.0#mh_prep#PrintTemperatureDiagnostics.c | mcsim-6.2.0 | mh.c | PrintTemperatureDiagnostics | 26 | void PrintTemperatureDiagnostics (PFILE fOut, PGIBBSDATA pgd)
{
register int i;
fprintf (fOut, "\nPerks:");
for (i = pgd->startT; i <= pgd->endT; i++) {
fprintf (fOut, "\t%g", pgd->rgdPerks[i]);
}
fprintf (fOut, "\nCounts:");
for (i = pgd->startT; i <= pgd->endT; i++) {
fprintf (fOut, "\t%ld", pgd->rglCount[i]);
}
fprintf (fOut, "\nLnPi(i):");
for (i = pgd->startT; i <= pgd->endT; i++) {
fprintf (fOut, "\t%g", pgd->rgdlnPi[i]);
}
fprintf (fOut, "\nTried Jumps:\t");
for (i = pgd->startT; i <= pgd->endT - 1; i++) {
fprintf (fOut, "\t%ld", pgd->rglTransAttempts[i]);
}
fprintf (fOut, "\nAccepted Jumps:\t");
for (i = pgd->startT; i <= pgd->endT - 1; i++) {
fprintf (fOut, "\t%ld", pgd->rglTransAccepts[i]);
}
fprintf(fOut, "\n\n");
fflush(fOut);
}
| {
"array_type": 5,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 5,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
json.h#allow_simplified_json_prep#json_extract_get_number_size.c | json.h | allow_simplified_json.c | json_extract_get_number_size | 7 | struct json_extract_result_s
json_extract_get_number_size(const struct json_number_s *const number) {
struct json_extract_result_s result;
result.dom_size = sizeof(struct json_number_s);
result.data_size = number->number_size;
return result;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
binn-3.0#binn_prep#binn_is_valid.c | binn-3.0 | binn.c | binn_is_valid | 6 | BOOL binn_is_valid(void *ptr, int *ptype, int *pcount, int *psize) {
if (ptype) *ptype = 0;
if (pcount) *pcount = 0;
if (psize) *psize = 0;
return binn_is_valid_ex(ptr, ptype, pcount, psize);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
gprolog-1.5.0#oper_supp_prep#Pl_Full_Var_Power_2.c | gprolog-1.5.0 | oper_supp.c | Pl_Full_Var_Power_2 | 39 | void
Pl_Full_Var_Power_2(Range *y, Range *x)
{
unsigned x2;
int i, vec_elem;
x2 = x->min * x->min;
do { y->vec = (Vector) (((WamWordP *) pl_reg_bank)[256 +3]); (((WamWordP *) pl_reg_bank)[256 +3]) += pl_vec_size; } while (0);
if (x2 > (unsigned) pl_vec_max_integer)
{
y->extra_cstr = 1;
(y)->max = (int)(1 << (sizeof(int) * 8 - 1));
return;
}
Pl_Vector_Empty(y->vec);
y->extra_cstr = 0;
y->min = x2;
if (((x)->vec == ((void *)0)))
{
for (i = x->min; i <= x->max; i++)
{
x2 = i * i;
if (x2 > (unsigned) pl_vec_max_integer)
goto end_loop;
(y->vec[((VecWord) (x2) >> 6)] |= ((VecWord) 1 << ((x2) & (((VecWord) 1 << 6)-1))));
}
}
else
{
y->extra_cstr = x->extra_cstr;
{ Vector enum_end = x->vec + pl_vec_size, enum_i = x->vec; int enum_j; VecWord enum_word; vec_elem = 0; do { enum_word = *enum_i; for (enum_j = 0; enum_j++ < (8 * 8); enum_word >>= 1, vec_elem++) { if (enum_word & 1) {;
x2 = vec_elem * vec_elem;
if (x2 > (unsigned) pl_vec_max_integer)
goto end_loop;
(y->vec[((VecWord) (x2) >> 6)] |= ((VecWord) 1 << ((x2) & (((VecWord) 1 << 6)-1))));
} } } while (++enum_i < enum_end); };
}
end_loop:
y->max = x2;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 2,
"function_pointer": 0,
"goto_statement": 2,
"if_statement": 5,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 5,
"union_type": 0,
"while_loop": 2
} |
libxml2#xpath_prep#xmlXPathNsLookup.c | libxml2 | xpath.c | xmlXPathNsLookup | 18 | const xmlChar *
xmlXPathNsLookup(xmlXPathContextPtr ctxt, const xmlChar *prefix) {
if (ctxt == ((void *)0))
return(((void *)0));
if (prefix == ((void *)0))
return(((void *)0));
if (xmlStrEqual(prefix, (const xmlChar *) "xml"))
return((const xmlChar *) "http://www.w3.org/XML/1998/namespace");
if (ctxt->namespaces != ((void *)0)) {
int i;
for (i = 0;i < ctxt->nsNr;i++) {
if ((ctxt->namespaces[i] != ((void *)0)) &&
(xmlStrEqual(ctxt->namespaces[i]->prefix, prefix)))
return(ctxt->namespaces[i]->href);
}
}
return((const xmlChar *) xmlHashLookup(ctxt->nsHash, prefix));
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 5,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 5,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 6,
"union_type": 0,
"while_loop": 0
} |
wget-1.21.4#ftp-basic_prep#ftp_cwd.c | wget-1.21.4 | ftp-basic.c | ftp_cwd | 30 | uerr_t
ftp_cwd (int csock, const char *dir)
{
char *request, *respline;
int nwritten;
uerr_t err;
request = ftp_request ("CWD", dir);
nwritten = fd_write (csock, request, strlen (request), -1);
if (nwritten < 0)
{
do { free ((void *) (request)); request = ((void *)0); } while (0);
return WRITEFAILED;
}
do { free ((void *) (request)); request = ((void *)0); } while (0);
err = ftp_response (csock, &respline);
if (err != FTPOK)
return err;
if (*respline == '5')
{
do { free ((void *) (respline)); respline = ((void *)0); } while (0);
return FTPNSFOD;
}
if (*respline != '2')
{
do { free ((void *) (respline)); respline = ((void *)0); } while (0);
return FTPRERR;
}
do { free ((void *) (respline)); respline = ((void *)0); } while (0);
return FTPOK;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 4,
"memory_management": 5,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 5,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 5,
"union_type": 0,
"while_loop": 5
} |
transcoder-set#MAXIMUM_LENGTH_SUBSEQUENCE_DIFFERENCE_ADJACENT_ELEMENTS_EITHER_0_1_prep#f_filled.c | transcoder-set | MAXIMUM_LENGTH_SUBSEQUENCE_DIFFERENCE_ADJACENT_ELEMENTS_EITHER_0_1.c | f_filled | 1 | int f_filled ( int arr [ ], int n ) {}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libosip2-5.3.1#ict_fsm_prep#osip_ict_timeout_b_event.c | libosip2-5.3.1 | ict_fsm.c | osip_ict_timeout_b_event | 11 | void osip_ict_timeout_b_event(osip_transaction_t *ict, osip_event_t *evt) {
ict->ict_context->timer_b_length = -1;
ict->ict_context->timer_b_start.tv_sec = -1;
if (ict->out_socket == -999) {
ict_handle_transport_error(ict, -1);
} else {
__osip_message_callback(OSIP_ICT_STATUS_TIMEOUT, ict, evt->sip);
__osip_transaction_set_state(ict, ICT_TERMINATED);
__osip_kill_transaction_callback(OSIP_ICT_KILL_TRANSACTION, ict);
}
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
nano-7.2#text_prep#copy_completion.c | nano-7.2 | text.c | copy_completion | 12 | char *copy_completion(char *text)
{
char *word;
size_t length = 0, index = 0;
while (is_word_char(&text[length], 0))
length = step_right(text, length);
word = nmalloc(length + 1);
while (index < length)
word[index++] = *(text++);
word[index] = '\0';
return word;
}
| {
"array_type": 2,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 2
} |
optipng-0.7.8#gifread_prep#GIFGetColorTable.c | optipng-0.7.8 | gifread.c | GIFGetColorTable | 23 | void GIFGetColorTable(unsigned char **colors, unsigned int *numColors,
struct GIFImage *image)
{
struct GIFScreen *screen;
if (image->LocalColorFlag)
{
((void)0);
*colors = image->LocalColorTable;
*numColors = image->LocalNumColors;
return;
}
screen = image->Screen;
if (screen->GlobalColorFlag)
{
((void)0);
*colors = screen->GlobalColorTable;
*numColors = screen->GlobalNumColors;
return;
}
((void)0);
*colors = DefaultColorTable;
*numColors = sizeof(DefaultColorTable) / 3;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 2,
"struct_type": 2,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 0
} |
bc-1.07.1#scan_prep#yy_flush_buffer.c | bc-1.07.1 | scan.c | yy_flush_buffer | 13 | void yy_flush_buffer (YY_BUFFER_STATE b )
{
if ( ! b )
return;
b->yy_n_chars = 0;
b->yy_ch_buf[0] = 0;
b->yy_ch_buf[1] = 0;
b->yy_buf_pos = &b->yy_ch_buf[0];
b->yy_at_bol = 1;
b->yy_buffer_status = 0;
if ( b == ( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)] : ((void *)0)) )
yy_load_buffer_state( );
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
make-4.4.1#job_prep#new_job.c | make-4.4.1 | job.c | new_job | 155 | void
new_job (struct file *file)
{
struct commands *cmds = file->cmds;
struct child *c;
char **lines;
unsigned int i;
start_waiting_jobs ();
reap_children (0, 0);
chop_commands (cmds);
c = xcalloc (sizeof (struct child));
output_init (&c->output);
c->file = file;
c->sh_batch_file = ((void *)0);
c->dontcare = file->dontcare;
do{ output_context = (&c->output)->syncout ? (&c->output) : ((void *)0); }while(0);
lines = xmalloc (cmds->ncommand_lines * sizeof (char *));
for (i = 0; i < cmds->ncommand_lines; ++i)
{
char *in, *out, *ref;
in = out = cmds->command_lines[i];
while ((ref = strchr (in, '$')) != 0)
{
++ref;
if (out != in)
memmove (out, in, ref - in);
out += ref - in;
in = ref;
if (*ref == '(' || *ref == '{')
{
char openparen = *ref;
char closeparen = openparen == '(' ? ')' : '}';
char *outref;
int count;
char *p;
*out++ = *in++;
outref = out;
count = 0;
while (*in != '\0')
{
if (*in == closeparen && --count < 0)
break;
else if (*in == '\\' && in[1] == '\n')
{
int quoted = 0;
for (p = in - 1; p > ref && *p == '\\'; --p)
quoted = !quoted;
if (quoted)
*out++ = *in++;
else
{
in += 2;
while ((((stopchar_map[(unsigned char)((*(in)))])&(((0x0002|0x0004)))) != 0)) ++(in);
while (out > outref && (((stopchar_map[(unsigned char)((out[-1]))])&((0x0002))) != 0))
--out;
*out++ = ' ';
}
}
else
{
if (*in == openparen)
++count;
*out++ = *in++;
}
}
}
}
if (out != in)
memmove (out, in, strlen (in) + 1);
cmds->fileinfo.offset = i;
lines[i] = allocated_variable_expand_for_file (cmds->command_lines[i],
file);
}
cmds->fileinfo.offset = 0;
c->command_lines = lines;
job_next_command (c);
if (job_slots != 0)
while (job_slots_used == job_slots)
reap_children (1, 0);
else if (jobserver_enabled ())
while (1)
{
int got_token;
do{ if((((0x004))&db_level)) {printf ("Need a job token; we %shave children\n", children ? "" : "don't "); fflush (stdout);} }while(0);
if (!jobserver_tokens)
break;
jobserver_pre_acquire ();
reap_children (0, 0);
start_waiting_jobs ();
if (!jobserver_tokens)
break;
if (!children)
fatal((((floc *)0)), 0, ("INTERNAL: no children as we go to sleep on read"));
got_token = jobserver_acquire (waiting_jobs != ((void *)0));
if (got_token == 1)
{
do{ if((((0x004))&db_level)) {printf (gettext ("Obtained token for child %p (%s).\n"), c, c->file->name); fflush (stdout);} }while(0);
break;
}
}
++jobserver_tokens;
if ((((0x020))&db_level))
{
const char *nm;
if (! cmds->fileinfo.filenm)
nm = gettext ("<builtin>");
else
{
char *n = __builtin_alloca (strlen (cmds->fileinfo.filenm) + 1 + 11 + 1);
sprintf (n, "%s:%lu", cmds->fileinfo.filenm, cmds->fileinfo.lineno);
nm = n;
}
if (c->file->phony)
message((0), strlen (nm) + strlen (c->file->name), (gettext ("%s: update target '%s' due to: target is .PHONY")), (nm), (c->file->name));
else if (c->file->last_mtime == 1)
message((0), strlen (nm) + strlen (c->file->name), (gettext ("%s: update target '%s' due to: target does not exist")), (nm), (c->file->name));
else
{
char *newer = allocated_variable_expand_for_file ("$?", c->file);
if (newer[0] != '\0')
{
message((0), strlen (nm) + strlen (c->file->name) + strlen (newer), (gettext ("%s: update target '%s' due to: %s")), (nm), (c->file->name), (newer));
free (newer);
}
else
{
size_t len = 0;
struct dep *d;
for (d = c->file->deps; d != ((void *)0); d = d->next)
if (d->file->last_mtime == 1)
len += strlen (d->file->name) + 1;
if (!len)
message((0), strlen (nm) + strlen (c->file->name), (gettext ("%s: update target '%s' due to: unknown reasons")), (nm), (c->file->name));
else
{
char *cp = newer = __builtin_alloca (len);
for (d = c->file->deps; d != ((void *)0); d = d->next)
if (d->file->last_mtime == 1)
{
if (cp > newer)
*(cp++) = ' ';
cp = stpcpy (cp, d->file->name);
}
message((0), strlen (nm) + strlen (c->file->name) + strlen (newer), (gettext ("%s: update target '%s' due to: %s")), (nm), (c->file->name), (newer));
}
}
}
}
start_waiting_job (c);
if (job_slots == 1 || not_parallel)
while (file->command_state == cs_running)
reap_children (1, 0);
do{ output_context = ((void *)0); }while(0);
return;
}
| {
"array_type": 4,
"break_continue_statement": 4,
"enum_type": 0,
"for_loop": 4,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 25,
"memory_management": 1,
"memory_operation": 2,
"pointer_type": 13,
"return_statement": 1,
"struct_type": 4,
"switch_statement": 0,
"type_casting": 8,
"union_type": 0,
"while_loop": 11
} |
cflow-1.7#symbol_prep#next_starter.c | cflow-1.7 | symbol.c | next_starter | 18 | Symbol *
next_starter(void *itr)
{
struct linked_list_entry *p;
if (!itr)
return ((void *)0);
p = *(void**)itr;
while (p) {
Symbol *sym = p->data;
if (sym->type != SymUndefined) {
*(void**)itr = p->next;
return sym;
}
p = p->next;
}
*(void**)itr = ((void *)0);
return ((void *)0);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 3,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 1
} |
transcoder-set#SUM_PAIRWISE_PRODUCTS_prep#min.c | transcoder-set | SUM_PAIRWISE_PRODUCTS.c | min | 1 | int min(int x, int y) { return (x < y)? x: y; }
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#MINIMAL_OPERATIONS_MAKE_NUMBER_MAGICAL_prep#cmpfunc.c | transcoder-set | MINIMAL_OPERATIONS_MAKE_NUMBER_MAGICAL.c | cmpfunc | 1 | int cmpfunc (const void * a, const void * b) {return ( *(int*)a - *(int*)b );}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libxml2#types_prep#libxml_doubleWrap.c | libxml2 | types.c | libxml_doubleWrap | 7 | PyObject *
libxml_doubleWrap(double val)
{
PyObject *ret;
ret = PyFloat_FromDouble((double) val);
return (ret);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
tinycc#x86_64-gen_prep#gen_addrpc32.c | tinycc | x86_64-gen.c | gen_addrpc32 | 6 | void gen_addrpc32(int r, Sym *sym, int c)
{
if (r & 0x0200)
greloca(cur_text_section, sym, ind, 2, c-4), c=4;
gen_le32(c-4);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
nettle-3.9.1#sexp2dsa_prep#nettle_dsa_sha1_keypair_from_sexp.c | nettle-3.9.1 | sexp2dsa.c | nettle_dsa_sha1_keypair_from_sexp | 14 | int
nettle_dsa_sha1_keypair_from_sexp(struct dsa_params *params,
mpz_t pub,
mpz_t priv,
unsigned p_max_bits,
size_t length, const uint8_t *expr)
{
struct sexp_iterator i;
return nettle_sexp_iterator_first(&i, length, expr)
&& nettle_sexp_iterator_check_type(&i, priv ? "private-key" : "public-key")
&& nettle_sexp_iterator_check_type(&i, "dsa")
&& nettle_dsa_keypair_from_sexp_alist(params, pub, priv,
p_max_bits, 160, &i);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.