id stringlengths 21 132 | codebase stringclasses 57 values | c_file stringlengths 3 108 | function stringlengths 3 74 | sloc stringclasses 134 values | c_code stringlengths 25 52.1k | c_constructs dict |
|---|---|---|---|---|---|---|
transcoder-set#SEARCH_INSERT_AND_DELETE_IN_AN_UNSORTED_ARRAY_prep#main.c | transcoder-set | SEARCH_INSERT_AND_DELETE_IN_AN_UNSORTED_ARRAY.c | main | 26 | int main(void) {
int n_success = 0;
int param0_0[] = {4,8,11,23,55,57,73,74,77,79,93};
int param0_1[] = {-88,12,-62,-66,-24,18,12,22,94,30,-50,-42,-94,18,76,-6,-48,-68,48,36,-78,52,-82,76,2,-44,-10,88};
int param0_2[] = {0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1};
int param0_3[] = {33,9,93,70,81,70,56,66,72,81,74,32,71,72,3,81,70,22,82,2,75,18,90,29,48};
int param0_4[] = {-98,-70,-62,-60,-60,-54,-48,-48,-46,-44,-34,-26,-18,-6,4,18,28,32,34,40,50,54,56,62,64,64,98};
int param0_5[] = {1,1,1,1,0,0,0,0,1,0,0,1,0,0,1,1,0,1,1,0,0,1};
int param0_6[] = {4,6,7,10,10,12,13,18,23,29,29,34,46,54,60,61,63,67,69,70,72,76,79,79,81,82,88,90,99};
int param0_7[] = {94,34,-60,-74,86,80,68,-48,78,-62,-98,-44,-44,92,-94,-86,-36,12,84,-90,52,42,-42,-66,88,76,66};
int param0_8[] = {0,0,0,1};
int param0_9[] = {76,59,38,83,38,93,27,11,17,80,26,28,35,53,88,10,9,75};
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[] = {8,27,11,24,18,17,15,21,2,12};
int param2[] = {11,12,0,72,23,16,28,16,3,13};
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
} |
less-633#position_prep#add_back_pos.c | less-633 | position.c | add_back_pos | 7 | void add_back_pos(POSITION pos)
{
int i;
for (i = sc_height - 1; i > 0; i--)
table[i] = table[i-1];
table[0] = pos;
}
| {
"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": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
tar-1.34#fdutimensat_prep#fdutimensat.c | tar-1.34 | fdutimensat.c | fdutimensat | 16 | int
fdutimensat (int fd, int dir, char const *file, struct timespec const ts[2],
int atflag)
{
int result = 1;
if (0 <= fd)
result = futimens (fd, ts);
if (file && (fd < 0 || (result == -1 && (*__errno_location ()) == 38)))
result = utimensat (dir, file, ts, atflag);
if (result == 1)
{
(*__errno_location ()) = 9;
result = -1;
}
return result;
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
tar-1.34#inttostr_prep#inttostr.c | tar-1.34 | inttostr.c | inttostr | 20 | char * __attribute__ ((__warn_unused_result__))
inttostr (int i, char *buf)
{
char *p = buf + (((((sizeof (int) * 8) - (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (int)) 0 < (__typeof__ (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": 1,
"union_type": 0,
"while_loop": 2
} |
transcoder-set#N_TH_NUMBER_WHOSE_SUM_OF_DIGITS_IS_TEN_1_prep#sort.c | transcoder-set | N_TH_NUMBER_WHOSE_SUM_OF_DIGITS_IS_TEN_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
} |
tmux#layout_prep#layout_fix_panes.c | tmux | layout.c | layout_fix_panes | 39 | void
layout_fix_panes(struct window *w, u_int wsx, u_int wsy)
{
struct window_pane *wp;
struct layout_cell *lc;
u_int sx, sy;
int shift, status, at_top;
status = options_get_number(w->options, "pane-border-status");
at_top = (status == 1);
for((wp) = ((&w->panes)->tqh_first); (wp) != ((void *)0); (wp) = ((wp)->entry.tqe_next)) {
if ((lc = wp->layout_cell) == ((void *)0))
continue;
if (status != 0)
shift = layout_need_status(lc, at_top);
else
shift = 0;
wp->xoff = lc->xoff;
wp->yoff = lc->yoff;
if (shift && at_top)
wp->yoff += 1;
if (lc->xoff >= wsx || lc->xoff + lc->sx < wsx)
sx = lc->sx;
else {
sx = wsx - lc->xoff;
if (sx < 1)
sx = lc->sx;
}
if (lc->yoff >= wsy || lc->yoff + lc->sy < wsy)
sy = lc->sy;
else {
sy = wsy - lc->yoff;
if (sy < 2)
sy = lc->sy;
}
if (shift)
sy -= 1;
window_pane_resize(wp, sx, sy);
}
}
| {
"array_type": 0,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 8,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 0,
"struct_type": 3,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
findutils-4.9.0#timespec-sub_prep#timespec_sub.c | findutils-4.9.0 | timespec-sub.c | timespec_sub | 34 | struct timespec
timespec_sub (struct timespec a, struct timespec b)
{
time_t rs = a.tv_sec;
time_t bs = b.tv_sec;
int ns = a.tv_nsec - b.tv_nsec;
int rns = ns;
if (ns < 0)
{
rns = ns + TIMESPEC_HZ;
time_t bs1;
if (!__builtin_add_overflow (bs, 1, &bs1))
bs = bs1;
else if (- (! ((time_t) 0 < (time_t) -1)) < rs)
rs--;
else
goto low_overflow;
}
if (__builtin_sub_overflow (rs, bs, &rs))
{
if (0 < bs)
{
low_overflow:
rs = ((time_t) ~ ((time_t) (! (! ((time_t) 0 < (time_t) -1)) ? (time_t) -1 : ((((time_t) 1 << ((sizeof (time_t) * 8) - 2)) - 1) * 2 + 1))));
rns = 0;
}
else
{
rs = ((time_t) (! (! ((time_t) 0 < (time_t) -1)) ? (time_t) -1 : ((((time_t) 1 << ((sizeof (time_t) * 8) - 2)) - 1) * 2 + 1)));
rns = TIMESPEC_HZ - 1;
}
}
return make_timespec (rs, rns);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 1,
"if_statement": 5,
"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#gifread_prep#GIFInitImage.c | optipng-0.7.8 | gifread.c | GIFInitImage | 6 | void GIFInitImage(struct GIFImage *image,
struct GIFScreen *screen, unsigned char **rows)
{
image->Screen = screen;
image->Rows = rows;
}
| {
"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": 2,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
uucp-1.07#xqtsub_prep#fsysdep_unlock_uuxqt.c | uucp-1.07 | xqtsub.c | fsysdep_unlock_uuxqt | 22 | boolean
fsysdep_unlock_uuxqt (iseq, zcmd, cmaxuuxqts)
int iseq;
const char *zcmd;
int cmaxuuxqts __attribute__ ((__unused__));
{
char ab[sizeof "LCK.XQT.9999"];
boolean fret;
fret = (1);
sprintf (ab, "LCK.XQT.%d", iseq);
if (! fsdo_unlock (ab, (1)))
fret = (0);
if (zcmd != ((void *)0))
{
char abcmd[sizeof "LXQ.123456789"];
sprintf (abcmd, "LXQ.%.9s", zcmd);
abcmd[strcspn (abcmd, " \t/")] = '\0';
if (! fsdo_unlock (abcmd, (1)))
fret = (0);
}
return fret;
}
| {
"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": 1,
"union_type": 0,
"while_loop": 0
} |
urlparser#gen_char_category_table_prep#main.c | urlparser | gen_char_category_table.c | main | 16 | int main()
{
fill( Scheme , alnum, "+-.");
fill( Unreserved, alnum, unreserved);
fill( GenDelim , alnum, ":/?#[]@");
fill( SubDelim , alnum, subdelim);
fill( PCharSlash, alnum, ":@/%");
fill( PCharSlash, unreserved, subdelim);
fill( HexDigit, "0123456789", "abcdef" "ABCDEF");
fill( Query, alnum, "/?:@%");
fill( Query, unreserved, subdelim);
fill( Userinfo, alnum, ":%");
fill( Userinfo, unreserved, subdelim);
fill( IPv6Char, "0123456789", "abcdef" "ABCDEF" ":");
print_table();
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libosip2-5.3.1#osip_uri_prep#__osip_uri_escape_header_param.c | libosip2-5.3.1 | osip_uri.c | __osip_uri_escape_header_param | 3 | char *__osip_uri_escape_header_param(char *string) {
return __osip_uri_escape_nonascii_and_nondef(string, header_param_def);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#SMALLEST_OF_THREE_INTEGERS_WITHOUT_COMPARISON_OPERATORS_prep#sort.c | transcoder-set | SMALLEST_OF_THREE_INTEGERS_WITHOUT_COMPARISON_OPERATORS.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#pngget_prep#png_get_chunk_cache_max.c | optipng-0.7.8 | pngget.c | png_get_chunk_cache_max | 5 | png_uint_32
png_get_chunk_cache_max(png_const_structrp png_ptr)
{
return (png_ptr ? png_ptr->user_chunk_cache_max : 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
} |
tinycc#tccelf_prep#find_elf_sym.c | tinycc | tccelf.c | find_elf_sym | 21 | int find_elf_sym(Section *s, const char *name)
{
Elf64_Sym *sym;
Section *hs;
int nbuckets, sym_index, h;
const char *name1;
hs = s->hash;
if (!hs)
return 0;
nbuckets = ((int *)hs->data)[0];
h = elf_hash((unsigned char *) name) % nbuckets;
sym_index = ((int *)hs->data)[2 + h];
while (sym_index != 0) {
sym = &((Elf64_Sym *)s->data)[sym_index];
name1 = (char *) s->link->data + sym->st_name;
if (!strcmp(name, name1))
return sym_index;
sym_index = ((int *)hs->data)[2 + nbuckets + sym_index];
}
return 0;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 3,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 1
} |
libxml2#buf_prep#xmlBufferLength.c | libxml2 | buf.c | xmlBufferLength | 7 | int
xmlBufferLength(const xmlBuffer *buf)
{
if(!buf)
return 0;
return buf->use;
}
| {
"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
} |
libxml2#xmlwriter_prep#xmlNewTextWriterFilename.c | libxml2 | xmlwriter.c | xmlNewTextWriterFilename | 22 | xmlTextWriterPtr
xmlNewTextWriterFilename(const char *uri, int compression)
{
xmlTextWriterPtr ret;
xmlOutputBufferPtr out;
out = xmlOutputBufferCreateFilename(uri, ((void *)0), compression);
if (out == ((void *)0)) {
xmlWriterErrMsg(((void *)0), XML_IO_EIO,
"xmlNewTextWriterFilename : cannot open uri\n");
return ((void *)0);
}
ret = xmlNewTextWriter(out);
if (ret == ((void *)0)) {
xmlWriterErrMsg(((void *)0), XML_ERR_NO_MEMORY,
"xmlNewTextWriterFilename : out of memory!\n");
xmlOutputBufferClose(out);
return ((void *)0);
}
ret->indent = 0;
ret->doindent = 0;
return ret;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 7,
"union_type": 0,
"while_loop": 0
} |
mcsim-6.2.0#modelu_prep#ModelIndex.c | mcsim-6.2.0 | modelu.c | ModelIndex | 4 | int ModelIndex (HVAR hvar)
{
return (IsModelVar(hvar) ? ((int) ((hvar) & 0x0FFFF)) : 0);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
mtools-4.0.43#direntry_prep#getEntryAsPos.c | mtools-4.0.43 | direntry.c | getEntryAsPos | 5 | unsigned int getEntryAsPos(direntry_t *entry) {
int pos = entry->entry;
((void) sizeof ((pos >= 0) ? 1 : 0), __extension__ ({ if (pos >= 0) ; else __assert_fail ("pos >= 0", "direntry.c", 57, __extension__ __PRETTY_FUNCTION__); }));
return (unsigned int) 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": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
json.h#allow_hexadecimal_numbers_prep#json_extract_get_string_size.c | json.h | allow_hexadecimal_numbers.c | json_extract_get_string_size | 7 | struct json_extract_result_s
json_extract_get_string_size(const struct json_string_s *const string) {
struct json_extract_result_s result;
result.dom_size = sizeof(struct json_string_s);
result.data_size = string->string_size + 1;
return result;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
nettle-3.9.1#gcm-aes_prep#nettle_gcm_aes_set_iv.c | nettle-3.9.1 | gcm-aes.c | nettle_gcm_aes_set_iv | 6 | void
nettle_gcm_aes_set_iv(struct gcm_aes_ctx *ctx,
size_t length, const uint8_t *iv)
{
nettle_gcm_set_iv(&(ctx)->gcm, &(ctx)->key, (length), (iv));
}
| {
"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#NUMBER_UNIQUE_RECTANGLES_FORMED_USING_N_UNIT_SQUARES_prep#main.c | transcoder-set | NUMBER_UNIQUE_RECTANGLES_FORMED_USING_N_UNIT_SQUARES.c | main | 14 | int main(void) {
int n_success = 0;
int param0[] = {34,49,41,17,67,38,59,64,61,58};
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
} |
libxml2#parserInternals_prep#xmlCtxtNewInputFromMemory.c | libxml2 | parserInternals.c | xmlCtxtNewInputFromMemory | 16 | xmlParserInputPtr
xmlCtxtNewInputFromMemory(xmlParserCtxtPtr ctxt, const char *url,
const void *mem, size_t size,
const char *encoding, int flags) {
xmlParserInputPtr input;
if ((ctxt == ((void *)0)) || (mem == ((void *)0)))
return(((void *)0));
input = xmlNewInputFromMemory(url, mem, size, 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
} |
libosip2-5.3.1#osip_transaction_prep#osip_transaction_set_reserved2.c | libosip2-5.3.1 | osip_transaction.c | osip_transaction_set_reserved2 | 6 | int osip_transaction_set_reserved2(osip_transaction_t *transaction, void *ptr) {
if (transaction == ((void *)0))
return -2;
transaction->reserved2 = ptr;
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": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#MAXIMUM_SUM_IARRI_AMONG_ROTATIONS_GIVEN_ARRAY_1_prep#f_gold.c | transcoder-set | MAXIMUM_SUM_IARRI_AMONG_ROTATIONS_GIVEN_ARRAY_1.c | f_gold | 19 | int f_gold ( int arr [ ], int n ) {
int cum_sum = 0;
for ( int i = 0;
i < n;
i ++ ) cum_sum += arr [ i ];
int curr_val = 0;
for ( int i = 0;
i < n;
i ++ ) curr_val += i * arr [ i ];
int res = curr_val;
for ( int i = 1;
i < n;
i ++ ) {
int next_val = curr_val - ( cum_sum - arr [ i - 1 ] ) + arr [ i - 1 ] * ( n - 1 );
curr_val = next_val;
res = max ( res, next_val );
}
return res;
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 3,
"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_header_prep#osip_header_set_name.c | libosip2-5.3.1 | osip_header.c | osip_header_set_name | 3 | void osip_header_set_name(osip_header_t *header, char *name) {
header->hname = name;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
tar-1.34#buffer_prep#xclose.c | tar-1.34 | buffer.c | xclose | 6 | void
xclose (int fd)
{
if (close (fd) != 0)
close_error (gettext ("(pipe)"));
}
| {
"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
} |
libxml2#xmlstring_prep#xmlStrncasecmp.c | libxml2 | xmlstring.c | xmlStrncasecmp | 13 | int
xmlStrncasecmp(const xmlChar *str1, const xmlChar *str2, int len) {
register int tmp;
if (len <= 0) return(0);
if (str1 == str2) return(0);
if (str1 == ((void *)0)) return(-1);
if (str2 == ((void *)0)) return(1);
do {
tmp = casemap[*str1++] - casemap[*str2];
if (tmp != 0 || --len == 0) return(tmp);
} while (*str2++ != 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": 6,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 1
} |
findutils-4.9.0#pred_prep#pred_type.c | findutils-4.9.0 | pred.c | pred_type | 44 | _Bool
pred_type (const char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
{
mode_t mode;
enum file_type type = FTYPE_COUNT;
((void) sizeof ((state.have_type) ? 1 : 0), __extension__ ({ if (state.have_type) ; else __assert_fail ("state.have_type", "pred.c", 977, __extension__ __PRETTY_FUNCTION__); }));
if (0 == state.type)
{
return 0;
}
(void) pathname;
if (state.have_stat)
mode = stat_buf->st_mode;
else
mode = state.type;
switch (mode & 0170000)
{
case 0100000:
type = FTYPE_REG;
break;
case 0040000:
type = FTYPE_DIR;
break;
case 0120000:
type = FTYPE_LNK;
break;
case 0060000:
type = FTYPE_BLK;
break;
case 0020000:
type = FTYPE_CHR;
break;
case 0140000:
type = FTYPE_SOCK;
break;
case 0010000:
type = FTYPE_FIFO;
break;
}
if ((type != FTYPE_COUNT) && pred_ptr->args.types[type])
return 1;
else
return 0;
}
| {
"array_type": 1,
"break_continue_statement": 7,
"enum_type": 1,
"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": 1,
"switch_statement": 1,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
snudown#buffer_prep#buftruncate.c | snudown | buffer.c | buftruncate | 10 | int
buftruncate(struct buf *buf, size_t size)
{
if (buf->size < size || size < 0) {
((void) sizeof ((0) ? 1 : 0), __extension__ ({ if (0) ; else __assert_fail ("0", "buffer.c", 186, __extension__ __PRETTY_FUNCTION__); }));
return BUF_EINVALIDIDX;
}
buf->size = size;
return BUF_OK;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 2,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
lodepng#lodepng_prep#lodepng_compress_settings_init.c | lodepng | lodepng.c | lodepng_compress_settings_init | 11 | void lodepng_compress_settings_init(LodePNGCompressSettings* settings) {
settings->btype = 2;
settings->use_lz77 = 1;
settings->windowsize = 2048;
settings->minmatch = 3;
settings->nicematch = 128;
settings->lazymatching = 1;
settings->custom_zlib = 0;
settings->custom_deflate = 0;
settings->custom_context = 0;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libxml2#libxml2-py_prep#libxml_xmlUCSIsTags.c | libxml2 | libxml2-py.c | libxml_xmlUCSIsTags | 13 | PyObject *
libxml_xmlUCSIsTags(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
int c_retval;
int code;
if (libxml_deprecationWarning("xmlUCSIsTags") == -1)
return(((void *)0));
if (!_PyArg_ParseTuple_SizeT(args, (char *)"i:xmlUCSIsTags", &code))
return(((void *)0));
c_retval = xmlUCSIsTags(code);
py_retval = libxml_intWrap((int) c_retval);
return(py_retval);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
libxml2#libxml2-py_prep#libxml_xmlReplaceNode.c | libxml2 | libxml2-py.c | libxml_xmlReplaceNode | 16 | PyObject *
libxml_xmlReplaceNode(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
xmlNodePtr c_retval;
xmlNodePtr old;
PyObject *pyobj_old;
xmlNodePtr cur;
PyObject *pyobj_cur;
if (!_PyArg_ParseTuple_SizeT(args, (char *)"OO:xmlReplaceNode", &pyobj_old, &pyobj_cur))
return(((void *)0));
old = (xmlNodePtr) (((pyobj_old) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyxmlNode_Object *)(pyobj_old))->obj));
cur = (xmlNodePtr) (((pyobj_cur) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyxmlNode_Object *)(pyobj_cur))->obj));
c_retval = xmlReplaceNode(old, cur);
py_retval = libxml_xmlNodePtrWrap((xmlNodePtr) 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": 4,
"union_type": 0,
"while_loop": 0
} |
libosip2-5.3.1#osip_transaction_prep#osip_transaction_get_your_instance.c | libosip2-5.3.1 | osip_transaction.c | osip_transaction_get_your_instance | 5 | void *osip_transaction_get_your_instance(osip_transaction_t *transaction) {
if (transaction == ((void *)0))
return ((void *)0);
return transaction->reserved1;
}
| {
"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
} |
json.h#allow_unquoted_keys_prep#json_write_pretty_get_value_size.c | json.h | allow_unquoted_keys.c | json_write_pretty_get_value_size | 31 | int json_write_pretty_get_value_size(const struct json_value_s *value,
size_t depth, size_t indent_size,
size_t newline_size, size_t *size) {
switch (value->type) {
default:
return 1;
case json_type_number:
return json_write_get_number_size((struct json_number_s *)value->payload,
size);
case json_type_string:
return json_write_get_string_size((struct json_string_s *)value->payload,
size);
case json_type_array:
return json_write_pretty_get_array_size(
(struct json_array_s *)value->payload, depth, indent_size, newline_size,
size);
case json_type_object:
return json_write_pretty_get_object_size(
(struct json_object_s *)value->payload, depth, indent_size,
newline_size, size);
case json_type_true:
*size += 4;
return 0;
case json_type_false:
*size += 5;
return 0;
case json_type_null:
*size += 4;
return 0;
}
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 8,
"struct_type": 1,
"switch_statement": 1,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
screen-4.9.0#misc_prep#Kill.c | screen-4.9.0 | misc.c | Kill | 8 | void
Kill(pid, sig)
int pid, sig;
{
if (pid < 2)
return;
(void) kill(pid, sig);
}
| {
"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
} |
pth-2.0.7#pth_high_prep#pth_sendto.c | pth-2.0.7 | pth_high.c | pth_sendto | 4 | ssize_t pth_sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen)
{
return pth_sendto_ev(s, buf, len, flags, to, tolen, ((void *)0));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libosip2-5.3.1#osip_authorization_prep#osip_authorization_init.c | libosip2-5.3.1 | osip_authorization.c | osip_authorization_init | 7 | int osip_authorization_init(osip_authorization_t **dest) {
*dest = (osip_authorization_t *) (osip_malloc_func ? osip_malloc_func(sizeof(osip_authorization_t)) : malloc(sizeof(osip_authorization_t)));
if (*dest == ((void *)0))
return -4;
memset(*dest, 0, sizeof(osip_authorization_t));
return 0;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 1,
"memory_operation": 1,
"pointer_type": 0,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
json.h#allow_json5_prep#json_write_minified_object.c | json.h | allow_json5.c | json_write_minified_object | 21 | char *json_write_minified_object(const struct json_object_s *object,
char *data) {
struct json_object_element_s *element = 0;
*data++ = '{';
for (element = object->start; 0 != element; element = element->next) {
if (element != object->start) {
*data++ = ',';
}
data = json_write_string(element->name, data);
if (0 == data) {
return 0;
}
*data++ = ':';
data = json_write_minified_value(element->value, data);
if (0 == data) {
return 0;
}
}
*data++ = '}';
return data;
}
| {
"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
} |
tmux#cmd-find_prep#cmd_find_from_session_window.c | tmux | cmd-find.c | cmd_find_from_session_window | 15 | int
cmd_find_from_session_window(struct cmd_find_state *fs, struct session *s,
struct window *w, int flags)
{
cmd_find_clear_state(fs, flags);
fs->s = s;
fs->w = w;
if (cmd_find_best_winlink_with_window(fs) != 0) {
cmd_find_clear_state(fs, flags);
return (-1);
}
fs->wp = fs->w->active;
cmd_find_log_state(__func__, fs);
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": 2,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libosip2-5.3.1#sdp_accessor_prep#sdp_message_m_payload_get.c | libosip2-5.3.1 | sdp_accessor.c | sdp_message_m_payload_get | 6 | char *sdp_message_m_payload_get(sdp_message_t *sdp, int pos_media, int pos) {
sdp_media_t *med = osip_list_get(&sdp->m_medias, pos_media);
if (med == ((void *)0))
return ((void *)0);
return (char *) osip_list_get(&med->m_payloads, 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": 3,
"union_type": 0,
"while_loop": 0
} |
json.h#allow_location_information_prep#json_get_key_size.c | json.h | allow_location_information.c | json_get_key_size | 31 | int json_get_key_size(struct json_parse_state_s *state) {
const size_t flags_bitset = state->flags_bitset;
if (json_parse_flags_allow_unquoted_keys & flags_bitset) {
size_t offset = state->offset;
const size_t size = state->size;
const char *const src = state->src;
size_t data_size = state->data_size;
if ('"' == src[offset]) {
return json_get_string_size(state, 1);
} else if ((json_parse_flags_allow_single_quoted_strings & flags_bitset) &&
('\'' == src[offset])) {
return json_get_string_size(state, 1);
} else {
while ((offset < size) && is_valid_unquoted_key_char(src[offset])) {
offset++;
data_size++;
}
data_size++;
if (json_parse_flags_allow_location_information & flags_bitset) {
state->dom_size += sizeof(struct json_string_ex_s);
} else {
state->dom_size += sizeof(struct json_string_s);
}
state->offset = offset;
state->data_size = data_size;
return 0;
}
} else {
return json_get_string_size(state, 1);
}
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 4,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 4,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 1
} |
libxml2#libxml2-py_prep#libxml_xmlXPathGetContextSize.c | libxml2 | libxml2-py.c | libxml_xmlXPathGetContextSize | 13 | PyObject *
libxml_xmlXPathGetContextSize(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
int c_retval;
xmlXPathContextPtr ctxt;
PyObject *pyobj_ctxt;
if (!_PyArg_ParseTuple_SizeT(args, (char *)"O:xmlXPathGetContextSize", &pyobj_ctxt))
return(((void *)0));
ctxt = (xmlXPathContextPtr) (((pyobj_ctxt) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyxmlXPathContext_Object *)(pyobj_ctxt))->obj));
c_retval = ctxt->contextSize;
py_retval = libxml_intWrap((int) c_retval);
return(py_retval);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
tmux#tty-term_prep#tty_term_ptr1.c | tmux | tty-term.c | tty_term_ptr1 | 5 | const char *
tty_term_ptr1(struct tty_term *term, enum tty_code_code code, const void *a)
{
return (tparm((char *) tty_term_string(term, code), a, 0, 0, 0, 0, 0, 0, 0, 0));
}
| {
"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": 0,
"return_statement": 1,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libxml2#xmlwriter_prep#xmlTextWriterWriteVFormatAttribute.c | libxml2 | xmlwriter.c | xmlTextWriterWriteVFormatAttribute | 16 | int
xmlTextWriterWriteVFormatAttribute(xmlTextWriterPtr writer,
const xmlChar * name,
const char *format, va_list argptr)
{
int rc;
xmlChar *buf;
if (writer == ((void *)0))
return -1;
buf = xmlTextWriterVSprintf(format, argptr);
if (buf == ((void *)0))
return -1;
rc = xmlTextWriterWriteAttribute(writer, name, buf);
xmlFree(buf);
return rc;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
nettle-3.9.1#gmp-glue_prep#_nettle_mpz_set_n.c | nettle-3.9.1 | gmp-glue.c | _nettle_mpz_set_n | 6 | void
_nettle_mpz_set_n (mpz_t r, const mp_limb_t *xp, mp_size_t xn)
{
__gmpn_copyi (__gmpz_limbs_write (r, xn), xp, xn);
__gmpz_limbs_finish (r, xn);
}
| {
"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
} |
dap-3.10#dap0_prep#dap_name.c | dap-3.10 | dap0.c | dap_name | 25 | void dap_name(char dname[], char *fname)
{
struct stat statbuf;
if (!fname || !fname[0])
{
strcpy(dname, "/dev/null");
return;
}
strcpy(dname, dap_setdir);
if (stat(dname, &statbuf) < 0)
{
if (mkdir(dname, (mode_t) 0700) < 0)
{
perror(dap_dapname);
exit(1);
}
}
else if (!(statbuf.st_mode & 0040000))
{
fprintf(dap_err, "%s: non-directory file exists: %s\n", dap_dapname, dname);
exit(1);
}
strcat(dname, "/");
strcat(dname, fname);
}
| {
"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": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
cpio-2.14#paxerror_prep#exec_fatal.c | cpio-2.14 | paxerror.c | exec_fatal | 5 | void
exec_fatal (char const *name)
{
call_arg_fatal ("exec", name);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
screen-4.9.0#process_prep#ParseAttrColor.c | screen-4.9.0 | process.c | ParseAttrColor | 162 | int
ParseAttrColor(s1, s2, msgok)
char *s1, *s2;
int msgok;
{
int i, n;
char *s, *ss;
int r = 0;
s = s1;
while (*s == ' ')
s++;
ss = s;
while (*ss && *ss != ' ')
ss++;
while (*ss == ' ')
ss++;
if (*s && (s2 || *ss || !((*s >= 'a' && *s <= 'z') || (*s >= 'A' && *s <= 'Z') || *s == '.')))
{
int mode = 0, n = 0;
if (*s == '+')
{
mode = 1;
s++;
}
else if (*s == '-')
{
mode = -1;
s++;
}
else if (*s == '!')
{
mode = 2;
s++;
}
else if (*s == '=')
s++;
if (*s >= '0' && *s <= '9')
{
n = *s++ - '0';
if (*s >= '0' && *s <= '9')
n = n * 16 + (*s++ - '0');
else if (*s >= 'a' && *s <= 'f')
n = n * 16 + (*s++ - ('a' - 10));
else if (*s >= 'A' && *s <= 'F')
n = n * 16 + (*s++ - ('A' - 10));
else if (*s && *s != ' ')
{
if (msgok)
Msg(0, "Illegal attribute hexchar '%c'", *s);
return -1;
}
}
else
{
while (*s && *s != ' ')
{
if (*s == 'd')
n |= (1<<0);
else if (*s == 'u')
n |= (1<<1);
else if (*s == 'b')
n |= (1<<2);
else if (*s == 'r')
n |= (1<<3);
else if (*s == 's')
n |= (1<<4);
else if (*s == 'B')
n |= (1<<5);
else
{
if (msgok)
Msg(0, "Illegal attribute specifier '%c'", *s);
return -1;
}
s++;
}
}
if (*s && *s != ' ')
{
if (msgok)
Msg(0, "junk after attribute description: '%c'", *s);
return -1;
}
if (mode == -1)
r = n << 8 | n;
else if (mode == 1)
r = n << 8;
else if (mode == 2)
r = n;
else if (mode == 0)
r = 0xffff ^ n;
}
while (*s && *s == ' ')
s++;
if (s2)
{
if (*s)
{
if (msgok)
Msg(0, "junk after description: '%c'", *s);
return -1;
}
s = s2;
while (*s && *s == ' ')
s++;
}
if (*s)
{
static char costr[] = "krgybmcw d i.01234567 9 f FKRGYBMCW I ";
int numco = 0, j;
n = 0;
if (*s == '.')
{
numco++;
n = 0x0f;
s++;
}
for (j = 0; j < 2 && *s && *s != ' '; j++)
{
for (i = 0; costr[i]; i++)
if (*s == costr[i])
break;
if (!costr[i])
{
if (msgok)
Msg(0, "illegal color descriptor: '%c'", *s);
return -1;
}
numco++;
n = n << 4 | (i & 15);
if (i >= 48)
n = (n & 0x20ff) | 0x200;
s++;
}
if ((n & 0xf00) == 0xf00)
n ^= 0xf00;
if (n & 0x2000)
n ^= 0x2400;
if (numco == 1)
n |= 0xf0;
if (numco != 2 && n != 0xff)
n |= 0x100;
if (*s && *s != ' ')
{
if (msgok)
Msg(0, "junk after color description: '%c'", *s);
return -1;
}
n ^= 0xff;
r |= n << 16;
}
while (*s && *s == ' ')
s++;
if (*s)
{
if (msgok)
Msg(0, "junk after description: '%c'", *s);
return -1;
}
do {} while (0);
return r;
}
| {
"array_type": 1,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 2,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 41,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 8,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 8
} |
transcoder-set#COMPUTE_N_UNDER_MODULO_P_prep#len.c | transcoder-set | COMPUTE_N_UNDER_MODULO_P.c | len | 1 | int len (int arr [ ]) {return ((int) (sizeof (arr) / sizeof (arr)[0]));}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libxml2#libxml2-py_prep#libxml_xmlUCSIsPrivateUse.c | libxml2 | libxml2-py.c | libxml_xmlUCSIsPrivateUse | 13 | PyObject *
libxml_xmlUCSIsPrivateUse(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
int c_retval;
int code;
if (libxml_deprecationWarning("xmlUCSIsPrivateUse") == -1)
return(((void *)0));
if (!_PyArg_ParseTuple_SizeT(args, (char *)"i:xmlUCSIsPrivateUse", &code))
return(((void *)0));
c_retval = xmlUCSIsPrivateUse(code);
py_retval = libxml_intWrap((int) c_retval);
return(py_retval);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#MAXIMUM_BINOMIAL_COEFFICIENT_TERM_VALUE_prep#f_gold.c | transcoder-set | MAXIMUM_BINOMIAL_COEFFICIENT_TERM_VALUE.c | f_gold | 18 | int f_gold ( int n ) {
int C [ n + 1 ] [ n + 1 ];
for ( int i = 0;
i <= n;
i ++ ) {
for ( int j = 0;
j <= min ( i, n );
j ++ ) {
if ( j == 0 || j == i ) C [ i ] [ j ] = 1;
else C [ i ] [ j ] = C [ i - 1 ] [ j - 1 ] + C [ i - 1 ] [ j ];
}
}
int maxvalue = 0;
for ( int i = 0;
i <= n;
i ++ ) maxvalue = max ( maxvalue, C [ n ] [ i ] );
return maxvalue;
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 3,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libxml2#xpath_prep#xmlXPathEval.c | libxml2 | xpath.c | xmlXPathEval | 23 | xmlXPathObjectPtr
xmlXPathEval(const xmlChar *str, xmlXPathContextPtr ctx) {
xmlXPathParserContextPtr ctxt;
xmlXPathObjectPtr res;
if (ctx == ((void *)0))
return(((void *)0));
xmlInitParser();
xmlResetError(&ctx->lastError);
ctxt = xmlXPathNewParserContext(str, ctx);
if (ctxt == ((void *)0))
return ((void *)0);
xmlXPathEvalExpr(ctxt);
if (ctxt->error != XPATH_EXPRESSION_OK) {
res = ((void *)0);
} else if (ctxt->valueNr != 1) {
xmlXPathErr(ctxt, XPATH_STACK_ERROR);
res = ((void *)0);
} else {
res = valuePop(ctxt);
}
xmlXPathFreeParserContext(ctxt);
return(res);
}
| {
"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": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 6,
"union_type": 0,
"while_loop": 0
} |
libxml2#libxml2-py_prep#libxml_xmlReadFd.c | libxml2 | libxml2-py.c | libxml_xmlReadFd | 14 | PyObject *
libxml_xmlReadFd(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
xmlDocPtr c_retval;
int fd;
char * URL;
char * encoding;
int options;
if (!_PyArg_ParseTuple_SizeT(args, (char *)"izzi:xmlReadFd", &fd, &URL, &encoding, &options))
return(((void *)0));
c_retval = xmlReadFd(fd, URL, encoding, options);
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
} |
libosip2-5.3.1#osip_content_length_prep#osip_content_length_parse.c | libosip2-5.3.1 | osip_content_length.c | osip_content_length_parse | 13 | int osip_content_length_parse(osip_content_length_t *content_length, const char *hvalue) {
size_t len;
if (hvalue == ((void *)0))
return -2;
len = strlen(hvalue);
if (len + 1 < 2)
return -5;
content_length->value = (char *) (osip_malloc_func ? osip_malloc_func(len + 1) : malloc(len + 1));
if (content_length->value == ((void *)0))
return -4;
osip_strncpy(content_length->value, hvalue, len);
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": 1,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 4,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 0
} |
gzip-1.12#util_prep#copy.c | gzip-1.12 | util.c | copy | 16 | int copy(in, out)
int in, out;
{
int got;
(*__errno_location ()) = 0;
while (insize > inptr) {
write_buf(out, (char*)inbuf + inptr, insize - inptr);
got = read_buffer (in, (char *) inbuf, 0x40000);
if (got == -1)
read_error();
bytes_in += got;
insize = (unsigned)got;
inptr = 0;
}
return 0;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 1
} |
gprolog-1.5.0#ma2asm_prep#BT_String_Init.c | gprolog-1.5.0 | ma2asm.c | BT_String_Init | 6 | void
BT_String_Init(BTString *bt_str)
{
bt_str->tree = ((void *)0);
bt_str->nb_elem = 0;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#SPACE_OPTIMIZED_DP_SOLUTION_0_1_KNAPSACK_PROBLEM_prep#f_gold.c | transcoder-set | SPACE_OPTIMIZED_DP_SOLUTION_0_1_KNAPSACK_PROBLEM.c | f_gold | 22 | int f_gold ( int val [ ], int wt [ ], int n, int W ) {
int mat [ 2 ] [ W + 1 ];
memset ( mat, 0, sizeof ( mat ) );
int i = 0;
while ( i < n ) {
int j = 0;
if ( i % 2 != 0 ) {
while ( ++ j <= W ) {
if ( wt [ i ] <= j ) mat [ 1 ] [ j ] = max ( val [ i ] + mat [ 0 ] [ j - wt [ i ] ], mat [ 0 ] [ j ] );
else mat [ 1 ] [ j ] = mat [ 0 ] [ j ];
}
}
else {
while ( ++ j <= W ) {
if ( wt [ i ] <= j ) mat [ 0 ] [ j ] = max ( val [ i ] + mat [ 1 ] [ j - wt [ i ] ], mat [ 1 ] [ j ] );
else mat [ 0 ] [ j ] = mat [ 1 ] [ j ];
}
}
i ++;
}
return ( n % 2 != 0 ) ? mat [ 0 ] [ W ] : mat [ 1 ] [ W ];
}
| {
"array_type": 3,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 1,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 3
} |
gprolog-1.5.0#c_supp_prep#Pl_Rd_Compound.c | gprolog-1.5.0 | c_supp.c | Pl_Rd_Compound | 22 | WamWord *
Pl_Rd_Compound(WamWord start_word, int *func, int *arity)
{
WamWord word, tag_mask;
WamWord *adr;
do { WamWord deref_last_word; word = start_word; ; do { ; deref_last_word = word; tag_mask = ((PlLong) (word) & ((PlULong)0x7)); if (tag_mask != (PlULong)0) break; word = *(((WamWord *) (word))); } while (word != deref_last_word); } while (0);
if (tag_mask == (PlULong)0x1)
{
adr = ((WamWord *) ((word) & (PlULong)0xfffffffffffffff8));
*func = ((int) (unsigned char) ('.'));
*arity = 2;
return &(((WamWord *) adr)[0]);
}
if (tag_mask == (PlULong)0x2)
{
adr = ((WamWord *) ((word) & (PlULong)0xfffffffffffffff8));
*func = (((PlULong)((((WamWord *) (adr))[0])) & (((PlULong) 1 << (sizeof(PlULong) * 8 - 10)) - 1)));
*arity = (((PlULong) ((((WamWord *) (adr))[0])) >> (sizeof(PlULong) * 8 - 10)));
return &(((WamWord *) (adr))[1 +0]);
}
return ((void *)0);
}
| {
"array_type": 0,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 1
} |
uucp-1.07#log_prep#ulog_close.c | uucp-1.07 | log.c | ulog_close | 17 | void
ulog_close ()
{
ulog (LOG_ERROR, (const char *) ((void *)0));
if (eLlog != ((void *)0))
{
(void) fclose (eLlog);
eLlog = ((void *)0);
fLlog_tried = (0);
}
if (eLdebug != ((void *)0))
{
(void) fclose (eLdebug);
eLdebug = ((void *)0);
fLdebug_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": 7,
"union_type": 0,
"while_loop": 0
} |
libxml2#xmlunicode_prep#xmlUCSIsSupplementalMathematicalOperators.c | libxml2 | xmlunicode.c | xmlUCSIsSupplementalMathematicalOperators | 4 | int
xmlUCSIsSupplementalMathematicalOperators(int code) {
return(((code >= 0x2A00) && (code <= 0x2AFF)));
}
| {
"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
} |
indent-2.2.13#indent_prep#main.c | indent-2.2.13 | indent.c | main | 44 | int main(
int argc,
char ** argv)
{
char *tmp;
char *profile_pathname = 0;
BOOLEAN using_stdin = 0;
exit_values_ty exit_status;
bindtextdomain("indent", "/usr/local/share/locale");
textdomain("indent");
memset(&settings, 0, sizeof(settings));
tmp = xmalloc(7);
memcpy(tmp, "size_t", 7);
addkey(tmp, rw_decl);
tmp = xmalloc(8);
memcpy(tmp, "wchar_t", 8);
addkey(tmp, rw_decl);
tmp = xmalloc(10);
memcpy(tmp, "ptrdiff_t", 10);
addkey(tmp, rw_decl);
init_parser ();
initialize_backups ();
exit_status = total_success;
input_files = 0;
in_file_names = xmalloc(max_input_files * sizeof(char *));
set_defaults();
profile_pathname = handle_profile(argc, argv);
exit_status = process_args(argc, argv, &using_stdin);
if (exit_status == total_success)
{
if (settings.verbose && profile_pathname)
{
fprintf (stderr, gettext("Read profile %s\n"), profile_pathname);
}
set_defaults_after();
exit_status = indent_all(using_stdin);
}
if (profile_pathname)
xfree(profile_pathname);
xfree(in_file_names);
uninit_parser();
cleanup_user_specials();
return exit_status;
}
| {
"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": 4,
"pointer_type": 2,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libosip2-5.3.1#osip_message_prep#osip_message_set_status_code.c | libosip2-5.3.1 | osip_message.c | osip_message_set_status_code | 3 | void osip_message_set_status_code(osip_message_t *sip, int status_code) {
sip->status_code = status_code;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libxml2#list_prep#xmlListSize.c | libxml2 | list.c | xmlListSize | 10 | int
xmlListSize(xmlListPtr l)
{
xmlLinkPtr lk;
int count=0;
if (l == ((void *)0))
return(-1);
for(lk = l->sentinel->next; lk != l->sentinel; lk = lk->next, count++);
return count;
}
| {
"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": 1,
"union_type": 0,
"while_loop": 0
} |
nettle-3.9.1#ripemd160_prep#nettle_ripemd160_init.c | nettle-3.9.1 | ripemd160.c | nettle_ripemd160_init | 15 | void
nettle_ripemd160_init(struct ripemd160_ctx *ctx)
{
static const uint32_t iv[5] =
{
0x67452301,
0xEFCDAB89,
0x98BADCFE,
0x10325476,
0xC3D2E1F0,
};
memcpy(ctx->state, iv, sizeof(ctx->state));
ctx->count = 0;
ctx->index = 0;
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 1,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
tar-1.34#tar_prep#confirm.c | tar-1.34 | tar.c | confirm | 39 | int
confirm (const char *message_action, const char *message_name)
{
static FILE *confirm_file;
static int confirm_file_EOF;
_Bool status = 0;
if (!confirm_file)
{
if (archive == 0 || stdin_used_by)
{
confirm_file = fopen ("/dev/tty", "r");
if (! confirm_file)
open_fatal ("/dev/tty");
}
else
{
request_stdin ("-w");
confirm_file = stdin;
}
}
fprintf (stdlis, "%s %s?", message_action, quote (message_name));
fflush_unlocked (stdlis);
if (!confirm_file_EOF)
{
char *response = ((void *)0);
size_t response_size = 0;
if (getline (&response, &response_size, confirm_file) < 0)
confirm_file_EOF = 1;
else
status = rpmatch (response) > 0;
free (response);
}
if (confirm_file_EOF)
{
fputc_unlocked ('\n',stdlis);
fflush_unlocked (stdlis);
}
return status;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 6,
"memory_management": 1,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
findutils-4.9.0#xargs_prep#main.c | findutils-4.9.0 | xargs.c | main | 327 | int
main (int argc, char **argv)
{
int optc, option_index;
int show_limits = 0;
int always_run_command = 1;
const char *input_file = "-";
char default_cmd[] = "echo";
char *default_arglist[1];
int (*read_args) (void) = read_line;
void (*act_on_init_result)(void) = noop;
enum BC_INIT_STATUS bcstatus;
enum { XARGS_POSIX_HEADROOM = 2048u };
struct sigaction sigact;
(void) 1;
if (argv[0])
set_program_name (argv[0]);
else
set_program_name ("xargs");
remember_non_cloexec_fds ();
parent = getpid ();
original_exit_value = 0;
setlocale (6, "");
bindtextdomain ("findutils", "/usr/local/share/locale");
textdomain ("findutils");
if (atexit (close_stdin) || atexit (wait_for_proc_all))
{
((!!sizeof (struct { _Static_assert (1, "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"The atexit library function failed\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (1, (*__errno_location ()), gettext ("The atexit library function failed")), ((0) ? (void) 0 : __builtin_unreachable ()))) : ((error (1, (*__errno_location ()), gettext ("The atexit library function failed")), ((0) ? (void) 0 : __builtin_unreachable ()))));
}
bcstatus = bc_init_controlinfo (&bc_ctl, XARGS_POSIX_HEADROOM);
if (BC_INIT_ENV_TOO_BIG == bcstatus)
{
act_on_init_result = fail_due_to_env_size;
}
else if (BC_INIT_CANNOT_ACCOMODATE_HEADROOM == bcstatus)
{
act_on_init_result = fail_due_to_env_size;
}
else
{
long val;
val = sysconf (_SC_ARG_MAX);
if (val > 0)
{
((void) sizeof ((val > XARGS_POSIX_HEADROOM) ? 1 : 0), __extension__ ({ if (val > XARGS_POSIX_HEADROOM) ; else __assert_fail ("val > XARGS_POSIX_HEADROOM", "xargs.c", 483, __extension__ __PRETTY_FUNCTION__); }));
bc_ctl.arg_max = smaller_of (bc_ctl.arg_max,
(size_t)val-XARGS_POSIX_HEADROOM);
}
else
{
}
((void) sizeof ((bc_ctl.arg_max >= 2048) ? 1 : 0), __extension__ ({ if (bc_ctl.arg_max >= 2048) ; else __assert_fail ("bc_ctl.arg_max >= LINE_MAX", "xargs.c", 511, __extension__ __PRETTY_FUNCTION__); }));
bc_ctl.exec_callback = xargs_do_exec;
bc_use_sensible_arg_max (&bc_ctl);
}
while ((optc = getopt_long (argc, argv, "+0a:E:e::i::I:l::L:n:oprs:txP:d:",
longopts, &option_index)) != -1)
{
switch (optc)
{
case '0':
read_args = read_string;
input_delimiter = '\0';
break;
case 'd':
read_args = read_string;
input_delimiter = get_input_delimiter (optarg);
break;
case 'E':
case 'e':
if (optarg && (strlen (optarg) > 0))
eof_str = optarg;
else
eof_str = ((void *)0);
break;
case 'h':
usage (0);
case 'I':
case 'i':
if (optarg)
bc_ctl.replace_pat = optarg;
else
bc_ctl.replace_pat = "{}";
if (bc_ctl.args_per_exec != 0)
{
warn_mutually_exclusive ("--replace/-I/-i", "--max-args");
bc_ctl.args_per_exec = 0;
}
if (bc_ctl.lines_per_exec != 0)
{
warn_mutually_exclusive ("--replace/-I/-i", "--max-lines");
bc_ctl.lines_per_exec = 0;
}
break;
case 'L':
bc_ctl.lines_per_exec = parse_num (optarg, 'L', 1L, -1L, 1);
if (bc_ctl.args_per_exec != 0)
{
warn_mutually_exclusive ("-L", "--max-args");
bc_ctl.args_per_exec = 0;
}
if (bc_ctl.replace_pat != ((void *)0))
{
warn_mutually_exclusive ("-L", "--replace");
bc_ctl.replace_pat = ((void *)0);
}
break;
case 'l':
if (optarg)
bc_ctl.lines_per_exec = parse_num (optarg, 'l', 1L, -1L, 1);
else
bc_ctl.lines_per_exec = 1;
if (bc_ctl.args_per_exec != 0)
{
warn_mutually_exclusive ("--max-lines/-l", "--max-args");
bc_ctl.args_per_exec = 0;
}
if (bc_ctl.replace_pat != ((void *)0))
{
warn_mutually_exclusive ("--max-lines/-l", "--replace");
bc_ctl.replace_pat = ((void *)0);
}
break;
case 'n':
bc_ctl.args_per_exec = parse_num (optarg, 'n', 1L, -1L, 1);
if (bc_ctl.lines_per_exec != 0)
{
warn_mutually_exclusive ("--max-args/-n", "--max-lines");
bc_ctl.lines_per_exec = 0;
}
if (bc_ctl.replace_pat != ((void *)0))
{
if (bc_ctl.args_per_exec == 1)
{
bc_ctl.args_per_exec = 0;
}
else
{
warn_mutually_exclusive ("--max-args/-n", "--replace");
bc_ctl.replace_pat = ((void *)0);
}
}
break;
case 's':
{
size_t arg_size;
act_on_init_result ();
arg_size = parse_num (optarg, 's', 1L,
bc_ctl.posix_arg_size_max, 0);
if (arg_size > bc_ctl.posix_arg_size_max)
{
error (0, 0,
gettext ("warning: value %ld for -s option is too large, " "using %ld instead"),
(long) arg_size, (long) bc_ctl.posix_arg_size_max);
arg_size = bc_ctl.posix_arg_size_max;
}
bc_ctl.arg_max = arg_size;
}
break;
case 'S':
show_limits = 1;
break;
case 't':
print_command = 1;
break;
case 'x':
bc_ctl.exit_if_size_exceeded = 1;
break;
case 'o':
open_tty = 1;
break;
case 'p':
query_before_executing = 1;
print_command = 1;
break;
case 'r':
always_run_command = 0;
break;
case 'P':
proc_max = parse_num (optarg, 'P', 0L, (2147483647), 1);
break;
case 'a':
input_file = optarg;
break;
case 'v':
display_findutils_version ("xargs");
return 0;
case PROCESS_SLOT_VAR:
if (strchr (optarg, '='))
{
((!!sizeof (struct { _Static_assert (1, "verify_expr (" "1" ", " "(error (1, 0, gettext (\"option --%s may not be set to a value which includes `='\"), longopts[option_index].name), assume (false))" ")"); int _gl_dummy; })) ? ((error (1, 0, gettext ("option --%s may not be set to a value which includes `='"), longopts[option_index].name), ((0) ? (void) 0 : __builtin_unreachable ()))) : ((error (1, 0, gettext ("option --%s may not be set to a value which includes `='"), longopts[option_index].name), ((0) ? (void) 0 : __builtin_unreachable ()))));
}
slot_var_name = optarg;
if (0 != unsetenv (slot_var_name))
{
((!!sizeof (struct { _Static_assert (1, "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"failed to unset environment variable %s\"), slot_var_name), assume (false))" ")"); int _gl_dummy; })) ? ((error (1, (*__errno_location ()), gettext ("failed to unset environment variable %s"), slot_var_name), ((0) ? (void) 0 : __builtin_unreachable ()))) : ((error (1, (*__errno_location ()), gettext ("failed to unset environment variable %s"), slot_var_name), ((0) ? (void) 0 : __builtin_unreachable ()))));
}
break;
default:
usage (1);
}
}
if (eof_str && (read_args == read_string))
{
error (0, 0,
gettext ("warning: the -E option has no effect if -0 or -d is used.\n"));
}
act_on_init_result ();
((void) sizeof ((BC_INIT_OK == bcstatus) ? 1 : 0), __extension__ ({ if (BC_INIT_OK == bcstatus) ; else __assert_fail ("BC_INIT_OK == bcstatus", "xargs.c", 723, __extension__ __PRETTY_FUNCTION__); }));
sigact.__sigaction_handler.sa_handler = increment_proc_max;
sigemptyset(&sigact.sa_mask);
sigact.sa_flags = 0;
if (0 != sigaction (10, &sigact, (struct sigaction *)((void *)0)))
error (0, (*__errno_location ()), gettext ("Cannot set SIGUSR1 signal handler"));
sigact.__sigaction_handler.sa_handler = decrement_proc_max;
sigemptyset(&sigact.sa_mask);
sigact.sa_flags = 0;
if (0 != sigaction (12, &sigact, (struct sigaction *)((void *)0)))
error (0, (*__errno_location ()), gettext ("Cannot set SIGUSR2 signal handler"));
if (0 == strcmp (input_file, "-"))
{
input_stream = stdin;
}
else
{
keep_stdin = 1;
input_stream = fopen_cloexec_for_read_only (input_file);
if (((void *)0) == input_stream)
{
((!!sizeof (struct { _Static_assert (1, "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"Cannot open input file %s\"), quotearg_n_style (0, locale_quoting_style, input_file)), assume (false))" ")"); int _gl_dummy; })) ? ((error (1, (*__errno_location ()), gettext ("Cannot open input file %s"), quotearg_n_style (0, locale_quoting_style, input_file)), ((0) ? (void) 0 : __builtin_unreachable ()))) : ((error (1, (*__errno_location ()), gettext ("Cannot open input file %s"), quotearg_n_style (0, locale_quoting_style, input_file)), ((0) ? (void) 0 : __builtin_unreachable ()))));
}
}
if (bc_ctl.replace_pat || bc_ctl.lines_per_exec)
bc_ctl.exit_if_size_exceeded = 1;
if (optind == argc)
{
optind = 0;
argc = 1;
default_arglist[0] = default_cmd;
argv = default_arglist;
}
if (show_limits)
{
fprintf (stderr,
gettext ("Your environment variables take up %" "l" "u" " bytes\n"),
(uintmax_t)bc_size_of_environment ());
fprintf (stderr,
gettext ("POSIX upper limit on argument length (this system): %" "l" "u" "\n"),
(uintmax_t)bc_ctl.posix_arg_size_max);
fprintf (stderr,
gettext ("POSIX smallest allowable upper limit on argument length (all systems): %" "l" "u" "\n"),
(uintmax_t)bc_ctl.posix_arg_size_min);
fprintf (stderr,
gettext ("Maximum length of command we could actually use: %" "l" "u" "\n"),
(uintmax_t)(bc_ctl.posix_arg_size_max - bc_size_of_environment ()));
fprintf (stderr,
gettext ("Size of command buffer we are actually using: %" "l" "u" "\n"),
(uintmax_t)bc_ctl.arg_max);
fprintf (stderr,
gettext ("Maximum parallelism (--max-procs must be no greater): %" "l" "u" "\n"),
(uintmax_t)(2147483647));
if (isatty (0))
{
fprintf (stderr,
gettext ("\n" "Execution of xargs will continue now, and it will " "try to read its input and run commands; if this is " "not what you wanted to happen, please type the " "end-of-file keystroke.\n"));
if (always_run_command)
{
fprintf (stderr,
gettext ("Warning: %s will be run at least once. " "If you do not want that to happen, then press " "the interrupt keystroke.\n"),
argv[optind]);
}
}
}
linebuf = xmalloc (bc_ctl.arg_max + 1);
bc_state.argbuf = xmalloc (bc_ctl.arg_max + 1);
signal (17, ((__sighandler_t) 0));
if (!bc_ctl.replace_pat)
{
for (; optind < argc; optind++)
bc_push_arg (&bc_ctl, &bc_state,
argv[optind], strlen (argv[optind]) + 1,
((void *)0), 0,
initial_args);
initial_args = 0;
bc_ctl.initial_argc = bc_state.cmd_argc;
bc_state.cmd_initial_argv_chars = bc_state.cmd_argv_chars;
bc_ctl.initial_argc = bc_state.cmd_argc;
while ((*read_args) () != -1)
if (bc_ctl.lines_per_exec && lineno >= bc_ctl.lines_per_exec)
{
bc_do_exec (&bc_ctl, &bc_state);
lineno = 0;
}
if (bc_state.cmd_argc != bc_ctl.initial_argc
|| (always_run_command && procs_executed==0))
bc_do_exec (&bc_ctl, &bc_state);
}
else
{
int i, args;
size_t *arglen = xmalloc (sizeof (size_t) * argc);
for (i = optind; i < argc; i++)
arglen[i] = strlen (argv[i]);
bc_ctl.rplen = strlen (bc_ctl.replace_pat);
while ((args = (*read_args) ()) != -1)
{
size_t len = (size_t) args;
bc_clear_args (&bc_ctl, &bc_state);
bc_state.cmd_argv_chars = 0;
bc_push_arg (&bc_ctl, &bc_state,
argv[optind], arglen[optind] + 1,
((void *)0), 0,
initial_args);
len--;
initial_args = 0;
for (i = optind + 1; i < argc; i++)
bc_do_insert (&bc_ctl, &bc_state,
argv[i], arglen[i],
((void *)0), 0,
linebuf, len,
initial_args);
bc_do_exec (&bc_ctl, &bc_state);
}
}
original_exit_value = child_error;
return child_error;
}
| {
"array_type": 4,
"break_continue_statement": 18,
"enum_type": 1,
"for_loop": 3,
"function_pointer": 4,
"goto_statement": 0,
"if_statement": 36,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 5,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 1,
"type_casting": 27,
"union_type": 0,
"while_loop": 3
} |
nettle-3.9.1#aes256-encrypt_prep#_nettle_aes256_encrypt_c.c | nettle-3.9.1 | aes256-encrypt.c | _nettle_aes256_encrypt_c | 9 | void
_nettle_aes256_encrypt_c(const struct aes256_ctx *ctx,
size_t length, uint8_t *dst,
const uint8_t *src)
{
((void) sizeof ((!(length % 16)) ? 1 : 0), __extension__ ({ if (!(length % 16)) ; else __assert_fail ("!(length % AES_BLOCK_SIZE)", "aes256-encrypt.c", 56, __extension__ __PRETTY_FUNCTION__); }));
_nettle_aes_encrypt(14, ctx->keys, &_nettle_aes_encrypt_table,
length, dst, src);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#NUMBER_DIGITS_PRODUCT_TWO_NUMBERS_1_prep#sort.c | transcoder-set | NUMBER_DIGITS_PRODUCT_TWO_NUMBERS_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
} |
mcsim-6.2.0#modo_prep#WriteHeader.c | mcsim-6.2.0 | modo.c | WriteHeader | 7 | void WriteHeader (PFILE pfile, PSTR szName, PVMMAPSTRCT pvmGlo)
{
time_t ttTime;
time(&ttTime);
if (fprintf(pfile, "/* %s\n", szName) < 0)
ReportError(((void *)0), 0x0003 | 0x8000,
szName, "...in WriteHeader ()");
fprintf(pfile, " ___________________________________________________\n\n");
fprintf(pfile, " Model File: %s\n\n", vszModelFilename);
fprintf(pfile, " Date: %s\n", ctime(&ttTime));
fprintf(pfile, " Created by: \"%s %s\"\n", vszModGenName, "v6.2.0");
fprintf(pfile, " -- a model preprocessor by Don Maszle\n");
fprintf(pfile, " ___________________________________________________\n\n");
fprintf(pfile, " " "Copyright (c) 1993-2020 Free Software Foundation, Inc." "\n");
fprintf(pfile, "\n Model calculations for compartmental model:\n\n");
if (vnStates == 1) fprintf(pfile, " 1 State:\n");
else fprintf(pfile, " %d States:\n", vnStates);
ForAllVar(pfile, pvmGlo, &WriteOneName, 0x10000, ((void *)0));
if (vnOutputs == 1) fprintf(pfile, "\n 1 Output:\n");
else fprintf(pfile, "\n %d Outputs:\n", vnOutputs);
ForAllVar(pfile, pvmGlo, &WriteOneName, 0x30000, ((void *)0));
if (vnInputs == 1) fprintf(pfile, "\n 1 Input:\n");
else fprintf(pfile, "\n %d Inputs:\n", vnInputs);
ForAllVar(pfile, pvmGlo, &WriteOneName, 0x20000, ((void *)0));
if (vnParms == 1) fprintf(pfile, "\n 1 Parameter:\n");
else fprintf(pfile, "\n %d Parameters:\n", vnParms);
ForAllVar(pfile, pvmGlo, &WriteOneName, 0x40000, ((void *)0));
fprintf(pfile, "*/\n\n");
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 5,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 5,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#C_PROGRAM_FACTORIAL_NUMBER_1_prep#cmpfunc.c | transcoder-set | C_PROGRAM_FACTORIAL_NUMBER_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
} |
make-4.4.1#misc_prep#get_tmpfd.c | make-4.4.1 | misc.c | get_tmpfd | 36 | int
get_tmpfd (char **name)
{
int fd = -1;
char *tmpnm;
mode_t mask;
if (name)
*name = ((void *)0);
else
{
fd = os_anontmp ();
if (fd >= 0)
return fd;
}
mask = umask (0077);
tmpnm = get_tmptemplate ();
while (((fd)=mkstemp (tmpnm))==-1 && (*__errno_location ())==4);
if (fd < 0)
{
error((((floc *)0)), strlen (tmpnm) + strlen (strerror ((*__errno_location ()))), (gettext ("cannot create temporary file %s: %s")), (tmpnm), (strerror ((*__errno_location ()))));
free (tmpnm);
return -1;
}
if (name)
*name = tmpnm;
else
{
int r;
while (((r)=unlink (tmpnm))==-1 && (*__errno_location ())==4);
if (r < 0)
error((((floc *)0)), strlen (tmpnm) + strlen (strerror ((*__errno_location ()))), (gettext ("cannot unlink temporary file %s: %s")), (tmpnm), (strerror ((*__errno_location ()))));
free (tmpnm);
}
umask (mask);
return fd;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 5,
"memory_management": 2,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 2
} |
transcoder-set#FIND_SMALLEST_VALUE_REPRESENTED_SUM_SUBSET_GIVEN_ARRAY_prep#f_gold.c | transcoder-set | FIND_SMALLEST_VALUE_REPRESENTED_SUM_SUBSET_GIVEN_ARRAY.c | f_gold | 7 | int f_gold ( int arr [ ], int n ) {
int res = 1;
for ( int i = 0;
i < n && arr [ i ] <= res;
i ++ ) res = res + arr [ i ];
return res;
}
| {
"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": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
nettle-3.9.1#aes192-set-decrypt-key_prep#nettle_aes192_invert_key.c | nettle-3.9.1 | aes192-set-decrypt-key.c | nettle_aes192_invert_key | 5 | void
nettle_aes192_invert_key (struct aes192_ctx *dst, const struct aes192_ctx *src)
{
_nettle_aes_invert (12, dst->keys, src->keys);
}
| {
"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
} |
gprolog-1.5.0#ma2asm_inst_prep#Dico_String_Stop.c | gprolog-1.5.0 | ma2asm_inst.c | Dico_String_Stop | 4 | void
Dico_String_Stop(int nb)
{
}
| {
"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#device_prep#check_if_sectors_fit.c | mtools-4.0.43 | device.c | check_if_sectors_fit | 15 | int check_if_sectors_fit(uint32_t tot_sectors,
mt_off_t maxBytes,
uint32_t sectorSize,
char *errmsg)
{
if(!maxBytes)
return 0;
if(tot_sectors > (smt_off_t) maxBytes / (smt_off_t) sectorSize) {
sprintf(errmsg,
"%d sectors too large for this platform\n",
tot_sectors);
return -1;
}
return 0;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 3,
"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#f_filled.c | transcoder-set | SEARCH_AN_ELEMENT_IN_AN_ARRAY_WHERE_DIFFERENCE_BETWEEN_ADJACENT_ELEMENTS_IS_1.c | f_filled | 1 | int f_filled ( int arr [ ], int n, int x ) {}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
units-2.22#units_prep#ignore_primitive.c | units-2.22 | units.c | ignore_primitive | 11 | int
ignore_primitive(char *name)
{
struct unitlist *ul;
if (!name)
return 0;
ul = ulookup(name);
if (ul && strchr(ul->value, '!'))
return 1;
return 0;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 3,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#MIDDLE_OF_THREE_USING_MINIMUM_COMPARISONS_1_prep#f_gold.c | transcoder-set | MIDDLE_OF_THREE_USING_MINIMUM_COMPARISONS_1.c | f_gold | 12 | int f_gold ( int a, int b, int c ) {
if ( a > b ) {
if ( b > c ) return b;
else if ( a > c ) return c;
else return a;
}
else {
if ( a > c ) return a;
else if ( b > c ) return c;
else return b;
}
}
| {
"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": 6,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#MINIMUM_DIFFERENCE_MAX_MIN_K_SIZE_SUBSETS_prep#main.c | transcoder-set | MINIMUM_DIFFERENCE_MAX_MIN_K_SIZE_SUBSETS.c | main | 26 | int main(void) {
int n_success = 0;
int param0_0[] = {1,1,4,18,21,35,37,39,76,81,86,92,96};
int param0_1[] = {-8,-6,62,52,-86,2,-94,0,-48,-38,24,-48,34};
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};
int param0_3[] = {23,36,43,50,74,81,94,13,30,57,30,71,10,99,66,94,83,39,37,3,89,34};
int param0_4[] = {-96,-94,-92,-84,-80,-72,-24,-22,-18,-14,6,8,26,28,30,36,50,58,80,84,92,92};
int param0_5[] = {0,0,0,0,0,0,1,1,0,1,1,1,1,0,1,0,0,1,1,0,0,1,1};
int param0_6[] = {6,7,9,27,30,42,54,55,57,57,59,76,84,84,84};
int param0_7[] = {88,44,-96,-72,-80,0,-64,-64,-68,4,38,4,-38,68,-54,92,-16,62,24,54,0,54,62,-70,80,-12,84,-16,-10,88,-30,-56,48,50,-24,94,40,28,-86,-12};
int param0_8[] = {0,1};
int param0_9[] = {89,18,7,54,67,93,10,61,59,59,69,63,98,8,78,55,6,1,56,97,75,88,10};
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,9,16,17,21,21,13,31,1,22};
int param2[] = {6,12,26,20,12,22,14,26,1,14};
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
} |
nettle-3.9.1#umac-l2_prep#_nettle_umac_l2_init.c | nettle-3.9.1 | umac-l2.c | _nettle_umac_l2_init | 11 | void
_nettle_umac_l2_init (unsigned size, uint32_t *k)
{
unsigned i;
for (i = 0; i < size; i++)
{
uint32_t w = k[i];
w = (((((w)<<(8)) | ((w)>>((-(8)&31)))) & 0x00FF00FFUL) | ((((w)<<(24)) | ((w)>>((-(24)&31)))) & 0xFF00FF00UL));
k[i] = w & 0x01ffffffUL;
}
}
| {
"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": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
nettle-3.9.1#sexp2dsa_prep#nettle_dsa_signature_from_sexp.c | nettle-3.9.1 | sexp2dsa.c | nettle_dsa_signature_from_sexp | 13 | int
nettle_dsa_signature_from_sexp(struct dsa_signature *rs,
struct sexp_iterator *i,
unsigned q_bits)
{
static const char * const names[2] = { "r", "s" };
struct sexp_iterator values[2];
if (!nettle_sexp_iterator_assoc(i, 2, names, values))
return 0;
do { if (!nettle_mpz_set_sexp((rs->r), (q_bits), (&values[0])) || ((rs->r)->_mp_size < 0 ? -1 : (rs->r)->_mp_size > 0) <= 0) return 0; } while(0);
do { if (!nettle_mpz_set_sexp((rs->s), (q_bits), (&values[1])) || ((rs->s)->_mp_size < 0 ? -1 : (rs->s)->_mp_size > 0) <= 0) return 0; } while(0);
return 1;
}
| {
"array_type": 2,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 4,
"struct_type": 2,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 2
} |
libosip2-5.3.1#osip_authorization_prep#osip_authorization_get_crand.c | libosip2-5.3.1 | osip_authorization.c | osip_authorization_get_crand | 3 | char *osip_authorization_get_crand(osip_authorization_t *authorization) {
return authorization->crand;
}
| {
"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#tty-term_prep#tty_term_number.c | tmux | tty-term.c | tty_term_number | 9 | int
tty_term_number(struct tty_term *term, enum tty_code_code code)
{
if (!tty_term_has(term, code))
return (0);
if (term->codes[code].type != TTYCODE_NUMBER)
fatalx("not a number: %d", code);
return (term->codes[code].value.number);
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 1,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 2,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
gprolog-1.5.0#wam2ma_prep#F_put_atom.c | gprolog-1.5.0 | wam2ma.c | F_put_atom | 7 | void
F_put_atom(ArgVal arg[])
{
ArgVal *top = arg; BTNode *atom; char *str_atom; PlLong a; ((str_atom) = *((char * *) (top)) , (top)++); atom = BT_String_Add(&bt_tagged_atom, str_atom); ((a) = *((PlLong *) (top)) , (top)++);
Inst_Printf("call_c", "Pl_Put_Atom_Tagged(ta(%d))", atom->no);
Inst_Printf("move_ret", "X(%" "l" "d" ")", a);
}
| {
"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": 4,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libxml2#parserInternals_prep#xmlPedanticParserDefault.c | libxml2 | parserInternals.c | xmlPedanticParserDefault | 6 | int
xmlPedanticParserDefault(int val) {
int old = (*__xmlPedanticParserDefaultValue());
(*__xmlPedanticParserDefaultValue()) = val;
return(old);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#FIND_MINIMUM_NUMBER_DIVIDED_MAKE_NUMBER_PERFECT_SQUARE_prep#max.c | transcoder-set | FIND_MINIMUM_NUMBER_DIVIDED_MAKE_NUMBER_PERFECT_SQUARE.c | max | 1 | int max(int x, int y) { return (x > y)? x: y; }
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
json.h#allow_hexadecimal_numbers_prep#json_write_string.c | json.h | allow_hexadecimal_numbers.c | json_write_string | 41 | char *json_write_string(const struct json_string_s *string, char *data) {
size_t i;
*data++ = '"';
for (i = 0; i < string->string_size; i++) {
switch (string->string[i]) {
case '"':
*data++ = '\\';
*data++ = '"';
break;
case '\\':
*data++ = '\\';
*data++ = '\\';
break;
case '\b':
*data++ = '\\';
*data++ = 'b';
break;
case '\f':
*data++ = '\\';
*data++ = 'f';
break;
case '\n':
*data++ = '\\';
*data++ = 'n';
break;
case '\r':
*data++ = '\\';
*data++ = 'r';
break;
case '\t':
*data++ = '\\';
*data++ = 't';
break;
default:
*data++ = string->string[i];
break;
}
}
*data++ = '"';
return data;
}
| {
"array_type": 1,
"break_continue_statement": 8,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 1,
"switch_statement": 1,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
tulipindicators-0.9.1#tiamalgamation_prep#ti_mom_start.c | tulipindicators-0.9.1 | tiamalgamation.c | ti_mom_start | 3 | int ti_mom_start(double const *options) {
return (int)options[0];
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
bzip2#bzlib_prep#BZ2_bzWriteOpen.c | bzip2 | bzlib.c | BZ2_bzWriteOpen | 37 | BZFILE* BZ2_bzWriteOpen
( int* bzerror,
FILE* f,
int blockSize100k,
int verbosity,
int workFactor )
{
Int32 ret;
bzFile* bzf = ((void *)0);
{ if (bzerror != ((void *)0)) *bzerror = 0; if (bzf != ((void *)0)) bzf->lastErr = 0; };
if (f == ((void *)0) ||
(blockSize100k < 1 || blockSize100k > 9) ||
(workFactor < 0 || workFactor > 250) ||
(verbosity < 0 || verbosity > 4))
{ { if (bzerror != ((void *)0)) *bzerror = (-2); if (bzf != ((void *)0)) bzf->lastErr = (-2); }; return ((void *)0); };
if (ferror(f))
{ { if (bzerror != ((void *)0)) *bzerror = (-6); if (bzf != ((void *)0)) bzf->lastErr = (-6); }; return ((void *)0); };
bzf = malloc ( sizeof(bzFile) );
if (bzf == ((void *)0))
{ { if (bzerror != ((void *)0)) *bzerror = (-3); if (bzf != ((void *)0)) bzf->lastErr = (-3); }; return ((void *)0); };
{ if (bzerror != ((void *)0)) *bzerror = 0; if (bzf != ((void *)0)) bzf->lastErr = 0; };
bzf->initialisedOk = ((Bool)0);
bzf->bufN = 0;
bzf->handle = f;
bzf->writing = ((Bool)1);
bzf->strm.bzalloc = ((void *)0);
bzf->strm.bzfree = ((void *)0);
bzf->strm.opaque = ((void *)0);
if (workFactor == 0) workFactor = 30;
ret = BZ2_bzCompressInit ( &(bzf->strm), blockSize100k,
verbosity, workFactor );
if (ret != 0)
{ { if (bzerror != ((void *)0)) *bzerror = ret; if (bzf != ((void *)0)) bzf->lastErr = ret; }; free(bzf); return ((void *)0); };
bzf->strm.avail_in = 0;
bzf->initialisedOk = ((Bool)1);
return bzf;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 11,
"memory_management": 2,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 5,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 12,
"union_type": 0,
"while_loop": 0
} |
libosip2-5.3.1#osip_authorization_prep#osip_authorization_set_version.c | libosip2-5.3.1 | osip_authorization.c | osip_authorization_set_version | 3 | void osip_authorization_set_version(osip_authorization_t *authorization, char *version) {
authorization->version = (char *) version;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libcsv#libcsv_prep#csv_set_delim.c | libcsv | libcsv.c | csv_set_delim | 5 | void
csv_set_delim(struct csv_parser *p, unsigned char c)
{
if (p) p->delim_char = c;
}
| {
"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#symbol_prep#install_params.c | gawk-5.2.2 | symbol.c | install_params | 14 | void
install_params(NODE *func)
{
int i, pcount;
NODE *parms;
if (func == ((void *)0))
return;
((void) (0));
if ( (pcount = func->sub.nodep.l.ll) <= 0
|| (parms = func->sub.nodep.rn) == ((void *)0))
return;
for (i = 0; i < pcount; i++)
(void) install(parms[i].sub.nodep.name, parms + i, Node_param_list);
}
| {
"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": 1,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
json.h#allow_hexadecimal_numbers_prep#json_parse_value.c | json.h | allow_hexadecimal_numbers.c | json_parse_value | 95 | void json_parse_value(struct json_parse_state_s *state, int is_global_object,
struct json_value_s *value) {
const size_t flags_bitset = state->flags_bitset;
const char *const src = state->src;
const size_t size = state->size;
size_t offset;
(void)json_skip_all_skippables(state);
offset = state->offset;
if (is_global_object) {
value->type = json_type_object;
value->payload = state->dom;
state->dom += sizeof(struct json_object_s);
json_parse_object(state, 1,
(struct json_object_s *)value->payload);
} else {
switch (src[offset]) {
case '"':
case '\'':
value->type = json_type_string;
value->payload = state->dom;
state->dom += sizeof(struct json_string_s);
json_parse_string(state, (struct json_string_s *)value->payload);
break;
case '{':
value->type = json_type_object;
value->payload = state->dom;
state->dom += sizeof(struct json_object_s);
json_parse_object(state, 0,
(struct json_object_s *)value->payload);
break;
case '[':
value->type = json_type_array;
value->payload = state->dom;
state->dom += sizeof(struct json_array_s);
json_parse_array(state, (struct json_array_s *)value->payload);
break;
case '-':
case '+':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case '.':
value->type = json_type_number;
value->payload = state->dom;
state->dom += sizeof(struct json_number_s);
json_parse_number(state, (struct json_number_s *)value->payload);
break;
default:
if ((offset + 4) <= size && 't' == src[offset + 0] &&
'r' == src[offset + 1] && 'u' == src[offset + 2] &&
'e' == src[offset + 3]) {
value->type = json_type_true;
value->payload = 0;
state->offset += 4;
} else if ((offset + 5) <= size && 'f' == src[offset + 0] &&
'a' == src[offset + 1] && 'l' == src[offset + 2] &&
's' == src[offset + 3] && 'e' == src[offset + 4]) {
value->type = json_type_false;
value->payload = 0;
state->offset += 5;
} else if ((offset + 4) <= size && 'n' == src[offset + 0] &&
'u' == src[offset + 1] && 'l' == src[offset + 2] &&
'l' == src[offset + 3]) {
value->type = json_type_null;
value->payload = 0;
state->offset += 4;
} else if ((json_parse_flags_allow_inf_and_nan & flags_bitset) &&
(offset + 3) <= size && 'N' == src[offset + 0] &&
'a' == src[offset + 1] && 'N' == src[offset + 2]) {
value->type = json_type_number;
value->payload = state->dom;
state->dom += sizeof(struct json_number_s);
json_parse_number(state, (struct json_number_s *)value->payload);
} else if ((json_parse_flags_allow_inf_and_nan & flags_bitset) &&
(offset + 8) <= size && 'I' == src[offset + 0] &&
'n' == src[offset + 1] && 'f' == src[offset + 2] &&
'i' == src[offset + 3] && 'n' == src[offset + 4] &&
'i' == src[offset + 5] && 't' == src[offset + 6] &&
'y' == src[offset + 7]) {
value->type = json_type_number;
value->payload = state->dom;
state->dom += sizeof(struct json_number_s);
json_parse_number(state, (struct json_number_s *)value->payload);
}
break;
}
}
}
| {
"array_type": 1,
"break_continue_statement": 5,
"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": 0,
"struct_type": 2,
"switch_statement": 1,
"type_casting": 15,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#DICE_THROW_PROBLEM_prep#f_gold.c | transcoder-set | DICE_THROW_PROBLEM.c | f_gold | 15 | int f_gold ( int m, int n, int x ) {
int table [ n + 1 ] [ x + 1 ];
memset ( table, 0, sizeof ( table ) );
for ( int j = 1;
j <= m && j <= x;
j ++ ) table [ 1 ] [ j ] = 1;
for ( int i = 2;
i <= n;
i ++ ) for ( int j = 1;
j <= x;
j ++ ) for ( int k = 1;
k <= m && k < j;
k ++ ) table [ i ] [ j ] += table [ i - 1 ] [ j - k ];
return table [ n ] [ x ];
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 4,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 1,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
mcsim-6.2.0#modo_prep#WriteOne_R_PIDefine.c | mcsim-6.2.0 | modo.c | WriteOne_R_PIDefine | 16 | int WriteOne_R_PIDefine (PFILE pfile, PVMMAPSTRCT pvm, PVOID pInfo)
{
static long iParms = 0;
static long iForcs = 0;
((void) sizeof (((pvm ? (pvm)->hType & 0xF0000 : 0x00000) != 0x30000) ? 1 : 0), __extension__ ({ if ((pvm ? (pvm)->hType & 0xF0000 : 0x00000) != 0x30000) ; else __assert_fail ("TYPE(pvm) != ID_OUTPUT", "modo.c", 1324, __extension__ __PRETTY_FUNCTION__); }));
((void) sizeof (((pvm ? (pvm)->hType & 0xF0000 : 0x00000) != 0x10000) ? 1 : 0), __extension__ ({ if ((pvm ? (pvm)->hType & 0xF0000 : 0x00000) != 0x10000) ; else __assert_fail ("TYPE(pvm) != ID_STATE", "modo.c", 1325, __extension__ __PRETTY_FUNCTION__); }));
if ((pvm ? (pvm)->hType & 0xF0000 : 0x00000) == 0x40000) {
fprintf(pfile, "#define %s parms[%ld]\n", pvm->szName, iParms);
iParms = iParms + 1;
}
else {
fprintf(pfile, "#define %s forc[%ld]\n", pvm->szName, iForcs);
iForcs = iForcs + 1;
}
return(1);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#CHECK_REVERSING_SUB_ARRAY_MAKE_ARRAY_SORTED_prep#cmpfunc.c | transcoder-set | CHECK_REVERSING_SUB_ARRAY_MAKE_ARRAY_SORTED.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
} |
heman#mat4_prep#kmMat4GetForwardVec3RH.c | heman | mat4.c | kmMat4GetForwardVec3RH | 6 | kmVec3* kmMat4GetForwardVec3RH(kmVec3* pOut, const kmMat4* pIn)
{
kmVec3MultiplyMat4(pOut, &KM_VEC3_NEG_Z, pIn);
kmVec3Normalize(pOut, pOut);
return pOut;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
json.h#allow_inf_and_nan_prep#json_parse_object.c | json.h | allow_inf_and_nan.c | json_parse_object | 89 | void json_parse_object(struct json_parse_state_s *state, int is_global_object,
struct json_object_s *object) {
const size_t flags_bitset = state->flags_bitset;
const size_t size = state->size;
const char *const src = state->src;
size_t elements = 0;
int allow_comma = 0;
struct json_object_element_s *previous = 0;
if (is_global_object) {
if ('{' == src[state->offset]) {
is_global_object = 0;
}
}
if (!is_global_object) {
state->offset++;
}
(void)json_skip_all_skippables(state);
elements = 0;
while (state->offset < size) {
struct json_object_element_s *element = 0;
struct json_string_s *string = 0;
struct json_value_s *value = 0;
if (!is_global_object) {
(void)json_skip_all_skippables(state);
if ('}' == src[state->offset]) {
state->offset++;
break;
}
} else {
if (json_skip_all_skippables(state)) {
break;
}
}
if (allow_comma) {
if (',' == src[state->offset]) {
state->offset++;
allow_comma = 0;
continue;
}
}
element = (struct json_object_element_s *)state->dom;
state->dom += sizeof(struct json_object_element_s);
if (0 == previous) {
object->start = element;
} else {
previous->next = element;
}
previous = element;
if (json_parse_flags_allow_location_information & flags_bitset) {
struct json_string_ex_s *string_ex =
(struct json_string_ex_s *)state->dom;
state->dom += sizeof(struct json_string_ex_s);
string_ex->offset = state->offset;
string_ex->line_no = state->line_no;
string_ex->row_no = state->offset - state->line_offset;
string = &(string_ex->string);
} else {
string = (struct json_string_s *)state->dom;
state->dom += sizeof(struct json_string_s);
}
element->name = string;
(void)json_parse_key(state, string);
(void)json_skip_all_skippables(state);
state->offset++;
(void)json_skip_all_skippables(state);
if (json_parse_flags_allow_location_information & flags_bitset) {
struct json_value_ex_s *value_ex = (struct json_value_ex_s *)state->dom;
state->dom += sizeof(struct json_value_ex_s);
value_ex->offset = state->offset;
value_ex->line_no = state->line_no;
value_ex->row_no = state->offset - state->line_offset;
value = &(value_ex->value);
} else {
value = (struct json_value_s *)state->dom;
state->dom += sizeof(struct json_value_s);
}
element->value = value;
json_parse_value(state, 0, value);
elements++;
allow_comma = 1;
}
if (previous) {
previous->next = 0;
}
if (0 == elements) {
object->start = 0;
}
object->length = elements;
}
| {
"array_type": 0,
"break_continue_statement": 3,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 13,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 6,
"return_statement": 0,
"struct_type": 8,
"switch_statement": 0,
"type_casting": 15,
"union_type": 0,
"while_loop": 1
} |
json.h#allow_simplified_json_prep#is_valid_unquoted_key_char.c | json.h | allow_simplified_json.c | is_valid_unquoted_key_char | 4 | int is_valid_unquoted_key_char(const char c) {
return (('0' <= c && c <= '9') || ('a' <= c && c <= 'z') ||
('A' <= c && c <= 'Z') || ('_' == c));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
rcs-5.10.1#rcsgen_prep#format_assocs.c | rcs-5.10.1 | rcsgen.c | format_assocs | 9 | void
format_assocs (FILE *out, char const *fmt)
{
for (struct link *ls = ((top->repository. r)-> symbols); ls; ls = ls->next)
{
struct symdef const *d = ls->entry;
aprintf (out, fmt, d->meaningful, d->underlying);
}
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.