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 |
|---|---|---|---|---|---|---|
libxml2#libxml2-py_prep#libxml_xmlIsBlankNode.c | libxml2 | libxml2-py.c | libxml_xmlIsBlankNode | 13 | PyObject *
libxml_xmlIsBlankNode(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
int c_retval;
xmlNode * node;
PyObject *pyobj_node;
if (!_PyArg_ParseTuple_SizeT(args, (char *)"O:xmlIsBlankNode", &pyobj_node))
return(((void *)0));
node = (xmlNode *) (((pyobj_node) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyxmlNode_Object *)(pyobj_node))->obj));
c_retval = xmlIsBlankNode(node);
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": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
tmux#window_prep#window_pane_tree_RB_PREV.c | tmux | window.c | window_pane_tree_RB_PREV | 1 | struct window_pane * window_pane_tree_RB_PREV(struct window_pane *elm) { if ((elm)->tree_entry.rbe_left) { elm = (elm)->tree_entry.rbe_left; while ((elm)->tree_entry.rbe_right) elm = (elm)->tree_entry.rbe_right; } else { if ((elm)->tree_entry.rbe_parent && (elm == ((elm)->tree_entry.rbe_parent)->tree_entry.rbe_right)) elm = (elm)->tree_entry.rbe_parent; else { while ((elm)->tree_entry.rbe_parent && (elm == ((elm)->tree_entry.rbe_parent)->tree_entry.rbe_left)) elm = (elm)->tree_entry.rbe_parent; elm = (elm)->tree_entry.rbe_parent; } } return (elm); }
| {
"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": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
less-633#mark_prep#unmark.c | less-633 | mark.c | unmark | 7 | void unmark(void* ifile)
{
int i;
for (i = 0; i < ((2*26)+2); i++)
if (marks[i].m_ifile == ifile)
marks[i].m_scrpos.pos = ((POSITION)(-1));
}
| {
"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": 0
} |
gprolog-1.5.0#write_c_prep#Pl_Display_1.c | gprolog-1.5.0 | write_c.c | Pl_Display_1 | 8 | void
Pl_Display_1(WamWord term_word)
{
(pl_sys_var[0]) = 2;
(pl_sys_var[1]) = -1;
(pl_sys_var[2]) = 1200;
Pl_Write_Term_2(((PlLong) (0) + ((PlULong)0)), 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": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#MAKING_ELEMENTS_OF_TWO_ARRAYS_SAME_WITH_MINIMUM_INCREMENTDECREMENT_prep#main.c | transcoder-set | MAKING_ELEMENTS_OF_TWO_ARRAYS_SAME_WITH_MINIMUM_INCREMENTDECREMENT.c | main | 36 | int main(void) {
int n_success = 0;
int param0_0[] = {1,6,6,7,10,11,13,18,19,19,19,31,34,37,37,40,41,41,47,47,53,54,55,55,56,56,60,60,62,62,66,73,75,76,78,81,81,85,88,90,91,92,93,95,97,98};
int param0_1[] = {-12,-6,78,62,86,-32};
int param0_2[] = {0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1};
int param0_3[] = {76,74};
int param0_4[] = {-92,-90,-88,-84,-76,-54,-44,-42,-38,-30,34,42};
int param0_5[] = {1,1,0,0,1,1,1,0,1,1,0,0,1,0,0,1,1,1};
int param0_6[] = {4,5,6,13,16,24,36,40,40,44,47,52,58,58,59,63,66,67,69,70,74,77,81,88,89,90,94,96};
int param0_7[] = {-16,66,-2,54,-8,10,44,-36,-54,50,92,84,-36,40,-12,98,36,22,-10};
int param0_8[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
int param0_9[] = {42,24,43,64,55,94,26,30,76,3,37,43,81,7,15,64,63,88,34,8,55,32,19,55};
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[] = {2,2,4,7,8,8,8,8,8,9,9,12,15,16,21,25,26,27,29,34,34,35,38,40,40,44,44,47,48,54,58,61,63,64,66,69,69,70,73,74,75,76,79,80,80,93};
int param1_1[] = {-86,20,32,52,50,-60};
int param1_2[] = {0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1};
int param1_3[] = {16,98};
int param1_4[] = {-80,-54,-34,12,14,16,16,46,50,64,84,92};
int param1_5[] = {0,1,1,0,1,1,1,1,0,0,0,0,0,1,1,1,1,1};
int param1_6[] = {1,7,10,17,21,22,22,27,36,37,39,46,52,53,56,59,65,67,70,75,78,78,79,89,89,94,96,97};
int param1_7[] = {-76,-74,62,22,50,84,78,26,-62,-10,86,-10,-92,-10,86,-6,-58,-26,-18};
int param1_8[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
int param1_9[] = {96,11,63,90,28,80,44,63,17,81,80,69,66,22,81,4,86,74,91,17,3,81,65,98};
int *param1[10] = {param1_0,param1_1,param1_2,param1_3,param1_4,param1_5,param1_6,param1_7,param1_8,param1_9};
int param2[] = {23,4,14,1,8,14,24,16,36,22};
for(int i = 0; i < len(param0); ++i)
{
if(f_filled(param0[i],param1[i],param2[i]) == f_gold(param0[i],param1[i],param2[i]))
{
n_success+=1;
}
break;
}
printf("#Results:", " ", n_success, ", ", len(param0));
return 0;
}
| {
"array_type": 3,
"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": 2,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#FIND_THE_MINIMUM_DISTANCE_BETWEEN_TWO_NUMBERS_prep#min.c | transcoder-set | FIND_THE_MINIMUM_DISTANCE_BETWEEN_TWO_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
} |
libosip2-5.3.1#sdp_accessor_prep#sdp_message_m_port_get.c | libosip2-5.3.1 | sdp_accessor.c | sdp_message_m_port_get | 6 | char *sdp_message_m_port_get(sdp_message_t *sdp, int pos_media) {
sdp_media_t *med = osip_list_get(&sdp->m_medias, pos_media);
if (med == ((void *)0))
return ((void *)0);
return med->m_port;
}
| {
"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
} |
tar-1.34#getopt1_prep#rpl_getopt_long_only.c | tar-1.34 | getopt1.c | rpl_getopt_long_only | 8 | int
rpl_getopt_long_only (int argc, char *const *argv,
const char *options,
const struct rpl_option *long_options, int *opt_index)
{
return rpl_getopt_internal (argc, (char **) argv, options, long_options,
opt_index, 1, 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": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
json-c#json_object_prep#json_object_get_boolean.c | json-c | json_object.c | json_object_get_boolean | 19 | json_bool json_object_get_boolean(const struct json_object *jso)
{
if (!jso)
return 0;
switch (jso->o_type)
{
case json_type_boolean: return JC_BOOL_C(jso)->c_boolean;
case json_type_int:
switch (JC_INT_C(jso)->cint_type)
{
case json_object_int_type_int64: return (JC_INT_C(jso)->cint.c_int64 != 0);
case json_object_int_type_uint64: return (JC_INT_C(jso)->cint.c_uint64 != 0);
default: json_abort("invalid cint_type");
}
case json_type_double: return (JC_DOUBLE_C(jso)->c_double != 0);
case json_type_string: return (JC_STRING_C(jso)->len != 0);
default: 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": 7,
"struct_type": 1,
"switch_statement": 2,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libxml2#parserInternals_prep#xmlCtxtSetCatalogs.c | libxml2 | parserInternals.c | xmlCtxtSetCatalogs | 6 | void
xmlCtxtSetCatalogs(xmlParserCtxtPtr ctxt, void *catalogs) {
if (ctxt == ((void *)0))
return;
ctxt->catalogs = catalogs;
}
| {
"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
} |
cpio-2.14#defer_prep#free_deferment.c | cpio-2.14 | defer.c | free_deferment | 6 | void
free_deferment (struct deferment *d)
{
free (d->header.c_name);
free (d);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 2,
"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#PROGRAM_TO_FIND_REMAINDER_WITHOUT_USING_MODULO_OR_OPERATOR_2_prep#len.c | transcoder-set | PROGRAM_TO_FIND_REMAINDER_WITHOUT_USING_MODULO_OR_OPERATOR_2.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#FIND_MINIMUM_NUMBER_DIVIDED_MAKE_NUMBER_PERFECT_SQUARE_prep#sort.c | transcoder-set | FIND_MINIMUM_NUMBER_DIVIDED_MAKE_NUMBER_PERFECT_SQUARE.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#format_prep#format_create.c | tmux | format.c | format_create | 30 | struct format_tree *
format_create(struct client *c, struct cmdq_item *item, int tag, int flags)
{
struct format_tree *ft;
if (!event_initialized(&format_job_event)) {
event_set((&format_job_event), -1, 0, (format_job_timer), (((void *)0)));
format_job_timer(-1, 0, ((void *)0));
}
ft = xcalloc(1, sizeof *ft);
do { (&ft->tree)->rbh_root = ((void *)0); } while (0);
if (c != ((void *)0)) {
ft->client = c;
ft->client->references++;
}
ft->tag = tag;
ft->flags = flags;
format_add(ft, "version", "%s", "master");
format_add_cb(ft, "host", format_cb_host);
format_add_cb(ft, "host_short", format_cb_host_short);
format_add_cb(ft, "pid", format_cb_pid);
format_add(ft, "socket_path", "%s", socket_path);
format_add_tv(ft, "start_time", &start_time);
if (item != ((void *)0)) {
if (item->cmd != ((void *)0))
format_add(ft, "command", "%s", item->cmd->entry->name);
if (item->shared != ((void *)0) && item->shared->formats != ((void *)0))
format_merge(ft, item->shared->formats);
}
return (ft);
}
| {
"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": 1,
"return_statement": 1,
"struct_type": 2,
"switch_statement": 0,
"type_casting": 7,
"union_type": 0,
"while_loop": 1
} |
tar-1.34#version-etc_prep#version_etc.c | tar-1.34 | version-etc.c | version_etc | 10 | void
version_etc (FILE *stream,
const char *command_name, const char *package,
const char *version, ...)
{
va_list authors;
__builtin_va_start(authors,version);
version_etc_va (stream, command_name, package, version, authors);
__builtin_va_end(authors);
}
| {
"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#SQUARE_ROOT_OF_AN_INTEGER_prep#sort.c | transcoder-set | SQUARE_ROOT_OF_AN_INTEGER.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
} |
gprolog-1.5.0#ma2asm_inst_prep#Fail_Ret.c | gprolog-1.5.0 | ma2asm_inst.c | Fail_Ret | 6 | void
Fail_Ret(void)
{
Inst_Printf("test", "%%rax, %%rax");
Inst_Printf("je", "fail");
}
| {
"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#COUNT_NUMBERS_THAT_DONT_CONTAIN_3_prep#f_gold.c | transcoder-set | COUNT_NUMBERS_THAT_DONT_CONTAIN_3.c | f_gold | 9 | int f_gold ( int n ) {
if ( n < 3 ) return n;
if ( n >= 3 && n < 10 ) return n - 1;
int po = 1;
while ( n / po > 9 ) po = po * 10;
int msd = n / po;
if ( msd != 3 ) return f_gold ( msd ) * f_gold ( po - 1 ) + f_gold ( msd ) + f_gold ( n % po );
else return f_gold ( msd * po - 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": 4,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
json.h#allow_no_commas_prep#json_write_get_string_size.c | json.h | allow_no_commas.c | json_write_get_string_size | 22 | int json_write_get_string_size(const struct json_string_s *string,
size_t *size) {
size_t i;
for (i = 0; i < string->string_size; i++) {
switch (string->string[i]) {
case '"':
case '\\':
case '\b':
case '\f':
case '\n':
case '\r':
case '\t':
*size += 2;
break;
default:
*size += 1;
break;
}
}
*size += 2;
return 0;
}
| {
"array_type": 1,
"break_continue_statement": 2,
"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": 1,
"switch_statement": 1,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
nettle-3.9.1#eax_prep#nettle_eax_encrypt.c | nettle-3.9.1 | eax.c | nettle_eax_encrypt | 8 | void
nettle_eax_encrypt (struct eax_ctx *eax, const struct eax_key *key,
const void *cipher, nettle_cipher_func *f,
size_t length, uint8_t *dst, const uint8_t *src)
{
nettle_ctr_crypt (cipher, f, 16, eax->ctr.b, length, dst, src);
omac_update (&eax->omac_message, key, cipher, f, length, dst);
}
| {
"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
} |
findutils-4.9.0#buildcmd_prep#bc_init_state.c | findutils-4.9.0 | buildcmd.c | bc_init_state | 18 | void
bc_init_state (const struct buildcmd_control *ctl,
struct buildcmd_state *state,
void *context)
{
state->cmd_argc = 0;
state->cmd_argv_chars = 0;
state->cmd_argv = ((void *)0);
state->cmd_argv_alloc = 0;
state->largest_successful_arg_count = 0;
state->smallest_failed_arg_count = 0;
((void) sizeof ((ctl->arg_max <= (0x7fffffffffffffffL - 2048L)) ? 1 : 0), __extension__ ({ if (ctl->arg_max <= (0x7fffffffffffffffL - 2048L)) ; else __assert_fail ("ctl->arg_max <= (LONG_MAX - 2048L)", "buildcmd.c", 572, __extension__ __PRETTY_FUNCTION__); }));
state->argbuf = xmalloc (ctl->arg_max + 1u);
state->cmd_argv_chars = state->cmd_initial_argv_chars = 0;
state->todo = 0;
state->dir_fd = -1;
state->usercontext = context;
}
| {
"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": 2,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#FIND_THE_ELEMENT_BEFORE_WHICH_ALL_THE_ELEMENTS_ARE_SMALLER_THAN_IT_AND_AFTER_WHICH_ALL_ARE_GREATER_THAN_IT_prep#max.c | transcoder-set | FIND_THE_ELEMENT_BEFORE_WHICH_ALL_THE_ELEMENTS_ARE_SMALLER_THAN_IT_AND_AFTER_WHICH_ALL_ARE_GREATER_THAN_IT.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
} |
json.h#allow_hexadecimal_numbers_prep#json_get_array_size.c | json.h | allow_hexadecimal_numbers.c | json_get_array_size | 49 | int json_get_array_size(struct json_parse_state_s *state) {
const size_t flags_bitset = state->flags_bitset;
size_t elements = 0;
int allow_comma = 0;
const char *const src = state->src;
const size_t size = state->size;
if ('[' != src[state->offset]) {
state->error = json_parse_error_unknown;
return 1;
}
state->offset++;
state->dom_size += sizeof(struct json_array_s);
while (state->offset < size) {
if (json_skip_all_skippables(state)) {
state->error = json_parse_error_premature_end_of_buffer;
return 1;
}
if (']' == src[state->offset]) {
state->offset++;
state->dom_size += sizeof(struct json_array_element_s) * elements;
return 0;
}
if (allow_comma) {
if (',' == src[state->offset]) {
state->offset++;
allow_comma = 0;
} else if (!(json_parse_flags_allow_no_commas & flags_bitset)) {
state->error = json_parse_error_expected_comma_or_closing_bracket;
return 1;
}
if (json_parse_flags_allow_trailing_comma & flags_bitset) {
allow_comma = 0;
continue;
} else {
if (json_skip_all_skippables(state)) {
state->error = json_parse_error_premature_end_of_buffer;
return 1;
}
}
}
if (json_get_value_size(state, 0)) {
return 1;
}
elements++;
allow_comma = 1;
}
state->error = json_parse_error_premature_end_of_buffer;
return 1;
}
| {
"array_type": 0,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 9,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 7,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 1
} |
transcoder-set#DYNAMIC_PROGRAMMING_SET_13_CUTTING_A_ROD_prep#f_filled.c | transcoder-set | DYNAMIC_PROGRAMMING_SET_13_CUTTING_A_ROD.c | f_filled | 1 | int f_filled ( int price [ ], 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
} |
nettle-3.9.1#pkcs1-decrypt_prep#nettle_pkcs1_decrypt.c | nettle-3.9.1 | pkcs1-decrypt.c | nettle_pkcs1_decrypt | 13 | int
nettle_pkcs1_decrypt (size_t key_size,
const mpz_t m,
size_t *length, uint8_t *message)
{
uint8_t *em; size_t tmp_em_size;
int ret;
do { tmp_em_size = (key_size); (em) = _nettle_gmp_alloc(sizeof (*em) * (key_size)); } while (0);
nettle_mpz_get_str_256(key_size, em, m);
ret = _nettle_pkcs1_sec_decrypt_variable (length, message, key_size, em);
(_nettle_gmp_free(em, tmp_em_size));
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": 0,
"union_type": 0,
"while_loop": 1
} |
json.h#allow_global_object_prep#json_write_minified_get_value_size.c | json.h | allow_global_object.c | json_write_minified_get_value_size | 28 | int json_write_minified_get_value_size(const struct json_value_s *value,
size_t *size) {
switch (value->type) {
default:
return 1;
case json_type_number:
return json_write_get_number_size((struct json_number_s *)value->payload,
size);
case json_type_string:
return json_write_get_string_size((struct json_string_s *)value->payload,
size);
case json_type_array:
return json_write_minified_get_array_size(
(struct json_array_s *)value->payload, size);
case json_type_object:
return json_write_minified_get_object_size(
(struct json_object_s *)value->payload, size);
case json_type_true:
*size += 4;
return 0;
case json_type_false:
*size += 5;
return 0;
case json_type_null:
*size += 4;
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": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 8,
"struct_type": 1,
"switch_statement": 1,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
uucp-1.07#syssub_prep#_uuconf_uclear_system.c | uucp-1.07 | syssub.c | _uuconf_uclear_system | 15 | void
_uuconf_uclear_system (q)
struct uuconf_system *q;
{
do { q->uuconf_zname = (char *) &_uuconf_unset; q->uuconf_zalternate = (char *) &_uuconf_unset; q->uuconf_zdebug = (char *) &_uuconf_unset; q->uuconf_zmax_remote_debug = (char *) &_uuconf_unset; q->uuconf_zphone = (char *) &_uuconf_unset; q->uuconf_zcall_login = (char *) &_uuconf_unset; q->uuconf_zcall_password = (char *) &_uuconf_unset; q->uuconf_zcalled_login = (char *) &_uuconf_unset; q->uuconf_zprotocols = (char *) &_uuconf_unset; q->uuconf_zpubdir = (char *) &_uuconf_unset; q->uuconf_zlocalname = (char *) &_uuconf_unset; } while (0);
do { q->uuconf_pzalias = (char **) &_uuconf_unset; q->uuconf_pzlocal_send = (char **) &_uuconf_unset; q->uuconf_pzremote_send = (char **) &_uuconf_unset; q->uuconf_pzlocal_receive = (char **) &_uuconf_unset; q->uuconf_pzremote_receive = (char **) &_uuconf_unset; q->uuconf_pzpath = (char **) &_uuconf_unset; q->uuconf_pzcmds = (char **) &_uuconf_unset; q->uuconf_pzforward_from = (char **) &_uuconf_unset; q->uuconf_pzforward_to = (char **) &_uuconf_unset; q->uuconf_schat.uuconf_pzchat = (char **) &_uuconf_unset; q->uuconf_schat.uuconf_pzprogram = (char **) &_uuconf_unset; q->uuconf_schat.uuconf_pzfail = (char **) &_uuconf_unset; q->uuconf_scalled_chat.uuconf_pzchat = (char **) &_uuconf_unset; q->uuconf_scalled_chat.uuconf_pzprogram = (char **) &_uuconf_unset; q->uuconf_scalled_chat.uuconf_pzfail = (char **) &_uuconf_unset; } while (0);
do { q->uuconf_qtimegrade = (struct uuconf_timespan *) &_uuconf_unset; q->uuconf_qcalltimegrade = (struct uuconf_timespan *) &_uuconf_unset; q->uuconf_qcalledtimegrade = (struct uuconf_timespan *) &_uuconf_unset; q->uuconf_qcall_local_size = (struct uuconf_timespan *) &_uuconf_unset; q->uuconf_qcall_remote_size = (struct uuconf_timespan *) &_uuconf_unset; q->uuconf_qcalled_local_size = (struct uuconf_timespan *) &_uuconf_unset; q->uuconf_qcalled_remote_size = (struct uuconf_timespan *) &_uuconf_unset; } while (0);
do { q->uuconf_fcall = -1; q->uuconf_fcalled = -1; q->uuconf_fcallback = -1; q->uuconf_fsequence = -1; q->uuconf_fsend_request = -1; q->uuconf_frec_request = -1; q->uuconf_fcall_transfer = -1; q->uuconf_fcalled_transfer = -1; q->uuconf_schat.uuconf_fstrip = -1; q->uuconf_scalled_chat.uuconf_fstrip = -1; } while (0);
do { q->uuconf_cmax_retries = -1; q->uuconf_csuccess_wait = -1; q->uuconf_ibaud = -1; q->uuconf_ihighbaud = -1; q->uuconf_cfree_space = -1; q->uuconf_schat.uuconf_ctimeout = -1; q->uuconf_scalled_chat.uuconf_ctimeout = -1; q->uuconf_cmax_file_time = -1; } while (0);
q->uuconf_qalternate = ((void *)0);
q->uuconf_zport = (char *) &_uuconf_unset;
q->uuconf_qport = (struct uuconf_port *) &_uuconf_unset;
q->uuconf_qproto_params = (struct uuconf_proto_param *) &_uuconf_unset;
q->uuconf_palloc = ((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": 1,
"switch_statement": 0,
"type_casting": 7,
"union_type": 0,
"while_loop": 5
} |
transcoder-set#NUMBER_SUBSTRINGS_STRING_prep#f_gold.c | transcoder-set | NUMBER_SUBSTRINGS_STRING.c | f_gold | 4 | int f_gold ( char str [] ) {
int n = strlen(str);
return n * ( n + 1 ) / 2;
}
| {
"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
} |
nettle-3.9.1#hmac-gosthash94_prep#nettle_hmac_gosthash94_digest.c | nettle-3.9.1 | hmac-gosthash94.c | nettle_hmac_gosthash94_digest | 6 | void
nettle_hmac_gosthash94_digest(struct hmac_gosthash94_ctx *ctx,
size_t length, uint8_t *digest)
{
nettle_hmac_digest( &(ctx)->outer, &(ctx)->inner, &(ctx)->state, (&nettle_gosthash94), (length), (digest) );
}
| {
"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
} |
tar-1.34#rtapelib_prep#rmt_close__.c | tar-1.34 | rtapelib.c | rmt_close__ | 10 | int
rmt_close__ (int handle)
{
long int status;
if (do_command (handle, "C\n") == -1)
return -1;
status = get_status (handle);
_rmt_shutdown (handle, (*__errno_location ()));
return status;
}
| {
"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": 0,
"union_type": 0,
"while_loop": 0
} |
cflow-1.7#basename-lgpl_prep#base_len.c | cflow-1.7 | basename-lgpl.c | base_len | 15 | size_t
base_len (char const *name)
{
size_t len;
size_t prefix_len = ((void) (name), 0);
for (len = strlen (name); 1 < len && ((name[len - 1]) == '/'); len--)
continue;
if (0 && len == 1
&& ((name[0]) == '/') && ((name[1]) == '/') && ! name[2])
return 2;
if (0 && prefix_len
&& len == prefix_len && ((name[prefix_len]) == '/'))
return prefix_len + 1;
return len;
}
| {
"array_type": 1,
"break_continue_statement": 1,
"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": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#K_TH_DISTINCT_OR_NON_REPEATING_ELEMENT_IN_AN_ARRAY_prep#f_gold.c | transcoder-set | K_TH_DISTINCT_OR_NON_REPEATING_ELEMENT_IN_AN_ARRAY.c | f_gold | 14 | int f_gold ( int arr [ ], int n, int k ) {
int dist_count = 0;
for ( int i = 0;
i < n;
i ++ ) {
int j;
for ( j = 0;
j < n;
j ++ ) if ( i != j && arr [ j ] == arr [ i ] ) break;
if ( j == n ) dist_count ++;
if ( dist_count == k ) return arr [ i ];
}
return - 1;
}
| {
"array_type": 1,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 2,
"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": 0,
"union_type": 0,
"while_loop": 0
} |
rcs-5.10.1#rcsmap_prep#checksid.c | rcs-5.10.1 | rcsmap.c | checksid | 5 | void
checksid (char const *id)
{
checkid (id, 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
} |
patch-2.7.6#filenamecat-lgpl_prep#mfile_name_concat.c | patch-2.7.6 | filenamecat-lgpl.c | mfile_name_concat | 30 | char *
mfile_name_concat (char const *dir, char const *base, char **base_in_result)
{
char const *dirbase = last_component (dir);
size_t dirbaselen = base_len (dirbase);
size_t dirlen = dirbase - dir + dirbaselen;
size_t baselen = strlen (base);
char sep = '\0';
if (dirbaselen)
{
if (! ((dir[dirlen - 1]) == '/') && ! ((*base) == '/'))
sep = '/';
}
else if (((*base) == '/'))
{
sep = '.';
}
char *p_concat = malloc (dirlen + (sep != '\0') + baselen + 1);
char *p;
if (p_concat == ((void *)0))
return ((void *)0);
p = mempcpy (p_concat, dir, dirlen);
*p = sep;
p += sep != '\0';
if (base_in_result)
*base_in_result = p;
p = mempcpy (p, base, baselen);
*p = '\0';
return p_concat;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 5,
"memory_management": 1,
"memory_operation": 0,
"pointer_type": 3,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#MAXIMUM_SUM_IARRI_AMONG_ROTATIONS_GIVEN_ARRAY_1_prep#sort.c | transcoder-set | MAXIMUM_SUM_IARRI_AMONG_ROTATIONS_GIVEN_ARRAY_1.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
} |
tulipindicators-0.9.1#trunc_prep#ti_trunc.c | tulipindicators-0.9.1 | trunc.c | ti_trunc | 1 | int ti_trunc(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] = ((int)(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
} |
json-c#json_object_prep#json_object_set_string.c | json-c | json_object.c | json_object_set_string | 4 | int json_object_set_string(json_object *jso, const char *s)
{
return _json_object_set_string_len(jso, s, strlen(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": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
tar-1.34#suffix_prep#set_compression_program_by_suffix.c | tar-1.34 | suffix.c | set_compression_program_by_suffix | 7 | void
set_compression_program_by_suffix (const char *name, const char *defprog)
{
const char *program = find_compression_program (name, defprog);
if (program)
use_compress_program_option = program;
}
| {
"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": 0
} |
json.h#allow_global_object_prep#json_extract_get_number_size.c | json.h | allow_global_object.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
} |
libxml2#libxml2-py_prep#libxml_xmlBuildURI.c | libxml2 | libxml2-py.c | libxml_xmlBuildURI | 12 | PyObject *
libxml_xmlBuildURI(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
xmlChar * c_retval;
xmlChar * URI;
xmlChar * base;
if (!_PyArg_ParseTuple_SizeT(args, (char *)"zz:xmlBuildURI", &URI, &base))
return(((void *)0));
c_retval = xmlBuildURI(URI, base);
py_retval = libxml_xmlCharPtrWrap((xmlChar *) 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#FIND_MAXIMUM_HEIGHT_PYRAMID_FROM_THE_GIVEN_ARRAY_OF_OBJECTS_prep#sort.c | transcoder-set | FIND_MAXIMUM_HEIGHT_PYRAMID_FROM_THE_GIVEN_ARRAY_OF_OBJECTS.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
} |
tulipindicators-0.9.1#tiamalgamation_prep#ti_dema_start.c | tulipindicators-0.9.1 | tiamalgamation.c | ti_dema_start | 4 | int ti_dema_start(double const *options) {
const int period = (int)options[0];
return (period-1) * 2;
}
| {
"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#COUNT_OFDIFFERENT_WAYS_EXPRESS_N_SUM_1_3_4_prep#f_filled.c | transcoder-set | COUNT_OFDIFFERENT_WAYS_EXPRESS_N_SUM_1_3_4.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
} |
diffutils-3.10#time_prep#rpl_time.c | diffutils-3.10 | time.c | rpl_time | 12 | time_t
rpl_time (time_t *tp)
{
struct timeval tv;
time_t tt;
if (gettimeofday (&tv, ((void *)0)) < 0)
abort ();
tt = tv.tv_sec;
if (tp)
*tp = tt;
return tt;
}
| {
"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": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#SUM_K_TH_GROUP_ODD_POSITIVE_NUMBERS_1_prep#f_gold.c | transcoder-set | SUM_K_TH_GROUP_ODD_POSITIVE_NUMBERS_1.c | f_gold | 3 | int f_gold ( int k ) {
return k * k * 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": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libxml2#libxml2-py_prep#libxml_xmlCatalogGetSystem.c | libxml2 | libxml2-py.c | libxml_xmlCatalogGetSystem | 11 | PyObject *
libxml_xmlCatalogGetSystem(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
const xmlChar * c_retval;
xmlChar * sysID;
if (!_PyArg_ParseTuple_SizeT(args, (char *)"z:xmlCatalogGetSystem", &sysID))
return(((void *)0));
c_retval = xmlCatalogGetSystem(sysID);
py_retval = libxml_xmlCharPtrConstWrap((const xmlChar *) 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#COUNTS_PATHS_POINT_REACH_ORIGIN_1_prep#main.c | transcoder-set | COUNTS_PATHS_POINT_REACH_ORIGIN_1.c | main | 15 | int main(void) {
int n_success = 0;
int param0[] = {55,74,76,6,2,36,40,14,42,62};
int param1[] = {30,15,57,90,64,1,71,56,4,12};
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
} |
libosip2-5.3.1#osip_cseq_prep#osip_cseq_clone.c | libosip2-5.3.1 | osip_cseq.c | osip_cseq_clone | 20 | int osip_cseq_clone(const osip_cseq_t *cseq, osip_cseq_t **dest) {
int i;
osip_cseq_t *cs;
*dest = ((void *)0);
if (cseq == ((void *)0))
return -2;
if (cseq->method == ((void *)0))
return -2;
if (cseq->number == ((void *)0))
return -2;
i = osip_cseq_init(&cs);
if (i != 0) {
osip_cseq_free(cs);
return i;
}
cs->method = osip_strdup(cseq->method);
cs->number = osip_strdup(cseq->number);
*dest = cs;
return 0;
}
| {
"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": 1,
"return_statement": 5,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
tar-1.34#savedir_prep#savedir.c | tar-1.34 | savedir.c | savedir | 19 | char *
savedir (char const *dir, enum savedir_option option)
{
DIR *dirp = opendir_safer (dir);
if (! dirp)
return ((void *)0);
else
{
char *name_space = streamsavedir (dirp, option);
if (closedir (dirp) != 0)
{
int closedir_errno = (*__errno_location ());
free (name_space);
(*__errno_location ()) = closedir_errno;
return ((void *)0);
}
return name_space;
}
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 1,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 1,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 3,
"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#sort.c | transcoder-set | MAXIMUM_SUM_SUBSEQUENCE_LEAST_K_DISTANT_ELEMENTS.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#QUICK_WAY_CHECK_CHARACTERS_STRING_prep#max.c | transcoder-set | QUICK_WAY_CHECK_CHARACTERS_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
} |
libxml2#xmlmemory_prep#xmlMemDisplay.c | libxml2 | xmlmemory.c | xmlMemDisplay | 4 | void
xmlMemDisplay(FILE *fp __attribute__((unused)))
{
}
| {
"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#PRIMALITY_TEST_SET_1_INTRODUCTION_AND_SCHOOL_METHOD_prep#min.c | transcoder-set | PRIMALITY_TEST_SET_1_INTRODUCTION_AND_SCHOOL_METHOD.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#FIND_THE_NUMBER_OCCURRING_ODD_NUMBER_OF_TIMES_prep#f_filled.c | transcoder-set | FIND_THE_NUMBER_OCCURRING_ODD_NUMBER_OF_TIMES.c | f_filled | 1 | int f_filled ( int arr [ ], int arr_size ) {}
| {
"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#MINIMUM_XOR_VALUE_PAIR_1_prep#sort.c | transcoder-set | MINIMUM_XOR_VALUE_PAIR_1.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#LARGEST_SUBARRAY_WITH_EQUAL_NUMBER_OF_0S_AND_1S_prep#sort.c | transcoder-set | LARGEST_SUBARRAY_WITH_EQUAL_NUMBER_OF_0S_AND_1S.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#FIND_HARMONIC_MEAN_USING_ARITHMETIC_MEAN_GEOMETRIC_MEAN_prep#sort.c | transcoder-set | FIND_HARMONIC_MEAN_USING_ARITHMETIC_MEAN_GEOMETRIC_MEAN.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
} |
brotli-1.0.9#decode_prep#BrotliDecoderGetErrorCode.c | brotli-1.0.9 | decode.c | BrotliDecoderGetErrorCode | 3 | BrotliDecoderErrorCode BrotliDecoderGetErrorCode(const BrotliDecoderStateInternal* s) {
return (BrotliDecoderErrorCode)s->error_code;
}
| {
"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-c#json_object_prep#json_object_new_double_s.c | json-c | json_object.c | json_object_new_double_s | 17 | struct json_object *json_object_new_double_s(double d, const char *ds)
{
char *new_ds;
struct json_object *jso = json_object_new_double(d);
if (!jso)
return ((void *)0);
new_ds = strdup(ds);
if (!new_ds)
{
json_object_generic_delete(jso);
(*__errno_location ()) = 12;
return ((void *)0);
}
json_object_set_serializer(jso, _json_object_userdata_to_json_string, new_ds,
json_object_free_userdata);
return jso;
}
| {
"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": 2,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
gawk-5.2.2#regex_prep#re_set_registers.c | gawk-5.2.2 | regex.c | re_set_registers | 18 | void
re_set_registers (struct re_pattern_buffer *bufp, struct re_registers *regs,
__re_size_t num_regs, regoff_t *starts, regoff_t *ends)
{
if (num_regs)
{
bufp->regs_allocated = 1;
regs->num_regs = num_regs;
regs->start = starts;
regs->end = ends;
}
else
{
bufp->regs_allocated = 0;
regs->num_regs = 0;
regs->start = regs->end = ((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": 0,
"return_statement": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libosip2-5.3.1#osip_from_prep#osip_from_get_displayname.c | libosip2-5.3.1 | osip_from.c | osip_from_get_displayname | 5 | char *osip_from_get_displayname(osip_from_t *from) {
if (from == ((void *)0))
return ((void *)0);
return from->displayname;
}
| {
"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#libxml2-py_prep#libxml_xmlReaderForMemory.c | libxml2 | libxml2-py.c | libxml_xmlReaderForMemory | 15 | PyObject *
libxml_xmlReaderForMemory(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
xmlTextReaderPtr c_retval;
char * buffer;
int size;
char * URL;
char * encoding;
int options;
if (!_PyArg_ParseTuple_SizeT(args, (char *)"zizzi:xmlReaderForMemory", &buffer, &size, &URL, &encoding, &options))
return(((void *)0));
c_retval = xmlReaderForMemory(buffer, size, URL, encoding, options);
py_retval = libxml_xmlTextReaderPtrWrap((xmlTextReaderPtr) 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#COUNT_EVEN_LENGTH_BINARY_SEQUENCES_WITH_SAME_SUM_OF_FIRST_AND_SECOND_HALF_BITS_1_prep#min.c | transcoder-set | COUNT_EVEN_LENGTH_BINARY_SEQUENCES_WITH_SAME_SUM_OF_FIRST_AND_SECOND_HALF_BITS_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
} |
findutils-4.9.0#tmpdir_prep#path_search.c | findutils-4.9.0 | tmpdir.c | path_search | 51 | int
path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
_Bool try_tmpdir)
{
const char *d;
size_t dlen, plen;
_Bool add_slash;
if (!pfx || !pfx[0])
{
pfx = "file";
plen = 4;
}
else
{
plen = strlen (pfx);
if (plen > 5)
plen = 5;
}
if (try_tmpdir)
{
d = secure_getenv ("TMPDIR");
if (d != ((void *)0) && direxists (d))
dir = d;
else if (dir != ((void *)0) && direxists (dir))
;
else
dir = ((void *)0);
}
if (dir == ((void *)0))
{
if (direxists ("/tmp"))
dir = "/tmp";
else if (strcmp ("/tmp", "/tmp") != 0 && direxists ("/tmp"))
dir = "/tmp";
else
{
(*__errno_location ()) = (2);
return -1;
}
}
dlen = strlen (dir);
add_slash = dlen != 0 && !((dir[dlen - 1]) == '/');
if (tmpl_len < dlen + add_slash + plen + 6 + 1)
{
(*__errno_location ()) = (22);
return -1;
}
memcpy (tmpl, dir, dlen);
sprintf (tmpl + dlen, &"/%.*sXXXXXX"[!add_slash], (int) plen, pfx);
return 0;
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 9,
"memory_management": 0,
"memory_operation": 1,
"pointer_type": 1,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 5,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#MAXIMUM_HEIGHT_OF_TRIANGULAR_ARRANGEMENT_OF_ARRAY_VALUES_1_prep#min.c | transcoder-set | MAXIMUM_HEIGHT_OF_TRIANGULAR_ARRANGEMENT_OF_ARRAY_VALUES_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
} |
less-633#ttyin_prep#getchr.c | less-633 | ttyin.c | getchr | 23 | int getchr(void)
{
char c;
int result;
do
{
flush();
{
unsigned char uc;
result = iread(tty, &uc, sizeof(char));
c = (char) uc;
}
if (result == (-2))
return ((-2));
if (result < 0)
{
quit(1);
}
if (c == '\0')
c = '\340';
} while (result != 1);
return (c & 0xFF);
}
| {
"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": 1
} |
transcoder-set#MINIMIZE_THE_SUM_OF_DIGITS_OF_A_AND_B_SUCH_THAT_A_B_N_prep#max.c | transcoder-set | MINIMIZE_THE_SUM_OF_DIGITS_OF_A_AND_B_SUCH_THAT_A_B_N.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#HTMLtree_prep#htmlSaveFileFormat.c | libxml2 | HTMLtree.c | htmlSaveFileFormat | 21 | int
htmlSaveFileFormat(const char *filename, xmlDocPtr cur,
const char *encoding, int format) {
xmlOutputBufferPtr buf;
xmlCharEncodingHandlerPtr handler = ((void *)0);
int ret;
if ((cur == ((void *)0)) || (filename == ((void *)0)))
return(-1);
xmlInitParser();
handler = htmlFindOutputEncoder(encoding);
if (handler != ((void *)0))
htmlSetMetaEncoding(cur, (const xmlChar *) handler->name);
else
htmlSetMetaEncoding(cur, (const xmlChar *) "UTF-8");
buf = xmlOutputBufferCreateFilename(filename, handler, 0);
if (buf == ((void *)0))
return(0);
htmlDocContentDumpFormatOutput(buf, cur, encoding, format);
ret = xmlOutputBufferClose(buf);
return(ret);
}
| {
"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": 4,
"union_type": 0,
"while_loop": 0
} |
heman#mat4_prep#kmMat4Scaling.c | heman | mat4.c | kmMat4Scaling | 10 | kmMat4* kmMat4Scaling(kmMat4* pOut, const float x, const float y,
float z)
{
memset(pOut->mat, 0, sizeof(float) * 16);
pOut->mat[0] = x;
pOut->mat[5] = y;
pOut->mat[10] = z;
pOut->mat[15] = 1.0f;
return pOut;
}
| {
"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": 1,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
json-c#json_util_prep#json_parse_uint64.c | json-c | json_util.c | json_parse_uint64 | 19 | int json_parse_uint64(const char *buf, uint64_t *retval)
{
char *end = ((void *)0);
uint64_t val;
(*__errno_location ()) = 0;
while (*buf == ' ')
buf++;
if (*buf == '-')
return 1;
val = strtoull(buf, &end, 10);
if (end != buf)
*retval = val;
if ((val == 0 && (*__errno_location ()) != 0) || (end == buf))
{
(*__errno_location ()) = 22;
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": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 1
} |
binn-3.0#binn_prep#binn_list_int8.c | binn-3.0 | binn.c | binn_list_int8 | 5 | signed char binn_list_int8(void *list, int pos) {
signed char value;
binn_list_get(list, pos, 0x21, &value, ((void *)0));
return 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
} |
transcoder-set#LARGEST_SUM_CONTIGUOUS_SUBARRAY_2_prep#max.c | transcoder-set | LARGEST_SUM_CONTIGUOUS_SUBARRAY_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
} |
mtools-4.0.43#plain_io_prep#SimpleFileOpen.c | mtools-4.0.43 | plain_io.c | SimpleFileOpen | 7 | Stream_t *SimpleFileOpen(struct device *dev, struct device *orig_dev,
const char *name, int mode, char *errmsg,
int mode2, int locked, mt_off_t *maxSize) {
return SimpleFileOpenWithLm(dev, orig_dev, name, mode,
errmsg, mode2, locked, mode, maxSize,
((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": 1,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#CHECK_LARGE_NUMBER_DIVISIBLE_4_NOT_prep#f_gold.c | transcoder-set | CHECK_LARGE_NUMBER_DIVISIBLE_4_NOT.c | f_gold | 8 | _Bool f_gold ( char str [] ) {
int n = strlen(str);
if ( n == 0 ) return 0;
if ( n == 1 ) return ( ( str [ 0 ] - '0' ) % 4 == 0 );
int last = str [ n - 1 ] - '0';
int second_last = str [ n - 2 ] - '0';
return ( ( second_last * 10 + last ) % 4 == 0 );
}
| {
"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": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
gprolog-1.5.0#arith_inl_c_prep#Pl_Fct_LSB.c | gprolog-1.5.0 | arith_inl_c.c | Pl_Fct_LSB | 5 | WamWord
Pl_Fct_LSB(WamWord x)
{
if ((((PlLong) (x) & ((PlULong)0x7)) == (PlULong)0x4)) Pl_Err_Type(pl_type_integer, x); return Pl_Fct_Fast_LSB(x);
}
| {
"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
} |
uucp-1.07#jobid_prep#zsfile_to_jobid.c | uucp-1.07 | jobid.c | zsfile_to_jobid | 25 | char *
zsfile_to_jobid (qsys, zfile, bgrade)
const struct uuconf_system *qsys;
const char *zfile;
int bgrade __attribute__ ((__unused__));
{
size_t clen;
char *zret;
clen = strlen (qsys->uuconf_zname);
{
size_t cseqlen;
zfile = strrchr (zfile, '/');
if (zfile == ((void *)0)
|| zfile[1] != 'C'
|| zfile[2] != '.'
|| zfile[3] == '\0')
ulog (LOG_FATAL, "zsfile_to_jobid: Can't happen");
zfile += 2;
cseqlen = strlen (zfile);
zret = zbufalc (clen + cseqlen + 1);
memcpy (zret, qsys->uuconf_zname, clen);
memcpy (zret + clen, zfile, cseqlen + 1);
}
return zret;
}
| {
"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": 2,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
json.h#allow_single_quoted_strings_prep#json_hexadecimal_value.c | json.h | allow_single_quoted_strings.c | json_hexadecimal_value | 18 | int json_hexadecimal_value(const char *c, const unsigned long size,
unsigned long *result) {
const char *p;
int digit;
if (size > sizeof(unsigned long) * 2) {
return 0;
}
*result = 0;
for (p = c; (unsigned long)(p - c) < size; ++p) {
*result <<= 4;
digit = json_hexadecimal_digit(*p);
if (digit < 0 || digit > 15) {
return 0;
}
*result |= (unsigned char)digit;
}
return 1;
}
| {
"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": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
less-633#xbuf_prep#xbuf_init.c | less-633 | xbuf.c | xbuf_init | 5 | void xbuf_init(struct xbuffer *xbuf)
{
xbuf->data = ((void *)0);
xbuf->size = xbuf->end = 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": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#MAKING_ELEMENTS_OF_TWO_ARRAYS_SAME_WITH_MINIMUM_INCREMENTDECREMENT_prep#min.c | transcoder-set | MAKING_ELEMENTS_OF_TWO_ARRAYS_SAME_WITH_MINIMUM_INCREMENTDECREMENT.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
} |
grep-3.11#thread_prep#gl_thread_create.c | grep-3.11 | thread.c | gl_thread_create | 10 | gl_thread_t
gl_thread_create (void *(*func) (void *arg), void *arg)
{
gl_thread_t thread;
int ret;
ret = (1 ? pthread_create (&thread, ((void *)0), func, arg) : 38);
if (ret != 0)
abort ();
return thread;
}
| {
"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": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
json.h#allow_simplified_json_prep#json_parse_array.c | json.h | allow_simplified_json.c | json_parse_array | 57 | void json_parse_array(struct json_parse_state_s *state,
struct json_array_s *array) {
const char *const src = state->src;
const size_t size = state->size;
size_t elements = 0;
int allow_comma = 0;
struct json_array_element_s *previous = 0;
state->offset++;
(void)json_skip_all_skippables(state);
elements = 0;
do {
struct json_array_element_s *element = 0;
struct json_value_s *value = 0;
(void)json_skip_all_skippables(state);
if (']' == src[state->offset]) {
state->offset++;
break;
}
if (allow_comma) {
if (',' == src[state->offset]) {
state->offset++;
allow_comma = 0;
continue;
}
}
element = (struct json_array_element_s *)state->dom;
state->dom += sizeof(struct json_array_element_s);
if (0 == previous) {
array->start = element;
} else {
previous->next = element;
}
previous = element;
if (json_parse_flags_allow_location_information & state->flags_bitset) {
struct json_value_ex_s *value_ex = (struct json_value_ex_s *)state->dom;
state->dom += sizeof(struct json_value_ex_s);
value_ex->offset = state->offset;
value_ex->line_no = state->line_no;
value_ex->row_no = state->offset - state->line_offset;
value = &(value_ex->value);
} else {
value = (struct json_value_s *)state->dom;
state->dom += sizeof(struct json_value_s);
}
element->value = value;
json_parse_value(state, 0, value);
elements++;
allow_comma = 1;
} while (state->offset < size);
if (previous) {
previous->next = 0;
}
if (0 == elements) {
array->start = 0;
}
array->length = elements;
}
| {
"array_type": 0,
"break_continue_statement": 2,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 7,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 4,
"return_statement": 0,
"struct_type": 6,
"switch_statement": 0,
"type_casting": 8,
"union_type": 0,
"while_loop": 1
} |
transcoder-set#COUNT_FREQUENCY_K_MATRIX_SIZE_N_MATRIXI_J_IJ_prep#f_filled.c | transcoder-set | COUNT_FREQUENCY_K_MATRIX_SIZE_N_MATRIXI_J_IJ.c | f_filled | 1 | int f_filled ( int n, int 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": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#DYNAMIC_PROGRAMMING_SET_8_MATRIX_CHAIN_MULTIPLICATION_prep#main.c | transcoder-set | DYNAMIC_PROGRAMMING_SET_8_MATRIX_CHAIN_MULTIPLICATION.c | main | 26 | int main(void) {
int n_success = 0;
int param0_0[] = {6,12,16,30,31,31,33,34,45,48,57,63,81,83};
int param0_1[] = {30,-78,42,-6,42,56,-38,28,-96,-96,84,-18,0,20,-56,-40,-58,-74,64,62,-22,78,10,-22,16,-48,2,14,82,-92,-64,-18,42,24,22,-50,12,-76,38,-30,-86,-58,-6,-4,10,28};
int param0_2[] = {0,0,0,0,0,0,1,1,1,1,1,1,1};
int param0_3[] = {54,46};
int param0_4[] = {-80,-76,-68,-66,-54,-12,-10,-6,6,8,20,20,22,60,66,78,78,82,98};
int param0_5[] = {0,0,1,0,0,1,0,1,1,1,0,0,1,1,0,1,1,1,0,1,0};
int param0_6[] = {14,21,29,31,37,50,51,54,57,62,64,72,85,98};
int param0_7[] = {-86,98,90,-20,90,68,70,-24,-10,-80,70,-42,14,56,-26,-42,2,-62,24,10,-46,-66,-82,-98,-84,-2,-52,-50,0,-18,90,-32,98,86};
int param0_8[] = {0,0,1,1,1,1};
int param0_9[] = {52,15,61,73,45,5,15,54,69,90,5,56,13,54,27,72,58,21,35,2,59,55,64,92,54,63,50,95,38,53,38,53,73,27,86,86,99,42,85,80,43,32,80,57,78};
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[] = {10,30,7,1,13,20,7,23,5,26};
int param2[] = {9,27,7,1,10,17,11,26,4,42};
for(int i = 0; i < len(param0); ++i)
{
if(f_filled(param0[i],param1[i],param2[i]) == f_gold(param0[i],param1[i],param2[i]))
{
n_success+=1;
}
break;
}
printf("#Results:", " ", n_success, ", ", len(param0));
return 0;
}
| {
"array_type": 3,
"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
} |
lodepng#lodepng_prep#lodepng_compute_color_stats.c | lodepng | lodepng.c | lodepng_compute_color_stats | 151 | unsigned lodepng_compute_color_stats(LodePNGColorStats* stats,
const unsigned char* in, unsigned w, unsigned h,
const LodePNGColorMode* mode_in) {
size_t i;
ColorTree tree;
size_t numpixels = (size_t)w * (size_t)h;
unsigned error = 0;
unsigned colored_done = lodepng_is_greyscale_type(mode_in) ? 1 : 0;
unsigned alpha_done = lodepng_can_have_alpha(mode_in) ? 0 : 1;
unsigned numcolors_done = 0;
unsigned bpp = lodepng_get_bpp(mode_in);
unsigned bits_done = (stats->bits == 1 && bpp == 1) ? 1 : 0;
unsigned sixteen = 0;
unsigned maxnumcolors = 257;
if(bpp <= 8) maxnumcolors = (((257) < (stats->numcolors + (1u << bpp))) ? (257) : (stats->numcolors + (1u << bpp)));
stats->numpixels += numpixels;
if(!stats->allow_palette) numcolors_done = 1;
color_tree_init(&tree);
if(stats->alpha) alpha_done = 1;
if(stats->colored) colored_done = 1;
if(stats->bits == 16) numcolors_done = 1;
if(stats->bits >= bpp) bits_done = 1;
if(stats->numcolors >= maxnumcolors) numcolors_done = 1;
if(!numcolors_done) {
for(i = 0; i < stats->numcolors; i++) {
const unsigned char* color = &stats->palette[i * 4];
error = color_tree_add(&tree, color[0], color[1], color[2], color[3], i);
if(error) goto cleanup;
}
}
if(mode_in->bitdepth == 16 && !sixteen) {
unsigned short r = 0, g = 0, b = 0, a = 0;
for(i = 0; i != numpixels; ++i) {
getPixelColorRGBA16(&r, &g, &b, &a, in, i, mode_in);
if((r & 255) != ((r >> 8) & 255) || (g & 255) != ((g >> 8) & 255) ||
(b & 255) != ((b >> 8) & 255) || (a & 255) != ((a >> 8) & 255)) {
stats->bits = 16;
sixteen = 1;
bits_done = 1;
numcolors_done = 1;
break;
}
}
}
if(sixteen) {
unsigned short r = 0, g = 0, b = 0, a = 0;
for(i = 0; i != numpixels; ++i) {
getPixelColorRGBA16(&r, &g, &b, &a, in, i, mode_in);
if(!colored_done && (r != g || r != b)) {
stats->colored = 1;
colored_done = 1;
}
if(!alpha_done) {
unsigned matchkey = (r == stats->key_r && g == stats->key_g && b == stats->key_b);
if(a != 65535 && (a != 0 || (stats->key && !matchkey))) {
stats->alpha = 1;
stats->key = 0;
alpha_done = 1;
} else if(a == 0 && !stats->alpha && !stats->key) {
stats->key = 1;
stats->key_r = r;
stats->key_g = g;
stats->key_b = b;
} else if(a == 65535 && stats->key && matchkey) {
stats->alpha = 1;
stats->key = 0;
alpha_done = 1;
}
}
if(alpha_done && numcolors_done && colored_done && bits_done) break;
}
if(stats->key && !stats->alpha) {
for(i = 0; i != numpixels; ++i) {
getPixelColorRGBA16(&r, &g, &b, &a, in, i, mode_in);
if(a != 0 && r == stats->key_r && g == stats->key_g && b == stats->key_b) {
stats->alpha = 1;
stats->key = 0;
alpha_done = 1;
}
}
}
} else {
unsigned char r = 0, g = 0, b = 0, a = 0;
for(i = 0; i != numpixels; ++i) {
getPixelColorRGBA8(&r, &g, &b, &a, in, i, mode_in);
if(!bits_done && stats->bits < 8) {
unsigned bits = getValueRequiredBits(r);
if(bits > stats->bits) stats->bits = bits;
}
bits_done = (stats->bits >= bpp);
if(!colored_done && (r != g || r != b)) {
stats->colored = 1;
colored_done = 1;
if(stats->bits < 8) stats->bits = 8;
}
if(!alpha_done) {
unsigned matchkey = (r == stats->key_r && g == stats->key_g && b == stats->key_b);
if(a != 255 && (a != 0 || (stats->key && !matchkey))) {
stats->alpha = 1;
stats->key = 0;
alpha_done = 1;
if(stats->bits < 8) stats->bits = 8;
} else if(a == 0 && !stats->alpha && !stats->key) {
stats->key = 1;
stats->key_r = r;
stats->key_g = g;
stats->key_b = b;
} else if(a == 255 && stats->key && matchkey) {
stats->alpha = 1;
stats->key = 0;
alpha_done = 1;
if(stats->bits < 8) stats->bits = 8;
}
}
if(!numcolors_done) {
if(!color_tree_has(&tree, r, g, b, a)) {
error = color_tree_add(&tree, r, g, b, a, stats->numcolors);
if(error) goto cleanup;
if(stats->numcolors < 256) {
unsigned char* p = stats->palette;
unsigned n = stats->numcolors;
p[n * 4 + 0] = r;
p[n * 4 + 1] = g;
p[n * 4 + 2] = b;
p[n * 4 + 3] = a;
}
++stats->numcolors;
numcolors_done = stats->numcolors >= maxnumcolors;
}
}
if(alpha_done && numcolors_done && colored_done && bits_done) break;
}
if(stats->key && !stats->alpha) {
for(i = 0; i != numpixels; ++i) {
getPixelColorRGBA8(&r, &g, &b, &a, in, i, mode_in);
if(a != 0 && r == stats->key_r && g == stats->key_g && b == stats->key_b) {
stats->alpha = 1;
stats->key = 0;
alpha_done = 1;
if(stats->bits < 8) stats->bits = 8;
}
}
}
stats->key_r += (stats->key_r << 8);
stats->key_g += (stats->key_g << 8);
stats->key_b += (stats->key_b << 8);
}
cleanup:
color_tree_cleanup(&tree);
return error;
}
| {
"array_type": 1,
"break_continue_statement": 3,
"enum_type": 0,
"for_loop": 6,
"function_pointer": 0,
"goto_statement": 2,
"if_statement": 38,
"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#PROGRAM_TO_CHECK_IF_A_GIVEN_NUMBER_IS_LUCKY_ALL_DIGITS_ARE_DIFFERENT_prep#f_filled.c | transcoder-set | PROGRAM_TO_CHECK_IF_A_GIVEN_NUMBER_IS_LUCKY_ALL_DIGITS_ARE_DIFFERENT.c | f_filled | 1 | _Bool 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
} |
heman#generate_prep#heman_generate_simplex_fbm.c | heman | generate.c | heman_generate_simplex_fbm | 29 | heman_image* heman_generate_simplex_fbm(int width, int height, float frequency,
float amplitude, int octaves, float lacunarity, float gain, int seed)
{
struct osn_context* ctx;
open_simplex_noise(seed, &ctx);
heman_image* img = heman_image_create(width, height, 1);
float* data = img->data;
float invh = 1.0f / height;
float invw = 1.0f / width;
float ampl = amplitude;
float freq = frequency;
memset(data, 0, sizeof(float) * width * height);
while (octaves--) {
int y;
#pragma omp parallel for
for (y = 0; y < height; ++y) {
float v = y * invh;
float* dst = data + y * width;
for (int x = 0; x < width; ++x) {
float u = x * invw;
*dst++ += ampl* open_simplex_noise2(ctx, u * freq, v * freq);
}
}
ampl *= gain;
freq *= lacunarity;
}
open_simplex_noise_free(ctx);
return img;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 2,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 1,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 1
} |
transcoder-set#CHECK_LARGE_NUMBER_DIVISIBLE_6_NOT_prep#min.c | transcoder-set | CHECK_LARGE_NUMBER_DIVISIBLE_6_NOT.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-c#test_charcase_prep#main.c | json-c | test_charcase.c | main | 6 | int main(int argc, char **argv)
{
if (0) mc_set_debug(1);
test_case_parse();
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": 0,
"union_type": 0,
"while_loop": 0
} |
json.h#test_prep#json_value_as_object.c | json.h | test.c | json_value_as_object | 6 | struct json_object_s *json_value_as_object(struct json_value_s *const value) {
if (value->type != json_type_object) {
return 0;
}
return (struct json_object_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
} |
nettle-3.9.1#siv-cmac-aes128_prep#nettle_siv_cmac_aes128_decrypt_message.c | nettle-3.9.1 | siv-cmac-aes128.c | nettle_siv_cmac_aes128_decrypt_message | 11 | int
nettle_siv_cmac_aes128_decrypt_message(const struct siv_cmac_aes128_ctx *ctx,
size_t nlength, const uint8_t *nonce,
size_t alength, const uint8_t *adata,
size_t mlength, uint8_t *dst, const uint8_t *src)
{
return nettle_siv_cmac_decrypt_message(&ctx->cmac_key, &ctx->cmac_cipher,
&nettle_aes128, &ctx->ctr_cipher,
nlength, nonce, alength, adata,
mlength, 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": 1,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libxml2#libxml2-py_prep#libxml_xmlValidateNMToken.c | libxml2 | libxml2-py.c | libxml_xmlValidateNMToken | 12 | PyObject *
libxml_xmlValidateNMToken(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
int c_retval;
xmlChar * value;
int space;
if (!_PyArg_ParseTuple_SizeT(args, (char *)"zi:xmlValidateNMToken", &value, &space))
return(((void *)0));
c_retval = xmlValidateNMToken(value, space);
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": 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#LONGEST_REPEATING_SUBSEQUENCE_prep#min.c | transcoder-set | LONGEST_REPEATING_SUBSEQUENCE.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
} |
lodepng#lodepng_prep#lodepng_decode24.c | lodepng | lodepng.c | lodepng_decode24 | 3 | unsigned lodepng_decode24(unsigned char** out, unsigned* w, unsigned* h, const unsigned char* in, size_t insize) {
return lodepng_decode_memory(out, w, h, in, insize, LCT_RGB, 8);
}
| {
"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
} |
uucp-1.07#tmpfil_prep#zstemp_file.c | uucp-1.07 | tmpfil.c | zstemp_file | 32 | char *
zstemp_file (qsys)
const struct uuconf_system *qsys __attribute__ ((__unused__));
{
static unsigned int icount;
const char *const zdigs = "0123456789abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";
char ab[14];
pid_t ime;
int iset;
ab[0] = 'T';
ab[1] = 'M';
ab[2] = '.';
ime = getpid ();
iset = 3;
while (ime > 0 && iset < 10)
{
ab[iset] = zdigs[ime % (sizeof "0123456789abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-" - 1)];
ime /= (sizeof "0123456789abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-" - 1);
++iset;
}
ab[iset] = '.';
++iset;
ab[iset] = zdigs[icount / (sizeof "0123456789abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-" - 1)];
++iset;
ab[iset] = zdigs[icount % (sizeof "0123456789abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-" - 1)];
++iset;
ab[iset] = '\0';
++icount;
if (icount >= (sizeof "0123456789abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-" - 1) * (sizeof "0123456789abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-" - 1))
icount = 0;
return zsysdep_in_dir (".Temp", ab);
}
| {
"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": 1,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
libxml2#HTMLtree_prep#htmlSaveFileEnc.c | libxml2 | HTMLtree.c | htmlSaveFileEnc | 4 | int
htmlSaveFileEnc(const char *filename, xmlDocPtr cur, const char *encoding) {
return(htmlSaveFileFormat(filename, cur, encoding, 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
} |
make-4.4.1#main_prep#main.c | make-4.4.1 | main.c | main | 803 | int
main (int argc, char **argv, char **envp)
{
int makefile_status = 0;
struct goaldep *read_files;
char current_directory[4096 +1];
unsigned int restarts = 0;
unsigned int syncing = 0;
int argv_slots;
initialize_variable_output ();
;
if ((((check_io_state ())&(0x0008)) != 0))
atexit (close_stdout);
output_init (&make_sync);
initialize_stopchar_map();
;
setlocale (6, "");
(void)bindtextdomain ("make", "/usr/local/share/locale");
(void)textdomain ("make");
sigemptyset (&fatal_signal_set);
if (bsd_signal (1, fatal_error_signal) == ((__sighandler_t) 1)) bsd_signal (1, ((__sighandler_t) 1)); else sigaddset (&fatal_signal_set, 1);;
if (bsd_signal (3, fatal_error_signal) == ((__sighandler_t) 1)) bsd_signal (3, ((__sighandler_t) 1)); else sigaddset (&fatal_signal_set, 3);;
if (bsd_signal (13, fatal_error_signal) == ((__sighandler_t) 1)) bsd_signal (13, ((__sighandler_t) 1)); else sigaddset (&fatal_signal_set, 13);;
if (bsd_signal (2, fatal_error_signal) == ((__sighandler_t) 1)) bsd_signal (2, ((__sighandler_t) 1)); else sigaddset (&fatal_signal_set, 2);;
if (bsd_signal (15, fatal_error_signal) == ((__sighandler_t) 1)) bsd_signal (15, ((__sighandler_t) 1)); else sigaddset (&fatal_signal_set, 15);;
if (bsd_signal (24, fatal_error_signal) == ((__sighandler_t) 1)) bsd_signal (24, ((__sighandler_t) 1)); else sigaddset (&fatal_signal_set, 24);;
if (bsd_signal (25, fatal_error_signal) == ((__sighandler_t) 1)) bsd_signal (25, ((__sighandler_t) 1)); else sigaddset (&fatal_signal_set, 25);;
(void) bsd_signal (17, ((__sighandler_t) 0));
output_init (((void *)0));
if (argv[0] == 0)
argv[0] = (char *)"";
if (argv[0][0] == '\0')
program = "make";
else
{
program = strrchr (argv[0], '/');
if (program == 0)
program = argv[0];
else
++program;
}
initialize_global_hash_tables ();
get_tmpdir ();
if (getcwd (current_directory, 4096) == 0)
{
perror_with_name ("getcwd", "");
current_directory[0] = '\0';
directory_before_chdir = 0;
}
else
directory_before_chdir = xstrdup (current_directory);
define_variable_in_set((".VARIABLES"),(sizeof (".VARIABLES") - 1),(""),(o_default),(0), current_variable_set_list->set,((floc *)0))->special = 1;
define_variable_in_set((".RECIPEPREFIX"),(sizeof (".RECIPEPREFIX") - 1),(""),(o_default),(0), current_variable_set_list->set,((floc *)0))->special = 1;
define_variable_in_set((".SHELLFLAGS"),(sizeof (".SHELLFLAGS") - 1),("-c"),(o_default),(0), current_variable_set_list->set,((floc *)0));
define_variable_in_set((".LOADED"),(sizeof (".LOADED") - 1),(""),(o_default),(0), current_variable_set_list->set,((floc *)0));
{
const char *features = "target-specific order-only second-expansion"
" else-if shortest-stem undefine oneshell nocomment"
" grouped-target extra-prereqs notintermediate"
" shell-export"
" archives"
" jobserver"
" jobserver-fifo"
" output-sync"
" check-symlink"
" load"
;
define_variable_in_set((".FEATURES"),(sizeof (".FEATURES") - 1),(features),(o_default),(0), current_variable_set_list->set,((floc *)0));
}
guile_gmake_setup (((floc *)0));
{
unsigned int i;
for (i = 0; envp[i] != 0; ++i)
{
struct variable *v;
const char *ep = envp[i];
enum variable_export export = v_export;
size_t len;
while (! (((stopchar_map[(unsigned char)(*ep)])&((0x0020|0x0001))) != 0))
++ep;
if (*ep == '\0')
continue;
len = ep++ - envp[i];
if (len == 13 && memcmp (envp[i], "MAKE_RESTARTS", (sizeof ("MAKE_RESTARTS")-1)) == 0)
{
if (*ep == '-')
{
do{ stdio_traced = 1; }while(0);
++ep;
}
restarts = make_toui (ep, ((void *)0));
export = v_noexport;
}
v = define_variable_in_set((envp[i]),(len),(ep),(o_env),(1), current_variable_set_list->set,((floc *)0));
if (((v->name) == ("SHELL") || (*(v->name) == *("SHELL") && (*(v->name) == '\0' || !strcmp ((v->name) + 1, ("SHELL") + 1)))))
{
export = v_noexport;
shell_var.name = xstrdup ("SHELL");
shell_var.length = 5;
shell_var.value = xstrdup (ep);
}
v->export = export;
}
}
if (lookup_variable (("GNUMAKEFLAGS"), (sizeof ("GNUMAKEFLAGS")-1)))
{
decode_env_switches (("GNUMAKEFLAGS"), (sizeof ("GNUMAKEFLAGS")-1), o_command);
define_variable_in_set(("GNUMAKEFLAGS"),(sizeof ("GNUMAKEFLAGS") - 1),(""),(o_env),(0), current_variable_set_list->set,((floc *)0));
}
decode_env_switches (("MAKEFLAGS"), (sizeof ("MAKEFLAGS")-1), o_command);
syncing = make_sync.syncout = (output_sync == 1
|| output_sync == 2);
do{ output_context = (&make_sync)->syncout ? (&make_sync) : ((void *)0); }while(0);
{
int env_slots = arg_job_slots;
arg_job_slots = (-1);
decode_switches (argc, (const char **)argv, o_command);
argv_slots = arg_job_slots;
if (arg_job_slots == (-1))
arg_job_slots = env_slots;
}
if (print_usage_flag)
print_usage (0);
if (print_version_flag)
{
print_version ();
die (0);
}
setvbuf (stdout, 0, 1, 8192);
if (shuffle_mode)
{
const char *effective_mode;
shuffle_set_mode (shuffle_mode);
free (shuffle_mode);
effective_mode = shuffle_get_mode ();
if (effective_mode)
shuffle_mode = xstrdup (effective_mode);
else
shuffle_mode = ((void *)0);
}
if (isatty (fileno (stdout)))
if (! lookup_variable (("MAKE_TERMOUT"), (sizeof ("MAKE_TERMOUT")-1)))
{
const char *tty = ttyname (fileno (stdout));
define_variable_in_set(("MAKE_TERMOUT"),(sizeof ("MAKE_TERMOUT") - 1),(tty ? tty : "true"),(o_default),(0), current_variable_set_list->set,((floc *)0))->export = v_export;
}
if (isatty (fileno (stderr)))
if (! lookup_variable (("MAKE_TERMERR"), (sizeof ("MAKE_TERMERR")-1)))
{
const char *tty = ttyname (fileno (stderr));
define_variable_in_set(("MAKE_TERMERR"),(sizeof ("MAKE_TERMERR") - 1),(tty ? tty : "true"),(o_default),(0), current_variable_set_list->set,((floc *)0))->export = v_export;
}
syncing = (output_sync == 1
|| output_sync == 2);
if (make_sync.syncout && ! syncing)
output_close (&make_sync);
make_sync.syncout = syncing;
do{ output_context = (&make_sync)->syncout ? (&make_sync) : ((void *)0); }while(0);
{
struct variable *v = lookup_variable (("MAKELEVEL"), (sizeof ("MAKELEVEL")-1));
if (v && v->value[0] != '\0' && v->value[0] != '-')
makelevel = make_toui (v->value, ((void *)0));
else
makelevel = 0;
}
always_make_flag = always_make_set && (restarts == 0);
if (no_builtin_variables_flag)
no_builtin_rules_flag = 1;
if ((((0x001))&db_level))
{
print_version ();
fflush (stdout);
}
if (current_directory[0] != '\0'
&& argv[0] != 0 && argv[0][0] != '/' && strchr (argv[0], '/') != 0
)
argv[0] = xstrdup (concat (3, current_directory, "/", argv[0]));
starting_directory = current_directory;
if (directories != 0)
{
unsigned int i;
for (i = 0; directories->list[i] != 0; ++i)
{
const char *dir = directories->list[i];
if (chdir (dir) < 0)
pfatal_with_name (dir);
}
}
if (directories)
{
if (getcwd (current_directory, 4096) == 0)
{
perror_with_name ("getcwd", "");
starting_directory = 0;
}
else
starting_directory = current_directory;
}
define_variable_in_set(("CURDIR"),(sizeof ("CURDIR") - 1),(current_directory),(o_file),(0), current_variable_set_list->set,((floc *)0));
construct_include_path (include_dirs ? include_dirs->list : ((void *)0));
if (jobserver_auth)
{
if (argv_slots == (-1))
{
if (jobserver_parse_auth (jobserver_auth))
goto job_setup_complete;
error((((floc *)0)), 0, (gettext ("warning: jobserver unavailable: using -j1. Add '+' to parent make rule.")));
arg_job_slots = 1;
}
else if (!restarts)
error((((floc *)0)), (53 * sizeof(uintmax_t) / 22 + 3), (gettext ("warning: -j%d forced in submake: resetting jobserver mode.")), (argv_slots));
reset_jobserver ();
}
job_setup_complete:
define_variable_in_set(("MAKE_COMMAND"),(sizeof ("MAKE_COMMAND") - 1),(argv[0]),(o_default),(0), current_variable_set_list->set,((floc *)0));
define_variable_in_set(("MAKE"),(sizeof ("MAKE") - 1),("$(MAKE_COMMAND)"),(o_default),(1), current_variable_set_list->set,((floc *)0));
if (command_variables != 0)
{
struct command_variable *cv;
struct variable *v;
size_t len = 0;
char *value, *p;
for (cv = command_variables; cv != 0; cv = cv->next)
{
v = cv->variable;
len += 2 * strlen (v->name);
if (! v->recursive)
++len;
++len;
len += 2 * strlen (v->value);
++len;
}
p = value = __builtin_alloca (len);
for (cv = command_variables; cv != 0; cv = cv->next)
{
v = cv->variable;
p = quote_for_env (p, v->name);
if (! v->recursive)
*p++ = ':';
*p++ = '=';
p = quote_for_env (p, v->value);
*p++ = ' ';
}
p[-1] = '\0';
define_variable_in_set(("-*-command-variables-*-"),(sizeof ("-*-command-variables-*-") - 1),(value),(o_automatic),(0), current_variable_set_list->set,((floc *)0));
define_variable_in_set(("MAKEOVERRIDES"),(sizeof ("MAKEOVERRIDES") - 1),("${-*-command-variables-*-}"),(o_default),(1), current_variable_set_list->set,((floc *)0));
}
if (makefiles != 0)
{
unsigned int i;
for (i = 0; i < makefiles->idx; ++i)
if (makefiles->list[i][0] == '-' && makefiles->list[i][1] == '\0')
{
FILE *outfile;
char *newnm;
if (stdin_offset >= 0)
fatal((((floc *)0)), 0, (gettext ("Makefile from standard input specified twice")));
outfile = get_tmpfile (&newnm);
if (!outfile)
fatal((((floc *)0)), 0, (gettext ("cannot store makefile from stdin to a temporary file")));
while (!feof (stdin) && ! ferror (stdin))
{
char buf[2048];
size_t n = fread (buf, 1, sizeof (buf), stdin);
if (n > 0 && fwrite (buf, 1, n, outfile) != n)
fatal((((floc *)0)), strlen (newnm) + strlen (strerror ((*__errno_location ()))), (gettext ("fwrite: temporary file %s: %s")), (newnm), (strerror ((*__errno_location ()))));
}
fclose (outfile);
makefiles->list[i] = strcache_add (newnm);
stdin_offset = i;
free (newnm);
}
}
if (stdin_offset >= 0)
{
struct file *f = enter_file (makefiles->list[stdin_offset]);
f->updated = 1;
f->update_status = us_success;
f->command_state = cs_finished;
f->intermediate = 0;
f->dontcare = 0;
f->last_mtime = f->mtime_before_update = f_mtime (f, 0);
}
{
bsd_signal (17, child_handler);
}
{
sigset_t block;
sigemptyset (&block);
sigaddset (&block, 17);
if (sigprocmask (2, &block, ((void *)0)) < 0)
pfatal_with_name ("sigprocmask(SIG_SETMASK, SIGCHLD)");
}
bsd_signal (10, debug_signal_handler);
set_default_suffixes ();
define_automatic_variables ();
define_makeflags (0)->export = v_export;
define_default_variables ();
default_file = enter_file (strcache_add (".DEFAULT"));
default_goal_var = define_variable_in_set((".DEFAULT_GOAL"),(sizeof (".DEFAULT_GOAL") - 1),(""),(o_file),(0), current_variable_set_list->set,((floc *)0));
if (eval_strings)
{
char *p, *endp, *value;
unsigned int i;
size_t len = ((sizeof ("--eval=")-1) + 1) * eval_strings->idx;
for (i = 0; i < eval_strings->idx; ++i)
{
p = xstrdup (eval_strings->list[i]);
len += 2 * strlen (p);
eval_buffer (p, ((void *)0));
free (p);
}
p = endp = value = __builtin_alloca (len);
for (i = 0; i < eval_strings->idx; ++i)
{
p = stpcpy (p, "--eval=");
p = quote_for_env (p, eval_strings->list[i]);
endp = p++;
*endp = ' ';
}
*endp = '\0';
define_variable_in_set(("-*-eval-flags-*-"),(sizeof ("-*-eval-flags-*-") - 1),(value),(o_automatic),(0), current_variable_set_list->set,((floc *)0));
}
{
int old_builtin_rules_flag = no_builtin_rules_flag;
int old_builtin_variables_flag = no_builtin_variables_flag;
int old_arg_job_slots = arg_job_slots;
read_files = read_all_makefiles (makefiles == 0 ? 0 : makefiles->list);
arg_job_slots = (-1);
decode_env_switches (("GNUMAKEFLAGS"), (sizeof ("GNUMAKEFLAGS")-1), o_env);
define_variable_in_set(("GNUMAKEFLAGS"),(sizeof ("GNUMAKEFLAGS") - 1),(""),(o_override),(0), current_variable_set_list->set,((floc *)0));
decode_env_switches (("MAKEFLAGS"), (sizeof ("MAKEFLAGS")-1), o_env);
if (arg_job_slots == (-1) || argv_slots != (-1))
arg_job_slots = old_arg_job_slots;
else if (jobserver_auth && arg_job_slots != old_arg_job_slots)
{
if (!restarts)
error((((floc *)0)), (53 * sizeof(uintmax_t) / 22 + 3), (gettext ("warning: -j%d forced in makefile: resetting jobserver mode.")), (arg_job_slots));
reset_jobserver ();
}
syncing = (output_sync == 1
|| output_sync == 2);
if (make_sync.syncout && ! syncing)
output_close (&make_sync);
make_sync.syncout = syncing;
do{ output_context = (&make_sync)->syncout ? (&make_sync) : ((void *)0); }while(0);
if (no_builtin_variables_flag)
no_builtin_rules_flag = 1;
if (no_builtin_rules_flag && ! old_builtin_rules_flag)
{
if (suffix_file->builtin)
{
free_ns_chain ((struct nameseq *)(suffix_file->deps));
suffix_file->deps = 0;
}
define_variable_in_set(("SUFFIXES"),(sizeof ("SUFFIXES") - 1),(""),(o_default),(0), current_variable_set_list->set,((floc *)0));
}
if (no_builtin_variables_flag && ! old_builtin_variables_flag)
undefine_default_variables ();
}
if (jobserver_auth)
job_slots = 0;
else if (arg_job_slots == (-1))
job_slots = 1;
else
job_slots = arg_job_slots;
if (job_slots > 1 && jobserver_setup (job_slots - 1, jobserver_style))
{
jobserver_auth = jobserver_get_auth ();
if (jobserver_auth)
{
master_job_slots = job_slots;
job_slots = 0;
}
}
if (syncing && job_slots == 1)
{
do{ output_context = ((void *)0); }while(0);
output_close (&make_sync);
syncing = 0;
output_sync = 0;
}
if (syncing)
{
if (!sync_mutex)
{
osync_setup ();
sync_mutex = osync_get_mutex ();
}
else if (!osync_parse_mutex (sync_mutex))
{
osync_clear ();
free (sync_mutex);
sync_mutex = ((void *)0);
syncing = 0;
}
}
if (jobserver_auth)
do{ if((((0x002)|(0x004))&db_level)) {printf (gettext ("Using jobserver controller %s\n"), jobserver_auth); fflush (stdout);} }while(0);
if (sync_mutex)
do{ if((((0x002))&db_level)) {printf (gettext ("Using output-sync mutex %s\n"), sync_mutex); fflush (stdout);} }while(0);
define_makeflags (0);
snap_deps ();
install_default_suffix_rules ();
convert_to_pattern ();
install_default_implicit_rules ();
snap_implicit_rules ();
build_vpath_lists ();
if (old_files != 0)
{
const char **p;
for (p = old_files->list; *p != 0; ++p)
{
struct file *f = enter_file (*p);
f->last_mtime = f->mtime_before_update = 2;
f->updated = 1;
f->update_status = us_success;
f->command_state = cs_finished;
}
}
if (!restarts && new_files != 0)
{
const char **p;
for (p = new_files->list; *p != 0; ++p)
{
struct file *f = enter_file (*p);
f->last_mtime = f->mtime_before_update = (~ (uintmax_t) 0 - (! ((uintmax_t) -1 <= 0) ? (uintmax_t) 0 : ~ (uintmax_t) 0 << (sizeof (uintmax_t) * 8 - 1)));
}
}
remote_setup ();
do{ output_context = ((void *)0); }while(0);
output_close (&make_sync);
if (shuffle_mode)
do{ if((((0x001))&db_level)) {printf (gettext ("Enabled shuffle mode: %s\n"), shuffle_mode); fflush (stdout);} }while(0);
if (read_files)
{
uintmax_t *makefile_mtimes;
struct goaldep *skipped_makefiles = ((void *)0);
const char **nargv = (const char **) argv;
int any_failed = 0;
enum update_status status;
do{ if((((0x001))&db_level)) {printf (gettext ("Updating makefiles....\n")); fflush (stdout);} }while(0);
{
unsigned int num_mkfiles = 0;
struct goaldep *d = read_files;
read_files = ((void *)0);
while (d != ((void *)0))
{
struct goaldep *t = d;
d = d->next;
t->next = read_files;
read_files = t;
++num_mkfiles;
}
makefile_mtimes = __builtin_alloca (num_mkfiles * sizeof (uintmax_t));
}
{
struct goaldep *d = read_files;
struct goaldep *last = ((void *)0);
unsigned int mm_idx = 0;
while (d != 0)
{
int skip = 0;
struct file *f = d->file;
if (f->phony)
skip = 1;
else
for (f = f->double_colon; f != ((void *)0); f = f->prev)
if (f->deps == ((void *)0) && f->cmds != ((void *)0))
{
skip = 1;
break;
}
if (!skip)
{
makefile_mtimes[mm_idx++] = (((d->file))->last_mtime == 0 ? f_mtime (((d->file)), 0) : ((d->file))->last_mtime);
last = d;
d = d->next;
}
else
{
do{ if((((0x002))&db_level)) {printf (gettext ("Makefile '%s' might loop; not remaking it.\n"), f->name); fflush (stdout);} }while(0);
if (last)
last->next = d->next;
else
read_files = d->next;
if (d->error && ! (d->flags & (1 << 2)))
{
d->next = skipped_makefiles;
skipped_makefiles = d;
any_failed = 1;
}
else
free (d);
d = last ? last->next : read_files;
}
}
}
define_makeflags (1);
{
int orig_db_level = db_level;
if (! (((0x100))&db_level))
db_level = (0x000);
rebuilding_makefiles = 1;
status = update_goal_chain (read_files);
rebuilding_makefiles = 0;
db_level = orig_db_level;
}
while (skipped_makefiles != ((void *)0))
{
struct goaldep *d = skipped_makefiles;
const char *err = strerror (d->error);
error((&d->floc), strlen (((d)->name ? (d)->name : (d)->file->name)) + strlen (err), (gettext ("%s: %s")), (((d)->name ? (d)->name : (d)->file->name)), (err));
skipped_makefiles = skipped_makefiles->next;
free (d);
}
if (any_failed && status == us_success)
status = us_none;
switch (status)
{
case us_question:
break;
case us_none:
{
struct goaldep *d;
for (d = read_files; d; d = d->next)
if (d->file->unloaded)
{
struct file *f = d->file;
if (load_file (&d->floc, f, 0) == 0)
fatal((&d->floc), strlen (f->name), (gettext ("%s: failed to load")), (f->name));
f->unloaded = 0;
f->loaded = 1;
}
}
if (0)
{
struct goaldep *d;
for (d = read_files; d != 0; d = d->next)
if (d->error && ! (d->flags & (1 << 2)))
{
const char *err = strerror (d->error);
error((&d->floc), strlen (((d)->name ? (d)->name : (d)->file->name)) + strlen (err), (gettext ("%s: %s")), (((d)->name ? (d)->name : (d)->file->name)), (err));
any_failed = 1;
}
}
break;
case us_failed:
{
int any_remade = 0;
unsigned int i;
struct goaldep *d;
for (i = 0, d = read_files; d != 0; ++i, d = d->next)
{
if (d->file->updated)
{
if (d->file->update_status == us_success)
any_remade |= ((((d->file))->last_mtime == 0 ? f_mtime (((d->file)), 0) : ((d->file))->last_mtime)
!= makefile_mtimes[i]);
else if (! (d->flags & (1 << 2)))
{
uintmax_t mtime;
error((&d->floc), strlen (d->file->name), (gettext ("Failed to remake makefile '%s'.")), (d->file->name));
mtime = (((d->file))->last_mtime == 0 ? f_mtime (((d->file)), 0) : ((d->file))->last_mtime);
any_remade |= (mtime != 1
&& mtime != makefile_mtimes[i]);
makefile_status = 2;
any_failed = 1;
}
}
else if (! (d->flags & (1 << 2)))
{
const char *dnm = ((d)->name ? (d)->name : (d)->file->name);
if (d->flags & (1 << 1))
error((&d->floc), strlen (dnm), (gettext ("Included makefile '%s' was not found.")), (dnm));
else
{
error((((floc *)0)), strlen (dnm), (gettext ("Makefile '%s' was not found")), (dnm));
any_failed = 1;
}
}
}
if (any_remade)
goto re_exec;
break;
}
case us_success:
re_exec:
remove_intermediates (0);
if (print_data_base_flag)
print_data_base ();
clean_jobserver (0);
if (makefiles != 0)
{
int mfidx = 0;
char** av = argv;
const char** nv;
nv = nargv = __builtin_alloca (sizeof (char*) * (argc + 1 + 1));
*(nv++) = *(av++);
for (; *av; ++av, ++nv)
{
char *f;
char *a = *av;
const char *mf = makefiles->list[mfidx];
((void) (0));
*nv = a;
if (a[0] != '-')
continue;
if (a[1] == '-')
{
if (strcmp (a, "--file") == 0 || strcmp (a, "--makefile") == 0)
++av;
else if (!(strncmp ((a), ("--file="), (7)) == 0)
&& !(strncmp ((a), ("--makefile="), (11)) == 0))
continue;
if (mfidx == stdin_offset)
{
char *na = __builtin_alloca ((sizeof ("--temp-stdin=")-1)
+ strlen (mf) + 1);
sprintf (na, "--temp-stdin=%s", mf);
*nv = na;
}
else
{
char *na = __builtin_alloca (strlen (mf) + 3);
sprintf (na, "-f%s", mf);
*nv = na;
}
++mfidx;
continue;
}
f = strchr (a, 'f');
if (!f)
continue;
if (f[1] == '\0')
++av;
if (mfidx == stdin_offset)
{
const size_t al = f - a;
char *na;
if (al > 1)
{
na = __builtin_alloca (al + 1);
memcpy (na, a, al);
na[al] = '\0';
*(nv++) = na;
}
na = __builtin_alloca ((sizeof ("--temp-stdin=")-1) + strlen (mf) + 1);
sprintf (na, "--temp-stdin=%s", mf);
*nv = na;
}
else if (f[1] == '\0')
*(++nv) = mf;
else
{
const size_t al = f - a + 1;
const size_t ml = strlen (mf) + 1;
char *na = __builtin_alloca (al + ml);
memcpy (na, a, al);
memcpy (na + al, mf, ml);
*nv = na;
}
++mfidx;
}
*nv = ((void *)0);
}
if (directories != 0 && directories->idx > 0)
{
int bad = 1;
if (directory_before_chdir != 0)
{
if (chdir (directory_before_chdir) < 0)
perror_with_name ("chdir", "");
else
bad = 0;
}
if (bad)
fatal((((floc *)0)), 0, (gettext ("Couldn't change back to original directory")));
}
++restarts;
if ((((0x001))&db_level))
{
const char **p;
printf (gettext ("Re-executing[%u]:"), restarts);
for (p = nargv; *p != 0; ++p)
printf (" %s", *p);
putchar ('\n');
fflush (stdout);
}
{
char **p;
for (p = environ; *p != 0; ++p)
{
if ((strncmp ((*p), ("MAKELEVEL" "="), (((sizeof ("MAKELEVEL")-1))+1)) == 0))
{
*p = __builtin_alloca (40);
sprintf (*p, "%s=%u", "MAKELEVEL", makelevel);
}
else if ((strncmp ((*p), ("MAKE_RESTARTS="), ((sizeof ("MAKE_RESTARTS=")-1))) == 0))
{
*p = __builtin_alloca (40);
sprintf (*p, "MAKE_RESTARTS=%s%u",
(!!stdio_traced) ? "-" : "", restarts);
restarts = 0;
}
}
}
if (restarts)
{
char *b = __builtin_alloca (40);
sprintf (b, "MAKE_RESTARTS=%s%u",
(!!stdio_traced) ? "-" : "", restarts);
putenv (b);
}
fflush (stdout);
fflush (stderr);
osync_clear();
jobserver_pre_child(1);
exec_command ((char **)nargv, environ);
jobserver_post_child(1);
temp_stdin_unlink ();
_exit (127);
}
if (any_failed)
die (2);
}
define_makeflags (0);
always_make_flag = always_make_set;
if (restarts && new_files != 0)
{
const char **p;
for (p = new_files->list; *p != 0; ++p)
{
struct file *f = enter_file (*p);
f->last_mtime = f->mtime_before_update = (~ (uintmax_t) 0 - (! ((uintmax_t) -1 <= 0) ? (uintmax_t) 0 : ~ (uintmax_t) 0 << (sizeof (uintmax_t) * 8 - 1)));
}
}
temp_stdin_unlink ();
if (goals == 0)
{
char *p;
if (default_goal_var->recursive)
p = variable_expand (default_goal_var->value);
else
{
p = variable_buffer_output (variable_buffer, default_goal_var->value,
strlen (default_goal_var->value));
*p = '\0';
p = variable_buffer;
}
if (*p != '\0')
{
struct file *f = lookup_file (p);
if (f == 0)
{
struct nameseq *ns;
ns = (struct nameseq *)parse_file_seq ((&p),sizeof (struct nameseq),0x0001,((void *)0),0x0000);
if (ns)
{
if (ns->next != 0)
fatal((((floc *)0)), 0, (gettext (".DEFAULT_GOAL contains more than one target")));
f = enter_file (strcache_add (ns->name));
ns->name = 0;
free_ns_chain (ns);
}
}
if (f)
{
goals = xcalloc (sizeof (struct goaldep));
goals->file = f;
}
}
}
else
lastgoal->next = 0;
if (!goals)
{
struct variable *v = lookup_variable (("MAKEFILE_LIST"), (sizeof ("MAKEFILE_LIST")-1));
if (v && v->value && v->value[0] != '\0')
fatal((((floc *)0)), 0, (gettext ("No targets")));
fatal((((floc *)0)), 0, (gettext ("No targets specified and no makefile found")));
}
do{ shuffle_deps_recursive ((struct dep *)goals); } while(0);
do{ if((((0x001))&db_level)) {printf (gettext ("Updating goal targets....\n")); fflush (stdout);} }while(0);
{
switch (update_goal_chain (goals))
{
case us_none:
case us_success:
break;
case us_question:
makefile_status = 1;
break;
case us_failed:
makefile_status = 2;
break;
}
if (clock_skew_detected)
error((((floc *)0)), 0, (gettext ("warning: Clock skew detected. Your build may be incomplete.")));
die (makefile_status);
}
exit (0);
}
| {
"array_type": 10,
"break_continue_statement": 12,
"enum_type": 2,
"for_loop": 17,
"function_pointer": 0,
"goto_statement": 2,
"if_statement": 127,
"memory_management": 6,
"memory_operation": 3,
"pointer_type": 27,
"return_statement": 0,
"struct_type": 23,
"switch_statement": 2,
"type_casting": 31,
"union_type": 0,
"while_loop": 18
} |
transcoder-set#FIND_INDEX_GIVEN_FIBONACCI_NUMBER_CONSTANT_TIME_1_prep#sort.c | transcoder-set | FIND_INDEX_GIVEN_FIBONACCI_NUMBER_CONSTANT_TIME_1.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
} |
mtools-4.0.43#mtools_prep#helpFlag.c | mtools-4.0.43 | mtools.c | helpFlag | 3 | int helpFlag(int argc, char **argv) {
return (argc > 1 && !strcmp(argv[1], "--help"));
}
| {
"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": 0,
"union_type": 0,
"while_loop": 0
} |
make-4.4.1#commands_prep#delete_child_targets.c | make-4.4.1 | commands.c | delete_child_targets | 11 | void
delete_child_targets (struct child *child)
{
struct dep *d;
if (child->deleted || child->pid < 0)
return;
delete_target (child->file, ((void *)0));
for (d = child->file->also_make; d != 0; d = d->next)
delete_target (d->file, child->file->name);
child->deleted = 1;
}
| {
"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": 2,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#FIND_SUM_MODULO_K_FIRST_N_NATURAL_NUMBER_1_prep#sort.c | transcoder-set | FIND_SUM_MODULO_K_FIRST_N_NATURAL_NUMBER_1.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
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.