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_xmlReaderNewDoc.c
libxml2
libxml2-py.c
libxml_xmlReaderNewDoc
17
PyObject * libxml_xmlReaderNewDoc(PyObject *self __attribute__ ((__unused__)), PyObject *args) { PyObject *py_retval; int c_retval; xmlTextReaderPtr reader; PyObject *pyobj_reader; xmlChar * cur; char * URL; char * encoding; int options; if (!_PyArg_ParseTuple_SizeT(args, (char *)"Ozzzi:xmlReaderNewDoc", &pyobj_reader, &cur, &URL, &encoding, &options)) return(((void *)0)); reader = (xmlTextReaderPtr) (((pyobj_reader) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyxmlTextReader_Object *)(pyobj_reader))->obj)); c_retval = xmlReaderNewDoc(reader, cur, URL, encoding, options); 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 }
transcoder-set#WAYS_TRANSFORMING_ONE_STRING_REMOVING_0_CHARACTERS_prep#f_filled.c
transcoder-set
WAYS_TRANSFORMING_ONE_STRING_REMOVING_0_CHARACTERS.c
f_filled
1
int f_filled ( char a [], char b [] ) {}
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 0, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 0, "struct_type": 0, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
pth-2.0.7#pth_lib_prep#__pth_thread_exists.c
pth-2.0.7
pth_lib.c
__pth_thread_exists
10
int __pth_thread_exists(pth_t t) { if (!__pth_pqueue_contains(&__pth_NQ, t)) if (!__pth_pqueue_contains(&__pth_RQ, t)) if (!__pth_pqueue_contains(&__pth_WQ, t)) if (!__pth_pqueue_contains(&__pth_SQ, t)) if (!__pth_pqueue_contains(&__pth_DQ, t)) return ((*__errno_location ()) = (3), ((0))); return (!(0)); }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 5, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 2, "struct_type": 0, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
tmux#arguments_prep#args_get.c
tmux
arguments.c
args_get
8
const char * args_get(struct args *args, u_char ch) { struct args_entry *entry; if ((entry = args_find(args, ch)) == ((void *)0)) return (((void *)0)); return (entry->value); }
{ "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": 2, "switch_statement": 0, "type_casting": 2, "union_type": 0, "while_loop": 0 }
transcoder-set#PROGRAM_FIND_SLOPE_LINE_prep#f_gold.c
transcoder-set
PROGRAM_FIND_SLOPE_LINE.c
f_gold
3
float f_gold ( float x1, float y1, float x2, float y2 ) { return ( y2 - y1 ) / ( x2 - x1 ); }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 0, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
gprolog-1.5.0#ma2asm_prep#Invoke_Dico_Double.c
gprolog-1.5.0
ma2asm.c
Invoke_Dico_Double
8
void Invoke_Dico_Double(int no, char *str, void *info) { DoubleInf *d = (DoubleInf *) info; if (comment) Inst_Printf("", "%s %s", mi.comment_prefix, d->cmt_str); Dico_Double(d); }
{ "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 }
bc-1.07.1#scan_prep#yyrestart.c
bc-1.07.1
scan.c
yyrestart
10
void yyrestart (FILE * input_file ) { if ( ! ( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)] : ((void *)0)) ){ yyensure_buffer_stack (); (yy_buffer_stack)[(yy_buffer_stack_top)] = yy_create_buffer(yyin,16384 ); } yy_init_buffer(( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)] : ((void *)0)),input_file ); yy_load_buffer_state( ); }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 1, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 0, "struct_type": 0, "switch_statement": 0, "type_casting": 2, "union_type": 0, "while_loop": 0 }
transcoder-set#COUNT_CHARACTERS_STRING_DISTANCE_ENGLISH_ALPHABETS_prep#min.c
transcoder-set
COUNT_CHARACTERS_STRING_DISTANCE_ENGLISH_ALPHABETS.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 }
libcsv#libcsv_prep#csv_set_space_func.c
libcsv
libcsv.c
csv_set_space_func
5
void csv_set_space_func(struct csv_parser *p, int (*f)(unsigned char)) { if (p) p->is_space = f; }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 1, "goto_statement": 0, "if_statement": 1, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 0, "struct_type": 1, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
dap-3.10#sbstrans3_prep#surveyselecttrans.c
dap-3.10
sbstrans3.c
surveyselecttrans
23
void surveyselecttrans(char *step, FILE *dapfile) { int s; int brace; int start; int resplen; int replace=0; static char nbtirage[127 + 1]; static char setname[127 + 1]; static char datafile[127 + 1]; static char method[127 + 1]; static char strreplace[127 + 1]; static char getnames[4]; if (!getoption(step, "out", setname, 1)) strcpy(setname, sbstmp); if (!getoption(step, "data", datafile, 1)) strcpy(datafile, sbstmp); if (!getoption(step, "method", method, 1)) strcpy(method, sbstmp); if (!getoption(step, "n", nbtirage, 1)) strcpy(nbtirage, "1"); fprintf(dapfile, " surveyselect(\"%s\", \"%s\" , \"%s\",%s);\n", datafile,setname,method,nbtirage); }
{ "array_type": 1, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 4, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 0, "struct_type": 0, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
dap-3.10#dap_prep#ecopy.c
dap-3.10
dap.c
ecopy
15
char *ecopy(char *e) { char *copy; if (e) { if (!(copy = malloc(strlen(e) + 1))) { perror("dap"); exit(1); } strcpy(copy, e); return copy; } return ((void *)0); }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 2, "memory_management": 1, "memory_operation": 0, "pointer_type": 1, "return_statement": 2, "struct_type": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
transcoder-set#FIND_VALUE_OF_Y_MOD_2_RAISED_TO_POWER_X_prep#f_gold.c
transcoder-set
FIND_VALUE_OF_Y_MOD_2_RAISED_TO_POWER_X.c
f_gold
5
long long int f_gold ( long long int y, long long int x ) { if ( log2 ( y ) < x ) return y; if ( x > 63 ) return y; return ( y % ( 1 << x ) ); }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 2, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 3, "struct_type": 0, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
transcoder-set#HOW_TO_CHECK_IF_A_GIVEN_ARRAY_REPRESENTS_A_BINARY_HEAP_1_prep#main.c
transcoder-set
HOW_TO_CHECK_IF_A_GIVEN_ARRAY_REPRESENTS_A_BINARY_HEAP_1.c
main
25
int main(void) { int n_success = 0; int param0_0[] = {2,2,2,7,10,14,24,38,42,50,59,60,72,73,79,83,89}; int param0_1[] = {-48,98,96,-56,-2,58,52,-50,58,50,62,86,-26,-98,34,20,-28,56,-36}; int param0_2[] = {0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; int param0_3[] = {91,50,37}; int param0_4[] = {-80,-26,0,0,6,14,22,76,82,88,98}; int param0_5[] = {1,0}; int param0_6[] = {9,24,24,33,48,50,55,61,69,79,83}; int param0_7[] = {30,32,-82,-48,88,-24,74,2,90,98,68,82,32,-60,2,-94,18,14,46,50,-60,-74,-76,66,-76,-34,-20,82,-44,-62,34,48,-56,2,64,-78,-64,98,-10,-28,78,-42}; int param0_8[] = {0,0,1,1,1,1,1,1,1,1,1,1}; int param0_9[] = {38,74,99,75,44,75,24,70,78,74,60,59,34,27,7,23,19,95,4,35,38,22,46,1,44,20,52,1,96,57,5,76,49,1,37,35}; 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[] = {9,9,20,2,10,1,8,27,6,31}; 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": 1, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
wget-1.21.4#connect_prep#fd_close.c
wget-1.21.4
connect.c
fd_close
20
void fd_close (int fd) { struct transport_info *info; if (fd < 0) return; info = ((void *)0); if (transport_map) info = hash_table_get (transport_map, (void *)(intptr_t) fd); if (info && info->imp->closer) info->imp->closer (fd, info->ctx); else sock_close (fd); if (info) { hash_table_remove (transport_map, (void *)(intptr_t) fd); do { free ((void *) (info)); info = ((void *)0); } while (0); ++transport_map_modified_tick; } }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 4, "memory_management": 1, "memory_operation": 0, "pointer_type": 1, "return_statement": 1, "struct_type": 1, "switch_statement": 0, "type_casting": 4, "union_type": 0, "while_loop": 1 }
tar-1.34#getopt_prep#rpl_getopt_internal.c
tar-1.34
getopt.c
rpl_getopt_internal
16
int rpl_getopt_internal (int argc, char **argv, const char *optstring, const struct rpl_option *longopts, int *longind, int long_only, int posixly_correct) { int result; getopt_data.rpl_optind = rpl_optind; getopt_data.rpl_opterr = rpl_opterr; result = _getopt_internal_r (argc, argv, optstring, longopts, longind, long_only, &getopt_data, posixly_correct); rpl_optind = getopt_data.rpl_optind; rpl_optarg = getopt_data.rpl_optarg; rpl_optopt = getopt_data.rpl_optopt; 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": 0, "union_type": 0, "while_loop": 0 }
transcoder-set#SCHEDULE_JOBS_SERVER_GETS_EQUAL_LOAD_prep#max.c
transcoder-set
SCHEDULE_JOBS_SERVER_GETS_EQUAL_LOAD.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 }
cpio-2.14#util_prep#cpio_file_stat_free.c
cpio-2.14
util.c
cpio_file_stat_free
6
void cpio_file_stat_free (struct cpio_file_stat *file_hdr) { free (file_hdr->c_name); cpio_file_stat_init (file_hdr); }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 0, "memory_management": 1, "memory_operation": 0, "pointer_type": 0, "return_statement": 0, "struct_type": 1, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
transcoder-set#FIND_LARGEST_PRIME_FACTOR_NUMBER_prep#main.c
transcoder-set
FIND_LARGEST_PRIME_FACTOR_NUMBER.c
main
14
int main(void) { int n_success = 0; long param0[] = {98,8,78,65,55,10,10,37,39,15}; for(int i = 0; i < len(param0); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } break; } printf("#Results:", " ", n_success, ", ", len(param0)); return 0; }
{ "array_type": 1, "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 }
gprolog-1.5.0#bc_supp_prep#Pl_BC_Emulate_Cont_0.c
gprolog-1.5.0
bc_supp.c
Pl_BC_Emulate_Cont_0
10
WamCont Pl_BC_Emulate_Cont_0(void) { WamCont codep; BCWord *bc; debug_call = (((WamWord *) pl_reg_bank)[256 +6]) & 1; bc = (BCWord *) (((((WamWord *) pl_reg_bank)[256 +6]) >> 1) << 1); codep = BC_Emulate_Byte_Code(bc); return (codep) ? codep : Pl_BC_Emulate_Pred(glob_func, glob_dyn); }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 0, "memory_management": 0, "memory_operation": 0, "pointer_type": 1, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
gprolog-1.5.0#arith_inl_c_prep#Pl_Fct_Float_Fract_Part.c
gprolog-1.5.0
arith_inl_c.c
Pl_Fct_Float_Fract_Part
5
WamWord Pl_Fct_Float_Fract_Part(WamWord x) { double d; if ((((PlLong) (x) & ((PlULong)0x7)) == (PlULong)0x7)) { Pl_Err_Type(pl_type_float, x); return x; } else d = Pl_Obtain_Float(((WamWord *) ((x) & (PlULong)0xfffffffffffffff8))); return Make_Tagged_Float(((d) - (((d) > 0) ? floor(d) : ceil(d)))); }
{ "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 }
libxml2#list_prep#xmlListPopBack.c
libxml2
list.c
xmlListPopBack
6
void xmlListPopBack(xmlListPtr l) { if(!xmlListEmpty(l)) xmlLinkDeallocator(l, l->sentinel->prev); }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 1, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 0, "struct_type": 0, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
transcoder-set#COUNT_PAIRS_DIFFERENCE_EQUAL_K_1_prep#main.c
transcoder-set
COUNT_PAIRS_DIFFERENCE_EQUAL_K_1.c
main
26
int main(void) { int n_success = 0; int param0_0[] = {5,5,10,19,29,32,40,60,65,70,72,89,92}; int param0_1[] = {-38,40,8,64,-38,56,4,8,84,60,-48,-78,-82,-88,-30,58,-58,62,-52,-98,24,22,14,68,-74,48,-56,-72,-90,26,-10,58,40,36,-80,68,58,-74,-46,-62,-12,74,-58}; int param0_2[] = {0,0,1}; int param0_3[] = {16,80,59,29,14,44,13,76,7,65,62,1,34,49,70,96,73,71,42,73,66,96}; int param0_4[] = {-98,-88,-58,-56,-48,-34,-22,-18,-14,-14,-8,-4,-2,2,18,38,42,46,54,68,70,90,94,96,98}; int param0_5[] = {0,1,1}; int param0_6[] = {11,43,50,58,60,68,75}; int param0_7[] = {86,94,-80,0,52,-56,42,88,-10,24,6,8}; int param0_8[] = {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}; int param0_9[] = {54,99,4,14,9,34,81,36,80,50,34,9,7}; 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[] = {7,24,1,12,23,2,4,11,29,9}; int param2[] = {12,36,1,16,22,1,4,9,30,8}; 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 }
transcoder-set#BIN_PACKING_PROBLEM_MINIMIZE_NUMBER_OF_USED_BINS_prep#max.c
transcoder-set
BIN_PACKING_PROBLEM_MINIMIZE_NUMBER_OF_USED_BINS.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 }
nano-7.2#prompt_prep#do_statusbar_end.c
nano-7.2
prompt.c
do_statusbar_end
4
void do_statusbar_end(void) { typing_x = strlen(answer); }
{ "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#SMALLEST_POWER_OF_2_GREATER_THAN_OR_EQUAL_TO_N_1_prep#f_gold.c
transcoder-set
SMALLEST_POWER_OF_2_GREATER_THAN_OR_EQUAL_TO_N_1.c
f_gold
6
unsigned int f_gold ( unsigned int n ) { unsigned int p = 1; if ( n && ! ( n & ( n - 1 ) ) ) return n; while ( p < n ) p <<= 1; return p; }
{ "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": 1 }
cflow-1.7#symbol_prep#first_starter.c
cflow-1.7
symbol.c
first_starter
15
Symbol * first_starter(void *itr) { struct linked_list_entry *p = ((start_symbol_list) ? (start_symbol_list)->head : ((void *)0)); while (p) { Symbol *sym = p->data; if (sym->type != SymUndefined) { *(void**)itr = p->next; return sym; } p = p->next; } *(void**)itr = ((void *)0); return ((void *)0); }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 1, "memory_management": 0, "memory_operation": 0, "pointer_type": 2, "return_statement": 2, "struct_type": 1, "switch_statement": 0, "type_casting": 3, "union_type": 0, "while_loop": 1 }
transcoder-set#FIND_INDEX_GIVEN_FIBONACCI_NUMBER_CONSTANT_TIME_prep#min.c
transcoder-set
FIND_INDEX_GIVEN_FIBONACCI_NUMBER_CONSTANT_TIME.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 }
pth-2.0.7#pth_high_prep#pth_accept_ev.c
pth-2.0.7
pth_high.c
pth_accept_ev
39
int pth_accept_ev(int s, struct sockaddr *addr, socklen_t *addrlen, pth_event_t ev_extra) { pth_event_t ev; static pth_key_t ev_key = (-1); int fdmode; int rv; if (!__pth_initialized) pth_init();; ; if (!__pth_util_fd_valid(s)) return ((*__errno_location ()) = (9), (-1)); if ((fdmode = pth_fdmode(s, PTH_FDMODE_NONBLOCK)) == PTH_FDMODE_ERROR) return ((*__errno_location ()) = (9), (-1)); ev = ((void *)0); while ((rv = accept(s, addr, addrlen)) == -1 && ((*__errno_location ()) == 11 || (*__errno_location ()) == 11) && fdmode != PTH_FDMODE_NONBLOCK) { if (ev == ((void *)0)) { if ((ev = pth_event((1<<(1))|(1<<(12))|(1<<(22)), &ev_key, s)) == ((void *)0)) return ((*__errno_location ()) = ((*__errno_location ())), (-1)); if (ev_extra != ((void *)0)) pth_event_concat(ev, ev_extra, ((void *)0)); } pth_wait(ev); if (ev_extra != ((void *)0)) { pth_event_isolate(ev); if (pth_event_status(ev) != PTH_STATUS_OCCURRED) { pth_fdmode(s, fdmode); return ((*__errno_location ()) = (4), (-1)); } } } for ( __pth_errno_storage = (*__errno_location ()), __pth_errno_flag = (!(0)); __pth_errno_flag; (*__errno_location ()) = __pth_errno_storage, __pth_errno_flag = (0) ) { pth_fdmode(s, fdmode); if (rv != -1) pth_fdmode(rv, fdmode); } ; return rv; }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 1, "function_pointer": 0, "goto_statement": 0, "if_statement": 9, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 5, "struct_type": 1, "switch_statement": 0, "type_casting": 6, "union_type": 0, "while_loop": 1 }
indent-2.2.13#code_io_prep#skip_horiz_space.c
indent-2.2.13
code_io.c
skip_horiz_space
9
extern char * skip_horiz_space( const char * p) { while ((*p == ' ') || (*p == '\t')) { p++; } return (char *)p; }
{ "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": 1 }
libxml2#libxml2-py_prep#libxml_xmlReconciliateNs.c
libxml2
libxml2-py.c
libxml_xmlReconciliateNs
16
PyObject * libxml_xmlReconciliateNs(PyObject *self __attribute__ ((__unused__)), PyObject *args) { PyObject *py_retval; int c_retval; xmlDocPtr doc; PyObject *pyobj_doc; xmlNodePtr tree; PyObject *pyobj_tree; if (!_PyArg_ParseTuple_SizeT(args, (char *)"OO:xmlReconciliateNs", &pyobj_doc, &pyobj_tree)) return(((void *)0)); doc = (xmlDocPtr) (((pyobj_doc) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyxmlNode_Object *)(pyobj_doc))->obj)); tree = (xmlNodePtr) (((pyobj_tree) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyxmlNode_Object *)(pyobj_tree))->obj)); c_retval = xmlReconciliateNs(doc, tree); 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": 3, "return_statement": 2, "struct_type": 0, "switch_statement": 0, "type_casting": 5, "union_type": 0, "while_loop": 0 }
patch-2.7.6#quotearg_prep#quote_mem.c
patch-2.7.6
quotearg.c
quote_mem
5
char const * quote_mem (char const *arg, size_t argsize) { return quote_n_mem (0, arg, argsize); }
{ "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#COUNT_PAIRS_DIFFERENCE_EQUAL_K_1_prep#len.c
transcoder-set
COUNT_PAIRS_DIFFERENCE_EQUAL_K_1.c
len
1
int len (int arr [ ]) {return ((int) (sizeof (arr) / sizeof (arr)[0]));}
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 0, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
libxml2#parserInternals_prep#xmlCtxtNewInputFromIO.c
libxml2
parserInternals.c
xmlCtxtNewInputFromIO
17
xmlParserInputPtr xmlCtxtNewInputFromIO(xmlParserCtxtPtr ctxt, const char *url, xmlInputReadCallback ioRead, xmlInputCloseCallback ioClose, void *ioCtxt, const char *encoding, int flags) { xmlParserInputPtr input; if ((ctxt == ((void *)0)) || (ioRead == ((void *)0))) return(((void *)0)); input = xmlNewInputFromIO(url, ioRead, ioClose, ioCtxt, flags); if (input == ((void *)0)) { xmlCtxtErrMemory(ctxt); return(((void *)0)); } if (encoding != ((void *)0)) xmlSwitchInputEncodingName(ctxt, input, encoding); return(input); }
{ "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": 5, "union_type": 0, "while_loop": 0 }
tar-1.34#extract_prep#rename_directory.c
tar-1.34
extract.c
rename_directory
28
_Bool rename_directory (char *src, char *dst) { if (renameat (chdir_fd, src, chdir_fd, dst) == 0) fixup_delayed_set_stat (src, dst); else { int e = (*__errno_location ()); _Bool interdir_made; switch (e) { case 2: if (make_directories (dst, &interdir_made) == 0) { if (renameat (chdir_fd, src, chdir_fd, dst) == 0) return 1; e = (*__errno_location ()); } break; case 18: default: break; } do { if (error_hook) error_hook (); error (0, e, gettext ("Cannot rename %s to %s"), quote_n (0, src), quote_n (1, dst)); exit_status = 2; } while (0); return 0; } return 1; }
{ "array_type": 0, "break_continue_statement": 2, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 4, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 3, "struct_type": 0, "switch_statement": 1, "type_casting": 0, "union_type": 0, "while_loop": 1 }
transcoder-set#PRIMALITY_TEST_SET_5USING_LUCAS_LEHMER_SERIES_prep#sort.c
transcoder-set
PRIMALITY_TEST_SET_5USING_LUCAS_LEHMER_SERIES.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 }
optipng-0.7.8#pnmin_prep#pnm_fget_bytes.c
optipng-0.7.8
pnmin.c
pnm_fget_bytes
65
int pnm_fget_bytes(const pnm_struct *pnm_ptr, unsigned char *sample_bytes, size_t sample_size, unsigned int num_rows, FILE *stream) { unsigned int format = pnm_ptr->format; unsigned int depth = pnm_ptr->depth; unsigned int width = pnm_ptr->width; unsigned int maxval = pnm_ptr->maxval; size_t row_length = (size_t)depth * (size_t)width; size_t num_samples = num_rows * row_length; size_t raw_sample_size; int ch, mask; size_t i, j; if (maxval <= 0xffU) raw_sample_size = 1; else if (maxval <= 0xffffU) raw_sample_size = 2; else if (maxval <= 0xffffffU) raw_sample_size = 3; else if (maxval <= 0xffffffffU) raw_sample_size = 4; else raw_sample_size = !sample_size; if (raw_sample_size != sample_size) { (*__errno_location ()) = 22; return 0; } switch (format) { case PNM_P4: for (i = j = 0; i < num_samples; ) { ch = getc(stream); if (ch == (-1)) break; for (mask = 0x80; mask != 0; mask >>= 1) { sample_bytes[i++] = (unsigned char)((ch & mask) ? 0 : 1); if (++j == row_length) { j = 0; break; } } } break; case PNM_P5: case PNM_P6: case PNM_P7: i = fread(sample_bytes, sample_size, num_samples, stream); break; default: (*__errno_location ()) = 22; return 0; } if (i < num_samples) { memset(sample_bytes + i, 0, sample_size * num_samples - i); return -1; } return 1; }
{ "array_type": 0, "break_continue_statement": 4, "enum_type": 0, "for_loop": 2, "function_pointer": 0, "goto_statement": 0, "if_statement": 8, "memory_management": 0, "memory_operation": 1, "pointer_type": 0, "return_statement": 4, "struct_type": 0, "switch_statement": 1, "type_casting": 1, "union_type": 0, "while_loop": 0 }
less-633#ch_prep#ch_length.c
less-633
ch.c
ch_length
12
POSITION ch_length(void) { if (thisfile == ((void *)0)) return (((POSITION)(-1))); if (ignore_eoi) return (((POSITION)(-1))); if (thisfile->flags & 010) return (size_helpdata); if (thisfile->flags & 020) return (0); return (thisfile->fsize); }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 4, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 5, "struct_type": 0, "switch_statement": 0, "type_casting": 2, "union_type": 0, "while_loop": 0 }
gprolog-1.5.0#hash_fct_prep#Pl_Hash_Incr_Init.c
gprolog-1.5.0
hash_fct.c
Pl_Hash_Incr_Init
6
void Pl_Hash_Incr_Init(HashIncrInfo *hi) { hi->len = 0; hi->hash = Hash_Initialize(); }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 0, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 0, "struct_type": 0, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
transcoder-set#CHECK_WHETHER_GIVEN_NUMBER_EVEN_ODD_prep#cmpfunc.c
transcoder-set
CHECK_WHETHER_GIVEN_NUMBER_EVEN_ODD.c
cmpfunc
1
int cmpfunc (const void * a, const void * b) {return ( *(int*)a - *(int*)b );}
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 0, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
tulipindicators-0.9.1#adosc_prep#ti_adosc.c
tulipindicators-0.9.1
adosc.c
ti_adosc
35
int ti_adosc(int size, double const *const *inputs, double const *options, double *const *outputs) { const double *high = inputs[0]; const double *low = inputs[1]; const double *close = inputs[2]; const double *volume = inputs[3]; const int short_period = (int)options[0]; const int long_period = (int)options[1]; const int start = long_period - 1; if (short_period < 1) return 1; if (long_period < short_period) return 1; if (size <= ti_adosc_start(options)) return 0; const double short_per = 2 / ((double)short_period + 1); const double long_per = 2 / ((double)long_period + 1); double *output = outputs[0]; double sum = 0, short_ema = 0, long_ema = 0; int i; for (i = 0; i < size; ++i) { const double hl = (high[i] - low[i]); if (hl != 0.0) { sum += (close[i] - low[i] - high[i] + close[i]) / hl * volume[i]; } if (i == 0) { short_ema = sum; long_ema = sum; } else { short_ema = (sum-short_ema) * short_per + short_ema; long_ema = (sum-long_ema) * long_per + long_ema; } if (i >= start) { *output++ = short_ema - long_ema; } } ((void) sizeof ((output - outputs[0] == size - ti_adosc_start(options)) ? 1 : 0), __extension__ ({ if (output - outputs[0] == size - ti_adosc_start(options)) ; else __assert_fail ("output - outputs[0] == size - ti_adosc_start(options)", "indicators/adosc.c", 73, __extension__ __PRETTY_FUNCTION__); })); return 0; }
{ "array_type": 7, "break_continue_statement": 0, "enum_type": 0, "for_loop": 1, "function_pointer": 0, "goto_statement": 0, "if_statement": 7, "memory_management": 0, "memory_operation": 0, "pointer_type": 5, "return_statement": 4, "struct_type": 0, "switch_statement": 0, "type_casting": 5, "union_type": 0, "while_loop": 0 }
cflow-1.7#symbol_prep#install_ident.c
cflow-1.7
symbol.c
install_ident
10
Symbol * install_ident(char *name, enum storage storage) { Symbol *sp; sp = install(name, storage != AutoStorage ? 0x02 : 0x00); init_ident(sp, storage); return sp; }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 1, "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": 0 }
tmux#xchecks_prep#__c2rust_hash_event_base_struct.c
tmux
xchecks.c
__c2rust_hash_event_base_struct
3
uint64_t __c2rust_hash_event_base_struct(void *l, size_t depth) { return 0xABCD0005; }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 0, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
snudown#buffer_prep#bufprefix.c
snudown
buffer.c
bufprefix
13
int bufprefix(const struct buf *buf, const char *prefix) { size_t i; ((void) sizeof ((buf && buf->unit) ? 1 : 0), __extension__ ({ if (buf && buf->unit) ; else __assert_fail ("buf && buf->unit", "buffer.c", 33, __extension__ __PRETTY_FUNCTION__); })); for (i = 0; i < buf->size; ++i) { if (prefix[i] == 0) return 0; if (buf->data[i] != prefix[i]) return buf->data[i] - prefix[i]; } return 0; }
{ "array_type": 2, "break_continue_statement": 0, "enum_type": 0, "for_loop": 1, "function_pointer": 0, "goto_statement": 0, "if_statement": 3, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 3, "struct_type": 1, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
heman#draw_prep#heman_draw_points.c
heman
draw.c
heman_draw_points
18
void heman_draw_points(heman_image* target, heman_points* pts, float val) { float* src = pts->data; for (int k = 0; k < pts->width; k++) { float x = src[0]; float y = src[1]; src += pts->nbands; int i = x * target->width; int j = y * target->height; if (i < 0 || i >= target->width || j < 0 || j >= target->height) { continue; } float* texel = heman_image_texel(target, i, j); for (int c = 0; c < target->nbands; c++) { *texel++ = val; } } }
{ "array_type": 1, "break_continue_statement": 1, "enum_type": 0, "for_loop": 2, "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 }
transcoder-set#COUNT_NUMBER_WAYS_REACH_GIVEN_SCORE_GAME_prep#f_filled.c
transcoder-set
COUNT_NUMBER_WAYS_REACH_GIVEN_SCORE_GAME.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 }
nettle-3.9.1#eax_prep#nettle_eax_set_nonce.c
nettle-3.9.1
eax.c
nettle_eax_set_nonce
12
void nettle_eax_set_nonce (struct eax_ctx *eax, const struct eax_key *key, const void *cipher, nettle_cipher_func *f, size_t nonce_length, const uint8_t *nonce) { omac_init (&eax->omac_nonce, 0); omac_update (&eax->omac_nonce, key, cipher, f, nonce_length, nonce); omac_final (&eax->omac_nonce, key, cipher, f); memcpy (eax->ctr.b, eax->omac_nonce.b, 16); omac_init (&eax->omac_data, 1); omac_init (&eax->omac_message, 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": 1, "pointer_type": 0, "return_statement": 0, "struct_type": 1, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
tmux#tty_prep#tty_putn.c
tmux
tty.c
tty_putn
13
void tty_putn(struct tty *tty, const void *buf, size_t len, u_int width) { tty_add(tty, buf, len); if (tty->cx + width > tty->sx) { tty->cx = (tty->cx + width) - tty->sx; if (tty->cx <= tty->sx) tty->cy++; else tty->cx = tty->cy = (0x7fffffff * 2U + 1U); } else tty->cx += width; }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 2, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 0, "struct_type": 1, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
transcoder-set#NEXT_POWER_OF_2_2_prep#cmpfunc.c
transcoder-set
NEXT_POWER_OF_2_2.c
cmpfunc
1
int cmpfunc (const void * a, const void * b) {return ( *(int*)a - *(int*)b );}
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 0, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
optipng-0.7.8#bitset_prep#opng_bitset_find_last.c
optipng-0.7.8
bitset.c
opng_bitset_find_last
11
int opng_bitset_find_last(opng_bitset_t set) { int i; for (i = OPNG_BITSET_ELT_MAX; i >= 0; --i) { if ((((set) & (1U << (i))) != 0)) return i; } return -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": 0, "return_statement": 2, "struct_type": 0, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
cpio-2.14#paxexit_prep#pax_exit.c
cpio-2.14
paxexit.c
pax_exit
5
void pax_exit () { exit (exit_status); }
{ "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 }
cpio-2.14#copypass_prep#link_to_maj_min_ino.c
cpio-2.14
copypass.c
link_to_maj_min_ino
18
int link_to_maj_min_ino (char *file_name, int st_dev_maj, int st_dev_min, ino_t st_ino) { int link_res; char *link_name; link_res = -1; link_name = find_inode_file (st_ino, st_dev_maj, st_dev_min); if (link_name == ((void *)0)) add_inode (st_ino, file_name, st_dev_maj, st_dev_min); else link_res = link_to_name (file_name, link_name); return link_res; }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 1, "memory_management": 0, "memory_operation": 0, "pointer_type": 1, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
wget-1.21.4#progress_prep#progress_update.c
wget-1.21.4
progress.c
progress_update
12
void progress_update (void *progress, wgint howmuch, double dltime) { if (dltime >= 0x7fffffff) dltime = 0x7fffffff - 1; else if (dltime < 0) dltime = 0; if (howmuch < 0) howmuch = 0; current_impl->update (progress, howmuch, dltime); current_impl->draw (progress); }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 3, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 0, "struct_type": 0, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
nettle-3.9.1#gcm-aes192_prep#nettle_gcm_aes192_digest.c
nettle-3.9.1
gcm-aes192.c
nettle_gcm_aes192_digest
6
void nettle_gcm_aes192_digest(struct gcm_aes192_ctx *ctx, size_t length, uint8_t *digest) { (0 ? (nettle_aes192_encrypt)(&(ctx)->cipher, ~(size_t) 0, (uint8_t *) 0, (const uint8_t *) 0) : nettle_gcm_digest(&(ctx)->gcm, &(ctx)->key, &(ctx)->cipher, (nettle_cipher_func *) (nettle_aes192_encrypt), (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": 1, "union_type": 0, "while_loop": 0 }
tulipindicators-0.9.1#tiamalgamation_prep#ti_ppo_start.c
tulipindicators-0.9.1
tiamalgamation.c
ti_ppo_start
4
int ti_ppo_start(double const *options) { (void)options; return 1; }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 0, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
gprolog-1.5.0#wam_inst_prep#Pl_Put_Y_Variable.c
gprolog-1.5.0
wam_inst.c
Pl_Put_Y_Variable
5
WamWord Pl_Put_Y_Variable(WamWord *y_adr) { return *y_adr = (((PlLong) (y_adr) + ((PlULong)0))); }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 0, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
libxml2#xpath_prep#xmlXPathFunctionLookupNS.c
libxml2
xpath.c
xmlXPathFunctionLookupNS
24
xmlXPathFunction xmlXPathFunctionLookupNS(xmlXPathContextPtr ctxt, const xmlChar *name, const xmlChar *ns_uri) { xmlXPathFunction ret; if (ctxt == ((void *)0)) return(((void *)0)); if (name == ((void *)0)) return(((void *)0)); if (ctxt->funcLookupFunc != ((void *)0)) { xmlXPathFuncLookupFunc f; f = ctxt->funcLookupFunc; ret = f(ctxt->funcLookupData, name, ns_uri); if (ret != ((void *)0)) return(ret); } if (ctxt->funcHash == ((void *)0)) return(((void *)0)); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpedantic" #pragma GCC diagnostic ignored "-Wcast-function-type" ret = (xmlXPathFunction) xmlHashLookup2(ctxt->funcHash, name, ns_uri); #pragma GCC diagnostic pop return(ret); }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 5, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 5, "struct_type": 0, "switch_statement": 0, "type_casting": 8, "union_type": 0, "while_loop": 0 }
libxml2#parser_prep#xmlStringLenDecodeEntities.c
libxml2
parser.c
xmlStringLenDecodeEntities
11
xmlChar * xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len, int what __attribute__((unused)), xmlChar end, xmlChar end2, xmlChar end3) { if ((ctxt == ((void *)0)) || (str == ((void *)0)) || (len < 0)) return(((void *)0)); if ((str[len] != 0) || (end != 0) || (end2 != 0) || (end3 != 0)) return(((void *)0)); return(xmlExpandEntitiesInAttValue(ctxt, str, 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": 3, "union_type": 0, "while_loop": 0 }
gprolog-1.5.0#hash_prep#Pl_Hash_Table_Size.c
gprolog-1.5.0
hash.c
Pl_Hash_Table_Size
5
int Pl_Hash_Table_Size(char *tbl) { return (((int *)(tbl))[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_EQUAL_POINT_STRING_BRACKETS_prep#f_filled.c
transcoder-set
FIND_EQUAL_POINT_STRING_BRACKETS.c
f_filled
1
int f_filled ( char str [] ) {}
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 0, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 0, "struct_type": 0, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
transcoder-set#FIND_INDEX_GIVEN_FIBONACCI_NUMBER_CONSTANT_TIME_1_prep#f_filled.c
transcoder-set
FIND_INDEX_GIVEN_FIBONACCI_NUMBER_CONSTANT_TIME_1.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 }
findutils-4.9.0#pred_prep#pred_sanity_check.c
findutils-4.9.0
pred.c
pred_sanity_check
36
void pred_sanity_check (const struct predicate *predicates) { const struct predicate *p; for (p=predicates; p != ((void *)0); p=p->pred_next) { ((void) sizeof ((p->pred_func != ((void *)0)) ? 1 : 0), __extension__ ({ if (p->pred_func != ((void *)0)) ; else __assert_fail ("p->pred_func != NULL", "pred.c", 1310, __extension__ __PRETTY_FUNCTION__); })); ((void) sizeof ((p->parser_entry != ((void *)0)) ? 1 : 0), __extension__ ({ if (p->parser_entry != ((void *)0)) ; else __assert_fail ("p->parser_entry != NULL", "pred.c", 1313, __extension__ __PRETTY_FUNCTION__); })); if (p->parser_entry->pred_func) { ((void) sizeof ((p->parser_entry->pred_func == p->pred_func) ? 1 : 0), __extension__ ({ if (p->parser_entry->pred_func == p->pred_func) ; else __assert_fail ("p->parser_entry->pred_func == p->pred_func", "pred.c", 1322, __extension__ __PRETTY_FUNCTION__); })); } switch (p->parser_entry->type) { case ARG_OPTION: case ARG_POSITIONAL_OPTION: ((void) sizeof ((p->parser_entry->type != ARG_OPTION) ? 1 : 0), __extension__ ({ if (p->parser_entry->type != ARG_OPTION) ; else __assert_fail ("p->parser_entry->type != ARG_OPTION", "pred.c", 1338, __extension__ __PRETTY_FUNCTION__); })); ((void) sizeof ((p->parser_entry->type != ARG_POSITIONAL_OPTION) ? 1 : 0), __extension__ ({ if (p->parser_entry->type != ARG_POSITIONAL_OPTION) ; else __assert_fail ("p->parser_entry->type != ARG_POSITIONAL_OPTION", "pred.c", 1339, __extension__ __PRETTY_FUNCTION__); })); break; case ARG_ACTION: ((void) sizeof ((p->side_effects) ? 1 : 0), __extension__ ({ if (p->side_effects) ; else __assert_fail ("p->side_effects", "pred.c", 1343, __extension__ __PRETTY_FUNCTION__); })); if (!( ((p)->pred_func) == (pred_prune) ) && !( ((p)->pred_func) == (pred_quit) )) { ((void) sizeof ((p->no_default_print) ? 1 : 0), __extension__ ({ if (p->no_default_print) ; else __assert_fail ("p->no_default_print", "pred.c", 1349, __extension__ __PRETTY_FUNCTION__); })); } break; case ARG_SPECIAL_PARSE: case ARG_TEST: case ARG_PUNCTUATION: case ARG_NOOP: ((void) sizeof ((!p->no_default_print) ? 1 : 0), __extension__ ({ if (!p->no_default_print) ; else __assert_fail ("!p->no_default_print", "pred.c", 1363, __extension__ __PRETTY_FUNCTION__); })); ((void) sizeof ((!p->side_effects) ? 1 : 0), __extension__ ({ if (!p->side_effects) ; else __assert_fail ("!p->side_effects", "pred.c", 1364, __extension__ __PRETTY_FUNCTION__); })); break; } } }
{ "array_type": 0, "break_continue_statement": 3, "enum_type": 0, "for_loop": 1, "function_pointer": 0, "goto_statement": 0, "if_statement": 11, "memory_management": 0, "memory_operation": 0, "pointer_type": 1, "return_statement": 0, "struct_type": 2, "switch_statement": 1, "type_casting": 10, "union_type": 0, "while_loop": 0 }
uucp-1.07#picksb_prep#fsysdep_uupick_init.c
uucp-1.07
picksb.c
fsysdep_uupick_init
21
boolean fsysdep_uupick_init (zsystem, zpubdir) const char *zsystem __attribute__ ((__unused__)); const char *zpubdir; { const char *zuser; zuser = zsysdep_login_name (); zStopdir = (char *) xmalloc (strlen (zpubdir) + sizeof "/receive/" + strlen (zuser)); sprintf (zStopdir, "%s/receive/%s", zpubdir, zuser); qStopdir = opendir (zStopdir); if (qStopdir == ((void *)0) && (*__errno_location ()) != 2) { ulog (LOG_ERROR, "opendir (%s): %s", zStopdir, strerror ((*__errno_location ()))); return (0); } qSsysdir = ((void *)0); return (1); }
{ "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#FIND_MAXIMUM_DOT_PRODUCT_TWO_ARRAYS_INSERTION_0S_prep#main.c
transcoder-set
FIND_MAXIMUM_DOT_PRODUCT_TWO_ARRAYS_INSERTION_0S.c
main
37
int main(void) { int n_success = 0; int param0_0[] = {7,9,22,68}; int param0_1[] = {24,40,98,58,-24,24,76,48,-92,-16,-46,-48,-70,88,66,2,44,36,34,34,46,90,-80,-24,-58,68,72,-20,-62,-40}; int param0_2[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; int param0_3[] = {32,15,41,41,4,42,22,33,33,11,68,5,41,80,39,15,36,75,41,11,25,40,50,19,39,12,75,28,52,20,63,5,27,53,19,62,98,72,10,90,74,93,52,81,91,65,90,93}; int param0_4[] = {-94,-76,-68,-50,-28,-20,18,24,30,54,74,84,98}; int param0_5[] = {1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,0,0,1,1,0,1,1,1,0,0,0,0,1,0,0,0,0,1,0,0,1,1,1,0,1,0}; int param0_6[] = {14,27,43,49}; int param0_7[] = {78,-26,-12,38,-90}; int param0_8[] = {0,1,1,1}; int param0_9[] = {12,69,57,7,52,14,15,83,67,57,15,86,81,43,1,64,45,68,30,23,14,70,13,51,23,33,98,68,24,43,12,82,46}; 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[] = {14,22,54,58}; int param1_1[] = {30,-88,6,-26,-76,14,-80,-30,-58,76,40,-28,-54,38,-60,-60,88,-80,-22,90,50,-48,68,-26,26,-2,68,-16,88,-72}; int param1_2[] = {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_3[] = {80,18,9,29,62,89,4,40,47,15,35,82,22,97,63,54,7,58,64,73,54,79,21,21,20,19,56,42,6,97,7,34,55,35,57,86,73,88,20,29,48,52,8,77,2,12,6,47}; int param1_4[] = {-88,-80,-78,-68,-44,-38,42,50,62,68,70,80,92}; int param1_5[] = {1,0,0,1,1,1,1,1,1,0,0,1,1,0,1,1,0,0,1,0,1,1,0,1,0,1,1,0,1,0,0,1,0,0,1,0,1,0,1,0,1}; int param1_6[] = {51,59,76,83}; int param1_7[] = {14,50,-6,-38,80}; int param1_8[] = {0,0,0,1}; int param1_9[] = {12,48,57,40,47,36,22,50,68,98,77,78,39,55,87,75,65,27,33,27,70,34,67,71,84,33,7,61,3,9,67,92,60}; 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[] = {3,22,22,30,11,21,2,3,3,17}; int param3[] = {2,22,19,25,8,33,2,2,2,32}; for(int i = 0; i < len(param0); ++i) { if(f_filled(param0[i],param1[i],param2[i],param3[i]) == f_gold(param0[i],param1[i],param2[i],param3[i])) { n_success+=1; } break; } printf("#Results:", " ", n_success, ", ", len(param0)); return 0; }
{ "array_type": 4, "break_continue_statement": 1, "enum_type": 0, "for_loop": 1, "function_pointer": 0, "goto_statement": 0, "if_statement": 1, "memory_management": 0, "memory_operation": 0, "pointer_type": 2, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
make-4.4.1#output_prep#pfatal_with_name.c
make-4.4.1
output.c
pfatal_with_name
6
void pfatal_with_name (const char *name) { const char *err = strerror ((*__errno_location ())); fatal((((floc *)0)), strlen (name) + strlen (err), (gettext ("%s: %s")), (name), (err)); }
{ "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": 0, "struct_type": 0, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
tmux#session_prep#sessions_RB_NEXT.c
tmux
session.c
sessions_RB_NEXT
1
struct session * sessions_RB_NEXT(struct session *elm) { if ((elm)->entry.rbe_right) { elm = (elm)->entry.rbe_right; while ((elm)->entry.rbe_left) elm = (elm)->entry.rbe_left; } else { if ((elm)->entry.rbe_parent && (elm == ((elm)->entry.rbe_parent)->entry.rbe_left)) elm = (elm)->entry.rbe_parent; else { while ((elm)->entry.rbe_parent && (elm == ((elm)->entry.rbe_parent)->entry.rbe_right)) elm = (elm)->entry.rbe_parent; elm = (elm)->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 }
libosip2-5.3.1#sdp_message_prep#sdp_time_descr_init.c
libosip2-5.3.1
sdp_message.c
sdp_time_descr_init
9
int sdp_time_descr_init(sdp_time_descr_t **td) { *td = (sdp_time_descr_t *) (osip_malloc_func ? osip_malloc_func(sizeof(sdp_time_descr_t)) : malloc(sizeof(sdp_time_descr_t))); if (*td == ((void *)0)) return -4; (*td)->t_start_time = ((void *)0); (*td)->t_stop_time = ((void *)0); osip_list_init(&(*td)->r_repeats); return 0; }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 1, "memory_management": 1, "memory_operation": 0, "pointer_type": 0, "return_statement": 2, "struct_type": 0, "switch_statement": 0, "type_casting": 3, "union_type": 0, "while_loop": 0 }
cpio-2.14#util_prep#disk_buffered_write.c
cpio-2.14
util.c
disk_buffered_write
22
void disk_buffered_write (char *in_buf, int out_des, off_t num_bytes) { off_t bytes_left = num_bytes; off_t space_left; while (bytes_left > 0) { space_left = 512 - output_size; if (space_left == 0) disk_empty_output_buffer (out_des, 0); else { if (bytes_left < space_left) space_left = bytes_left; memcpy (out_buff, in_buf, (unsigned) space_left); out_buff += space_left; output_size += space_left; in_buf += space_left; bytes_left -= space_left; } } }
{ "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": 1, "pointer_type": 0, "return_statement": 0, "struct_type": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 1 }
uucp-1.07#protg_prep#fvstart.c
uucp-1.07
protg.c
fvstart
9
boolean fvstart (qdaemon, pzlog) struct sdaemon *qdaemon; char **pzlog; { if (iGrequest_packsize == (64)) iGrequest_packsize = 1024; return fgstart (qdaemon, pzlog); }
{ "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": 0 }
transcoder-set#FIND_MINIMUM_NUMBER_OF_COINS_THAT_MAKE_A_CHANGE_1_prep#min.c
transcoder-set
FIND_MINIMUM_NUMBER_OF_COINS_THAT_MAKE_A_CHANGE_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 }
transcoder-set#DYNAMIC_PROGRAMMING_SET_13_CUTTING_A_ROD_prep#cmpfunc.c
transcoder-set
DYNAMIC_PROGRAMMING_SET_13_CUTTING_A_ROD.c
cmpfunc
1
int cmpfunc (const void * a, const void * b) {return ( *(int*)a - *(int*)b );}
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 0, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
tulipindicators-0.9.1#tiamalgamation_prep#ti_acos_start.c
tulipindicators-0.9.1
tiamalgamation.c
ti_acos_start
1
int ti_acos_start(double const *options) { (void)options; 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": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
transcoder-set#MAXIMUM_NUMBER_OF_SQUARES_THAT_CAN_BE_FIT_IN_A_RIGHT_ANGLE_ISOSCELES_TRIANGLE_prep#len.c
transcoder-set
MAXIMUM_NUMBER_OF_SQUARES_THAT_CAN_BE_FIT_IN_A_RIGHT_ANGLE_ISOSCELES_TRIANGLE.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#CHECK_OCCURRENCES_CHARACTER_APPEAR_TOGETHER_prep#max.c
transcoder-set
CHECK_OCCURRENCES_CHARACTER_APPEAR_TOGETHER.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 }
tulipindicators-0.9.1#ceil_prep#ti_ceil_start.c
tulipindicators-0.9.1
ceil.c
ti_ceil_start
1
int ti_ceil_start(double const *options) { (void)options; 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": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
libxml2#xmlreader_prep#xmlTextReaderNext.c
libxml2
xmlreader.c
xmlTextReaderNext
22
int xmlTextReaderNext(xmlTextReaderPtr reader) { int ret; xmlNodePtr cur; if (reader == ((void *)0)) return(-1); if (reader->doc != ((void *)0)) return(xmlTextReaderNextTree(reader)); cur = reader->node; if ((cur == ((void *)0)) || (cur->type != XML_ELEMENT_NODE)) return(xmlTextReaderRead(reader)); if (reader->state == XML_TEXTREADER_END || reader->state == XML_TEXTREADER_BACKTRACK) return(xmlTextReaderRead(reader)); if (cur->extra & 0x1) return(xmlTextReaderRead(reader)); do { ret = xmlTextReaderRead(reader); if (ret != 1) return(ret); } while (reader->node != cur); return(xmlTextReaderRead(reader)); }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 6, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 7, "struct_type": 0, "switch_statement": 0, "type_casting": 3, "union_type": 0, "while_loop": 1 }
transcoder-set#FIND_MINIMUM_NUMBER_OF_COINS_THAT_MAKE_A_CHANGE_1_prep#cmpfunc.c
transcoder-set
FIND_MINIMUM_NUMBER_OF_COINS_THAT_MAKE_A_CHANGE_1.c
cmpfunc
1
int cmpfunc (const void * a, const void * b) {return ( *(int*)a - *(int*)b );}
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 0, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
tmux#paste_prep#paste_make_sample.c
tmux
paste.c
paste_make_sample
16
char * paste_make_sample(struct paste_buffer *pb) { char *buf; size_t len, used; const int flags = 0x01|0x08|0x10; const size_t width = 200; len = pb->size; if (len > width) len = width; buf = xreallocarray(((void *)0), len, 4 + 4); used = utf8_strvis(buf, pb->data, len, flags); if (pb->size > width || used > width) strlcpy(buf + width, "...", 4); return (buf); }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 2, "memory_management": 0, "memory_operation": 0, "pointer_type": 1, "return_statement": 1, "struct_type": 1, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
wget-1.21.4#css__prep#yypush_buffer_state.c
wget-1.21.4
css_.c
yypush_buffer_state
17
void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == ((void *)0)) return; yyensure_buffer_stack(); if ( ( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)] : ((void *)0)) ) { *(yy_c_buf_p) = (yy_hold_char); (yy_buffer_stack)[(yy_buffer_stack_top)]->yy_buf_pos = (yy_c_buf_p); (yy_buffer_stack)[(yy_buffer_stack_top)]->yy_n_chars = (yy_n_chars); } if (( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)] : ((void *)0))) (yy_buffer_stack_top)++; (yy_buffer_stack)[(yy_buffer_stack_top)] = new_buffer; yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 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": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 3, "union_type": 0, "while_loop": 0 }
libxml2#HTMLtree_prep#htmlSaveFile.c
libxml2
HTMLtree.c
htmlSaveFile
18
int htmlSaveFile(const char *filename, xmlDocPtr cur) { xmlOutputBufferPtr buf; xmlCharEncodingHandlerPtr handler = ((void *)0); const char *encoding; int ret; if ((cur == ((void *)0)) || (filename == ((void *)0))) return(-1); xmlInitParser(); encoding = (const char *) htmlGetMetaEncoding(cur); handler = htmlFindOutputEncoder(encoding); buf = xmlOutputBufferCreateFilename(filename, handler, cur->compression); if (buf == ((void *)0)) return(0); htmlDocContentDumpOutput(buf, cur, ((void *)0)); 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": 2, "memory_management": 0, "memory_operation": 0, "pointer_type": 1, "return_statement": 3, "struct_type": 0, "switch_statement": 0, "type_casting": 4, "union_type": 0, "while_loop": 0 }
bc-1.07.1#numeric_prep#dc_out_num.c
bc-1.07.1
numeric.c
dc_out_num
11
void dc_out_num ( dc_num value , int obase , dc_discard discard_p ) { out_char('\0'); bc_out_num((value), obase, out_char, 0); if (discard_p == DC_TOSS) dc_free_num(&value); }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 1, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 0, "struct_type": 0, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
transcoder-set#MAXIMIZE_ARRAY_ELEMENTS_UPTO_GIVEN_NUMBER_prep#cmpfunc.c
transcoder-set
MAXIMIZE_ARRAY_ELEMENTS_UPTO_GIVEN_NUMBER.c
cmpfunc
1
int cmpfunc (const void * a, const void * b) {return ( *(int*)a - *(int*)b );}
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 0, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
mcsim-6.2.0#delays_prep#StoreDelayed.c
mcsim-6.2.0
delays.c
StoreDelayed
12
void StoreDelayed (double t) { int i; iCurrentTime++; if (iCurrentTime == 1000) iCurrentTime = 0; rgdTime[iCurrentTime] = t; for (i = 0; i < GetNModelVars(); i++) if (rgiVars[i]) { pdVar[i][iCurrentTime] = vrgModelVars[i]; } }
{ "array_type": 4, "break_continue_statement": 0, "enum_type": 0, "for_loop": 1, "function_pointer": 0, "goto_statement": 0, "if_statement": 2, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 0, "struct_type": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
nettle-3.9.1#io_prep#hash_file.c
nettle-3.9.1
io.c
hash_file
14
int hash_file(const struct nettle_hash *hash, void *ctx, FILE *f) { for (;;) { uint8_t buffer[1000]; size_t res = fread(buffer, 1, sizeof(buffer), f); if (ferror(f)) return 0; hash->update(ctx, res, buffer); if (feof(f)) return 1; } }
{ "array_type": 1, "break_continue_statement": 0, "enum_type": 0, "for_loop": 1, "function_pointer": 0, "goto_statement": 0, "if_statement": 2, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 2, "struct_type": 1, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
transcoder-set#ADD_1_TO_A_GIVEN_NUMBER_prep#main.c
transcoder-set
ADD_1_TO_A_GIVEN_NUMBER.c
main
14
int main(void) { int n_success = 0; int param0[] = {96,66,67,13,75,78,1,83,27,65}; for(int i = 0; i < len(param0); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } break; } printf("#Results:", " ", n_success, ", ", len(param0)); return 0; }
{ "array_type": 1, "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 }
heman#plane_prep#kmPlaneFromNormalAndDistance.c
heman
plane.c
kmPlaneFromNormalAndDistance
7
kmPlane* kmPlaneFromNormalAndDistance(kmPlane* plane, const struct kmVec3* normal, const float dist) { plane->a = normal->x; plane->b = normal->y; plane->c = normal->z; plane->d = dist; return plane; }
{ "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#buf_prep#xmlBufCreateMem.c
libxml2
buf.c
xmlBufCreateMem
32
xmlBufPtr xmlBufCreateMem(const xmlChar *mem, size_t size, int isStatic) { xmlBufPtr ret; if (mem == ((void *)0)) return(((void *)0)); ret = xmlMalloc(sizeof(*ret)); if (ret == ((void *)0)) return(((void *)0)); if (isStatic) { if (mem[size] != 0) { xmlFree(ret); return(((void *)0)); } ret->flags = (1u << 2); ret->mem = (xmlChar *) mem; } else { ret->flags = 0; ret->mem = xmlMalloc(size + 1); if (ret->mem == ((void *)0)) { xmlFree(ret); return(((void *)0)); } memcpy(ret->mem, mem, size); ret->mem[size] = 0; } ret->use = size; ret->size = size; ret->maxSize = ((size_t) -1) - 1; ret->content = ret->mem; if (ret->size < 0x7fffffff) ret->compat_size = ret->size; else ret->compat_size = 0x7fffffff; if (ret->use < 0x7fffffff) ret->compat_use = ret->use; else ret->compat_use = 0x7fffffff;; return(ret); }
{ "array_type": 1, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 6, "memory_management": 0, "memory_operation": 1, "pointer_type": 0, "return_statement": 5, "struct_type": 0, "switch_statement": 0, "type_casting": 8, "union_type": 0, "while_loop": 0 }
nano-7.2#prompt_prep#do_prompt.c
nano-7.2
prompt.c
do_prompt
36
int do_prompt(int menu, const char *provided, linestruct **history_list, void (*refresh_func)(void), const char *msg, ...) { functionptrtype function = ((void *)0); _Bool listed = 0; va_list ap; int retval; size_t was_typing_x = typing_x; char *saved_prompt = prompt; bottombars(menu); if (answer != provided) answer = mallocstrcpy(answer, provided); redo_theprompt: prompt = nmalloc((COLS * 4) + 1); __builtin_va_start(ap,msg); vsnprintf(prompt, COLS * 4, msg, ap); __builtin_va_end(ap); prompt[actual_x(prompt, (COLS < 5) ? 0 : COLS - 5)] = '\0'; lastmessage = VACUUM; function = acquire_an_answer(&retval, &listed, history_list, refresh_func); free(prompt); if (retval == -2) goto redo_theprompt; prompt = saved_prompt; if (function == do_cancel || function == do_enter) typing_x = was_typing_x; if (function == do_cancel) retval = -1; else if (function == do_enter) retval = (*answer == '\0') ? -2 : 0; if (lastmessage == VACUUM) wipe_statusbar(); if (listed) refresh_func(); return retval; }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 1, "goto_statement": 1, "if_statement": 7, "memory_management": 1, "memory_operation": 0, "pointer_type": 1, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 2, "union_type": 0, "while_loop": 0 }
transcoder-set#INTEGER_POSITIVE_VALUE_POSITIVE_NEGATIVE_VALUE_ARRAY_1_prep#cmpfunc.c
transcoder-set
INTEGER_POSITIVE_VALUE_POSITIVE_NEGATIVE_VALUE_ARRAY_1.c
cmpfunc
1
int cmpfunc (const void * a, const void * b) {return ( *(int*)a - *(int*)b );}
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 0, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
transcoder-set#COUNT_NUMBER_BINARY_STRINGS_WITHOUT_CONSECUTIVE_1S_prep#max.c
transcoder-set
COUNT_NUMBER_BINARY_STRINGS_WITHOUT_CONSECUTIVE_1S.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 }
libosip2-5.3.1#osip_authorization_prep#osip_authorization_set_cnonce.c
libosip2-5.3.1
osip_authorization.c
osip_authorization_set_cnonce
3
void osip_authorization_set_cnonce(osip_authorization_t *authorization, char *cnonce) { authorization->cnonce = (char *) cnonce; }
{ "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#fd_range_prep#Pl_Vector_Copy.c
gprolog-1.5.0
fd_range.c
Pl_Vector_Copy
8
void Pl_Vector_Copy(Vector vec, Vector vec1) { Vector end = vec + pl_vec_size; do *vec++ = *vec1++; while (vec < end); }
{ "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": 1 }
json.h#allow_leading_plus_sign_prep#json_extract_get_array_size.c
json.h
allow_leading_plus_sign.c
json_extract_get_array_size
17
struct json_extract_result_s json_extract_get_array_size(const struct json_array_s *const array) { struct json_extract_result_s result; size_t i; const struct json_array_element_s *element = array->start; result.dom_size = sizeof(struct json_array_s) + (sizeof(struct json_array_element_s) * array->length); result.data_size = 0; for (i = 0; i < array->length; i++) { const struct json_extract_result_s value_result = json_extract_get_value_size(element->value); result.dom_size += value_result.dom_size; result.data_size += value_result.data_size; element = element->next; } return result; }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 1, "function_pointer": 0, "goto_statement": 0, "if_statement": 0, "memory_management": 0, "memory_operation": 0, "pointer_type": 1, "return_statement": 1, "struct_type": 2, "switch_statement": 0, "type_casting": 2, "union_type": 0, "while_loop": 0 }
genann#example4_prep#main.c
genann
example4.c
main
29
int main(int argc, char *argv[]) { printf("GENANN example 4.\n"); printf("Train an ANN on the IRIS dataset using backpropagation.\n"); srand(time(0)); load_data(); genann *ann = genann_init(4, 1, 4, 3); int i, j; int loops = 5000; printf("Training for %d loops over data.\n", loops); for (i = 0; i < loops; ++i) { for (j = 0; j < samples; ++j) { genann_train(ann, input + j*4, class + j*3, .01); } } int correct = 0; for (j = 0; j < samples; ++j) { const double *guess = genann_run(ann, input + j*4); if (class[j*3+0] == 1.0) {if (guess[0] > guess[1] && guess[0] > guess[2]) ++correct;} else if (class[j*3+1] == 1.0) {if (guess[1] > guess[0] && guess[1] > guess[2]) ++correct;} else if (class[j*3+2] == 1.0) {if (guess[2] > guess[0] && guess[2] > guess[1]) ++correct;} else {printf("Logic error.\n"); exit(1);} } printf("%d/%d correct (%0.1f%%).\n", correct, samples, (double)correct / samples * 100.0); genann_free(ann); free(input); free(class); return 0; }
{ "array_type": 1, "break_continue_statement": 0, "enum_type": 0, "for_loop": 3, "function_pointer": 0, "goto_statement": 0, "if_statement": 3, "memory_management": 2, "memory_operation": 0, "pointer_type": 2, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
cflow-1.7#parser_prep#reset_static_caller.c
cflow-1.7
parser.c
reset_static_caller
7
void reset_static_caller(void) { if (caller && (caller->storage == StaticStorage || caller->flag == symbol_local)) caller = ((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": 0, "switch_statement": 0, "type_casting": 2, "union_type": 0, "while_loop": 0 }
libxml2#types_prep#libxml_xmlOutputBufferPtrWrap.c
libxml2
types.c
libxml_xmlOutputBufferPtrWrap
13
PyObject * libxml_xmlOutputBufferPtrWrap(xmlOutputBufferPtr buffer) { PyObject *ret; if (buffer == ((void *)0)) { _Py_INCREF(((PyObject*)((&_Py_NoneStruct)))); return ((&_Py_NoneStruct)); } ret = PyCapsule_New((void *) buffer, (char *) "xmlOutputBufferPtr", ((void *)0)); return (ret); }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 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 }
findutils-4.9.0#parser_prep#set_follow_state.c
findutils-4.9.0
parser.c
set_follow_state
25
void set_follow_state (enum SymlinkOption opt) { switch (opt) { case SYMLINK_ALWAYS_DEREF: options.xstat = optionl_stat; options.x_getfilecon = optionl_getfilecon; options.no_leaf_check = 1; break; case SYMLINK_NEVER_DEREF: options.xstat = optionp_stat; options.x_getfilecon = optionp_getfilecon; break; case SYMLINK_DEREF_ARGSONLY: options.xstat = optionh_stat; options.x_getfilecon = optionh_getfilecon; options.no_leaf_check = 1; } options.symlink_handling = opt; if (options.debug_options & DebugStat) { options.xstat = debug_stat; } }
{ "array_type": 0, "break_continue_statement": 2, "enum_type": 1, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 1, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 0, "struct_type": 0, "switch_statement": 1, "type_casting": 0, "union_type": 0, "while_loop": 0 }
transcoder-set#N_TH_NUMBER_WHOSE_SUM_OF_DIGITS_IS_TEN_1_prep#max.c
transcoder-set
N_TH_NUMBER_WHOSE_SUM_OF_DIGITS_IS_TEN_1.c
max
1
int max(int x, int y) { return (x > y)? x: y; }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 0, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
transcoder-set#COUNT_NUMBER_OF_OCCURRENCES_OR_FREQUENCY_IN_A_SORTED_ARRAY_prep#f_gold.c
transcoder-set
COUNT_NUMBER_OF_OCCURRENCES_OR_FREQUENCY_IN_A_SORTED_ARRAY.c
f_gold
7
int f_gold ( int arr [ ], int n, int x ) { int res = 0; for ( int i = 0; i < n; i ++ ) if ( x == arr [ i ] ) res ++; return res; }
{ "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": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
transcoder-set#DIFFERENT_WAYS_SUM_N_USING_NUMBERS_GREATER_EQUAL_M_prep#f_gold.c
transcoder-set
DIFFERENT_WAYS_SUM_N_USING_NUMBERS_GREATER_EQUAL_M.c
f_gold
16
int f_gold ( int n, int m ) { int dp [ n + 2 ] [ n + 2 ]; memset ( dp, 0, sizeof ( dp ) ); dp [ 0 ] [ n + 1 ] = 1; for ( int k = n; k >= m; k -- ) { for ( int i = 0; i <= n; i ++ ) { dp [ i ] [ k ] = dp [ i ] [ k + 1 ]; if ( i - k >= 0 ) dp [ i ] [ k ] = ( dp [ i ] [ k ] + dp [ i - k ] [ k ] ); } } return dp [ n ] [ m ]; }
{ "array_type": 1, "break_continue_statement": 0, "enum_type": 0, "for_loop": 2, "function_pointer": 0, "goto_statement": 0, "if_statement": 1, "memory_management": 0, "memory_operation": 1, "pointer_type": 0, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
tar-1.34#misc_prep#quote_n_colon.c
tar-1.34
misc.c
quote_n_colon
5
char const * quote_n_colon (int n, char const *arg) { return quotearg_n_style_colon (n, get_quoting_style (((void *)0)), arg); }
{ "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 }