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
screen-4.9.0#process_prep#AddWindowFlags.c
screen-4.9.0
process.c
AddWindowFlags
32
char * AddWindowFlags(buf, len, p) char *buf; int len; struct win *p; { char *s = buf; if (p == 0 || len < 12) { *s = 0; return s; } if (p->w_layer.l_cvlist && p->w_layer.l_cvlist->c_lnext) *s++ = '&'; if (p->w_monitor == 3 && display && (((p->w_mon_notify)[(display->d_user->u_id) >> 3]) & (0x80 >> ((display->d_user->u_id) & 7))) ) *s++ = '@'; if (p->w_bell == 2) *s++ = '!'; if (p->w_slot != (slot_t) 0 && p->w_slot != (slot_t) -1) *s++ = '$'; if (p->w_log != 0) { strcpy(s, "(L)"); s += 3; } if (p->w_ptyfd < 0 && p->w_type != 3) *s++ = 'Z'; *s = 0; return s; }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 7, "memory_management": 0, "memory_operation": 0, "pointer_type": 1, "return_statement": 2, "struct_type": 1, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
gawk-5.2.2#cint_array_prep#init_argv_array.c
gawk-5.2.2
cint_array.c
init_argv_array
8
void init_argv_array(NODE *argv_node, NODE *shadow_node) { if (! (do_flags & DO_SANDBOX)) return; argv_node->sub.nodep.l.lp = & argv_array_func; argv_shadow_array = shadow_node; }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 1, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
transcoder-set#FIND_SUM_EVEN_INDEX_BINOMIAL_COEFFICIENTS_prep#max.c
transcoder-set
FIND_SUM_EVEN_INDEX_BINOMIAL_COEFFICIENTS.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 }
bc-1.07.1#util_prep#set_genstr_size.c
bc-1.07.1
util.c
set_genstr_size
10
void set_genstr_size (int size) { if (size > genlen) { if (genstr != ((void *)0)) free(genstr); genstr = bc_malloc (size); genlen = size; } }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 2, "memory_management": 1, "memory_operation": 0, "pointer_type": 0, "return_statement": 0, "struct_type": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
tinycc#tccgen_prep#gvtst.c
tinycc
tccgen.c
gvtst
15
int gvtst(int inv, int t) { int v = vtop->r & 0x003f; if (v != 0x0033 && v != 0x0034 && v != 0x0035) { vpushi(0); gen_op(0x95); } if ((vtop->r & (0x003f | 0x0100 | 0x0200)) == 0x0030) { if ((vtop->c.i != 0) != inv) t = gjmp(t); vtop--; return t; } return gtst(inv, t); }
{ "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": 0, "union_type": 0, "while_loop": 0 }
less-633#command_prep#peekcc.c
less-633
command.c
peekcc
6
LWCHAR peekcc(void) { LWCHAR c = getcc(); ungetcc(c); return c; }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 0, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
less-633#line_prep#gline.c
less-633
line.c
gline
25
int gline(int i, int *ap) { if (is_null_line) { if (twiddle) { if (i == 0) { *ap = (1 << 1); return '~'; } --i; } *ap = (0); return i ? '\0' : '\n'; } if (i < linebuf.pfx_end) { *ap = linebuf.pfx_attr[i]; return linebuf.pfx[i]; } i += linebuf.print - linebuf.pfx_end; *ap = linebuf.attr[i]; return (linebuf.buf[i] & 0xFF); }
{ "array_type": 4, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 4, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 4, "struct_type": 0, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
transcoder-set#SEARCH_AN_ELEMENT_IN_AN_ARRAY_WHERE_DIFFERENCE_BETWEEN_ADJACENT_ELEMENTS_IS_1_prep#sort.c
transcoder-set
SEARCH_AN_ELEMENT_IN_AN_ARRAY_WHERE_DIFFERENCE_BETWEEN_ADJACENT_ELEMENTS_IS_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 }
libxml2#libxml2-py_prep#libxml_xmlSchemaIsValid.c
libxml2
libxml2-py.c
libxml_xmlSchemaIsValid
13
PyObject * libxml_xmlSchemaIsValid(PyObject *self __attribute__ ((__unused__)), PyObject *args) { PyObject *py_retval; int c_retval; xmlSchemaValidCtxtPtr ctxt; PyObject *pyobj_ctxt; if (!_PyArg_ParseTuple_SizeT(args, (char *)"O:xmlSchemaIsValid", &pyobj_ctxt)) return(((void *)0)); ctxt = (xmlSchemaValidCtxtPtr) (((pyobj_ctxt) == (&_Py_NoneStruct)) ? ((void *)0) : (((PySchemaValidCtxt_Object *)(pyobj_ctxt))->obj)); c_retval = xmlSchemaIsValid(ctxt); 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 }
json-c#json_object_prep#json_object_get_userdata.c
json-c
json_object.c
json_object_get_userdata
4
void *json_object_get_userdata(json_object *jso) { return jso ? jso->_userdata : ((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": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
gprolog-1.5.0#hash_prep#Pl_Hash_Nb_Elements.c
gprolog-1.5.0
hash.c
Pl_Hash_Nb_Elements
5
int Pl_Hash_Nb_Elements(char *tbl) { return (((int *)(tbl))[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": 1, "union_type": 0, "while_loop": 0 }
nettle-3.9.1#umac96_prep#nettle_umac96_update.c
nettle-3.9.1
umac96.c
nettle_umac96_update
6
void nettle_umac96_update (struct umac96_ctx *ctx, size_t length, const uint8_t *data) { do { if ((ctx)->index) { unsigned __md_left = sizeof((ctx)->block) - (ctx)->index; if ((length) < __md_left) { memcpy((ctx)->block + (ctx)->index, (data), (length)); (ctx)->index += (length); goto __md_done; } else { memcpy((ctx)->block + (ctx)->index, (data), __md_left); do { uint64_t __umac96_y[3]; _nettle_umac_nh_n (__umac96_y, 3, (ctx)->l1_key, 1024, (ctx)->block); __umac96_y[0] += 8*1024; __umac96_y[1] += 8*1024; __umac96_y[2] += 8*1024; _nettle_umac_l2 ((ctx)->l2_key, (ctx)->l2_state, 3, (ctx)->count++, __umac96_y); } while (0); ((void)0); (data) += __md_left; (length) -= __md_left; } } while ((length) >= sizeof((ctx)->block)) { do { uint64_t __umac96_y[3]; _nettle_umac_nh_n (__umac96_y, 3, (ctx)->l1_key, 1024, (data)); __umac96_y[0] += 8*1024; __umac96_y[1] += 8*1024; __umac96_y[2] += 8*1024; _nettle_umac_l2 ((ctx)->l2_key, (ctx)->l2_state, 3, (ctx)->count++, __umac96_y); } while (0); ((void)0); (data) += sizeof((ctx)->block); (length) -= sizeof((ctx)->block); } memcpy ((ctx)->block, (data), (length)); (ctx)->index = (length); __md_done: ; } while (0); }
{ "array_type": 1, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 1, "if_statement": 1, "memory_management": 0, "memory_operation": 1, "pointer_type": 0, "return_statement": 0, "struct_type": 1, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 1 }
nano-7.2#rcfile_prep#parse_argument.c
nano-7.2
rcfile.c
parse_argument
20
char *parse_argument(char *ptr) { const char *ptr_save = ptr; char *last_quote = ((void *)0); if (*ptr != '"') return parse_next_word(ptr); while (*ptr != '\0') { if (*++ptr == '"') last_quote = ptr; } if (last_quote == ((void *)0)) { jot_error(("Argument '%s' has an unterminated \""), ptr_save); return ((void *)0); } *last_quote = '\0'; ptr = last_quote + 1; while (((*__ctype_b_loc ())[(int) (((unsigned char)*ptr))] & (unsigned short int) _ISblank)) ptr++; return ptr; }
{ "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": 2, "return_statement": 3, "struct_type": 0, "switch_statement": 0, "type_casting": 4, "union_type": 0, "while_loop": 2 }
libxml2#libxml2-py_prep#libxml_xmlTextReaderConstPrefix.c
libxml2
libxml2-py.c
libxml_xmlTextReaderConstPrefix
13
PyObject * libxml_xmlTextReaderConstPrefix(PyObject *self __attribute__ ((__unused__)), PyObject *args) { PyObject *py_retval; const xmlChar * c_retval; xmlTextReaderPtr reader; PyObject *pyobj_reader; if (!_PyArg_ParseTuple_SizeT(args, (char *)"O:xmlTextReaderConstPrefix", &pyobj_reader)) return(((void *)0)); reader = (xmlTextReaderPtr) (((pyobj_reader) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyxmlTextReader_Object *)(pyobj_reader))->obj)); c_retval = xmlTextReaderConstPrefix(reader); 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": 2, "return_statement": 2, "struct_type": 0, "switch_statement": 0, "type_casting": 3, "union_type": 0, "while_loop": 0 }
transcoder-set#PROGRAM_FIND_SMALLEST_DIFFERENCE_ANGLES_TWO_PARTS_GIVEN_CIRCLE_prep#max.c
transcoder-set
PROGRAM_FIND_SMALLEST_DIFFERENCE_ANGLES_TWO_PARTS_GIVEN_CIRCLE.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#DISTRIBUTING_M_ITEMS_CIRCLE_SIZE_N_STARTING_K_TH_POSITION_prep#main.c
transcoder-set
DISTRIBUTING_M_ITEMS_CIRCLE_SIZE_N_STARTING_K_TH_POSITION.c
main
16
int main(void) { int n_success = 0; int param0[] = {19,23,92,9,20,68,66,77,90,26}; int param1[] = {14,51,10,50,67,25,30,22,1,34}; int param2[] = {34,5,24,34,20,40,24,32,71,54}; 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": 0, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
libxml2#libxml2-py_prep#libxml_xmlParseDoc.c
libxml2
libxml2-py.c
libxml_xmlParseDoc
11
PyObject * libxml_xmlParseDoc(PyObject *self __attribute__ ((__unused__)), PyObject *args) { PyObject *py_retval; xmlDocPtr c_retval; xmlChar * cur; if (!_PyArg_ParseTuple_SizeT(args, (char *)"z:xmlParseDoc", &cur)) return(((void *)0)); c_retval = xmlParseDoc(cur); py_retval = libxml_xmlDocPtrWrap((xmlDocPtr) 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 }
json.h#allow_simplified_json_prep#json_skip_all_skippables.c
json.h
allow_simplified_json.c
json_skip_all_skippables
31
int json_skip_all_skippables(struct json_parse_state_s *state) { int did_consume = 0; const size_t size = state->size; if (json_parse_flags_allow_c_style_comments & state->flags_bitset) { do { if (state->offset == size) { state->error = json_parse_error_premature_end_of_buffer; return 1; } did_consume = json_skip_whitespace(state); if (state->offset >= size) { state->error = json_parse_error_premature_end_of_buffer; return 1; } did_consume |= json_skip_c_style_comments(state); } while (0 != did_consume); } else { do { if (state->offset == size) { state->error = json_parse_error_premature_end_of_buffer; return 1; } did_consume = json_skip_whitespace(state); } while (0 != did_consume); } if (state->offset == size) { state->error = json_parse_error_premature_end_of_buffer; 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": 5, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 5, "struct_type": 1, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 2 }
grep-3.11#uinttostr_prep#uinttostr.c
grep-3.11
uinttostr.c
uinttostr
20
__attribute__ ((__warn_unused_result__)) char * uinttostr (unsigned int i, char *buf) { char *p = buf + (((((sizeof (unsigned int) * 8) - (! ((__typeof__ (unsigned int)) 0 < (__typeof__ (unsigned int)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (unsigned int)) 0 < (__typeof__ (unsigned int)) -1))); *p = 0; if (i < 0) { do *--p = '0' - i % 10; while ((i /= 10) != 0); *--p = '-'; } else { do *--p = '0' + i % 10; while ((i /= 10) != 0); } 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": 1, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 2 }
optipng-0.7.8#pngget_prep#png_get_x_pixels_per_meter.c
optipng-0.7.8
pngget.c
png_get_x_pixels_per_meter
8
png_uint_32 png_get_x_pixels_per_meter(png_const_structrp png_ptr, png_const_inforp info_ptr) { (void)png_ptr; (void)info_ptr; 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": 2, "union_type": 0, "while_loop": 0 }
transcoder-set#COUNT_POSSIBLE_PATHS_TOP_LEFT_BOTTOM_RIGHT_NXM_MATRIX_3_prep#max.c
transcoder-set
COUNT_POSSIBLE_PATHS_TOP_LEFT_BOTTOM_RIGHT_NXM_MATRIX_3.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_allow_prep#osip_message_get_allow.c
libosip2-5.3.1
osip_allow.c
osip_message_get_allow
9
int osip_message_get_allow(const osip_message_t *sip, int pos, osip_allow_t **dest) { osip_allow_t *allow; *dest = ((void *)0); if (osip_list_size(&sip->allows) <= pos) return -1; allow = (osip_allow_t *) osip_list_get(&sip->allows, pos); *dest = allow; return pos; }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 1, "memory_management": 0, "memory_operation": 0, "pointer_type": 1, "return_statement": 2, "struct_type": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
gawk-5.2.2#builtin_prep#do_index.c
gawk-5.2.2
builtin.c
do_index
88
NODE * do_index(int nargs) { NODE *s1, *s2; const char *p1, *p2; size_t l1, l2; long ret; _Bool do_single_byte = 0; mbstate_t mbs1, mbs2; check_exact_args(nargs, "index", 2); if (gawk_mb_cur_max > 1) { memset(& mbs1, 0, sizeof(mbstate_t)); memset(& mbs2, 0, sizeof(mbstate_t)); } s2 = POP_SCALAR(); s1 = ((stack_ptr--)->rptr); do { if (s1->type == Node_var_array) { DEREF(s2); (*(set_loc("builtin.c", 428), r_fatal))(gettext("attempt to use array `%s' in a scalar context"), array_vname(s1)); }} while (0); if ((do_flags & (DO_LINT_INVALID|DO_LINT_ALL))) { if ((fixtype(s1)->flags & (STRING|USER_INPUT)) == 0) (*(set_loc("builtin.c", 432),lintfunc))(gettext("%s: received non-string first argument"), "index"); if ((fixtype(s2)->flags & (STRING|USER_INPUT)) == 0) (*(set_loc("builtin.c", 434),lintfunc))(gettext("%s: received non-string second argument"), "index"); } s1 = force_string_fmt((s1), CONVFMT, CONVFMTidx); s2 = force_string_fmt((s2), CONVFMT, CONVFMTidx); p1 = s1->sub.val.sp; p2 = s2->sub.val.sp; l1 = s1->sub.val.slen; l2 = s2->sub.val.slen; ret = 0; if (l2 == 0) { ret = 1; goto out; } if (gawk_mb_cur_max > 1) { s1 = str2wstr(s1, ((void *)0)); s2 = str2wstr(s2, ((void *)0)); do_single_byte = ((s1->sub.val.wslen == 0 && s1->sub.val.slen > 0) || (s2->sub.val.wslen == 0 && s2->sub.val.slen > 0)); } if (IGNORECASE) { while (l1 > 0) { if (l2 > l1) break; if (! do_single_byte && gawk_mb_cur_max > 1) { const wchar_t *pos; pos = wcasestrstr(s1->sub.val.wsp, s1->sub.val.wslen, s2->sub.val.wsp, s2->sub.val.wslen); if (pos == ((void *)0)) ret = 0; else ret = pos - s1->sub.val.wsp + 1; goto out; } else { if (casetable[(unsigned char)*p1] == casetable[(unsigned char)*p2] && (l2 == 1 || strncasecmp(p1, p2, l2) == 0)) { ret = 1 + s1->sub.val.slen - l1; break; } l1--; p1++; } } } else { while (l1 > 0) { if (l2 > l1) break; if (*p1 == *p2 && (l2 == 1 || (l2 > 0 && memcmp(p1, p2, l2) == 0))) { ret = 1 + s1->sub.val.slen - l1; break; } if (! do_single_byte && gawk_mb_cur_max > 1) { const wchar_t *pos; pos = wstrstr(s1->sub.val.wsp, s1->sub.val.wslen, s2->sub.val.wsp, s2->sub.val.wslen); if (pos == ((void *)0)) ret = 0; else ret = pos - s1->sub.val.wsp + 1; goto out; } else { l1--; p1++; } } } out: DEREF(s1); DEREF(s2); return make_number((double) ret); }
{ "array_type": 0, "break_continue_statement": 4, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 3, "if_statement": 16, "memory_management": 0, "memory_operation": 2, "pointer_type": 5, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 5, "union_type": 0, "while_loop": 3 }
dap-3.10#ps_prep#pict_port.c
dap-3.10
ps.c
pict_port
4
void pict_port(int npages) { pict_init('p', 0, 0, 612, 792, npages); }
{ "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_event_prep#pth_event_concat.c
pth-2.0.7
pth_event.c
pth_event_concat
23
pth_event_t pth_event_concat(pth_event_t evf, ...) { pth_event_t evc; pth_event_t evn; pth_event_t evl; pth_event_t evt; va_list ap; if (evf == ((void *)0)) return ((*__errno_location ()) = (22), ((pth_event_t)((void *)0))); __builtin_va_start(ap,evf); evc = evf; evl = evc->ev_next; while ((evn = __builtin_va_arg(ap,pth_event_t)) != ((void *)0)) { evc->ev_next = evn; evt = evn->ev_prev; evn->ev_prev = evc; evc = evt; } evc->ev_next = evl; evl->ev_prev = evc; __builtin_va_end(ap); return evf; }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 1, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 2, "struct_type": 0, "switch_statement": 0, "type_casting": 3, "union_type": 0, "while_loop": 1 }
findutils-4.9.0#sharefile_prep#sharefile_init.c
findutils-4.9.0
sharefile.c
sharefile_init
31
sharefile_handle sharefile_init (const char *mode) { struct Hash_tuning; struct sharefile *p = malloc (sizeof (struct sharefile)); if (p) { p->mode = strdup (mode); if (p->mode) { p->table = hash_initialize (DefaultHashTableSize, ((void *)0), entry_hashfunc, entry_comparator, entry_free); if (p->table) { return p; } else { free (p->mode); free (p); } } else { free (p); } } return ((void *)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": 4, "memory_operation": 0, "pointer_type": 1, "return_statement": 2, "struct_type": 1, "switch_statement": 0, "type_casting": 3, "union_type": 0, "while_loop": 0 }
nettle-3.9.1#serpent-set-key_prep#nettle_serpent256_set_key.c
nettle-3.9.1
serpent-set-key.c
nettle_serpent256_set_key
5
void nettle_serpent256_set_key (struct serpent_ctx *ctx, const uint8_t *key) { nettle_serpent_set_key (ctx, 32, key); }
{ "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 }
transcoder-set#SEARCH_AN_ELEMENT_IN_AN_ARRAY_WHERE_DIFFERENCE_BETWEEN_ADJACENT_ELEMENTS_IS_1_prep#len.c
transcoder-set
SEARCH_AN_ELEMENT_IN_AN_ARRAY_WHERE_DIFFERENCE_BETWEEN_ADJACENT_ELEMENTS_IS_1.c
len
1
int len (int arr [ ]) {return ((int) (sizeof (arr) / sizeof (arr)[0]));}
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 0, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
transcoder-set#FIND_MINIMUM_RADIUS_ATLEAST_K_POINT_LIE_INSIDE_CIRCLE_prep#f_gold.c
transcoder-set
FIND_MINIMUM_RADIUS_ATLEAST_K_POINT_LIE_INSIDE_CIRCLE.c
f_gold
8
int f_gold ( int k, int x [ ], int y [ ], int n ) { int dis [ n ]; for ( int i = 0; i < n; i ++ ) dis [ i ] = x [ i ] * x [ i ] + y [ i ] * y [ i ]; sort ( dis, dis + n ); return dis [ k - 1 ]; }
{ "array_type": 3, "break_continue_statement": 0, "enum_type": 0, "for_loop": 1, "function_pointer": 0, "goto_statement": 0, "if_statement": 0, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
transcoder-set#COUNT_INVERSIONS_OF_SIZE_THREE_IN_A_GIVE_ARRAY_1_prep#sort.c
transcoder-set
COUNT_INVERSIONS_OF_SIZE_THREE_IN_A_GIVE_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 }
hello-2.12.1#dirname-lgpl_prep#mdir_name.c
hello-2.12.1
dirname-lgpl.c
mdir_name
17
char * mdir_name (char const *file) { size_t length = dir_len (file); _Bool append_dot = (length == 0 || (0 && length == ((void) (file), 0) && file[2] != '\0' && ! ((file[2]) == '/'))); char *dir = malloc (length + append_dot + 1); if (!dir) return ((void *)0); memcpy (dir, file, length); if (append_dot) dir[length++] = '.'; dir[length] = '\0'; return dir; }
{ "array_type": 2, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 2, "memory_management": 1, "memory_operation": 1, "pointer_type": 1, "return_statement": 2, "struct_type": 0, "switch_statement": 0, "type_casting": 2, "union_type": 0, "while_loop": 0 }
tulipindicators-0.9.1#wad_prep#ti_wad.c
tulipindicators-0.9.1
wad.c
ti_wad
24
int ti_wad(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]; (void)options; if (size <= ti_wad_start(options)) return 0; double *output = outputs[0]; double sum = 0; double yc = close[0]; int i; for (i = 1; i < size; ++i) { const double c = close[i]; if (c > yc) { sum += c - ((yc)<(low[i])?(yc):(low[i])); } else if (c < yc) { sum += c - ((yc)>(high[i])?(yc):(high[i])); } else { } *output++ = sum; yc = close[i]; } ((void) sizeof ((output - outputs[0] == size - ti_wad_start(options)) ? 1 : 0), __extension__ ({ if (output - outputs[0] == size - ti_wad_start(options)) ; else __assert_fail ("output - outputs[0] == size - ti_wad_start(options)", "indicators/wad.c", 66, __extension__ __PRETTY_FUNCTION__); })); return 0; }
{ "array_type": 5, "break_continue_statement": 0, "enum_type": 0, "for_loop": 1, "function_pointer": 0, "goto_statement": 0, "if_statement": 4, "memory_management": 0, "memory_operation": 0, "pointer_type": 4, "return_statement": 2, "struct_type": 0, "switch_statement": 0, "type_casting": 2, "union_type": 0, "while_loop": 0 }
libxml2#parserInternals_prep#xmlNoNetExternalEntityLoader.c
libxml2
parserInternals.c
xmlNoNetExternalEntityLoader
14
xmlParserInputPtr xmlNoNetExternalEntityLoader(const char *URL, const char *ID, xmlParserCtxtPtr ctxt) { int oldOptions = 0; xmlParserInputPtr input; if (ctxt != ((void *)0)) { oldOptions = ctxt->options; ctxt->options |= XML_PARSE_NONET; } input = xmlDefaultExternalEntityLoader(URL, ID, ctxt); if (ctxt != ((void *)0)) ctxt->options = oldOptions; return(input); }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 2, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 2, "union_type": 0, "while_loop": 0 }
uucp-1.07#cusub_prep#fsysdep_cu.c
uucp-1.07
cusub.c
fsysdep_cu
53
boolean fsysdep_cu (qconn, pbcmd, zlocalname) struct sconnection *qconn; char *pbcmd; const char *zlocalname; { boolean fstart; char b; int c; fstart = (1); while ((1)) { if (((1))) ; else { ulog (LOG_ERROR, (const char *) ((void *)0)); return (0); } c = read (0, &b, 1); ; if (c <= 0) break; if (fstart && b == *zCuvar_escape && b != '\0') { c = cscu_escape (pbcmd, zlocalname); if (c <= 0) break; if (*pbcmd != b) { write (1, pbcmd, 1); if (*pbcmd == bSeof) *pbcmd = '.'; if (*pbcmd == bStstp) *pbcmd = 'z'; return (1); } } if (! fconn_write (qconn, &b, (size_t) 1)) return (0); fstart = strchr (zCuvar_eol, b) != ((void *)0); } if (c < 0) { if ((*__errno_location ()) != 4) ulog (LOG_ERROR, "read: %s", strerror ((*__errno_location ()))); else ulog (LOG_ERROR, (const char *) ((void *)0)); return (0); } ulog (LOG_ERROR, "End of file on terminal"); return (0); }
{ "array_type": 0, "break_continue_statement": 2, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 10, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 5, "struct_type": 1, "switch_statement": 0, "type_casting": 4, "union_type": 0, "while_loop": 1 }
transcoder-set#CHECK_GIVEN_CIRCLE_LIES_COMPLETELY_INSIDE_RING_FORMED_TWO_CONCENTRIC_CIRCLES_prep#main.c
transcoder-set
CHECK_GIVEN_CIRCLE_LIES_COMPLETELY_INSIDE_RING_FORMED_TWO_CONCENTRIC_CIRCLES.c
main
18
int main(void) { int n_success = 0; int param0[] = {8,400,1,61,60,88,60,26,33,70}; int param1[] = {4,1,400,40,49,10,79,88,65,57}; int param2[] = {2,10,10,2,68,69,92,75,57,77}; int param3[] = {6,74,74,50,77,71,29,84,21,52}; int param4[] = {0,38,38,0,71,26,38,10,61,87}; for(int i = 0; i < len(param0); ++i) { if(f_filled(param0[i],param1[i],param2[i],param3[i],param4[i]) == f_gold(param0[i],param1[i],param2[i],param3[i],param4[i])) { n_success+=1; } break; } printf("#Results:", " ", n_success, ", ", len(param0)); return 0; }
{ "array_type": 5, "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 }
transcoder-set#NUMBER_DIGITS_PRODUCT_TWO_NUMBERS_prep#cmpfunc.c
transcoder-set
NUMBER_DIGITS_PRODUCT_TWO_NUMBERS.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#CEILING_IN_A_SORTED_ARRAY_prep#main.c
transcoder-set
CEILING_IN_A_SORTED_ARRAY.c
main
27
int main(void) { int n_success = 0; int param0_0[] = {2,3,4,6,8,9,9,10,11,16,19,20,21,21,21,24,24,25,28,30,30,30,32,34,35,39,41,42,49,52,57,59,61,62,66,68,71,73,76,79,83,84,85,86,87,87}; int param0_1[] = {92,50,-84,60,32,-54,84,-82,-42,-72,-64,-28,-48,66,92,-42,42,-66,52,-30,48,42,36,-4,64,62,-16,0,20,26,78,78,12,-6,-30,-14,76,72,70,-34,98,32}; int param0_2[] = {0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1}; int param0_3[] = {26,68,73,76,14,19,56,80,17,7,15,64,99,98,21,21,72,12,14,10,44,82,25,42,46,86,79,43,91}; int param0_4[] = {-90,-86,-84,-50,-30,-24,-12,-2,8,22,30,44,58,58,60,60,62,90}; int param0_5[] = {0,0,1,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,0,0,1,1}; int param0_6[] = {2,2,29,31,34,39,48,50,56,61,66,66,69,73,88}; int param0_7[] = {-98,48,-58,8,70,62,92,84,-58,-46,-26,-92,18,-88,40,-12,60,14,54,-64,88,52,-44,88,-46,-8,36,-22,28,-20,-50,58,-82,-44,-44,54,-86,40,10,0,-24,-84,-10,62,58,0,-88}; int param0_8[] = {0,0,0,0,1,1}; int param0_9[] = {56,30,33,5,67,35,22,54,36,55,94,89,40,65,29,76,17,14,14,49,40,44,35,69,63,2,81,78,19,67,12,14,68,30,82,85,12,2,94,33,85,75,97,31,69,31,85,26}; 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[] = {23,36,11,23,9,12,9,40,5,46}; int param2[] = {37,35,9,27,16,15,12,29,5,47}; int param3[] = {44,34,13,26,10,18,10,24,5,47}; for(int i = 0; i < len(param0); ++i) { if(f_filled(param0[i],param1[i],param2[i],param3[i]) == f_gold(param0[i],param1[i],param2[i],param3[i])) { n_success+=1; } break; } printf("#Results:", " ", n_success, ", ", len(param0)); return 0; }
{ "array_type": 4, "break_continue_statement": 1, "enum_type": 0, "for_loop": 1, "function_pointer": 0, "goto_statement": 0, "if_statement": 1, "memory_management": 0, "memory_operation": 0, "pointer_type": 1, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
gawk-5.2.2#main_prep#getenv_long.c
gawk-5.2.2
main.c
getenv_long
12
long getenv_long(const char *name) { const char *val; long newval; if ((val = getenv(name)) != ((void *)0) && ((*__ctype_b_loc ())[(int) (((unsigned char) *val))] & (unsigned short int) _ISdigit)) { for (newval = 0; *val && ((*__ctype_b_loc ())[(int) (((unsigned char) *val))] & (unsigned short int) _ISdigit); val++) newval = (newval * 10) + *val - '0'; return newval; } 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": 1, "return_statement": 2, "struct_type": 0, "switch_statement": 0, "type_casting": 2, "union_type": 0, "while_loop": 0 }
transcoder-set#MINIMUM_NUMBER_SUBSETS_DISTINCT_ELEMENTS_prep#main.c
transcoder-set
MINIMUM_NUMBER_SUBSETS_DISTINCT_ELEMENTS.c
main
24
int main(void) { int n_success = 0; int param0_0[] = {1,2,5,8,16,21,21,22,23,26,26,27,27,29,31,33,36,37,37,38,42,45,47,50,57,58,60,60,62,63,66,66,76,84,84,88,96,99}; int param0_1[] = {-30,-60,34,4,86,80,-96,-94,52,46,8,82,-94,-96,78,82,-22,-36,78,50,-46,-36,80,24,-14,94,-46,-38,82,4,-24,2,4,-82,-82,-18,-62,12,8,92,70,-10}; int param0_2[] = {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,1}; int param0_3[] = {38,47,84,49,48,62,48,41,38,48,92,16,99}; int param0_4[] = {-88,-64,-40,-38,-38,-16,16,20,28,40,56,58,60,68,74,92}; int param0_5[] = {1,1,0,1,0,0,1,0,1,0,0,1,1,0,1,0,1,1,1,1,0,0,0,1,0,1,0,0,1,0,0,0,1,0,0,0,0,0,1,1,1,1,1}; int param0_6[] = {14,24,82,87,95}; int param0_7[] = {-34,62,40,-84,52,-76,2,-58,94,22,2,-18,-88,62,-14,46,50,-58,-80,68,-64,90,-58,12,76,-40,40,-46,8,-80,4,-90,14,-10,64,-68}; int param0_8[] = {0,1,1,1}; int param0_9[] = {43,41,90,5,6,17,68,68,86,89}; 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[] = {25,35,34,6,12,29,3,34,3,7}; for(int i = 0; i < len(param0); ++i) { if(f_filled(param0[i],param1[i]) == f_gold(param0[i],param1[i])) { n_success+=1; } } printf("#Results:", " ", n_success, ", ", len(param0)); return 0; }
{ "array_type": 2, "break_continue_statement": 0, "enum_type": 0, "for_loop": 1, "function_pointer": 0, "goto_statement": 0, "if_statement": 1, "memory_management": 0, "memory_operation": 0, "pointer_type": 1, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
mtools-4.0.43#privileges_prep#closeExec.c
mtools-4.0.43
privileges.c
closeExec
4
void closeExec(int fd) { fcntl(fd, 2, 1); }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 0, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 0, "struct_type": 0, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
nettle-3.9.1#sha3-384_prep#nettle_sha3_384_digest.c
nettle-3.9.1
sha3-384.c
nettle_sha3_384_digest
9
void nettle_sha3_384_digest(struct sha3_384_ctx *ctx, size_t length, uint8_t *digest) { _nettle_sha3_pad (&ctx->state, 104, ctx->block, ctx->index, 6); _nettle_write_le64 (length, digest, ctx->state.a); nettle_sha3_384_init (ctx); }
{ "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 }
transcoder-set#MAXIMIZE_SUM_CONSECUTIVE_DIFFERENCES_CIRCULAR_ARRAY_prep#min.c
transcoder-set
MAXIMIZE_SUM_CONSECUTIVE_DIFFERENCES_CIRCULAR_ARRAY.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#NUMBER_N_DIGIT_STEPPING_NUMBERS_prep#cmpfunc.c
transcoder-set
NUMBER_N_DIGIT_STEPPING_NUMBERS.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 }
make-4.4.1#ar_prep#ar_member_date.c
make-4.4.1
ar.c
ar_member_date
19
time_t ar_member_date (const char *name) { char *arname; char *memname; intmax_t val; ar_parse_name (name, &arname, &memname); { struct file *arfile; arfile = lookup_file (arname); if (arfile == 0 && file_exists_p (arname)) arfile = enter_file (strcache_add (arname)); if (arfile != 0) (void) f_mtime (arfile, 0); } val = ar_scan (arname, ar_member_date_1, memname); free (arname); return 0 < val && val <= ((time_t) (! (! ((time_t) 0 < (time_t) -1)) ? (time_t) -1 : ((((time_t) 1 << ((sizeof (time_t) * 8) - 2)) - 1) * 2 + 1))) ? val : -1; }
{ "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": 3, "return_statement": 1, "struct_type": 1, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
libxml2#valid_prep#xmlNewValidCtxt.c
libxml2
valid.c
xmlNewValidCtxt
8
xmlValidCtxtPtr xmlNewValidCtxt(void) { xmlValidCtxtPtr ret; ret = xmlMalloc(sizeof (xmlValidCtxt)); if (ret == ((void *)0)) return (((void *)0)); (void) memset(ret, 0, sizeof (xmlValidCtxt)); 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": 1, "pointer_type": 0, "return_statement": 2, "struct_type": 0, "switch_statement": 0, "type_casting": 4, "union_type": 0, "while_loop": 0 }
libosip2-5.3.1#osip_authorization_prep#osip_authorization_get_gssapi_data.c
libosip2-5.3.1
osip_authorization.c
osip_authorization_get_gssapi_data
3
char *osip_authorization_get_gssapi_data(osip_authorization_t *authorization) { return authorization->gssapi_data; }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 0, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
optipng-0.7.8#bitset_prep#opng_bitset_count.c
optipng-0.7.8
bitset.c
opng_bitset_count
12
unsigned int opng_bitset_count(opng_bitset_t set) { unsigned int result; result = 0; while (set != 0) { set &= (set - 1); ++result; } 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": 0, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 1 }
libosip2-5.3.1#sdp_accessor_prep#sdp_message_i_info_set.c
libosip2-5.3.1
sdp_accessor.c
sdp_message_i_info_set
14
int sdp_message_i_info_set(sdp_message_t *sdp, int pos_media, char *info) { sdp_media_t *med; if (sdp == ((void *)0)) return -2; if (pos_media == -1) { sdp->i_info = info; return 0; } med = osip_list_get(&sdp->m_medias, pos_media); if (med == ((void *)0)) return -1; med->i_info = info; 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": 4, "struct_type": 0, "switch_statement": 0, "type_casting": 2, "union_type": 0, "while_loop": 0 }
json.h#allow_location_information_prep#json_parse_key.c
json.h
allow_location_information.c
json_parse_key
23
void json_parse_key(struct json_parse_state_s *state, struct json_string_s *string) { if (json_parse_flags_allow_unquoted_keys & state->flags_bitset) { const char *const src = state->src; char *const data = state->data; size_t offset = state->offset; if (('"' == src[offset]) || ('\'' == src[offset])) { json_parse_string(state, string); } else { size_t size = 0; string->string = state->data; while (is_valid_unquoted_key_char(src[offset])) { data[size++] = src[offset++]; } data[size] = '\0'; string->string_size = size++; state->data += size; state->offset = offset; } } else { json_parse_string(state, string); } }
{ "array_type": 2, "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": 2, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 1 }
libxml2#schematron_prep#xmlSchematronFreeParserCtxt.c
libxml2
schematron.c
xmlSchematronFreeParserCtxt
15
void xmlSchematronFreeParserCtxt(xmlSchematronParserCtxtPtr ctxt) { if (ctxt == ((void *)0)) return; if (ctxt->doc != ((void *)0) && !ctxt->preserve) xmlFreeDoc(ctxt->doc); if (ctxt->xctxt != ((void *)0)) { xmlXPathFreeContext(ctxt->xctxt); } if (ctxt->namespaces != ((void *)0)) xmlFree((char **) ctxt->namespaces); xmlDictFree(ctxt->dict); xmlFree(ctxt); }
{ "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": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 4, "union_type": 0, "while_loop": 0 }
optipng-0.7.8#pngmem_prep#png_free.c
optipng-0.7.8
pngmem.c
png_free
7
void png_free(png_const_structrp png_ptr, png_voidp ptr) { if (png_ptr == ((void *)0) || ptr == ((void *)0)) return; free(ptr); }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 1, "memory_management": 1, "memory_operation": 0, "pointer_type": 0, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
libxml2#libxml2-py_prep#libxml_xmlPopInput.c
libxml2
libxml2-py.c
libxml_xmlPopInput
13
PyObject * libxml_xmlPopInput(PyObject *self __attribute__ ((__unused__)), PyObject *args) { PyObject *py_retval; xmlChar c_retval; xmlParserCtxtPtr ctxt; PyObject *pyobj_ctxt; if (!_PyArg_ParseTuple_SizeT(args, (char *)"O:xmlPopInput", &pyobj_ctxt)) return(((void *)0)); ctxt = (xmlParserCtxtPtr) (((pyobj_ctxt) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyparserCtxt_Object *)(pyobj_ctxt))->obj)); c_retval = xmlPopInput(ctxt); 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 }
json.h#allow_location_information_prep#json_write_pretty_array.c
json.h
allow_location_information.c
json_write_pretty_array
41
char *json_write_pretty_array(const struct json_array_s *array, size_t depth, const char *indent, const char *newline, char *data) { size_t k, m; struct json_array_element_s *element; *data++ = '['; if (0 < array->length) { for (k = 0; '\0' != newline[k]; k++) { *data++ = newline[k]; } for (element = array->start; 0 != element; element = element->next) { if (element != array->start) { *data++ = ','; for (k = 0; '\0' != newline[k]; k++) { *data++ = newline[k]; } } for (k = 0; k < depth + 1; k++) { for (m = 0; '\0' != indent[m]; m++) { *data++ = indent[m]; } } data = json_write_pretty_value(element->value, depth + 1, indent, newline, data); if (0 == data) { return 0; } } for (k = 0; '\0' != newline[k]; k++) { *data++ = newline[k]; } for (k = 0; k < depth; k++) { for (m = 0; '\0' != indent[m]; m++) { *data++ = indent[m]; } } } *data++ = ']'; return data; }
{ "array_type": 2, "break_continue_statement": 0, "enum_type": 0, "for_loop": 8, "function_pointer": 0, "goto_statement": 0, "if_statement": 3, "memory_management": 0, "memory_operation": 0, "pointer_type": 1, "return_statement": 2, "struct_type": 2, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
transcoder-set#COUNT_NUMBER_OF_WAYS_TO_COVER_A_DISTANCE_1_prep#max.c
transcoder-set
COUNT_NUMBER_OF_WAYS_TO_COVER_A_DISTANCE_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 }
libosip2-5.3.1#osip_transaction_prep#osip_transaction_get_reserved4.c
libosip2-5.3.1
osip_transaction.c
osip_transaction_get_reserved4
5
void *osip_transaction_get_reserved4(osip_transaction_t *transaction) { if (transaction == ((void *)0)) return ((void *)0); return transaction->reserved4; }
{ "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 }
transcoder-set#WAYS_TO_WRITE_N_AS_SUM_OF_TWO_OR_MORE_POSITIVE_INTEGERS_prep#len.c
transcoder-set
WAYS_TO_WRITE_N_AS_SUM_OF_TWO_OR_MORE_POSITIVE_INTEGERS.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#xmlunicode_prep#xmlUCSIsMiscellaneousSymbolsandArrows.c
libxml2
xmlunicode.c
xmlUCSIsMiscellaneousSymbolsandArrows
4
int xmlUCSIsMiscellaneousSymbolsandArrows(int code) { return(((code >= 0x2B00) && (code <= 0x2BFF))); }
{ "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 }
patch-2.7.6#pch_prep#pch_line_len.c
patch-2.7.6
pch.c
pch_line_len
5
size_t pch_line_len (lin line) { return p_len[line]; }
{ "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 }
transcoder-set#SQUARE_ROOT_OF_AN_INTEGER_1_prep#cmpfunc.c
transcoder-set
SQUARE_ROOT_OF_AN_INTEGER_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 }
less-633#cvt_prep#cvt_alloc_chpos.c
less-633
cvt.c
cvt_alloc_chpos
8
int * cvt_alloc_chpos(int len) { int i; int *chpos = (int *) ecalloc(sizeof(int), len); for (i = 0; i < len; i++) chpos[i] = -1; return (chpos); }
{ "array_type": 1, "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": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
genann#genann_prep#genann_run.c
genann
genann.c
genann_run
47
double const *genann_run(genann const *ann, double const *inputs) { double const *w = ann->weight; double *o = ann->output + ann->inputs; double const *i = ann->output; memcpy(ann->output, inputs, sizeof(double) * ann->inputs); int h, j, k; if (!ann->hidden_layers) { double *ret = o; for (j = 0; j < ann->outputs; ++j) { double sum = *w++ * -1.0; for (k = 0; k < ann->inputs; ++k) { sum += *w++ * i[k]; } *o++ = genann_act_output_indirect(ann, sum); } return ret; } for (j = 0; j < ann->hidden; ++j) { double sum = *w++ * -1.0; for (k = 0; k < ann->inputs; ++k) { sum += *w++ * i[k]; } *o++ = genann_act_hidden_indirect(ann, sum); } i += ann->inputs; for (h = 1; h < ann->hidden_layers; ++h) { for (j = 0; j < ann->hidden; ++j) { double sum = *w++ * -1.0; for (k = 0; k < ann->hidden; ++k) { sum += *w++ * i[k]; } *o++ = genann_act_hidden_indirect(ann, sum); } i += ann->hidden; } double const *ret = o; for (j = 0; j < ann->outputs; ++j) { double sum = *w++ * -1.0; for (k = 0; k < ann->hidden; ++k) { sum += *w++ * i[k]; } *o++ = genann_act_output_indirect(ann, sum); } ((void) sizeof ((w - ann->weight == ann->total_weights) ? 1 : 0), __extension__ ({ if (w - ann->weight == ann->total_weights) ; else __assert_fail ("w - ann->weight == ann->total_weights", "genann.c", 271, __extension__ __PRETTY_FUNCTION__); })); ((void) sizeof ((o - ann->output == ann->total_neurons) ? 1 : 0), __extension__ ({ if (o - ann->output == ann->total_neurons) ; else __assert_fail ("o - ann->output == ann->total_neurons", "genann.c", 272, __extension__ __PRETTY_FUNCTION__); })); return ret; }
{ "array_type": 1, "break_continue_statement": 0, "enum_type": 0, "for_loop": 9, "function_pointer": 0, "goto_statement": 0, "if_statement": 3, "memory_management": 0, "memory_operation": 1, "pointer_type": 4, "return_statement": 2, "struct_type": 0, "switch_statement": 0, "type_casting": 3, "union_type": 0, "while_loop": 0 }
bc-1.07.1#string_prep#dc_makestring.c
bc-1.07.1
string.c
dc_makestring
17
dc_data dc_makestring ( const char *s , size_t len ) { dc_data result; struct dc_string *string; string = dc_malloc(sizeof *string); string->s_ptr = dc_malloc(len+1); memcpy(string->s_ptr, s, len); string->s_ptr[len] = '\0'; string->s_len = len; string->s_refs = 1; result.v.string = string; result.dc_type = DC_STRING; return result; }
{ "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": 1, "return_statement": 1, "struct_type": 1, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
less-633#optfunc_prep#opt_linenum_width.c
less-633
optfunc.c
opt_linenum_width
18
void opt_linenum_width(int type, char *s) { PARG parg; switch (type) { case 0: case 2: if (linenum_width > 16) { parg.p_int = 16; error("Line number width must not be larger than %d", &parg); linenum_width = 7; } break; case 1: break; } }
{ "array_type": 0, "break_continue_statement": 2, "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": 1, "type_casting": 0, "union_type": 0, "while_loop": 0 }
json.h#allow_hexadecimal_numbers_prep#json_write_number.c
json.h
allow_hexadecimal_numbers.c
json_write_number
115
char *json_write_number(const struct json_number_s *number, char *data) { uintmax_t parsed_number, backup; size_t i; if (number->number_size >= 2) { switch (number->number[1]) { default: break; case 'x': case 'X': parsed_number = strtoumax(number->number, 0, 0); backup = parsed_number; i = 0; while (0 != parsed_number) { parsed_number /= 10; i++; } parsed_number = backup; backup = i; do { *(data + i - 1) = '0' + (char)(parsed_number % 10); parsed_number /= 10; i--; } while (0 != parsed_number); data += backup; return data; } } i = 0; if ((i < number->number_size) && (('+' == number->number[i]) || ('-' == number->number[i]))) { i++; } if ((i < number->number_size) && ('I' == number->number[i])) { const char *inf = "Infinity"; size_t k; for (k = i; k < number->number_size; k++) { const char c = *inf++; if ('\0' == c) { break; } else if (c != number->number[k]) { break; } } if ('\0' == *inf++) { const char *dbl_max; if ('-' == number->number[0]) { *data++ = '-'; } for (dbl_max = "1.7976931348623158e308"; '\0' != *dbl_max; dbl_max++) { *data++ = *dbl_max; } return data; } } if ((i < number->number_size) && ('N' == number->number[i])) { const char *nan = "NaN"; size_t k; for (k = i; k < number->number_size; k++) { const char c = *nan++; if ('\0' == c) { break; } else if (c != number->number[k]) { break; } } if ('\0' == *nan++) { *data++ = '0'; return data; } } if ((i < number->number_size) && ('.' == number->number[i])) { i = 0; if ('+' == number->number[i]) { i++; } if ('-' == number->number[i]) { *data++ = '-'; i++; } *data++ = '0'; for (; i < number->number_size; i++) { *data++ = number->number[i]; } return data; } for (; i < number->number_size; i++) { const char c = number->number[i]; if (!('0' <= c && c <= '9')) { break; } } if ((i + 1 == number->number_size) && ('.' == number->number[i])) { i = 0; if ('+' == number->number[i]) { i++; } if ('-' == number->number[i]) { *data++ = '-'; i++; } for (; i < number->number_size; i++) { *data++ = number->number[i]; } *data++ = '0'; return data; } i = 0; if ('+' == number->number[i]) { i++; } for (; i < number->number_size; i++) { *data++ = number->number[i]; } return data; }
{ "array_type": 1, "break_continue_statement": 6, "enum_type": 0, "for_loop": 7, "function_pointer": 0, "goto_statement": 0, "if_statement": 19, "memory_management": 0, "memory_operation": 0, "pointer_type": 3, "return_statement": 6, "struct_type": 1, "switch_statement": 1, "type_casting": 1, "union_type": 0, "while_loop": 2 }
gprolog-1.5.0#linedit_prep#Pl_LE_Compl_Add_Word.c
gprolog-1.5.0
linedit.c
Pl_LE_Compl_Add_Word
22
char * Pl_LE_Compl_Add_Word(char *word, int word_length) { CompNode **p; CompNode *q; int cmp; for (p = &comp_start; *p; p = &(*p)->next) { cmp = strcmp((*p)->word, word); if (cmp == 0) return word; if (cmp > 0) break; } if ((q = (CompNode *) malloc(sizeof(CompNode))) == ((void *)0)) exit(1); q->word = word; q->word_length = word_length; q->next = *p; *p = q; return word; }
{ "array_type": 0, "break_continue_statement": 1, "enum_type": 0, "for_loop": 1, "function_pointer": 0, "goto_statement": 0, "if_statement": 3, "memory_management": 1, "memory_operation": 0, "pointer_type": 2, "return_statement": 2, "struct_type": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
libosip2-5.3.1#osip_time_prep#add_gettimeofday.c
libosip2-5.3.1
osip_time.c
add_gettimeofday
12
void add_gettimeofday(struct timeval *atv, int ms) { int m; if (ms >= 1000000) { atv->tv_usec = 0; m = ms / 1000; } else { atv->tv_usec += ms * 1000; m = atv->tv_usec / 1000000; atv->tv_usec = atv->tv_usec % 1000000; } atv->tv_sec += m; }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 1, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 0, "struct_type": 1, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
gawk-5.2.2#profile_prep#pp_string_or_typed_regex.c
gawk-5.2.2
profile.c
pp_string_or_typed_regex
61
char * pp_string_or_typed_regex(const char *in_str, size_t len, int delim, _Bool typed_regex) { static char str_escapes[] = "\a\b\f\n\r\t\v\\"; static char str_printables[] = "abfnrtv\\"; static char re_escapes[] = "\a\b\f\n\r\t\v"; static char re_printables[] = "abfnrtv"; char *escapes; char *printables; char *cp; int i; const unsigned char *str = (const unsigned char *) in_str; size_t ofre, osiz; char *obuf, *obufout; ((void) (0)); if (delim == '/') { escapes = re_escapes; printables = re_printables; } else { escapes = str_escapes; printables = str_printables; } osiz = len + 3 + 1 + (typed_regex == 1); (void) (obuf = (char *) emalloc_real((size_t)(osiz), "pp_string", "obuf", "profile.c", 1700)); obufout = obuf; ofre = osiz - 1; if (typed_regex) *obufout++ = '@'; *obufout++ = delim; for (; len > 0; len--, str++) { if ((2) > ofre) { long olen = obufout - obuf; (void) (obuf = (char *) erealloc_real((void *) obuf, (size_t)(osiz * 2), "pp_string", "obuf", "profile.c", 1709)); obufout = obuf + olen; ofre += osiz; osiz *= 2; } ofre -= (2); if (delim != '/' && *str == delim) { *obufout++ = '\\'; *obufout++ = delim; } else if (*str == '\0') { *obufout++ = '\\'; *obufout++ = '0'; if ((2) > ofre) { long olen = obufout - obuf; (void) (obuf = (char *) erealloc_real((void *) obuf, (size_t)(osiz * 2), "pp_string", "obuf", "profile.c", 1716)); obufout = obuf + olen; ofre += osiz; osiz *= 2; } ofre -= (2); *obufout++ = '0'; *obufout++ = '0'; } else if ((cp = strchr(escapes, *str)) != ((void *)0)) { i = cp - escapes; *obufout++ = '\\'; *obufout++ = printables[i]; } else if ((((*str) & ~0x7f) == 0) && ((*__ctype_b_loc ())[(int) ((*str))] & (unsigned short int) _ISprint)) { *obufout++ = *str; ofre += 1; } else { size_t len; if ((8) > ofre) { long olen = obufout - obuf; (void) (obuf = (char *) erealloc_real((void *) obuf, (size_t)(osiz * 2), "pp_string", "obuf", "profile.c", 1730)); obufout = obuf + olen; ofre += osiz; osiz *= 2; } ofre -= (8); sprintf(obufout, "\\%03o", *str & 0xff); len = strlen(obufout); ofre += (10 - len); obufout += len; } } if ((2) > ofre) { long olen = obufout - obuf; (void) (obuf = (char *) erealloc_real((void *) obuf, (size_t)(osiz * 2), "pp_string", "obuf", "profile.c", 1738)); obufout = obuf + olen; ofre += osiz; osiz *= 2; } ofre -= (2); *obufout++ = delim; *obufout = '\0'; return obuf; }
{ "array_type": 1, "break_continue_statement": 0, "enum_type": 0, "for_loop": 1, "function_pointer": 0, "goto_statement": 0, "if_statement": 10, "memory_management": 0, "memory_operation": 0, "pointer_type": 6, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 8, "union_type": 0, "while_loop": 0 }
bc-1.07.1#stack_prep#dc_register_get.c
bc-1.07.1
stack.c
dc_register_get
19
int dc_register_get ( int regid , dc_data *result ) { dc_list *r; regid = ((regid) & (((0x7f * 2 + 1)+1)-1)); r = dc_register[regid]; if (r==((void *)0)){ *result = dc_int2data(0); }else if (r->value.dc_type==DC_UNINITIALIZED){ fprintf(stderr, "%s: BUG: register ", progname); dc_show_id(stderr, regid, " exists but is uninitialized?\n"); return 2; }else{ *result = dc_dup(r->value); } return 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": 1, "return_statement": 2, "struct_type": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
transcoder-set#WRITE_AN_EFFICIENT_METHOD_TO_CHECK_IF_A_NUMBER_IS_MULTIPLE_OF_3_prep#cmpfunc.c
transcoder-set
WRITE_AN_EFFICIENT_METHOD_TO_CHECK_IF_A_NUMBER_IS_MULTIPLE_OF_3.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 }
lodepng#lodepng_prep#lodepng_save_file.c
lodepng
lodepng.c
lodepng_save_file
8
unsigned lodepng_save_file(const unsigned char* buffer, size_t buffersize, const char* filename) { FILE* file; file = fopen(filename, "wb" ); if(!file) return 79; fwrite(buffer, 1, buffersize, file); fclose(file); 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": 2, "struct_type": 0, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
diffutils-3.10#io_prep#read_files.c
diffutils-3.10
io.c
read_files
36
_Bool read_files (struct file_data filevec[], _Bool pretend_binary) { int i; _Bool skip_test = text | pretend_binary; _Bool appears_binary = pretend_binary | sip (&filevec[0], skip_test); if (filevec[0].desc != filevec[1].desc) appears_binary |= sip (&filevec[1], skip_test | appears_binary); else { filevec[1].buffer = filevec[0].buffer; filevec[1].bufsize = filevec[0].bufsize; filevec[1].buffered = filevec[0].buffered; } if (appears_binary) { set_binary_mode (filevec[0].desc, 0); set_binary_mode (filevec[1].desc, 0); return 1; } find_identical_ends (filevec); equivs_alloc = filevec[0].alloc_lines + filevec[1].alloc_lines + 1; equivs = xnmalloc (equivs_alloc, sizeof *equivs); equivs_index = 1; for (i = 9; (size_t) 1 << i < equivs_alloc / 3; i++) continue; nbuckets = ((size_t) 1 << i) - prime_offset[i]; buckets = xcalloc (nbuckets + 1, sizeof *buckets); buckets++; for (i = 0; i < 2; i++) find_and_hash_each_line (&filevec[i]); filevec[0].equiv_max = filevec[1].equiv_max = equivs_index; free (equivs); free (buckets - 1); return 0; }
{ "array_type": 2, "break_continue_statement": 1, "enum_type": 0, "for_loop": 2, "function_pointer": 0, "goto_statement": 0, "if_statement": 2, "memory_management": 2, "memory_operation": 0, "pointer_type": 0, "return_statement": 2, "struct_type": 0, "switch_statement": 0, "type_casting": 2, "union_type": 0, "while_loop": 0 }
transcoder-set#CHOCOLATE_DISTRIBUTION_PROBLEM_prep#max.c
transcoder-set
CHOCOLATE_DISTRIBUTION_PROBLEM.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 }
tmux#session_prep#session_groups_RB_INSERT.c
tmux
session.c
session_groups_RB_INSERT
1
struct session_group * session_groups_RB_INSERT(struct session_groups *head, struct session_group *elm) { struct session_group *tmp; struct session_group *parent = ((void *)0); int comp = 0; tmp = (head)->rbh_root; while (tmp) { parent = tmp; comp = (session_group_cmp)(elm, parent); if (comp < 0) tmp = (tmp)->entry.rbe_left; else if (comp > 0) tmp = (tmp)->entry.rbe_right; else return (tmp); } do { (elm)->entry.rbe_parent = parent; (elm)->entry.rbe_left = (elm)->entry.rbe_right = ((void *)0); (elm)->entry.rbe_color = 1; } while (0); if (parent != ((void *)0)) { if (comp < 0) (parent)->entry.rbe_left = elm; else (parent)->entry.rbe_right = elm; do {} while (0); } else (head)->rbh_root = elm; session_groups_RB_INSERT_COLOR(head, elm); 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": 1, "struct_type": 1, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 1 }
rcs-5.10.1#b-divvy_prep#accf.c
rcs-5.10.1
b-divvy.c
accf
8
void accf (struct divvy *divvy, char const *fmt, ...) { va_list args; __builtin_va_start(args,fmt); obstack_vprintf (&divvy->space, fmt, args); __builtin_va_end(args); }
{ "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 }
heman#mat3_prep#kmMat3Inverse.c
heman
mat3.c
kmMat3Inverse
14
kmMat3* kmMat3Inverse(kmMat3* pOut, const kmMat3* pM) { float determinate = kmMat3Determinant(pM); float detInv; kmMat3 adjugate; if(determinate == 0.0) { return ((void *)0); } detInv = 1.0 / determinate; kmMat3Adjugate(&adjugate, pM); kmMat3ScalarMultiply(pOut, &adjugate, detInv); return pOut; }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 1, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 2, "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#cmpfunc.c
transcoder-set
COUNT_NUMBER_BINARY_STRINGS_WITHOUT_CONSECUTIVE_1S.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 }
nano-7.2#winio_prep#record_macro.c
nano-7.2
winio.c
record_macro
13
void record_macro(void) { recording = !recording; if (recording) { macro_length = 0; statusline(REMARK, gettext("Recording a macro...")); } else { snip_last_keystroke(); statusline(REMARK, gettext("Stopped recording")); } if (((flags[((STATEFLAGS) / (sizeof(unsigned) * 8))] & ((unsigned)1 << ((STATEFLAGS) % (sizeof(unsigned) * 8)))) != 0)) titlebar(((void *)0)); }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 2, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 0, "struct_type": 0, "switch_statement": 0, "type_casting": 3, "union_type": 0, "while_loop": 0 }
dap-3.10#prob_prep#dap_simp.c
dap-3.10
prob.c
dap_simp
14
double dap_simp(double (*f)(), double a, double b, int n) { double h; double val; int i; h = (b - a) / ((double) n); val = 0.0; for (i = 1; i <= n - 1; i += 2) val += 4.0 * (*f)(a + ((double) i) * h); for (i = 2; i <= n - 2; i += 2) val += 2.0 * (*f)(a + ((double) i) * h); val += (*f)(a) + (*f)(b); return val * h / 3.0; }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 2, "function_pointer": 4, "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": 3, "union_type": 0, "while_loop": 0 }
libxml2#libxml2-py_prep#libxml_htmlNodeDumpFile.c
libxml2
libxml2-py.c
libxml_htmlNodeDumpFile
18
PyObject * libxml_htmlNodeDumpFile(PyObject *self __attribute__ ((__unused__)), PyObject *args) { FILE * out; PyObject *pyobj_out; xmlDocPtr doc; PyObject *pyobj_doc; xmlNodePtr cur; PyObject *pyobj_cur; if (!_PyArg_ParseTuple_SizeT(args, (char *)"OOO:htmlNodeDumpFile", &pyobj_out, &pyobj_doc, &pyobj_cur)) return(((void *)0)); out = (FILE *) (((pyobj_out) == (&_Py_NoneStruct)) ? ((void *)0) : libxml_PyFileGet(pyobj_out)); doc = (xmlDocPtr) (((pyobj_doc) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyxmlNode_Object *)(pyobj_doc))->obj)); cur = (xmlNodePtr) (((pyobj_cur) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyxmlNode_Object *)(pyobj_cur))->obj)); htmlNodeDumpFile(out, doc, cur); libxml_PyFileRelease(out); _Py_INCREF(((PyObject*)((&_Py_NoneStruct)))); return((&_Py_NoneStruct)); }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 1, "memory_management": 0, "memory_operation": 0, "pointer_type": 3, "return_statement": 2, "struct_type": 0, "switch_statement": 0, "type_casting": 5, "union_type": 0, "while_loop": 0 }
transcoder-set#SEQUENCES_GIVEN_LENGTH_EVERY_ELEMENT_EQUAL_TWICE_PREVIOUS_1_prep#f_filled.c
transcoder-set
SEQUENCES_GIVEN_LENGTH_EVERY_ELEMENT_EQUAL_TWICE_PREVIOUS_1.c
f_filled
1
int f_filled ( int m, 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 }
mtools-4.0.43#mformat_prep#setFsSectorSize.c
mtools-4.0.43
mformat.c
setFsSectorSize
15
void setFsSectorSize(Fs_t *Fs, struct device *dev, uint16_t msize) { unsigned int j; Fs->sector_size = 512; if( !(dev->use_2m & 0x7f)) { Fs->sector_size = (uint16_t) (128u << (dev->ssize & 0x7f)); } if(msize)Fs->sector_size=msize; for(j = 0; j < 31; j++) { if (Fs->sector_size == (unsigned int) (1 << j)) { Fs->sectorShift = j; break; } } Fs->sectorMask = Fs->sector_size - 1; }
{ "array_type": 0, "break_continue_statement": 1, "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": 0, "struct_type": 1, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
transcoder-set#FIND_N_TH_ELEMENT_FROM_STERNS_DIATOMIC_SERIES_prep#f_filled.c
transcoder-set
FIND_N_TH_ELEMENT_FROM_STERNS_DIATOMIC_SERIES.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 }
libxml2#hash_prep#xmlHashQLookup2.c
libxml2
hash.c
xmlHashQLookup2
6
void * xmlHashQLookup2(xmlHashTablePtr hash, const xmlChar *prefix, const xmlChar *name, const xmlChar *prefix2, const xmlChar *name2) { return(xmlHashQLookup3(hash, prefix, name, prefix2, name2, ((void *)0), ((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": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
libxml2#hash_prep#xmlHashUpdateEntry.c
libxml2
hash.c
xmlHashUpdateEntry
9
int xmlHashUpdateEntry(xmlHashTablePtr hash, const xmlChar *key, void *payload, xmlHashDeallocator dealloc) { int res = xmlHashUpdateInternal(hash, key, ((void *)0), ((void *)0), payload, dealloc, 1); if (res == 1) res = 0; return(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": 0, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
json.h#allow_inf_and_nan_prep#json_skip_c_style_comments.c
json.h
allow_inf_and_nan.c
json_skip_c_style_comments
40
int json_skip_c_style_comments(struct json_parse_state_s *state) { if ((state->offset + 2) > state->size) { return 0; } if ('/' == state->src[state->offset]) { if ('/' == state->src[state->offset + 1]) { state->offset++; state->offset++; while (state->offset < state->size) { switch (state->src[state->offset]) { default: state->offset++; break; case '\n': state->offset++; state->line_no++; state->line_offset = state->offset; return 1; } } return 1; } else if ('*' == state->src[state->offset + 1]) { state->offset++; state->offset++; while (state->offset + 1 < state->size) { if (('*' == state->src[state->offset]) && ('/' == state->src[state->offset + 1])) { state->offset += 2; return 1; } else if ('\n' == state->src[state->offset]) { state->line_no++; state->line_offset = state->offset; } state->offset++; } return 1; } } return 0; }
{ "array_type": 0, "break_continue_statement": 1, "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": 6, "struct_type": 1, "switch_statement": 1, "type_casting": 0, "union_type": 0, "while_loop": 2 }
pexec-1.0rc8#fifo_prep#fifo_skip.c
pexec-1.0rc8
fifo.c
fifo_skip
4
size_t fifo_skip(fifo *f,size_t size) { return(fifo_read(f,((void *)0),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": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 1, "union_type": 0, "while_loop": 0 }
transcoder-set#SUM_MATRIX_ELEMENT_ELEMENT_INTEGER_DIVISION_ROW_COLUMN_prep#cmpfunc.c
transcoder-set
SUM_MATRIX_ELEMENT_ELEMENT_INTEGER_DIVISION_ROW_COLUMN.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 }
uucp-1.07#log_prep#ustats_close.c
uucp-1.07
log.c
ustats_close
11
void ustats_close () { if (eLstats != ((void *)0)) { if (fclose (eLstats) != 0) ulog (LOG_ERROR, "fclose: %s", strerror ((*__errno_location ()))); eLstats = ((void *)0); fLstats_tried = (0); } }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 2, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 0, "struct_type": 0, "switch_statement": 0, "type_casting": 2, "union_type": 0, "while_loop": 0 }
patch-2.7.6#tempname_prep#gen_tempname.c
patch-2.7.6
tempname.c
gen_tempname
21
int gen_tempname (char *tmpl, int suffixlen, int flags, int kind) { int (*tryfunc) (char *, void *); switch (kind) { case 0: tryfunc = try_file; break; case 1: tryfunc = try_dir; break; case 2: tryfunc = try_nocreate; break; default: ((void) sizeof ((! "invalid KIND in __gen_tempname") ? 1 : 0), __extension__ ({ if (! "invalid KIND in __gen_tempname") ; else __assert_fail ("! \"invalid KIND in __gen_tempname\"", "tempname.c", 319, __extension__ __PRETTY_FUNCTION__); })); abort (); } return try_tempname (tmpl, suffixlen, &flags, tryfunc); }
{ "array_type": 0, "break_continue_statement": 3, "enum_type": 0, "for_loop": 0, "function_pointer": 1, "goto_statement": 0, "if_statement": 1, "memory_management": 0, "memory_operation": 0, "pointer_type": 1, "return_statement": 1, "struct_type": 0, "switch_statement": 1, "type_casting": 1, "union_type": 0, "while_loop": 0 }
wget-1.21.4#utils_prep#datetime_str.c
wget-1.21.4
utils.c
datetime_str
5
char * datetime_str (time_t t) { return fmttime(t, "%Y-%m-%d %H:%M:%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 }
uucp-1.07#recep_prep#fsysdep_already_received.c
uucp-1.07
recep.c
fsysdep_already_received
25
boolean fsysdep_already_received (qsys, zto, ztemp) const struct uuconf_system *qsys; const char *zto __attribute__ ((__unused__)); const char *ztemp; { char *zfile; struct stat s; boolean fret; zfile = zsreceived_name (qsys, ztemp); if (zfile == ((void *)0)) return (0); if (stat (zfile, &s) < 0) { if ((*__errno_location ()) != 2) ulog (LOG_ERROR, "stat (%s): %s", zfile, strerror ((*__errno_location ()))); ubuffree (zfile); return (0); } fret = s.st_mtim.tv_sec + ((long) 7 * (long) 24 * (long) 60 * (long) 60) >= time ((time_t *) ((void *)0)); if (fret) do { if (((iDebug & ((0200))) != 0)) ulog (LOG_DEBUG, ("fsysdep_already_received: Found %s"), (zfile)); } while (0); ubuffree (zfile); return fret; }
{ "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": 3, "struct_type": 1, "switch_statement": 0, "type_casting": 2, "union_type": 0, "while_loop": 1 }
transcoder-set#MEDIAN_OF_TWO_SORTED_ARRAYS_prep#sort.c
transcoder-set
MEDIAN_OF_TWO_SORTED_ARRAYS.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 }
wget-1.21.4#host_prep#address_list_contains.c
wget-1.21.4
host.c
address_list_contains
29
_Bool address_list_contains (const struct address_list *al, const ip_address *ip) { int i; switch (ip->family) { case 2: for (i = 0; i < al->count; i++) { ip_address *cur = al->addresses + i; if (cur->family == 2 && (cur->data.d4.s_addr == ip->data.d4.s_addr)) return 1; } return 0; case 10: for (i = 0; i < al->count; i++) { ip_address *cur = al->addresses + i; if (cur->family == 10 && cur->ipv6_scope == ip->ipv6_scope && (__extension__ ({ const struct in6_addr *__a = (const struct in6_addr *) (&cur->data.d6); const struct in6_addr *__b = (const struct in6_addr *) (&ip->data.d6); __a->__in6_u.__u6_addr32[0] == __b->__in6_u.__u6_addr32[0] && __a->__in6_u.__u6_addr32[1] == __b->__in6_u.__u6_addr32[1] && __a->__in6_u.__u6_addr32[2] == __b->__in6_u.__u6_addr32[2] && __a->__in6_u.__u6_addr32[3] == __b->__in6_u.__u6_addr32[3]; }))) return 1; } return 0; default: abort (); } }
{ "array_type": 1, "break_continue_statement": 0, "enum_type": 0, "for_loop": 2, "function_pointer": 0, "goto_statement": 0, "if_statement": 2, "memory_management": 0, "memory_operation": 0, "pointer_type": 1, "return_statement": 4, "struct_type": 2, "switch_statement": 1, "type_casting": 0, "union_type": 0, "while_loop": 0 }
libzahl-1.0#zcmp_prep#zcmp.c
libzahl-1.0
zcmp.c
zcmp
7
int zcmp(z_t a, z_t b) { if (zsignum(a) != zsignum(b)) return zsignum(a) < zsignum(b) ? -1 : zsignum(a) > zsignum(b); return zsignum(a) * zcmpmag(a, b); }
{ "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 }
nano-7.2#chars_prep#mbstrcasestr.c
nano-7.2
chars.c
mbstrcasestr
13
char *mbstrcasestr(const char *haystack, const char *needle) { if (use_utf8) { size_t needle_len = mbstrlen(needle); while (*haystack != '\0') { if (mbstrncasecmp(haystack, needle, needle_len) == 0) return (char *)haystack; haystack += char_length(haystack); } return ((void *)0); } else return (char *)strcasestr(haystack, needle); }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 2, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 3, "struct_type": 0, "switch_statement": 0, "type_casting": 3, "union_type": 0, "while_loop": 1 }
optipng-0.7.8#pngget_prep#png_get_x_offset_microns.c
optipng-0.7.8
pngget.c
png_get_x_offset_microns
7
png_int_32 png_get_x_offset_microns(png_const_structrp png_ptr, png_const_inforp info_ptr) { (void)png_ptr; (void)info_ptr; 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": 2, "union_type": 0, "while_loop": 0 }
transcoder-set#MAXIMUM_CONSECUTIVE_REPEATING_CHARACTER_STRING_1_prep#sort.c
transcoder-set
MAXIMUM_CONSECUTIVE_REPEATING_CHARACTER_STRING_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 }
pth-2.0.7#pth_ring_prep#__pth_ring_favorite.c
pth-2.0.7
pth_ring.c
__pth_ring_favorite
12
int __pth_ring_favorite(pth_ring_t *r, pth_ringnode_t *rn) { if (r == ((void *)0)) return (0); if (r->r_hook == ((void *)0)) return (0); if (r->r_hook == rn) return (!(0)); __pth_ring_delete(r, rn); __pth_ring_prepend(r, rn); 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": 0, "return_statement": 4, "struct_type": 0, "switch_statement": 0, "type_casting": 2, "union_type": 0, "while_loop": 0 }
json.h#allow_equals_in_object_prep#json_write_minified_get_object_size.c
json.h
allow_equals_in_object.c
json_write_minified_get_object_size
18
int json_write_minified_get_object_size(const struct json_object_s *object, size_t *size) { struct json_object_element_s *element; *size += 2; *size += object->length; if (1 < object->length) { *size += object->length - 1; } for (element = object->start; 0 != element; element = element->next) { if (json_write_get_string_size(element->name, size)) { return 1; } if (json_write_minified_get_value_size(element->value, size)) { return 1; } } return 0; }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 1, "function_pointer": 0, "goto_statement": 0, "if_statement": 3, "memory_management": 0, "memory_operation": 0, "pointer_type": 1, "return_statement": 3, "struct_type": 2, "switch_statement": 0, "type_casting": 0, "union_type": 0, "while_loop": 0 }
lil#lil_prep#lil_to_integer.c
lil
lil.c
lil_to_integer
4
lilint_t lil_to_integer(lil_value_t val) { return (lilint_t)atoll(lil_to_string(val)); }
{ "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 }