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 |
|---|---|---|---|---|---|---|
transcoder-set#MAXIMUM_TRIPLET_SUM_ARRAY_prep#max.c | transcoder-set | MAXIMUM_TRIPLET_SUM_ARRAY.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#UNBOUNDED_KNAPSACK_REPETITION_ITEMS_ALLOWED_prep#max.c | transcoder-set | UNBOUNDED_KNAPSACK_REPETITION_ITEMS_ALLOWED.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
} |
libxml2#valid_prep#xmlFreeValidCtxt.c | libxml2 | valid.c | xmlFreeValidCtxt | 10 | void
xmlFreeValidCtxt(xmlValidCtxtPtr cur) {
if (cur == ((void *)0))
return;
if (cur->vstateTab != ((void *)0))
xmlFree(cur->vstateTab);
if (cur->nodeTab != ((void *)0))
xmlFree(cur->nodeTab);
xmlFree(cur);
}
| {
"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": 3,
"union_type": 0,
"while_loop": 0
} |
mcsim-6.2.0#list_prep#FreeList.c | mcsim-6.2.0 | list.c | FreeList | 17 | void FreeList (PLIST *pplist, PFV_FREELISTCALLBACK pfvFreeData, BOOL bAndData)
{
PLIST plist = *pplist;
if (!plist)
return;
while (plist->pleHead) {
if (pfvFreeData)
(*pfvFreeData)(plist->pleHead->pData);
else if (bAndData && plist->pleHead->pData)
free (plist->pleHead->pData);
plist->pleTail = plist->pleHead;
plist->pleHead = plist->pleHead->pleNext;
free (plist->pleTail);
}
free (plist);
*pplist = ((void *)0);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 1,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 3,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 1
} |
transcoder-set#COUNT_DISTINCT_OCCURRENCES_AS_A_SUBSEQUENCE_prep#f_filled.c | transcoder-set | COUNT_DISTINCT_OCCURRENCES_AS_A_SUBSEQUENCE.c | f_filled | 1 | int f_filled ( char S [], char T [] ) {}
| {
"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
} |
transcoder-set#CHECK_REVERSING_SUB_ARRAY_MAKE_ARRAY_SORTED_1_prep#min.c | transcoder-set | CHECK_REVERSING_SUB_ARRAY_MAKE_ARRAY_SORTED_1.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#tccelf_prep#tcc_object_type.c | tinycc | tccelf.c | tcc_object_type | 14 | int tcc_object_type(int fd, Elf64_Ehdr *h)
{
int size = read(fd, h, sizeof *h);
if (size == sizeof *h && 0 == memcmp(h, "\177ELF", 4)) {
if (h->e_type == 1)
return 1;
if (h->e_type == 3)
return 2;
} else if (size >= 8) {
if (0 == memcmp(h, "!<arch>\012", 8))
return 3;
}
return 0;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 5,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 4,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libxml2#parser_prep#namePop.c | libxml2 | parser.c | namePop | 15 | const xmlChar *
namePop(xmlParserCtxtPtr ctxt)
{
const xmlChar *ret;
if ((ctxt == ((void *)0)) || (ctxt->nameNr <= 0))
return (((void *)0));
ctxt->nameNr--;
if (ctxt->nameNr > 0)
ctxt->name = ctxt->nameTab[ctxt->nameNr - 1];
else
ctxt->name = ((void *)0);
ret = ctxt->nameTab[ctxt->nameNr];
ctxt->nameTab[ctxt->nameNr] = ((void *)0);
return (ret);
}
| {
"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": 0,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#PROGRAM_FIND_SLOPE_LINE_prep#len.c | transcoder-set | PROGRAM_FIND_SLOPE_LINE.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_to_prep#osip_to_to_str.c | libosip2-5.3.1 | osip_to.c | osip_to_to_str | 3 | int osip_to_to_str(const osip_to_t *to, char **dest) {
return osip_from_to_str((osip_from_t *) to, dest);
}
| {
"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#screen-write_prep#screen_write_putc.c | tmux | screen-write.c | screen_write_putc | 9 | void
screen_write_putc(struct screen_write_ctx *ctx, const struct grid_cell *gcp,
u_char ch)
{
struct grid_cell gc;
memcpy(&gc, gcp, sizeof gc);
utf8_set(&gc.data, ch);
screen_write_cell(ctx, &gc);
}
| {
"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": 1,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libxml2#libxml2-py_prep#libxml_xmlSchemaNewParserCtxt.c | libxml2 | libxml2-py.c | libxml_xmlSchemaNewParserCtxt | 11 | PyObject *
libxml_xmlSchemaNewParserCtxt(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
xmlSchemaParserCtxtPtr c_retval;
char * URL;
if (!_PyArg_ParseTuple_SizeT(args, (char *)"z:xmlSchemaNewParserCtxt", &URL))
return(((void *)0));
c_retval = xmlSchemaNewParserCtxt(URL);
py_retval = libxml_xmlSchemaParserCtxtPtrWrap((xmlSchemaParserCtxtPtr) 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_SUM_SUBSEQUENCE_LEAST_K_DISTANT_ELEMENTS_prep#cmpfunc.c | transcoder-set | MAXIMUM_SUM_SUBSEQUENCE_LEAST_K_DISTANT_ELEMENTS.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
} |
transcoder-set#COUNT_NUMBER_WAYS_REACH_GIVEN_SCORE_GAME_prep#min.c | transcoder-set | COUNT_NUMBER_WAYS_REACH_GIVEN_SCORE_GAME.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#TRIANGULAR_NUMBERS_prep#f_filled.c | transcoder-set | TRIANGULAR_NUMBERS.c | f_filled | 1 | _Bool f_filled ( int num ) {}
| {
"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
} |
uucp-1.07#uustat_prep#main.c | uucp-1.07 | uustat.c | main | 290 | int
main (argc, argv)
int argc;
char **argv;
{
boolean fall = (0);
int cstdin = 100;
int ccommands = 0;
char **pazcommands = ((void *)0);
boolean fnotcommands = (0);
boolean fexecute = (0);
int ckills = 0;
char **pazkills = ((void *)0);
boolean fmachine = (0);
int ioldhours = -1;
boolean fps = (0);
boolean fquery = (0);
int crejuvs = 0;
char **pazrejuvs = ((void *)0);
int csystems = 0;
char **pazsystems = ((void *)0);
boolean fnotsystems = (0);
int cusers = 0;
char **pazusers = ((void *)0);
boolean fnotusers = (0);
const char *zcomment = ((void *)0);
int iyounghours = -1;
const char *zconfig = ((void *)0);
int icmd = (01);
int ccmds;
int iopt;
pointer puuconf;
int iuuconf;
long iold;
long iyoung;
const char *azoneuser[1];
boolean fret;
zProgram = argv[0];
while ((iopt = getopt_long (argc, argv,
"aB:c:C:eiI:k:KmMNo:pqQr:Rs:S:u:U:vW:x:y:",
asSlongopts, (int *) ((void *)0))) != (-1))
{
switch (iopt)
{
case 'a':
fall = (1);
break;
case 'B':
cstdin = (int) strtol (gnu_optarg, (char **) ((void *)0), 10);
break;
case 'C':
fnotcommands = (1);
case 'c':
++ccommands;
pazcommands = (char **) xrealloc ((pointer) pazcommands,
ccommands * sizeof (char *));
pazcommands[ccommands - 1] = gnu_optarg;
break;
case 'e':
fexecute = (1);
break;
case 'i':
icmd |= (02);
break;
case 'I':
if (fsysdep_other_config (gnu_optarg))
zconfig = gnu_optarg;
break;
case 'k':
++ckills;
pazkills = (char **) xrealloc ((pointer) pazkills,
ckills * sizeof (char *));
pazkills[ckills - 1] = gnu_optarg;
break;
case 'K':
icmd |= (04);
break;
case 'm':
fmachine = (1);
break;
case 'M':
icmd |= (020);
break;
case 'N':
icmd |= (040);
break;
case 'o':
ioldhours = (int) strtol (gnu_optarg, (char **) ((void *)0), 10);
break;
case 'p':
fps = (1);
break;
case 'q':
fquery = (1);
break;
case 'Q':
icmd &=~ (01);
break;
case 'r':
++crejuvs;
pazrejuvs = (char **) xrealloc ((pointer) pazrejuvs,
crejuvs * sizeof (char *));
pazrejuvs[crejuvs - 1] = gnu_optarg;
break;
case 'R':
icmd |= (010);
break;
case 'S':
fnotsystems = (1);
case 's':
++csystems;
pazsystems = (char **) xrealloc ((pointer) pazsystems,
csystems * sizeof (char *));
pazsystems[csystems - 1] = gnu_optarg;
break;
case 'U':
fnotusers = (1);
case 'u':
++cusers;
pazusers = (char **) xrealloc ((pointer) pazusers,
cusers * sizeof (char *));
pazusers[cusers - 1] = gnu_optarg;
break;
case 'W':
zcomment = gnu_optarg;
break;
case 'x':
iDebug |= idebug_parse (gnu_optarg);
break;
case 'y':
iyounghours = (int) strtol (gnu_optarg, (char **) ((void *)0), 10);
break;
case 'v':
printf ("uustat (Taylor UUCP) %s\n", "1.07");
printf ("Copyright (C) 1991, 92, 93, 94, 1995, 2002 Ian Lance Taylor\n");
printf ("This program is free software; you may redistribute it under the terms of\n");
printf ("the GNU General Public LIcense. This program has ABSOLUTELY NO WARRANTY.\n");
exit (0);
case 1:
ushelp ();
exit (0);
case 0:
break;
default:
ususage ();
}
}
if (gnu_optind != argc)
ususage ();
ccmds = 0;
if (fall)
++ccmds;
if (ckills > 0 || crejuvs > 0)
++ccmds;
if (fmachine)
++ccmds;
if (fps)
++ccmds;
if (fexecute || fquery || csystems > 0 || cusers > 0 || ioldhours != -1
|| iyounghours != -1 || ccommands > 0)
++ccmds;
if (fexecute && fquery)
++ccmds;
if (ccmds > 1)
{
fprintf (stderr, "%s: too many options\n", zProgram);
ususage ();
}
if ((icmd & (04)) != 0
&& (icmd & (010)) != 0)
{
fprintf (stderr, "%s: can not both rejuvenate and kill jobs\n",
zProgram);
ususage ();
}
iuuconf = uuconf_init (&puuconf, (const char *) ((void *)0), zconfig);
if (iuuconf != (0))
ulog_uuconf (LOG_FATAL, puuconf, iuuconf);
{
const char *zdebug;
iuuconf = uuconf_debuglevel (puuconf, &zdebug);
if (iuuconf != (0))
ulog_uuconf (LOG_FATAL, puuconf, iuuconf);
if (zdebug != ((void *)0))
iDebug |= idebug_parse (zdebug);
}
usysdep_initialize (puuconf, (04));
if (ccmds == 0)
{
cusers = 1;
azoneuser[0] = zsysdep_login_name ();
pazusers = (char **) azoneuser;
}
if (csystems > 0)
{
int i;
for (i = 0; i < csystems; i++)
{
struct uuconf_system ssys;
iuuconf = uuconf_system_info (puuconf, pazsystems[i], &ssys);
if (iuuconf != (0))
{
if (iuuconf == (1))
ulog (LOG_FATAL, "%s: System not found", pazsystems[i]);
else
ulog_uuconf (LOG_FATAL, puuconf, iuuconf);
}
if (strcmp (pazsystems[i], ssys.uuconf_zname) != 0)
pazsystems[i] = zbufcpy (ssys.uuconf_zname);
(void) uuconf_system_free (puuconf, &ssys);
}
}
if (ioldhours == -1)
iold = (long) -1;
else
{
iold = (ixsysdep_time ((long *) ((void *)0))
- (long) ioldhours * (long) 60 * (long) 60);
if (iold < 0L)
iold = 0L;
}
if (iyounghours == -1)
iyoung = (long) -1;
else
{
iyoung = (ixsysdep_time ((long *) ((void *)0))
- (long) iyounghours * (long) 60 * (long) 60);
if (iyoung < 0L)
iyoung = 0L;
}
if (! fexecute
&& ! fquery
&& (fall
|| csystems > 0
|| cusers > 0
|| ioldhours != -1
|| iyounghours != -1
|| ccommands > 0))
fret = fsworkfiles (puuconf, icmd, csystems, pazsystems, fnotsystems,
cusers, pazusers, fnotusers, iold, iyoung,
ccommands, pazcommands, fnotcommands, zcomment,
cstdin);
else if (fexecute)
fret = fsexecutions (puuconf, icmd, csystems, pazsystems, fnotsystems,
cusers, pazusers, fnotusers, iold, iyoung,
ccommands, pazcommands, fnotcommands, zcomment,
cstdin);
else if (icmd != (01))
{
ulog (LOG_ERROR,
"-i, -K, -M, -N, -Q, -R not supported with -k, -m, -p, -q, -r");
ususage ();
fret = (0);
}
else if (fquery)
{
if (cusers > 0 || ccommands > 0)
{
ulog (LOG_ERROR, "-u, -c not supported with -q");
ususage ();
fret = (0);
}
else
fret = fsquery (puuconf, csystems, pazsystems, fnotsystems,
iold, iyoung);
}
else if (fmachine)
fret = fsmachines ();
else if (ckills > 0 || crejuvs > 0)
{
int i;
fret = (1);
for (i = 0; i < ckills; i++)
if (! fsysdep_kill_job (puuconf, pazkills[i]))
fret = (0);
for (i = 0; i < crejuvs; i++)
if (! fsysdep_rejuvenate_job (puuconf, pazrejuvs[i]))
fret = (0);
}
else if (fps)
fret = fsysdep_lock_status ();
else
{
ulog (LOG_FATAL, "Can't happen");
fret = (0);
}
ulog_close ();
usysdep_exit (fret);
return 0;
}
| {
"array_type": 5,
"break_continue_statement": 23,
"enum_type": 0,
"for_loop": 3,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 32,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 9,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 1,
"type_casting": 25,
"union_type": 0,
"while_loop": 1
} |
libxml2#libxml2-py_prep#libxml_xmlXPathDivValues.c | libxml2 | libxml2-py.c | libxml_xmlXPathDivValues | 11 | PyObject *
libxml_xmlXPathDivValues(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
xmlXPathParserContextPtr ctxt;
PyObject *pyobj_ctxt;
if (!_PyArg_ParseTuple_SizeT(args, (char *)"O:xmlXPathDivValues", &pyobj_ctxt))
return(((void *)0));
ctxt = (xmlXPathParserContextPtr) (((pyobj_ctxt) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyxmlXPathParserContext_Object *)(pyobj_ctxt))->obj));
xmlXPathDivValues(ctxt);
_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
} |
json.h#allow_multi_line_strings_prep#json_get_key_size.c | json.h | allow_multi_line_strings.c | json_get_key_size | 31 | int json_get_key_size(struct json_parse_state_s *state) {
const size_t flags_bitset = state->flags_bitset;
if (json_parse_flags_allow_unquoted_keys & flags_bitset) {
size_t offset = state->offset;
const size_t size = state->size;
const char *const src = state->src;
size_t data_size = state->data_size;
if ('"' == src[offset]) {
return json_get_string_size(state, 1);
} else if ((json_parse_flags_allow_single_quoted_strings & flags_bitset) &&
('\'' == src[offset])) {
return json_get_string_size(state, 1);
} else {
while ((offset < size) && is_valid_unquoted_key_char(src[offset])) {
offset++;
data_size++;
}
data_size++;
if (json_parse_flags_allow_location_information & flags_bitset) {
state->dom_size += sizeof(struct json_string_ex_s);
} else {
state->dom_size += sizeof(struct json_string_s);
}
state->offset = offset;
state->data_size = data_size;
return 0;
}
} else {
return json_get_string_size(state, 1);
}
}
| {
"array_type": 1,
"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": 4,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 1
} |
gprolog-1.5.0#arith_inl_c_prep#Pl_Fct_Cos.c | gprolog-1.5.0 | arith_inl_c.c | Pl_Fct_Cos | 5 | WamWord
Pl_Fct_Cos(WamWord x)
{
return Make_Tagged_Float(cos(To_Double(x)));
}
| {
"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#x86_64-gen_prep#gen_cvt_ftoi.c | tinycc | x86_64-gen.c | gen_cvt_ftoi | 26 | void gen_cvt_ftoi(int t)
{
int ft, bt, size, r;
ft = vtop->type.t;
bt = ft & 0x000f;
if (bt == 10) {
gen_cvt_ftof(9);
bt = 9;
}
gv(0x0002);
if (t != 3)
size = 8;
else
size = 4;
r = get_reg(0x0001);
if (bt == 8) {
o(0xf3);
} else if (bt == 9) {
o(0xf2);
} else {
((void) sizeof ((0) ? 1 : 0), __extension__ ({ if (0) ; else __assert_fail ("0", "x86_64-gen.c", 2201, __extension__ __PRETTY_FUNCTION__); }));
}
orex(size == 8, r, 0, 0x2c0f);
o(0xc0 + ((vtop->r) & 7) + ((r) & 7)*8);
vtop->r = r;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 5,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
gprolog-1.5.0#pretty_c_prep#Pl_Portray_Clause_3.c | gprolog-1.5.0 | pretty_c.c | Pl_Portray_Clause_3 | 15 | void
Pl_Portray_Clause_3(WamWord sora_word, WamWord term_word, WamWord above_word)
{
int stm;
StmInf *pstm;
WamWord *b;
stm = (sora_word == ((PlLong) (0) + ((PlULong)0)))
? pl_stm_output : Pl_Get_Stream_Or_Alias(sora_word, 3);
pstm = pl_stm_tbl[stm];
pl_last_output_sora = sora_word;
Pl_Check_Stream_Type(stm, 1, 0);
b = (((WamWordP *) pl_reg_bank)[256 +7]) + Pl_Rd_Integer(above_word);
above_H = (*(WamWord **) &(b[-6]));
Portray_Clause(pstm, term_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": 2,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libxml2#parser_prep#xmlCreateURLParserCtxt.c | libxml2 | parser.c | xmlCreateURLParserCtxt | 22 | xmlParserCtxtPtr
xmlCreateURLParserCtxt(const char *filename, int options)
{
xmlParserCtxtPtr ctxt;
xmlParserInputPtr input;
ctxt = xmlNewParserCtxt();
if (ctxt == ((void *)0))
return(((void *)0));
xmlCtxtUseOptions(ctxt, options);
ctxt->linenumbers = 1;
input = xmlLoadResource(ctxt, filename, ((void *)0), XML_RESOURCE_MAIN_DOCUMENT);
if (input == ((void *)0)) {
xmlFreeParserCtxt(ctxt);
return(((void *)0));
}
if (inputPush(ctxt, input) < 0) {
xmlFreeInputStream(input);
xmlFreeParserCtxt(ctxt);
return(((void *)0));
}
return(ctxt);
}
| {
"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": 4,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 6,
"union_type": 0,
"while_loop": 0
} |
tulipindicators-0.9.1#tema_prep#ti_tema_start.c | tulipindicators-0.9.1 | tema.c | ti_tema_start | 4 | int ti_tema_start(double const *options) {
const int period = (int)options[0];
return (period-1) * 3;
}
| {
"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
} |
gprolog-1.5.0#type_inl_c_prep#Pl_Blt_Compound.c | gprolog-1.5.0 | type_inl_c.c | Pl_Blt_Compound | 5 | Bool
Pl_Blt_Compound(WamWord x)
{
WamWord word, tag_mask; do { WamWord deref_last_word; word = x; ; 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); return (tag_mask == (PlULong)0x2 || tag_mask == (PlULong)0x1);
}
| {
"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": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
dap-3.10#prob_prep#varnorm.c | dap-3.10 | prob.c | varnorm | 12 | double varnorm()
{
double u1, u2, v1, v2, w;
do {
u1 = 2.0 * ((double) random()) / randmax - 1.0;
v1 = u1 * u1;
u2 = 2.0 * ((double) random()) / randmax - 1.0;
v2 = u2 * u2;
} while ((w = v1 + v2) > 1.0);
w = sqrt(-2.0 * log(w) / w);
return u1 * w;
}
| {
"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": 2,
"union_type": 0,
"while_loop": 1
} |
screen-4.9.0#encoding_prep#PrepareEncodedChar.c | screen-4.9.0 | encoding.c | PrepareEncodedChar | 50 | int
PrepareEncodedChar(c)
int c;
{
int encoding;
int t = 0;
int f;
encoding = display->d_encoding;
f = display->d_rend.font;
t = display->d_mbcs;
if (encoding == 2)
{
if (f == 'I')
return c | 0x80;
else if (f == ('B' & 037))
{
t += (c & 1) ? ((t <= 0x5f) ? 0x1f : 0x20) : 0x7e;
c = (c - 0x21) / 2 + ((c < 0x5f) ? 0x81 : 0xc1);
display->d_mbcs = t;
}
return c;
}
if (encoding == 1)
{
if (f == 'I')
{
do { if (--display->d_obuffree <= 0) Resize_obuf(); *display->d_obufp++ = (0x8e); } while (0);
return c | 0x80;
}
if (f == ('B' & 037))
{
display->d_mbcs = t | 0x80;
return c | 0x80;
}
if (f == ('D' & 037))
{
do { if (--display->d_obuffree <= 0) Resize_obuf(); *display->d_obufp++ = (0x8f); } while (0);
display->d_mbcs = t | 0x80;
return c | 0x80;
}
}
if ((encoding == 3 && f == 3) || (encoding == 4 && f == 1))
{
display->d_mbcs = t | 0x80;
return c | 0x80;
}
if ((encoding == 5 && f == 030) || (encoding == 20 && f == 031))
return c | 0x80;
return c;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 11,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 8,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 2
} |
json.h#allow_unquoted_keys_prep#json_write_pretty_get_array_size.c | json.h | allow_unquoted_keys.c | json_write_pretty_get_array_size | 22 | int json_write_pretty_get_array_size(const struct json_array_s *array,
size_t depth, size_t indent_size,
size_t newline_size, size_t *size) {
struct json_array_element_s *element;
*size += 1;
if (0 < array->length) {
*size += newline_size;
*size += array->length - 1;
for (element = array->start; 0 != element;
element = element->next) {
*size += (depth + 1) * indent_size;
if (json_write_pretty_get_value_size(element->value, depth + 1,
indent_size, newline_size, size)) {
return 1;
}
*size += newline_size;
}
*size += depth * indent_size;
}
*size += 1;
return 0;
}
| {
"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": 1,
"return_statement": 2,
"struct_type": 2,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
tulipindicators-0.9.1#benchmark_prep#posc_option_setter.c | tulipindicators-0.9.1 | benchmark.c | posc_option_setter | 5 | void posc_option_setter(double period, double *options, int ti) {
(void)ti;
options[0] = period;
options[1] = 3;
}
| {
"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
} |
json.h#allow_json5_prep#json_write_pretty_array.c | json.h | allow_json5.c | json_write_pretty_array | 41 | char *json_write_pretty_array(const struct json_array_s *array, size_t depth,
const char *indent, const char *newline,
char *data) {
size_t k, m;
struct json_array_element_s *element;
*data++ = '[';
if (0 < array->length) {
for (k = 0; '\0' != newline[k]; k++) {
*data++ = newline[k];
}
for (element = array->start; 0 != element;
element = element->next) {
if (element != array->start) {
*data++ = ',';
for (k = 0; '\0' != newline[k]; k++) {
*data++ = newline[k];
}
}
for (k = 0; k < depth + 1; k++) {
for (m = 0; '\0' != indent[m]; m++) {
*data++ = indent[m];
}
}
data = json_write_pretty_value(element->value, depth + 1, indent, newline,
data);
if (0 == data) {
return 0;
}
}
for (k = 0; '\0' != newline[k]; k++) {
*data++ = newline[k];
}
for (k = 0; k < depth; k++) {
for (m = 0; '\0' != indent[m]; m++) {
*data++ = indent[m];
}
}
}
*data++ = ']';
return data;
}
| {
"array_type": 2,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 8,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 2,
"struct_type": 2,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#PROGRAM_PRINT_SUM_GIVEN_NTH_TERM_1_prep#cmpfunc.c | transcoder-set | PROGRAM_PRINT_SUM_GIVEN_NTH_TERM_1.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
} |
transcoder-set#SEARCH_INSERT_AND_DELETE_IN_A_SORTED_ARRAY_1_prep#main.c | transcoder-set | SEARCH_INSERT_AND_DELETE_IN_A_SORTED_ARRAY_1.c | main | 27 | int main(void) {
int n_success = 0;
int param0_0[] = {69};
int param0_1[] = {-34,-38,-72,90,-84,-40,-40,-52,-12,80,-4,-58};
int param0_2[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1};
int param0_3[] = {96,34,11,1,36,79,64,75,75,96,32,18,25,79,63,80,90,75,44,71,48,1,62,53,17,98};
int param0_4[] = {-98,-92,-92,-84,-82,-80,-80,-74,-70,-60,-48,-42,-36,-34,-34,-34,-30,-28,-16,-6,-2,-2,2,12,14,20,24,40,46,50,60,66,70,72,78,82,88,92,94,94,96};
int param0_5[] = {1,0,1,1,0,0,1,0,0,0,1,1,0};
int param0_6[] = {10,12,12,19,20,21,24,27,37,47,50,54,55,58,61,63,63,68,73,75,87,90,90,92,92};
int param0_7[] = {-74,62,74,92,-38,-28,-26,4,88,-68,-76,-20,-4,12,72,6,42,36,88,-96,-80,90,80,-26,-36,-72,-62,38,-20,40,-10,-22,-20,38,82,-84,8,-60,86,-26,44,-72,-70,-16,-22,18,-16,76,-50};
int param0_8[] = {1,1,1,1,1};
int param0_9[] = {64,80,47,58,41,3,85,96,51,4,22,89,67,54,88,15,83,31,19,28,40,67,37,13,63,38,27,14,7,68};
int *param0[10] = {param0_0,param0_1,param0_2,param0_3,param0_4,param0_5,param0_6,param0_7,param0_8,param0_9};
int param1[] = {0,6,13,21,30,12,12,37,3,23};
int param2[] = {0,6,19,20,32,9,13,26,4,24};
int param3[] = {0,9,11,13,28,10,21,42,2,25};
for(int i = 0; i < len(param0); ++i)
{
if(f_filled(param0[i],param1[i],param2[i],param3[i]) == f_gold(param0[i],param1[i],param2[i],param3[i]))
{
n_success+=1;
}
break;
}
printf("#Results:", " ", n_success, ", ", len(param0));
return 0;
}
| {
"array_type": 4,
"break_continue_statement": 1,
"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": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#NUMBER_SUBSEQUENCES_FORM_AI_BJ_CK_prep#cmpfunc.c | transcoder-set | NUMBER_SUBSEQUENCES_FORM_AI_BJ_CK.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
} |
less-633#screen_prep#clear_eol.c | less-633 | screen.c | clear_eol | 4 | void clear_eol(void)
{
ltputs(sc_eol_clear, 1, putchr);
}
| {
"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
} |
gprolog-1.5.0#debugger_c_prep#Pl_Remove_One_Choice_Point_1.c | gprolog-1.5.0 | debugger_c.c | Pl_Remove_One_Choice_Point_1 | 9 | void
Pl_Remove_One_Choice_Point_1(WamWord b_word)
{
WamWord word, tag_mask;
WamWord *b;
do { WamWord deref_last_word; word = b_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);
b = ((((WamWordP *) pl_reg_bank)[256 +7]) + ((PlLong) ((word) << 0) >> 3));
(B = ((*(WamWord **) &(b[-5]))), (((WamWordP *) pl_reg_bank)[256 +0]) = (*(WamWord **) &(B[-6])));
}
| {
"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": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
libxml2#libxml2-py_prep#libxml_xmlUCSIsArabic.c | libxml2 | libxml2-py.c | libxml_xmlUCSIsArabic | 13 | PyObject *
libxml_xmlUCSIsArabic(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
int c_retval;
int code;
if (libxml_deprecationWarning("xmlUCSIsArabic") == -1)
return(((void *)0));
if (!_PyArg_ParseTuple_SizeT(args, (char *)"i:xmlUCSIsArabic", &code))
return(((void *)0));
c_retval = xmlUCSIsArabic(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
} |
transcoder-set#MAXIMUM_POSSIBLE_DIFFERENCE_TWO_SUBSETS_ARRAY_1_prep#f_gold.c | transcoder-set | MAXIMUM_POSSIBLE_DIFFERENCE_TWO_SUBSETS_ARRAY_1.c | f_gold | 12 | int f_gold ( int arr [ ], int n ) {
int result = 0;
sort ( arr, arr + n );
for ( int i = 0;
i < n - 1;
i ++ ) {
if ( arr [ i ] != arr [ i + 1 ] ) result += abs ( arr [ i ] );
else i ++;
}
if ( arr [ n - 2 ] != arr [ n - 1 ] ) result += abs ( arr [ n - 1 ] );
return result;
}
| {
"array_type": 1,
"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": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#MAXIMUM_POSSIBLE_DIFFERENCE_TWO_SUBSETS_ARRAY_1_prep#min.c | transcoder-set | MAXIMUM_POSSIBLE_DIFFERENCE_TWO_SUBSETS_ARRAY_1.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
} |
json.h#allow_location_information_prep#json_write_pretty_object.c | json.h | allow_location_information.c | json_write_pretty_object | 48 | char *json_write_pretty_object(const struct json_object_s *object, size_t depth,
const char *indent, const char *newline,
char *data) {
size_t k, m;
struct json_object_element_s *element;
*data++ = '{';
if (0 < object->length) {
for (k = 0; '\0' != newline[k]; k++) {
*data++ = newline[k];
}
for (element = object->start; 0 != element;
element = element->next) {
if (element != object->start) {
*data++ = ',';
for (k = 0; '\0' != newline[k]; k++) {
*data++ = newline[k];
}
}
for (k = 0; k < depth + 1; k++) {
for (m = 0; '\0' != indent[m]; m++) {
*data++ = indent[m];
}
}
data = json_write_string(element->name, data);
if (0 == data) {
return 0;
}
*data++ = ' ';
*data++ = ':';
*data++ = ' ';
data = json_write_pretty_value(element->value, depth + 1, indent, newline,
data);
if (0 == data) {
return 0;
}
}
for (k = 0; '\0' != newline[k]; k++) {
*data++ = newline[k];
}
for (k = 0; k < depth; k++) {
for (m = 0; '\0' != indent[m]; m++) {
*data++ = indent[m];
}
}
}
*data++ = '}';
return data;
}
| {
"array_type": 2,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 8,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 4,
"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
} |
binn-3.0#binn_prep#binn_set_blob.c | binn-3.0 | binn.c | binn_set_blob | 14 | BOOL binn_set_blob(binn *item, void *ptr, int size, binn_mem_free pfree) {
if (item == ((void *)0) || ptr == ((void *)0)) return 0;
if (pfree == ((binn_mem_free)-1)) {
item->ptr = binn_memdup(ptr, size);
if (item->ptr == ((void *)0)) return 0;
item->freefn = free_fn;
} else {
item->ptr = ptr;
item->freefn = pfree;
}
item->type = 0xC0;
item->size = size;
return 1;
}
| {
"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": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
tinycc#tccgen_prep#inc.c | tinycc | tccgen.c | inc | 15 | void inc(int post, int c)
{
test_lvalue();
vdup();
if (post) {
gv_dup();
vrotb(3);
vrotb(3);
}
vpushi(c - 0xa3);
gen_op('+');
vstore();
if (post)
vpop();
}
| {
"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
} |
less-633#mark_prep#init_mark.c | less-633 | mark.c | init_mark | 15 | void init_mark(void)
{
int i;
for (i = 0; i < ((2*26)+2); i++)
{
char letter;
switch (i) {
case (((2*26)+2)-2): letter = '#'; break;
case (((2*26)+2)-1): letter = '\''; break;
default: letter = (i < 26) ? 'a'+i : 'A'+i-26; break;
}
marks[i].m_letter = letter;
cmark(&marks[i], ((void*)((void *)0)), ((POSITION)(-1)), -1);
}
}
| {
"array_type": 1,
"break_continue_statement": 3,
"enum_type": 0,
"for_loop": 1,
"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": 1,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#LCS_FORMED_CONSECUTIVE_SEGMENTS_LEAST_LENGTH_K_prep#sort.c | transcoder-set | LCS_FORMED_CONSECUTIVE_SEGMENTS_LEAST_LENGTH_K.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
} |
tmux#mode-tree_prep#mode_tree_down.c | tmux | mode-tree.c | mode_tree_down | 14 | void
mode_tree_down(struct mode_tree_data *mtd, int wrap)
{
if (mtd->current == mtd->line_size - 1) {
if (wrap) {
mtd->current = 0;
mtd->offset = 0;
}
} else {
mtd->current++;
if (mtd->current > mtd->offset + mtd->height - 1)
mtd->offset++;
}
}
| {
"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": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
gawk-5.2.2#debug_prep#do_stepi.c | gawk-5.2.2 | debug.c | do_stepi | 9 | int
do_stepi(CMDARG *arg, int cmd)
{
int ret;
ret = next_step(arg, cmd);
if (ret)
stop.check_func = check_stepi;
return ret;
}
| {
"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
} |
nettle-3.9.1#cnd-copy_prep#_nettle_cnd_copy.c | nettle-3.9.1 | cnd-copy.c | _nettle_cnd_copy | 10 | void
_nettle_cnd_copy (int cnd, mp_limb_t *rp, const mp_limb_t *ap, mp_size_t n)
{
mp_limb_t mask, keep;
mp_size_t i;
mask = -(mp_limb_t) (cnd !=0);
keep = ~mask;
for (i = 0; i < n; i++)
rp[i] = (rp[i] & keep) + (ap[i] & mask);
}
| {
"array_type": 2,
"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": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
json-c#linkhash_prep#lh_table_lookup_entry.c | json-c | linkhash.c | lh_table_lookup_entry | 4 | struct lh_entry *lh_table_lookup_entry(struct lh_table *t, const void *k)
{
return lh_table_lookup_entry_w_hash(t, k, lh_get_hash(t, k));
}
| {
"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
} |
transcoder-set#SUM_PAIRWISE_PRODUCTS_2_prep#cmpfunc.c | transcoder-set | SUM_PAIRWISE_PRODUCTS_2.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
} |
libosip2-5.3.1#osip_from_prep#osip_generic_param_get_name.c | libosip2-5.3.1 | osip_from.c | osip_generic_param_get_name | 5 | char *osip_generic_param_get_name(const osip_generic_param_t *fparam) {
if (fparam == ((void *)0))
return ((void *)0);
return fparam->gname;
}
| {
"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": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
libxml2#tree_prep#xmlGetIntSubset.c | libxml2 | tree.c | xmlGetIntSubset | 13 | xmlDtdPtr
xmlGetIntSubset(const xmlDoc *doc) {
xmlNodePtr cur;
if (doc == ((void *)0))
return(((void *)0));
cur = doc->children;
while (cur != ((void *)0)) {
if (cur->type == XML_DTD_NODE)
return((xmlDtdPtr) cur);
cur = cur->next;
}
return((xmlDtdPtr) doc->intSubset);
}
| {
"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": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 1
} |
gzip-1.12#unlzh_prep#unlzh.c | gzip-1.12 | unlzh.c | unlzh | 15 | int unlzh(in, out)
int in;
int out;
{
unsigned n;
ifd = in;
ofd = out;
decode_start();
while (!done) {
n = decode((unsigned) ((unsigned) 1 << 13), window);
if (n > 0)
write_buf (out, window, n);
}
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": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 1
} |
transcoder-set#COMPUTE_AVERAGE_TWO_NUMBERS_WITHOUT_OVERFLOW_1_prep#main.c | transcoder-set | COMPUTE_AVERAGE_TWO_NUMBERS_WITHOUT_OVERFLOW_1.c | main | 15 | int main(void) {
int n_success = 0;
int param0[] = {9,68,51,31,14,73,51,75,98,83};
int param1[] = {81,79,2,49,10,9,13,67,51,74};
for(int i = 0; i < len(param0); ++i)
{
if(f_filled(param0[i],param1[i]) == f_gold(param0[i],param1[i]))
{
n_success+=1;
}
break;
}
printf("#Results:", " ", n_success, ", ", len(param0));
return 0;
}
| {
"array_type": 2,
"break_continue_statement": 1,
"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": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
wget-1.21.4#http_prep#http_atotm.c | wget-1.21.4 | http.c | http_atotm | 38 | time_t
http_atotm (const char *time_string)
{
static const char *time_formats[] = {
"%a, %d %b %Y %T",
"%A, %d-%b-%y %T",
"%a %b %d %T %Y",
"%a, %d-%b-%Y %T"
};
const char *oldlocale;
char savedlocale[256];
size_t i;
time_t ret = (time_t) -1;
oldlocale = setlocale (2, ((void *)0));
if (oldlocale)
{
size_t l = strlen (oldlocale) + 1;
if (l >= sizeof savedlocale)
savedlocale[0] = '\0';
else
memcpy (savedlocale, oldlocale, l);
}
else savedlocale[0] = '\0';
setlocale (2, "C");
for (i = 0; i < (sizeof (time_formats) / sizeof ((time_formats)[0])); i++)
{
struct tm t;
memset (&(t), '\0', sizeof (t));
if (check_end (strptime (time_string, time_formats[i], &t)))
{
ret = timegm (&t);
break;
}
}
if (savedlocale[0])
setlocale (2, savedlocale);
return ret;
}
| {
"array_type": 2,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 4,
"memory_management": 0,
"memory_operation": 2,
"pointer_type": 2,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
heman#quaternion_prep#kmQuaternionExp.c | heman | quaternion.c | kmQuaternionExp | 5 | kmQuaternion* kmQuaternionExp(kmQuaternion* pOut, const kmQuaternion* pIn)
{
((void) sizeof ((0) ? 1 : 0), __extension__ ({ if (0) ; else __assert_fail ("0", "/home/melih/storage/Transpiler/Dataset/projects/codebases_v2/heman/kazmath/quaternion.c", 68, __extension__ __PRETTY_FUNCTION__); }));
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": 1,
"union_type": 0,
"while_loop": 0
} |
tmux#strlcpy_prep#strlcpy.c | tmux | strlcpy.c | strlcpy | 20 | size_t
strlcpy(char *dst, const char *src, size_t siz)
{
char *d = dst;
const char *s = src;
size_t n = siz;
if (n != 0 && --n != 0) {
do {
if ((*d++ = *s++) == 0)
break;
} while (--n != 0);
}
if (n == 0) {
if (siz != 0)
*d = '\0';
while (*s++)
;
}
return(s - src - 1);
}
| {
"array_type": 0,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 4,
"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": 2
} |
wget-1.21.4#utils_prep#unique_create.c | wget-1.21.4 | utils.c | unique_create | 24 | FILE *
unique_create (const char *name, _Bool binary, char **opened_name)
{
char *uname = unique_name (name);
FILE *fp;
while ((fp = fopen_excl (uname, binary)) == ((void *)0) && (*__errno_location ()) == 17)
{
do { free ((void *) (uname)); uname = ((void *)0); } while (0);
uname = unique_name (name);
}
if (opened_name)
{
if (fp)
*opened_name = uname;
else
{
*opened_name = ((void *)0);
do { free ((void *) (uname)); uname = ((void *)0); } while (0);
}
}
else
do { free ((void *) (uname)); uname = ((void *)0); } while (0);
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": 3,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 5,
"union_type": 0,
"while_loop": 4
} |
transcoder-set#PROGRAM_CALCULATE_VOLUME_ELLIPSOID_prep#len.c | transcoder-set | PROGRAM_CALCULATE_VOLUME_ELLIPSOID.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
} |
make-4.4.1#shuffle_prep#shuffle_deps_recursive.c | make-4.4.1 | shuffle.c | shuffle_deps_recursive | 14 | void
shuffle_deps_recursive (struct dep *deps)
{
struct dep *dep;
if (config.mode == sm_none)
return;
if (not_parallel)
return;
if (config.mode == sm_random)
make_seed (config.seed);
shuffle_deps (deps);
for (dep = deps; dep; dep = dep->next)
shuffle_file_deps_recursive (dep->file);
}
| {
"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": 2,
"struct_type": 2,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
heman#ops_prep#heman_ops_normalize_f32.c | heman | ops.c | heman_ops_normalize_f32 | 15 | heman_image* heman_ops_normalize_f32(
heman_image* source, float minv, float maxv)
{
heman_image* result =
heman_image_create(source->width, source->height, source->nbands);
float* src = source->data;
float* dst = result->data;
float scale = 1.0f / (maxv - minv);
int size = source->height * source->width * source->nbands;
for (int i = 0; i < size; ++i) {
float v = (*src++ - minv) * scale;
*dst++ = (0 > (1 > v ? v : 1) ? 0 : (1 > v ? v : 1));
}
return result;
}
| {
"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": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
pth-2.0.7#pth_lib_prep#__pth_thread_cleanup.c | pth-2.0.7 | pth_lib.c | __pth_thread_cleanup | 9 | void __pth_thread_cleanup(pth_t thread)
{
if (thread->cleanups != ((void *)0))
__pth_cleanup_popall(thread, (!(0)));
if (thread->data_value != ((void *)0))
__pth_key_destroydata(thread);
__pth_mutex_releaseall(thread);
return;
}
| {
"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": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
less-633#lessecho_prep#main.c | less-633 | lessecho.c | main | 107 | int main(int argc, char *argv[])
{
char *arg;
char *s;
int no_more_options;
no_more_options = 0;
while (--argc > 0)
{
arg = *++argv;
if (*arg != '-' || no_more_options)
break;
switch (*++arg)
{
case 'a':
quote_all = 1;
break;
case 'c':
closequote = *++arg;
break;
case 'd':
closequote = lstrtol(++arg, &s, 0);
if (s == arg)
pr_error("Missing number after -d");
break;
case 'e':
if (strcmp(++arg, "-") == 0)
meta_escape = "";
else
meta_escape = arg;
break;
case 'f':
meta_escape_buf[0] = lstrtol(++arg, &s, 0);
meta_escape_buf[1] = '\0';
meta_escape = meta_escape_buf;
if (s == arg)
pr_error("Missing number after -f");
break;
case 'o':
openquote = *++arg;
break;
case 'p':
openquote = lstrtol(++arg, &s, 0);
if (s == arg)
pr_error("Missing number after -p");
break;
case 'm':
add_metachar(*++arg);
break;
case 'n':
add_metachar(lstrtol(++arg, &s, 0));
if (s == arg)
pr_error("Missing number after -n");
break;
case '?':
pr_usage();
return (0);
case '-':
if (*++arg == '\0')
{
no_more_options = 1;
break;
}
if (strcmp(arg, "version") == 0)
{
pr_version();
return (0);
}
if (strcmp(arg, "help") == 0)
{
pr_usage();
return (0);
}
pr_error("Invalid option after --");
default:
pr_error("Invalid option letter");
}
}
while (argc-- > 0)
{
int has_meta = 0;
arg = *argv++;
for (s = arg; *s != '\0'; s++)
{
if (is_metachar(*s))
{
has_meta = 1;
break;
}
}
if (quote_all || (has_meta && strlen(meta_escape) == 0))
printf("%c%s%c", openquote, arg, closequote);
else
{
for (s = arg; *s != '\0'; s++)
{
if (is_metachar(*s))
printf("%s", meta_escape);
printf("%c", *s);
}
}
if (argc > 0)
printf(" ");
else
printf("\n");
}
return (0);
}
| {
"array_type": 1,
"break_continue_statement": 12,
"enum_type": 0,
"for_loop": 2,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 13,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 4,
"struct_type": 0,
"switch_statement": 1,
"type_casting": 0,
"union_type": 0,
"while_loop": 2
} |
json.h#allow_simplified_json_prep#json_extract_get_object_size.c | json.h | allow_simplified_json.c | json_extract_get_object_size | 21 | struct json_extract_result_s
json_extract_get_object_size(const struct json_object_s *const object) {
struct json_extract_result_s result;
size_t i;
const struct json_object_element_s *element = object->start;
result.dom_size = sizeof(struct json_object_s) +
(sizeof(struct json_object_element_s) * object->length);
result.data_size = 0;
for (i = 0; i < object->length; i++) {
const struct json_extract_result_s string_result =
json_extract_get_string_size(element->name);
const struct json_extract_result_s value_result =
json_extract_get_value_size(element->value);
result.dom_size += string_result.dom_size;
result.data_size += string_result.data_size;
result.dom_size += value_result.dom_size;
result.data_size += value_result.data_size;
element = element->next;
}
return result;
}
| {
"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": 1,
"return_statement": 1,
"struct_type": 2,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
libxml2#SAX2_prep#xmlSAX2Reference.c | libxml2 | SAX2.c | xmlSAX2Reference | 13 | void
xmlSAX2Reference(void *ctx, const xmlChar *name)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
xmlNodePtr ret;
if (ctx == ((void *)0)) return;
ret = xmlNewReference(ctxt->myDoc, name);
if (ret == ((void *)0)) {
xmlSAX2ErrMemory(ctxt);
return;
}
xmlSAX2AppendChild(ctxt, ret);
}
| {
"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": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
libxml2#libxml2-py_prep#libxml_xmlParseTextDecl.c | libxml2 | libxml2-py.c | libxml_xmlParseTextDecl | 13 | PyObject *
libxml_xmlParseTextDecl(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
xmlParserCtxtPtr ctxt;
PyObject *pyobj_ctxt;
if (libxml_deprecationWarning("xmlParseTextDecl") == -1)
return(((void *)0));
if (!_PyArg_ParseTuple_SizeT(args, (char *)"O:xmlParseTextDecl", &pyobj_ctxt))
return(((void *)0));
ctxt = (xmlParserCtxtPtr) (((pyobj_ctxt) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyparserCtxt_Object *)(pyobj_ctxt))->obj));
xmlParseTextDecl(ctxt);
_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
} |
tulipindicators-0.9.1#stderr_prep#ti_stderr_start.c | tulipindicators-0.9.1 | stderr.c | ti_stderr_start | 3 | int ti_stderr_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#xmlwriter_prep#xmlTextWriterWriteAttribute.c | libxml2 | xmlwriter.c | xmlTextWriterWriteAttribute | 21 | int
xmlTextWriterWriteAttribute(xmlTextWriterPtr writer, const xmlChar * name,
const xmlChar * content)
{
int count;
int sum;
sum = 0;
count = xmlTextWriterStartAttribute(writer, name);
if (count < 0)
return -1;
sum += count;
count = xmlTextWriterWriteString(writer, content);
if (count < 0)
return -1;
sum += count;
count = xmlTextWriterEndAttribute(writer);
if (count < 0)
return -1;
sum += count;
return sum;
}
| {
"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": 4,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
cflow-1.7#c_prep#yy_delete_buffer.c | cflow-1.7 | c.c | yy_delete_buffer | 10 | void yy_delete_buffer (YY_BUFFER_STATE b )
{
if ( ! b )
return;
if ( b == ( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)] : ((void *)0)) )
(yy_buffer_stack)[(yy_buffer_stack_top)] = (YY_BUFFER_STATE) 0;
if ( b->yy_is_our_buffer )
yyfree((void *) b->yy_ch_buf );
yyfree((void *) b );
}
| {
"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": 3,
"union_type": 0,
"while_loop": 0
} |
tar-1.34#paxerror_prep#savedir_warn.c | tar-1.34 | paxerror.c | savedir_warn | 5 | void
savedir_warn (char const *name)
{
call_arg_warn ("savedir", 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
} |
tmux#proc_prep#proc_exit.c | tmux | proc.c | proc_exit | 5 | void
proc_exit(struct tmuxproc *tp)
{
tp->exit = 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": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
brotli-1.0.9#huffman_prep#BrotliBuildSimpleHuffmanTable.c | brotli-1.0.9 | huffman.c | BrotliBuildSimpleHuffmanTable | 75 | uint32_t BrotliBuildSimpleHuffmanTable(HuffmanCode* table,
int root_bits,
uint16_t* val,
uint32_t num_symbols) {
uint32_t table_size = 1;
const uint32_t goal_size = 1U << root_bits;
switch (num_symbols) {
case 0:
table[0] = ConstructHuffmanCode(0, val[0]);
break;
case 1:
if (val[1] > val[0]) {
table[0] = ConstructHuffmanCode(1, val[0]);
table[1] = ConstructHuffmanCode(1, val[1]);
} else {
table[0] = ConstructHuffmanCode(1, val[1]);
table[1] = ConstructHuffmanCode(1, val[0]);
}
table_size = 2;
break;
case 2:
table[0] = ConstructHuffmanCode(1, val[0]);
table[2] = ConstructHuffmanCode(1, val[0]);
if (val[2] > val[1]) {
table[1] = ConstructHuffmanCode(2, val[1]);
table[3] = ConstructHuffmanCode(2, val[2]);
} else {
table[1] = ConstructHuffmanCode(2, val[2]);
table[3] = ConstructHuffmanCode(2, val[1]);
}
table_size = 4;
break;
case 3: {
int i, k;
for (i = 0; i < 3; ++i) {
for (k = i + 1; k < 4; ++k) {
if (val[k] < val[i]) {
uint16_t t = val[k];
val[k] = val[i];
val[i] = t;
}
}
}
table[0] = ConstructHuffmanCode(2, val[0]);
table[2] = ConstructHuffmanCode(2, val[1]);
table[1] = ConstructHuffmanCode(2, val[2]);
table[3] = ConstructHuffmanCode(2, val[3]);
table_size = 4;
break;
}
case 4: {
if (val[3] < val[2]) {
uint16_t t = val[3];
val[3] = val[2];
val[2] = t;
}
table[0] = ConstructHuffmanCode(1, val[0]);
table[1] = ConstructHuffmanCode(2, val[1]);
table[2] = ConstructHuffmanCode(1, val[0]);
table[3] = ConstructHuffmanCode(3, val[2]);
table[4] = ConstructHuffmanCode(1, val[0]);
table[5] = ConstructHuffmanCode(2, val[1]);
table[6] = ConstructHuffmanCode(1, val[0]);
table[7] = ConstructHuffmanCode(3, val[3]);
table_size = 8;
break;
}
}
while (table_size != goal_size) {
memcpy(&table[table_size], &table[0],
(size_t)table_size * sizeof(table[0]));
table_size <<= 1;
}
return goal_size;
}
| {
"array_type": 2,
"break_continue_statement": 5,
"enum_type": 0,
"for_loop": 2,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 4,
"memory_management": 0,
"memory_operation": 1,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 1,
"type_casting": 1,
"union_type": 0,
"while_loop": 1
} |
transcoder-set#CONVERT_STRICTLY_INCREASING_ARRAY_MINIMUM_CHANGES_prep#f_filled.c | transcoder-set | CONVERT_STRICTLY_INCREASING_ARRAY_MINIMUM_CHANGES.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
} |
transcoder-set#SUM_SQUARES_BINOMIAL_COEFFICIENTS_prep#f_gold.c | transcoder-set | SUM_SQUARES_BINOMIAL_COEFFICIENTS.c | f_gold | 19 | int f_gold ( int n ) {
int C [ n + 1 ] [ n + 1 ];
int i, j;
for ( i = 0;
i <= n;
i ++ ) {
for ( j = 0;
j <= min ( i, n );
j ++ ) {
if ( j == 0 || j == i ) C [ i ] [ j ] = 1;
else C [ i ] [ j ] = C [ i - 1 ] [ j - 1 ] + C [ i - 1 ] [ j ];
}
}
int sum = 0;
for ( int i = 0;
i <= n;
i ++ ) sum += ( C [ n ] [ i ] * C [ n ] [ i ] );
return sum;
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 3,
"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
} |
wget-1.21.4#url_prep#url_set_file.c | wget-1.21.4 | url.c | url_set_file | 7 | void
url_set_file (struct url *url, const char *newfile)
{
do { free ((void *) (url->file)); url->file = ((void *)0); } while (0);
url->file = xstrdup (newfile);
sync_path (url);
}
| {
"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": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 1
} |
transcoder-set#COUNT_FACTORIAL_NUMBERS_IN_A_GIVEN_RANGE_prep#f_gold.c | transcoder-set | COUNT_FACTORIAL_NUMBERS_IN_A_GIVEN_RANGE.c | f_gold | 14 | int f_gold ( int low, int high ) {
int fact = 1, x = 1;
while ( fact < low ) {
fact = fact * x;
x ++;
}
int res = 0;
while ( fact <= high ) {
res ++;
fact = fact * x;
x ++;
}
return res;
}
| {
"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": 2
} |
pth-2.0.7#pth_high_prep#__pth_readv_faked.c | pth-2.0.7 | pth_high.c | __pth_readv_faked | 30 | ssize_t __pth_readv_faked(int fd, const struct iovec *iov, int iovcnt)
{
char *buffer;
size_t bytes, copy, rv;
int i;
bytes = 0;
for (i = 0; i < iovcnt; i++) {
if (iov[i].iov_len <= 0)
return ((*__errno_location ()) = (22), ((ssize_t)(-1)));
bytes += iov[i].iov_len;
}
if (bytes <= 0)
return ((*__errno_location ()) = (22), ((ssize_t)(-1)));
if ((buffer = (char *)malloc(bytes)) == ((void *)0))
return (ssize_t)(-1);
rv = read(fd, buffer, bytes);
if (rv > 0) {
bytes = rv;
for (i = 0; i < iovcnt; i++) {
copy = ((iov[i].iov_len) > (bytes) ? (bytes) : (iov[i].iov_len));
memcpy(iov[i].iov_base, buffer, copy);
buffer += copy;
bytes -= copy;
if (bytes <= 0)
break;
}
}
for ( __pth_errno_storage = (*__errno_location ()), __pth_errno_flag = (!(0)); __pth_errno_flag; (*__errno_location ()) = __pth_errno_storage, __pth_errno_flag = (0) ) { free(buffer); }
return(rv);
}
| {
"array_type": 1,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 3,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 5,
"memory_management": 2,
"memory_operation": 1,
"pointer_type": 1,
"return_statement": 4,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
libxml2#libxml2-py_prep#libxml_xmlSchemaParse.c | libxml2 | libxml2-py.c | libxml_xmlSchemaParse | 13 | PyObject *
libxml_xmlSchemaParse(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
xmlSchemaPtr c_retval;
xmlSchemaParserCtxtPtr ctxt;
PyObject *pyobj_ctxt;
if (!_PyArg_ParseTuple_SizeT(args, (char *)"O:xmlSchemaParse", &pyobj_ctxt))
return(((void *)0));
ctxt = (xmlSchemaParserCtxtPtr) (((pyobj_ctxt) == (&_Py_NoneStruct)) ? ((void *)0) : (((PySchemaParserCtxt_Object *)(pyobj_ctxt))->obj));
c_retval = xmlSchemaParse(ctxt);
py_retval = libxml_xmlSchemaPtrWrap((xmlSchemaPtr) 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": 2,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 0
} |
rcs-5.10.1#maketime_prep#adjzone.c | rcs-5.10.1 | maketime.c | adjzone | 47 | void
adjzone (register struct tm *t, long seconds)
{
int leap_second = t->tm_sec == 60;
long sec = seconds + (t->tm_sec - leap_second);
if (sec < 0)
{
if ((t->tm_min -= (59 - sec) / 60) < 0)
{
if ((t->tm_hour -= (59 - t->tm_min) / 60) < 0)
{
t->tm_hour += 24;
if ((0 <= (t->tm_wday)) && --t->tm_wday < 0)
t->tm_wday = 6;
if (--t->tm_mday <= 0)
{
if (--t->tm_mon < 0)
{
--t->tm_year;
t->tm_mon = 11;
}
t->tm_mday = month_days (t);
}
}
t->tm_min += 24 * 60;
}
sec += 24L * 60 * 60;
}
else if (60 <= (t->tm_min += sec / 60))
if (24 <= (t->tm_hour += t->tm_min / 60))
{
t->tm_hour -= 24;
if ((0 <= (t->tm_wday)) && ++t->tm_wday == 7)
t->tm_wday = 0;
if (month_days (t) < ++t->tm_mday)
{
if (11 < ++t->tm_mon)
{
++t->tm_year;
t->tm_mon = 0;
}
t->tm_mday = 1;
}
}
t->tm_min %= 60;
t->tm_sec = (int) (sec % 60) + leap_second;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 11,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libxml2#xpointer_prep#xmlXPtrNewContext.c | libxml2 | xpointer.c | xmlXPtrNewContext | 10 | xmlXPathContextPtr
xmlXPtrNewContext(xmlDocPtr doc, xmlNodePtr here, xmlNodePtr origin) {
xmlXPathContextPtr ret;
(void) here;
(void) origin;
ret = xmlXPathNewContext(doc);
if (ret == ((void *)0))
return(ret);
return(ret);
}
| {
"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": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 0
} |
gprolog-1.5.0#arith_inl_c_prep#Pl_Fct_Fast_Neg.c | gprolog-1.5.0 | arith_inl_c.c | Pl_Fct_Fast_Neg | 6 | WamWord
Pl_Fct_Fast_Neg(WamWord x)
{
PlLong vx = ((PlLong) ((x) << 0) >> 3);
return (((PlULong) (-vx) << 3) | (PlULong)0x7);
}
| {
"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#suffix_prep#strip_compression_suffix.c | tar-1.34 | suffix.c | strip_compression_suffix | 19 | char *
strip_compression_suffix (const char *name)
{
char *s = ((void *)0);
size_t len;
struct compression_suffix const *p = find_compression_suffix (name, &len);
if (p)
{
if (len > 4 && strncmp (name + len - 4, ".tar", 4) == 0
&& p->suffix[0] != 't')
len -= 4;
if (len == 0)
return ((void *)0);
s = xmalloc (len + 1);
memcpy (s, name, len);
s[len] = 0;
}
return s;
}
| {
"array_type": 2,
"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": 2,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
cflow-1.7#wordsplit_prep#wordsplit_c_quote_char.c | cflow-1.7 | wordsplit.c | wordsplit_c_quote_char | 5 | int
wordsplit_c_quote_char (int c)
{
return wsplt_quote_char (wordsplit_c_escape_tab, c);
}
| {
"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#CHECK_WHETHER_GIVEN_NUMBER_EVEN_ODD_prep#f_gold.c | transcoder-set | CHECK_WHETHER_GIVEN_NUMBER_EVEN_ODD.c | f_gold | 3 | _Bool f_gold ( int n ) {
return ( n % 2 == 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
} |
transcoder-set#SMALLEST_POWER_OF_2_GREATER_THAN_OR_EQUAL_TO_N_2_prep#min.c | transcoder-set | SMALLEST_POWER_OF_2_GREATER_THAN_OR_EQUAL_TO_N_2.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
} |
optipng-0.7.8#pngget_prep#png_get_IHDR.c | optipng-0.7.8 | pngget.c | png_get_IHDR | 28 | png_uint_32
png_get_IHDR(png_const_structrp png_ptr, png_const_inforp info_ptr,
png_uint_32 *width, png_uint_32 *height, int *bit_depth,
int *color_type, int *interlace_type, int *compression_type,
int *filter_type)
{
((void)0);
if (png_ptr == ((void *)0) || info_ptr == ((void *)0))
return (0);
if (width != ((void *)0))
*width = info_ptr->width;
if (height != ((void *)0))
*height = info_ptr->height;
if (bit_depth != ((void *)0))
*bit_depth = info_ptr->bit_depth;
if (color_type != ((void *)0))
*color_type = info_ptr->color_type;
if (compression_type != ((void *)0))
*compression_type = info_ptr->compression_type;
if (filter_type != ((void *)0))
*filter_type = info_ptr->filter_type;
if (interlace_type != ((void *)0))
*interlace_type = info_ptr->interlace_type;
png_check_IHDR(png_ptr, info_ptr->width, info_ptr->height,
info_ptr->bit_depth, info_ptr->color_type, info_ptr->interlace_type,
info_ptr->compression_type, info_ptr->filter_type);
return (1);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 8,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 9,
"union_type": 0,
"while_loop": 0
} |
pexec-1.0rc8#fifo_prep#fifo_available.c | pexec-1.0rc8 | fifo.c | fifo_available | 4 | size_t fifo_available(fifo *f)
{
return(f->wrts);
}
| {
"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
} |
optipng-0.7.8#pnmutil_prep#pnm_mem_size.c | optipng-0.7.8 | pnmutil.c | pnm_mem_size | 17 | size_t pnm_mem_size(const pnm_struct *pnm_ptr,
size_t sample_size, unsigned int num_rows)
{
unsigned int depth = pnm_ptr->depth;
unsigned int width = pnm_ptr->width;
if (sample_size == 0 || depth == 0 || width == 0)
{
(*__errno_location ()) = 22;
return 0;
}
if (num_rows > (size_t)(-1) / sample_size / depth / width)
{
(*__errno_location ()) = 34;
return 0;
}
return sample_size * depth * width * num_rows;
}
| {
"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": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#SUM_SERIES_555555_N_TERMS_prep#cmpfunc.c | transcoder-set | SUM_SERIES_555555_N_TERMS.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
} |
mtools-4.0.43#dirCache_prep#growDirCache.c | mtools-4.0.43 | dirCache.c | growDirCache | 20 | int growDirCache(dirCache_t *cache, unsigned int slot)
{
if((int) slot < 0) {
fprintf(stderr, "Bad slot %d\n", slot);
exit(1);
}
if( cache->nr_entries <= slot) {
unsigned int i;
cache->entries = realloc(cache->entries,
(slot+1) * 2 *
sizeof(dirCacheEntry_t *));
if(!cache->entries)
return -1;
for(i= cache->nr_entries; i < (slot+1) * 2; i++) {
cache->entries[i] = 0;
}
cache->nr_entries = (slot+1) * 2;
}
return 0;
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 1,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#COUNT_DERANGEMENTS_PERMUTATION_SUCH_THAT_NO_ELEMENT_APPEARS_IN_ITS_ORIGINAL_POSITION_1_prep#len.c | transcoder-set | COUNT_DERANGEMENTS_PERMUTATION_SUCH_THAT_NO_ELEMENT_APPEARS_IN_ITS_ORIGINAL_POSITION_1.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#SMALLEST_OF_THREE_INTEGERS_WITHOUT_COMPARISON_OPERATORS_1_prep#min.c | transcoder-set | SMALLEST_OF_THREE_INTEGERS_WITHOUT_COMPARISON_OPERATORS_1.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
} |
libosip2-5.3.1#osip_mime_version_prep#osip_message_get_mime_version.c | libosip2-5.3.1 | osip_mime_version.c | osip_message_get_mime_version | 3 | osip_mime_version_t *osip_message_get_mime_version(const osip_message_t *sip) {
return sip->mime_version;
}
| {
"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#arith_inl_c_prep#Pl_Math_Fast_Load_Value.c | gprolog-1.5.0 | arith_inl_c.c | Pl_Math_Fast_Load_Value | 7 | void
Pl_Math_Fast_Load_Value(WamWord start_word, WamWord *word_adr)
{
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);
*word_adr = 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
} |
nettle-3.9.1#gcm-aes256_prep#nettle_gcm_aes256_decrypt.c | nettle-3.9.1 | gcm-aes256.c | nettle_gcm_aes256_decrypt | 6 | void
nettle_gcm_aes256_decrypt(struct gcm_aes256_ctx *ctx,
size_t length, uint8_t *dst, const uint8_t *src)
{
(0 ? (nettle_aes256_encrypt)(&(ctx)->cipher, ~(size_t) 0, (uint8_t *) 0, (const uint8_t *) 0) : nettle_gcm_decrypt(&(ctx)->gcm, &(ctx)->key, &(ctx)->cipher, (nettle_cipher_func *) (nettle_aes256_encrypt), (length), (dst), (src)));
}
| {
"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": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libosip2-5.3.1#osip_prep#osip_set_kill_transaction_callback.c | libosip2-5.3.1 | osip.c | osip_set_kill_transaction_callback | 8 | int osip_set_kill_transaction_callback(osip_t *config, int type, osip_kill_transaction_cb_t cb) {
if (type >= OSIP_KILL_CALLBACK_COUNT) {
osip_trace("osip.c", 1701, TRACE_LEVEL2, ((void *)0), "invalid callback type %d\n", type);
return -2;
}
config->kill_callbacks[type] = cb;
return 0;
}
| {
"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": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
tulipindicators-0.9.1#md_prep#ti_md_start.c | tulipindicators-0.9.1 | md.c | ti_md_start | 3 | int ti_md_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
} |
transcoder-set#FIND_PAIR_WITH_GREATEST_PRODUCT_IN_ARRAY_prep#sort.c | transcoder-set | FIND_PAIR_WITH_GREATEST_PRODUCT_IN_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
} |
buffer-0.4.0#buffer_prep#buffer_append.c | buffer-0.4.0 | buffer.c | buffer_append | 4 | int
buffer_append(buffer_t *self, const char *str) {
return buffer_append_n(self, str, strlen(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": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
json.h#allow_hexadecimal_numbers_prep#json_value_as_string.c | json.h | allow_hexadecimal_numbers.c | json_value_as_string | 6 | struct json_string_s *json_value_as_string(struct json_value_s *const value) {
if (value->type != json_type_string) {
return 0;
}
return (struct json_string_s *)value->payload;
}
| {
"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": 2,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
less-633#charset_prep#is_utf8_well_formed.c | less-633 | charset.c | is_utf8_well_formed | 28 | int is_utf8_well_formed(char *ss, int slen)
{
int i;
int len;
unsigned char *s = (unsigned char *) ss;
if ((((s[0]) & 0xFE) == 0xFE))
return (0);
len = utf_len(s[0]);
if (len > slen)
return (0);
if (len == 1)
return (1);
if (len == 2)
{
if (s[0] < 0xC2)
return (0);
} else
{
unsigned char mask;
mask = (~((1 << (8-len)) - 1)) & 0xFF;
if (s[0] == mask && (s[1] & mask) == 0x80)
return (0);
}
for (i = 1; i < len; i++)
if (!(((s[i]) & 0xC0) == 0x80))
return (0);
return (1);
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 7,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 7,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
json.h#allow_multi_line_strings_prep#json_get_string_size.c | json.h | allow_multi_line_strings.c | json_get_string_size | 126 | int json_get_string_size(struct json_parse_state_s *state, size_t is_key) {
size_t offset = state->offset;
const size_t size = state->size;
size_t data_size = 0;
const char *const src = state->src;
const int is_single_quote = '\'' == src[offset];
const char quote_to_use = is_single_quote ? '\'' : '"';
const size_t flags_bitset = state->flags_bitset;
unsigned long codepoint;
unsigned long high_surrogate = 0;
if ((json_parse_flags_allow_location_information & flags_bitset) != 0 &&
is_key != 0) {
state->dom_size += sizeof(struct json_string_ex_s);
} else {
state->dom_size += sizeof(struct json_string_s);
}
if ('"' != src[offset]) {
if (!((json_parse_flags_allow_single_quoted_strings & flags_bitset) &&
is_single_quote)) {
state->error = json_parse_error_expected_opening_quote;
state->offset = offset;
return 1;
}
}
offset++;
while ((offset < size) && (quote_to_use != src[offset])) {
data_size++;
switch (src[offset]) {
default:
break;
case '\0':
case '\t':
state->error = json_parse_error_invalid_string;
state->offset = offset;
return 1;
}
if ('\\' == src[offset]) {
offset++;
if (offset == size) {
state->error = json_parse_error_premature_end_of_buffer;
state->offset = offset;
return 1;
}
switch (src[offset]) {
default:
state->error = json_parse_error_invalid_string_escape_sequence;
state->offset = offset;
return 1;
case '"':
case '\\':
case '/':
case 'b':
case 'f':
case 'n':
case 'r':
case 't':
offset++;
break;
case 'u':
if (!(offset + 5 < size)) {
state->error = json_parse_error_invalid_string_escape_sequence;
state->offset = offset;
return 1;
}
codepoint = 0;
if (!json_hexadecimal_value(&src[offset + 1], 4, &codepoint)) {
state->error = json_parse_error_invalid_string_escape_sequence;
state->offset = offset;
return 1;
}
if (high_surrogate != 0) {
if (codepoint >= 0xdc00 &&
codepoint <= 0xdfff) {
data_size += 3;
high_surrogate = 0;
} else {
state->error = json_parse_error_invalid_string_escape_sequence;
state->offset = offset;
return 1;
}
} else if (codepoint <= 0x7f) {
data_size += 0;
} else if (codepoint <= 0x7ff) {
data_size += 1;
} else if (codepoint >= 0xd800 &&
codepoint <= 0xdbff) {
if (offset + 11 > size || '\\' != src[offset + 5] ||
'u' != src[offset + 6]) {
state->error = json_parse_error_invalid_string_escape_sequence;
state->offset = offset;
return 1;
}
high_surrogate = codepoint;
} else if (codepoint >= 0xd800 &&
codepoint <= 0xdfff) {
state->error = json_parse_error_invalid_string_escape_sequence;
state->offset = offset;
return 1;
} else {
data_size += 2;
}
offset += 5;
break;
}
} else if (('\r' == src[offset]) || ('\n' == src[offset])) {
if (!(json_parse_flags_allow_multi_line_strings & flags_bitset)) {
state->error = json_parse_error_invalid_string_escape_sequence;
state->offset = offset;
return 1;
}
offset++;
} else {
offset++;
}
}
if (offset == size) {
state->error = json_parse_error_premature_end_of_buffer;
state->offset = offset - 1;
return 1;
}
offset++;
state->data_size += data_size;
state->data_size++;
state->offset = offset;
return 0;
}
| {
"array_type": 1,
"break_continue_statement": 3,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 17,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 12,
"struct_type": 1,
"switch_statement": 2,
"type_casting": 2,
"union_type": 0,
"while_loop": 1
} |
tar-1.34#paxerror_prep#open_fatal.c | tar-1.34 | paxerror.c | open_fatal | 5 | void
open_fatal (char const *name)
{
call_arg_fatal ("open", 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
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.