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 |
|---|---|---|---|---|---|---|
nettle-3.9.1#ctr16_prep#_nettle_ctr_crypt16.c | nettle-3.9.1 | ctr16.c | _nettle_ctr_crypt16 | 51 | void
_nettle_ctr_crypt16(const void *ctx, nettle_cipher_func *f,
nettle_fill16_func *fill, uint8_t *ctr,
size_t length, uint8_t *dst,
const uint8_t *src)
{
if (dst != src && !((uintptr_t) dst % sizeof(uint64_t)))
{
size_t blocks = length / 16u;
size_t done;
fill (ctr, blocks, (union nettle_block16 *) dst);
done = blocks * 16;
f(ctx, done, dst, dst);
nettle_memxor (dst, src, done);
length -= done;
if (length > 0)
{
union nettle_block16 block;
dst += done;
src += done;
((void) sizeof ((length < 16) ? 1 : 0), __extension__ ({ if (length < 16) ; else __assert_fail ("length < 16", "ctr16.c", 71, __extension__ __PRETTY_FUNCTION__); }));
fill (ctr, 1, &block);
f (ctx, 16, block.b, block.b);
nettle_memxor3 (dst, src, block.b, length);
}
}
else
{
union nettle_block16 *buffer;
size_t blocks = (length + 15) / 16u;
size_t i;
(buffer = __builtin_alloca (sizeof (*buffer) * ((((blocks) < (512 / 16)) ? (blocks) : (512 / 16)))));
for (i = 0; blocks >= 512 / 16;
i += 512, blocks -= 512 / 16)
{
fill (ctr, 512 / 16, buffer);
f(ctx, 512, buffer->b, buffer->b);
if (length - i < 512)
goto done;
nettle_memxor3 (dst + i, src + i, buffer->b, 512);
}
if (blocks > 0)
{
((void) sizeof ((length - i < 512) ? 1 : 0), __extension__ ({ if (length - i < 512) ; else __assert_fail ("length - i < CTR_BUFFER_LIMIT", "ctr16.c", 99, __extension__ __PRETTY_FUNCTION__); }));
fill (ctr, blocks, buffer);
f(ctx, blocks * 16, buffer->b, buffer->b);
done:
nettle_memxor3 (dst + i, src + i, buffer->b, length - i);
}
}
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 1,
"if_statement": 6,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 3,
"union_type": 3,
"while_loop": 0
} |
bc-1.07.1#storage_prep#store_array.c | bc-1.07.1 | storage.c | store_array | 24 | void
store_array (int var_name)
{
bc_num *num_ptr;
long idx;
if (!check_stack(2)) return;
idx = bc_num2long (ex_stack->s_next->s_num);
if (idx < 0 || idx > 16777215 ||
(idx == 0 && !bc_is_zero(ex_stack->s_next->s_num)))
rt_error ("Array %s subscript out of bounds.", a_names[var_name]);
else
{
num_ptr = get_array_num (var_name, idx);
if (num_ptr != ((void *)0))
{
bc_free_num (num_ptr);
*num_ptr = bc_copy_num (ex_stack->s_num);
bc_free_num (&ex_stack->s_next->s_num);
ex_stack->s_next->s_num = ex_stack->s_num;
bc_init_num (&ex_stack->s_num);
pop();
}
}
}
| {
"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": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
nettle-3.9.1#ocb-aes128_prep#nettle_ocb_aes128_set_encrypt_key.c | nettle-3.9.1 | ocb-aes128.c | nettle_ocb_aes128_set_encrypt_key | 6 | void
nettle_ocb_aes128_set_encrypt_key (struct ocb_aes128_encrypt_key *ocb_key, const uint8_t *key)
{
nettle_aes128_set_encrypt_key (&ocb_key->encrypt, key);
nettle_ocb_set_key (&ocb_key->ocb, &ocb_key->encrypt, (nettle_cipher_func *) nettle_aes128_encrypt);
}
| {
"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
} |
tulipindicators-0.9.1#sub_prep#ti_sub.c | tulipindicators-0.9.1 | sub.c | ti_sub | 1 | int ti_sub(int size, double const *const *inputs, double const *options, double *const *outputs) { const double *in1 = inputs[0]; const double *in2 = inputs[1]; (void)options; double *output = outputs[0]; int i; for (i = 0; i < size; ++i) { output[i] = (in1[i] - in2[i]); } return 0; }
| {
"array_type": 5,
"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": 4,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#FIND_THE_ELEMENT_THAT_APPEARS_ONCE_prep#sort.c | transcoder-set | FIND_THE_ELEMENT_THAT_APPEARS_ONCE.c | sort | 1 | void sort (int arr [ ], int n) {qsort (arr, n, sizeof(int), cmpfunc);}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#SMALLEST_POWER_OF_2_GREATER_THAN_OR_EQUAL_TO_N_prep#f_gold.c | transcoder-set | SMALLEST_POWER_OF_2_GREATER_THAN_OR_EQUAL_TO_N.c | f_gold | 9 | unsigned int f_gold ( unsigned int n ) {
unsigned count = 0;
if ( n && ! ( n & ( n - 1 ) ) ) return n;
while ( n != 0 ) {
n >>= 1;
count += 1;
}
return 1 << count;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
nettle-3.9.1#ocb-aes128_prep#nettle_ocb_aes128_encrypt.c | nettle-3.9.1 | ocb-aes128.c | nettle_ocb_aes128_encrypt | 7 | void
nettle_ocb_aes128_encrypt(struct ocb_ctx *ctx, const struct ocb_aes128_encrypt_key *key,
size_t length, uint8_t *dst, const uint8_t *src)
{
nettle_ocb_encrypt (ctx, &key->ocb, &key->encrypt, (nettle_cipher_func *) nettle_aes128_encrypt,
length, dst, src);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
optipng-0.7.8#gzlib_prep#gzoffset64.c | optipng-0.7.8 | gzlib.c | gzoffset64 | 15 | off_t gzoffset64(gzFile file) {
off_t offset;
gz_statep state;
if (file == ((void *)0))
return -1;
state = (gz_statep)file;
if (state->mode != 7247 && state->mode != 31153)
return -1;
offset = lseek(state->fd, 0, 1);
if (offset == -1)
return -1;
if (state->mode == 7247)
offset -= state->strm.avail_in;
return offset;
}
| {
"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": 4,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#DYNAMIC_PROGRAMMING_SET_8_MATRIX_CHAIN_MULTIPLICATION_1_prep#main.c | transcoder-set | DYNAMIC_PROGRAMMING_SET_8_MATRIX_CHAIN_MULTIPLICATION_1.c | main | 25 | int main(void) {
int n_success = 0;
int param0_0[] = {1,4,11,17,26,33,37,51,62,70,71,73,74,74,81,82,83,90,95,98,98};
int param0_1[] = {-50,74,-8,2,-24,28,-86,34,-36,92,-70,-98};
int param0_2[] = {0,0,0,1,1,1,1};
int param0_3[] = {4,73,3,88,79,40,25,58,39,53,32,20,95,60,60,98,23,95,42,26,95,14,43,97,30,83,29,37,74,72,37,31,32,83,57,40,56,95,8,79,67,62};
int param0_4[] = {-92,-88,-88,-88,-86,-84,-80,-78,-76,-74,-72,-68,-68,-66,-62,-42,-34,-30,-28,-24,-20,-14,-12,-10,-8,-8,-8,6,10,26,26,36,38,42,46,48,48,54,54,58,60,66,70,76,78,80,82,98};
int param0_5[] = {1,1,0,1,0,0,1};
int param0_6[] = {8,25,38,39,41,57,71,89};
int param0_7[] = {76,-28,20,62,-44,8,-46,52,26,76,22,38,-36,10,2,-86,42,-62,-68,-56,10};
int param0_8[] = {0,0,0,0,1,1,1};
int param0_9[] = {98,96,76,76,8,4,53,34,54,10,98,46,58,7,36,72,32,59,52,99,40,52,50,43,26,93,76,90,12,82,31,50,55,34,61,78};
int *param0[10] = {param0_0,param0_1,param0_2,param0_3,param0_4,param0_5,param0_6,param0_7,param0_8,param0_9};
int param1[] = {20,10,3,41,47,4,6,18,5,26};
for(int i = 0; i < len(param0); ++i)
{
if(f_filled(param0[i],param1[i]) == f_gold(param0[i],param1[i]))
{
n_success+=1;
}
break;
}
printf("#Results:", " ", n_success, ", ", len(param0));
return 0;
}
| {
"array_type": 2,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#FIND_MAXIMUM_PRODUCT_OF_A_TRIPLET_IN_ARRAY_prep#f_gold.c | transcoder-set | FIND_MAXIMUM_PRODUCT_OF_A_TRIPLET_IN_ARRAY.c | f_gold | 12 | int f_gold ( int arr [ ], int n ) {
if ( n < 3 ) return - 1;
int max_product = (-0x7fffffff - 1);
for ( int i = 0;
i < n - 2;
i ++ ) for ( int j = i + 1;
j < n - 1;
j ++ ) for ( int k = j + 1;
k < n;
k ++ ) max_product = max ( max_product, arr [ i ] * arr [ j ] * arr [ k ] );
return max_product;
}
| {
"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": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
nettle-3.9.1#ecc-secp521r1_prep#nettle_get_secp_521r1.c | nettle-3.9.1 | ecc-secp521r1.c | nettle_get_secp_521r1 | 4 | const struct ecc_curve *nettle_get_secp_521r1(void)
{
return &_nettle_secp_521r1;
}
| {
"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
} |
make-4.4.1#default_prep#install_default_suffix_rules.c | make-4.4.1 | default.c | install_default_suffix_rules | 20 | void
install_default_suffix_rules ()
{
const char **s;
if (no_builtin_rules_flag)
return;
for (s = default_suffix_rules; *s != 0; s += 2)
{
struct file *f = enter_file (strcache_add (s[0]));
if (!f->cmds)
{
f->cmds = xmalloc (sizeof (struct commands));
f->cmds->fileinfo.filenm = ((void *)0);
f->cmds->commands = xstrdup (s[1]);
f->cmds->command_lines = ((void *)0);
f->cmds->recipe_prefix = '\t';
f->builtin = 1;
}
}
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 1,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 0
} |
findutils-4.9.0#exec_prep#impl_pred_exec.c | findutils-4.9.0 | exec.c | impl_pred_exec | 84 | _Bool
impl_pred_exec (const char *pathname,
struct stat *stat_buf,
struct predicate *pred_ptr)
{
struct exec_val *execp = &pred_ptr->args.exec_vec;
char *buf = ((void *)0);
const char *target;
_Bool result;
const _Bool local = is_exec_in_local_dir (pred_ptr->pred_func);
const char *prefix;
size_t pfxlen;
(void) stat_buf;
if (local)
{
if (!record_exec_dir (execp))
{
((!!sizeof (struct { _Static_assert (1, "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"Failed to save working directory in order to \" \"run a command on %s\"), safely_quote_err_filename (0, pathname)), assume (false))" ")"); int _gl_dummy; })) ? ((error (1, (*__errno_location ()), gettext ("Failed to save working directory in order to " "run a command on %s"), safely_quote_err_filename (0, pathname)), ((0) ? (void) 0 : __builtin_unreachable ()))) : ((error (1, (*__errno_location ()), gettext ("Failed to save working directory in order to " "run a command on %s"), safely_quote_err_filename (0, pathname)), ((0) ? (void) 0 : __builtin_unreachable ()))));
}
target = buf = base_name (state.rel_pathname);
if ('/' == target[0])
{
prefix = ((void *)0);
pfxlen = 0;
}
else
{
prefix = "./";
pfxlen = 2u;
}
}
else
{
((void) sizeof ((execp->wd_for_exec == initial_wd) ? 1 : 0), __extension__ ({ if (execp->wd_for_exec == initial_wd) ; else __assert_fail ("execp->wd_for_exec == initial_wd", "exec.c", 148, __extension__ __PRETTY_FUNCTION__); }));
target = pathname;
prefix = ((void *)0);
pfxlen = 0u;
}
if (execp->multiple)
{
bc_push_arg (&execp->ctl,
&execp->state,
target, strlen (target)+1,
prefix, pfxlen,
0);
if (execp->state.todo)
state.execdirs_outstanding = 1;
result = 1;
}
else
{
int i;
for (i=0; i<execp->num_args; ++i)
{
bc_do_insert (&execp->ctl,
&execp->state,
execp->replace_vec[i],
strlen (execp->replace_vec[i]),
prefix, pfxlen,
target, strlen (target),
0);
}
bc_do_exec (&execp->ctl, &execp->state);
if ((((execp->last_child_status) & 0x7f) == 0))
{
if (0 == (((execp->last_child_status) & 0xff00) >> 8))
result = 1;
else
result = 0;
}
else
{
result = 0;
}
if (local)
free_cwd (execp->wd_for_exec);
}
if (buf)
{
((void) sizeof ((local) ? 1 : 0), __extension__ ({ if (local) ; else __assert_fail ("local", "exec.c", 208, __extension__ __PRETTY_FUNCTION__); }));
free (buf);
}
return result;
}
| {
"array_type": 2,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 11,
"memory_management": 1,
"memory_operation": 0,
"pointer_type": 4,
"return_statement": 1,
"struct_type": 3,
"switch_statement": 0,
"type_casting": 7,
"union_type": 0,
"while_loop": 0
} |
libxml2#pattern_prep#xmlPatternMatch.c | libxml2 | pattern.c | xmlPatternMatch | 14 | int
xmlPatternMatch(xmlPatternPtr comp, xmlNodePtr node)
{
int ret = 0;
if ((comp == ((void *)0)) || (node == ((void *)0)))
return(-1);
while (comp != ((void *)0)) {
ret = xmlPatMatch(comp, node);
if (ret != 0)
return(ret);
comp = comp->next;
}
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": 2,
"union_type": 0,
"while_loop": 1
} |
libosip2-5.3.1#osip_via_prep#osip_via_get_host.c | libosip2-5.3.1 | osip_via.c | osip_via_get_host | 5 | char *osip_via_get_host(osip_via_t *via) {
if (via == ((void *)0))
return ((void *)0);
return via->host;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#COUNT_TOTAL_SET_BITS_IN_ALL_NUMBERS_FROM_1_TO_N_prep#f_filled.c | transcoder-set | COUNT_TOTAL_SET_BITS_IN_ALL_NUMBERS_FROM_1_TO_N.c | f_filled | 1 | int f_filled ( int n ) {}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#SUM_FACTORS_NUMBER_prep#len.c | transcoder-set | SUM_FACTORS_NUMBER.c | len | 1 | int len (int arr [ ]) {return ((int) (sizeof (arr) / sizeof (arr)[0]));}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#SUM_DIVISORS_1_N_1_prep#sort.c | transcoder-set | SUM_DIVISORS_1_N_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
} |
gprolog-1.5.0#os_interf_c_prep#Pl_Select_5.c | gprolog-1.5.0 | os_interf_c.c | Pl_Select_5 | 28 | Bool
Pl_Select_5(WamWord reads_word, WamWord ready_reads_word,
WamWord writes_word, WamWord ready_writes_word,
WamWord time_out_word)
{
double time_out;
struct timeval *p, t;
fd_set read_set, write_set;
int max, n;
max = Select_Init_Set(reads_word, &read_set, 2);
Pl_Check_For_Un_List(ready_reads_word);
n = Select_Init_Set(writes_word, &write_set, 3);
if (n > max)
max = n;
Pl_Check_For_Un_List(ready_writes_word);
time_out = Pl_Rd_Number_Check(time_out_word);
if (time_out <= 0)
p = ((void *)0);
else
{
t.tv_sec = (PlLong) (time_out / 1000);
t.tv_usec = (PlLong) (fmod(time_out, 1000) * 1000);
p = &t;
}
do { int _tst = (select(max + 1, &read_set, &write_set, ((void *)0), p)); if (_tst < 0) { Pl_Os_Error(_tst); return 0; } } while(0);
return Select_Init_Ready_List(reads_word, &read_set, ready_reads_word) &&
Select_Init_Ready_List(writes_word, &write_set, ready_writes_word);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 2,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 1
} |
tar-1.34#xheader_prep#xheader_finish.c | tar-1.34 | xheader.c | xheader_finish | 8 | void
xheader_finish (struct xheader *xhdr)
{
struct keyword_list *kp;
for (kp = keyword_override_list; kp; kp = kp->next)
code_string (kp->value, kp->pattern, xhdr);
xhdr->buffer = __extension__ ({ struct obstack *__o1 = (xhdr->stk); void *__value = (void *) __o1->object_base; if (__o1->next_free == __value) __o1->maybe_empty_object = 1; __o1->next_free = ((sizeof (ptrdiff_t) < sizeof (void *) ? (__o1->object_base) : (char *) 0) + (((__o1->next_free) - (sizeof (ptrdiff_t) < sizeof (void *) ? (__o1->object_base) : (char *) 0) + (__o1->alignment_mask)) & ~(__o1->alignment_mask))); if ((size_t) (__o1->next_free - (char *) __o1->chunk) > (size_t) (__o1->chunk_limit - (char *) __o1->chunk)) __o1->next_free = __o1->chunk_limit; __o1->object_base = __o1->next_free; __value; });
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 0,
"struct_type": 3,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
uucp-1.07#chmod_prep#fsysdep_change_mode.c | uucp-1.07 | chmod.c | fsysdep_change_mode | 12 | boolean
fsysdep_change_mode (zfile, imode)
const char *zfile;
unsigned int imode;
{
if (chmod ((char *) zfile, imode) < 0)
{
ulog (LOG_ERROR, "chmod (%s): %s", zfile, strerror ((*__errno_location ())));
return (0);
}
return (1);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
grep-3.11#searchutils_prep#wordinit.c | grep-3.11 | searchutils.c | wordinit | 6 | void
wordinit (void)
{
for (int i = 0; i < NCHAR; i++)
sbwordchar[i] = wordchar (localeinfo.sbctowc[i]);
}
| {
"array_type": 2,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
cpio-2.14#rtapelib_prep#rmt_ioctl__.c | cpio-2.14 | rtapelib.c | rmt_ioctl__ | 55 | int
rmt_ioctl__ (int handle, unsigned long int operation, void *argument)
{
switch (operation)
{
default:
(*__errno_location ()) = 95;
return -1;
case (((1U) << (((0 +8)+8)+14)) | ((('m')) << (0 +8)) | (((1)) << 0) | ((((sizeof(struct mtop)))) << ((0 +8)+8))):
{
struct mtop *mtop = argument;
enum { oplen = (((((sizeof (mtop->mt_op) * 8) - (! ((__typeof__ (mtop->mt_op)) 0 < (__typeof__ (mtop->mt_op)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (mtop->mt_op)) 0 < (__typeof__ (mtop->mt_op)) -1))) };
enum { countlen = (((((sizeof (mtop->mt_count) * 8) - (! ((__typeof__ (mtop->mt_count)) 0 < (__typeof__ (mtop->mt_count)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (mtop->mt_count)) 0 < (__typeof__ (mtop->mt_count)) -1))) };
char command_buffer[sizeof "I\n\n" + oplen + countlen];
intmax_t count = mtop->mt_count;
sprintf (command_buffer, "I%d\n%jd\n", mtop->mt_op, count);
if (do_command (handle, command_buffer) == -1)
return -1;
return get_status (handle);
}
case (((2U) << (((0 +8)+8)+14)) | ((('m')) << (0 +8)) | (((2)) << 0) | ((((sizeof(struct mtget)))) << ((0 +8)+8))):
{
ssize_t status;
size_t counter;
if (do_command (handle, "S") == -1
|| (status = get_status (handle), status == -1))
return -1;
if (status > sizeof (struct mtop))
{
(*__errno_location ()) = 75;
return -1;
}
for (char *p = argument; status > 0; status -= counter, p += counter)
{
counter = safe_read ((from_remote[handle][0]), p, status);
if (counter == ((size_t) -1) || counter == 0)
{
_rmt_shutdown (handle, 5);
return -1;
}
}
struct mtget *mtget = argument;
if (mtget->mt_type < 256)
return 0;
char *buf = argument;
for (counter = 0; counter < status; counter += 2)
{
char copy = buf[counter];
buf[counter] = buf[counter + 1];
buf[counter + 1] = copy;
}
return 0;
}
}
}
| {
"array_type": 2,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 2,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 5,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 4,
"return_statement": 8,
"struct_type": 2,
"switch_statement": 1,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
gawk-5.2.2#eval_prep#elem_new_to_scalar.c | gawk-5.2.2 | eval.c | elem_new_to_scalar | 12 | NODE *
elem_new_to_scalar(NODE *n)
{
if (n->type != Node_elem_new)
return n;
if (n->valref > 1) {
unref(n);
return dupnode(Nnull_string);
}
n->type = Node_val;
return n;
}
| {
"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
} |
json.h#allow_json5_prep#json_extract_copy_value.c | json.h | allow_json5.c | json_extract_copy_value | 81 | void json_extract_copy_value(struct json_extract_state_s *const state,
const struct json_value_s *const value) {
struct json_string_s *string;
struct json_number_s *number;
struct json_object_s *object;
struct json_array_s *array;
struct json_value_s *new_value;
memcpy(state->dom, value, sizeof(struct json_value_s));
new_value = (struct json_value_s *)state->dom;
state->dom += sizeof(struct json_value_s);
new_value->payload = state->dom;
if (json_type_string == value->type) {
memcpy(state->dom, value->payload, sizeof(struct json_string_s));
string = (struct json_string_s *)state->dom;
state->dom += sizeof(struct json_string_s);
memcpy(state->data, string->string, string->string_size + 1);
string->string = state->data;
state->data += string->string_size + 1;
} else if (json_type_number == value->type) {
memcpy(state->dom, value->payload, sizeof(struct json_number_s));
number = (struct json_number_s *)state->dom;
state->dom += sizeof(struct json_number_s);
memcpy(state->data, number->number, number->number_size);
number->number = state->data;
state->data += number->number_size;
} else if (json_type_object == value->type) {
struct json_object_element_s *element;
size_t i;
memcpy(state->dom, value->payload, sizeof(struct json_object_s));
object = (struct json_object_s *)state->dom;
state->dom += sizeof(struct json_object_s);
element = object->start;
object->start = (struct json_object_element_s *)state->dom;
for (i = 0; i < object->length; i++) {
struct json_value_s *previous_value;
struct json_object_element_s *previous_element;
memcpy(state->dom, element, sizeof(struct json_object_element_s));
element = (struct json_object_element_s *)state->dom;
state->dom += sizeof(struct json_object_element_s);
string = element->name;
memcpy(state->dom, string, sizeof(struct json_string_s));
string = (struct json_string_s *)state->dom;
state->dom += sizeof(struct json_string_s);
element->name = string;
memcpy(state->data, string->string, string->string_size + 1);
string->string = state->data;
state->data += string->string_size + 1;
previous_value = element->value;
element->value = (struct json_value_s *)state->dom;
json_extract_copy_value(state, previous_value);
previous_element = element;
element = element->next;
if (element) {
previous_element->next = (struct json_object_element_s *)state->dom;
}
}
} else if (json_type_array == value->type) {
struct json_array_element_s *element;
size_t i;
memcpy(state->dom, value->payload, sizeof(struct json_array_s));
array = (struct json_array_s *)state->dom;
state->dom += sizeof(struct json_array_s);
element = array->start;
array->start = (struct json_array_element_s *)state->dom;
for (i = 0; i < array->length; i++) {
struct json_value_s *previous_value;
struct json_array_element_s *previous_element;
memcpy(state->dom, element, sizeof(struct json_array_element_s));
element = (struct json_array_element_s *)state->dom;
state->dom += sizeof(struct json_array_element_s);
previous_value = element->value;
element->value = (struct json_value_s *)state->dom;
json_extract_copy_value(state, previous_value);
previous_element = element;
element = element->next;
if (element) {
previous_element->next = (struct json_array_element_s *)state->dom;
}
}
}
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 2,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 6,
"memory_management": 0,
"memory_operation": 11,
"pointer_type": 8,
"return_statement": 0,
"struct_type": 13,
"switch_statement": 0,
"type_casting": 30,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#FIND_SUM_MODULO_K_FIRST_N_NATURAL_NUMBER_prep#cmpfunc.c | transcoder-set | FIND_SUM_MODULO_K_FIRST_N_NATURAL_NUMBER.c | cmpfunc | 1 | int cmpfunc (const void * a, const void * b) {return ( *(int*)a - *(int*)b );}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
json-c#json_util_prep#json_util_get_last_err.c | json-c | json_util.c | json_util_get_last_err | 6 | const char *json_util_get_last_err(void)
{
if (_last_err[0] == '\0')
return ((void *)0);
return _last_err;
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
buffer-0.4.0#test_prep#test_buffer_slice__end.c | buffer-0.4.0 | test.c | test_buffer_slice__end | 15 | void
test_buffer_slice__end() {
buffer_t *buf = buffer_new_with_copy("Tobi Ferret");
buffer_t *a = buffer_slice(buf, 5, -1);
equal("Tobi Ferret", (buf->data));
equal("Ferret", (a->data));
buffer_t *b = buffer_slice(buf, 5, -3);
equal("Ferr", (b->data));
buffer_t *c = buffer_slice(buf, 8, -1);
equal("ret", (c->data));
buffer_free(buf);
buffer_free(a);
buffer_free(b);
buffer_free(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": 4,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libxml2#libxml2-py_prep#libxml_xmlNewParserCtxt.c | libxml2 | libxml2-py.c | libxml_xmlNewParserCtxt | 8 | PyObject *
libxml_xmlNewParserCtxt(PyObject *self __attribute__ ((__unused__)), PyObject *args __attribute__ ((__unused__))) {
PyObject *py_retval;
xmlParserCtxtPtr c_retval;
c_retval = xmlNewParserCtxt();
py_retval = libxml_xmlParserCtxtPtrWrap((xmlParserCtxtPtr) 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": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#CHECK_LARGE_NUMBER_DIVISIBLE_9_NOT_prep#len.c | transcoder-set | CHECK_LARGE_NUMBER_DIVISIBLE_9_NOT.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
} |
binn-3.0#binn_prep#binn_type.c | binn-3.0 | binn.c | binn_type | 12 | int binn_type(void *ptr) {
binn *item;
switch (binn_get_ptr_type(ptr)) {
case 1:
item = (binn*) ptr;
return item->type;
case 2:
return binn_buf_type(ptr);
default:
return -1;
}
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 1,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libosip2-5.3.1#osip_www_authenticate_prep#osip_www_authenticate_free.c | libosip2-5.3.1 | osip_www_authenticate.c | osip_www_authenticate_free | 16 | void osip_www_authenticate_free(osip_www_authenticate_t *www_authenticate) {
if (www_authenticate == ((void *)0))
return;
{ if (www_authenticate->auth_type != ((void *)0)) { if (osip_free_func) osip_free_func(www_authenticate->auth_type); else free(www_authenticate->auth_type); } };
{ if (www_authenticate->realm != ((void *)0)) { if (osip_free_func) osip_free_func(www_authenticate->realm); else free(www_authenticate->realm); } };
{ if (www_authenticate->domain != ((void *)0)) { if (osip_free_func) osip_free_func(www_authenticate->domain); else free(www_authenticate->domain); } };
{ if (www_authenticate->nonce != ((void *)0)) { if (osip_free_func) osip_free_func(www_authenticate->nonce); else free(www_authenticate->nonce); } };
{ if (www_authenticate->opaque != ((void *)0)) { if (osip_free_func) osip_free_func(www_authenticate->opaque); else free(www_authenticate->opaque); } };
{ if (www_authenticate->stale != ((void *)0)) { if (osip_free_func) osip_free_func(www_authenticate->stale); else free(www_authenticate->stale); } };
{ if (www_authenticate->algorithm != ((void *)0)) { if (osip_free_func) osip_free_func(www_authenticate->algorithm); else free(www_authenticate->algorithm); } };
{ if (www_authenticate->qop_options != ((void *)0)) { if (osip_free_func) osip_free_func(www_authenticate->qop_options); else free(www_authenticate->qop_options); } };
{ if (www_authenticate->version != ((void *)0)) { if (osip_free_func) osip_free_func(www_authenticate->version); else free(www_authenticate->version); } };
{ if (www_authenticate->targetname != ((void *)0)) { if (osip_free_func) osip_free_func(www_authenticate->targetname); else free(www_authenticate->targetname); } };
{ if (www_authenticate->gssapi_data != ((void *)0)) { if (osip_free_func) osip_free_func(www_authenticate->gssapi_data); else free(www_authenticate->gssapi_data); } };
{ if (www_authenticate != ((void *)0)) { if (osip_free_func) osip_free_func(www_authenticate); else free(www_authenticate); } };
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 13,
"memory_management": 12,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 13,
"union_type": 0,
"while_loop": 0
} |
cpio-2.14#tar_prep#tar_checksum.c | cpio-2.14 | tar.c | tar_checksum | 18 | unsigned int
tar_checksum (struct tar_header *tar_hdr)
{
unsigned int sum = 0;
char *p = (char *) tar_hdr;
char *q = p + 512;
int i;
while (p < tar_hdr->chksum)
sum += *p++ & 0xff;
for (i = 0; i < 8; ++i)
{
sum += ' ';
++p;
}
while (p < q)
sum += *p++ & 0xff;
return sum;
}
| {
"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": 1,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 2
} |
optipng-0.7.8#pngerror_prep#png_formatted_warning.c | optipng-0.7.8 | pngerror.c | png_formatted_warning | 31 | void
png_formatted_warning(png_const_structrp png_ptr, png_warning_parameters p,
png_const_charp message)
{
size_t i = 0;
char msg[192];
while (i<(sizeof msg)-1 && *message != '\0')
{
if (p != ((void *)0) && *message == '@' && message[1] != '\0')
{
int parameter_char = *++message;
static const char valid_parameters[] = "123456789";
int parameter = 0;
while (valid_parameters[parameter] != parameter_char &&
valid_parameters[parameter] != '\0')
++parameter;
if (parameter < 8)
{
png_const_charp parm = p[parameter];
png_const_charp pend = p[parameter] + (sizeof p[parameter]);
while (i<(sizeof msg)-1 && *parm != '\0' && parm < pend)
msg[i++] = *parm++;
++message;
continue;
}
}
msg[i++] = *message++;
}
msg[i] = '\0';
png_warning(png_ptr, msg);
}
| {
"array_type": 4,
"break_continue_statement": 1,
"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": 1,
"union_type": 0,
"while_loop": 3
} |
gprolog-1.5.0#c_supp_prep#Pl_Rd_Codes_Str_Check.c | gprolog-1.5.0 | c_supp.c | Pl_Rd_Codes_Str_Check | 25 | int
Pl_Rd_Codes_Str_Check(WamWord start_word, char *str)
{
WamWord word, tag_mask;
WamWord save_start_word;
WamWord *lst_adr;
int n = 0;
save_start_word = start_word;
for (;;)
{
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)0)
Pl_Err_Instantiation();
if (word == (((PlLong) (256) << 3) + ((PlULong)0x3)))
break;
if (tag_mask != (PlULong)0x1)
Pl_Err_Type(pl_type_list, save_start_word);
lst_adr = ((WamWord *) ((word) & (PlULong)0xfffffffffffffff8));
*str++ = Pl_Rd_Code_Check((((WamWord *) lst_adr)[0]));
n++;
start_word = (((WamWord *) lst_adr)[0 +1]);
}
*str = '\0';
return n;
}
| {
"array_type": 0,
"break_continue_statement": 2,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 4,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
transcoder-set#FIND_A_ROTATION_WITH_MAXIMUM_HAMMING_DISTANCE_prep#cmpfunc.c | transcoder-set | FIND_A_ROTATION_WITH_MAXIMUM_HAMMING_DISTANCE.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
} |
libxml2#xmlunicode_prep#xmlUCSIsDingbats.c | libxml2 | xmlunicode.c | xmlUCSIsDingbats | 4 | int
xmlUCSIsDingbats(int code) {
return(((code >= 0x2700) && (code <= 0x27BF)));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
optipng-0.7.8#trees_prep#_tr_tally.c | optipng-0.7.8 | trees.c | _tr_tally | 15 | int _tr_tally(deflate_state *s, unsigned dist, unsigned lc) {
s->sym_buf[s->sym_next++] = (uch)dist;
s->sym_buf[s->sym_next++] = (uch)(dist >> 8);
s->sym_buf[s->sym_next++] = (uch)lc;
if (dist == 0) {
s->dyn_ltree[lc].fc.freq++;
} else {
s->matches++;
dist--;
;
s->dyn_ltree[_length_code[lc] + 256 + 1].fc.freq++;
s->dyn_dtree[((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])].fc.freq++;
}
return (s->sym_next == s->sym_end);
}
| {
"array_type": 3,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
gawk-5.2.2#eval_prep#opcode2str.c | gawk-5.2.2 | eval.c | opcode2str | 8 | const char *
opcode2str(OPCODE op)
{
if (op >= Op_illegal && op < Op_final)
return optypes[(int) op].desc;
(*(set_loc("eval.c", 416), r_fatal))(gettext("unknown opcode %d"), (int) op);
return ((void *)0);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#AREA_SQUARE_CIRCUMSCRIBED_CIRCLE_prep#f_gold.c | transcoder-set | AREA_SQUARE_CIRCUMSCRIBED_CIRCLE.c | f_gold | 3 | int f_gold ( int r ) {
return ( 2 * r * r );
}
| {
"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
} |
gawk-5.2.2#msg_prep#err.c | gawk-5.2.2 | msg.c | err | 59 | void
err(_Bool isfatal, const char *s, const char *emsg, va_list argp)
{
char *file;
const char *me;
static _Bool first = 1;
static _Bool add_src_info = 0;
static long lineno_val = 0;
if (first) {
first = 0;
add_src_info = (getenv("GAWK_MSG_SRC") != ((void *)0));
if (! (do_flags & DO_TRADITIONAL)) {
NODE *n = lookup("LINENO");
if (n != ((void *)0) && n->type == Node_var)
lineno_val = (!(((n->sub.nodep.l.lptr))->flags & (MPFN|MPZN)) ? ((double) (n->sub.nodep.l.lptr)->sub.val.nm.fltnum) : ((((n->sub.nodep.l.lptr))->flags & MPFN) ? (mpfr_get_d((n->sub.nodep.l.lptr)->sub.val.nm.mpnum, ROUND_MODE)) : (__gmpz_get_d((n->sub.nodep.l.lptr)->sub.val.nm.mpi))));
}
}
(void) fflush(output_fp);
me = myname;
(void) fprintf(stderr, "%s: ", me);
if (srcfile != ((void *)0) && add_src_info) {
fprintf(stderr, "%s:%d:", srcfile, srcline);
srcfile = ((void *)0);
}
if (sourceline > 0) {
if (source != ((void *)0))
(void) fprintf(stderr, "%s:", source);
else
(void) fprintf(stderr, gettext("cmd. line:"));
(void) fprintf(stderr, "%ld: ", sourceline + lineno_val);
}
if (FNR_node && FNR_node->sub.nodep.l.lptr && (((FNR_node->sub.nodep.l.lptr)->flags & (MPZN|MPFN)) != 0)) {
NODE *val;
val = mpg_update_var(FNR_node);
((void) (0));
if (((val->sub.val.nm.mpi)->_mp_size < 0 ? -1 : (val->sub.val.nm.mpi)->_mp_size > 0) > 0) {
int len = FILENAME_node->sub.nodep.l.lptr->sub.val.slen;
file = FILENAME_node->sub.nodep.l.lptr->sub.val.sp;
(void) putc('(', stderr);
if (file)
(void) fprintf(stderr, "FILENAME=%.*s ", len, file);
(void) __gmpfr_fprintf(stderr, "FNR=%Zd) ", val->sub.val.nm.mpi);
}
} else
if (FNR > 0) {
int len = FILENAME_node->sub.nodep.l.lptr->sub.val.slen;
file = FILENAME_node->sub.nodep.l.lptr->sub.val.sp;
(void) putc('(', stderr);
if (file)
(void) fprintf(stderr, "FILENAME=%.*s ", len, file);
(void) fprintf(stderr, "FNR=%ld) ", FNR);
}
(void) fprintf(stderr, "%s", s);
vfprintf(stderr, emsg, argp);
(void) fprintf(stderr, "\n");
(void) fflush(stderr);
if (isfatal)
gawk_exit(2);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 12,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 4,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 21,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#PROGRAM_TO_FIND_THE_VOLUME_OF_A_TRIANGULAR_PRISM_prep#sort.c | transcoder-set | PROGRAM_TO_FIND_THE_VOLUME_OF_A_TRIANGULAR_PRISM.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
} |
dap-3.10#sbstrans_prep#findvar.c | dap-3.10 | sbstrans.c | findvar | 12 | int findvar(char *varname, char var[][127 + 1], int nvars)
{
int v;
for (v = 0; v < nvars; v++)
{
if (!linecmp(varname, var[v]))
break;
}
if (v < 512 - 1)
strcpy(var[v], varname);
return v;
}
| {
"array_type": 1,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libxml2#globals_prep#xmlCleanupGlobals.c | libxml2 | globals.c | xmlCleanupGlobals | 2 | void xmlCleanupGlobals(void) {
}
| {
"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#CHECK_TWO_GIVEN_CIRCLES_TOUCH_INTERSECT_prep#len.c | transcoder-set | CHECK_TWO_GIVEN_CIRCLES_TOUCH_INTERSECT.c | len | 1 | int len (int arr [ ]) {return ((int) (sizeof (arr) / sizeof (arr)[0]));}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
make-4.4.1#variable_prep#merge_variable_set_lists.c | make-4.4.1 | variable.c | merge_variable_set_lists | 34 | void
merge_variable_set_lists (struct variable_set_list **setlist0,
struct variable_set_list *setlist1)
{
struct variable_set_list *to = *setlist0;
struct variable_set_list *last0 = 0;
if (!setlist1 || setlist1 == &global_setlist)
return;
if (to)
{
while (to != &global_setlist)
{
if (to == setlist1)
return;
to = to->next;
}
to = *setlist0;
while (setlist1 != &global_setlist && to != &global_setlist)
{
struct variable_set_list *from = setlist1;
setlist1 = setlist1->next;
merge_variable_sets (to->set, from->set);
last0 = to;
to = to->next;
}
}
if (setlist1 != &global_setlist)
{
if (last0 == 0)
*setlist0 = setlist1;
else
last0->next = setlist1;
}
}
| {
"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": 3,
"return_statement": 2,
"struct_type": 4,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 2
} |
transcoder-set#TOTAL_NUMBER_OF_NON_DECREASING_NUMBERS_WITH_N_DIGITS_prep#cmpfunc.c | transcoder-set | TOTAL_NUMBER_OF_NON_DECREASING_NUMBERS_WITH_N_DIGITS.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
} |
libxml2#libxml2-py_prep#libxml_xmlXPathNsLookup.c | libxml2 | libxml2-py.c | libxml_xmlXPathNsLookup | 14 | PyObject *
libxml_xmlXPathNsLookup(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
const xmlChar * c_retval;
xmlXPathContextPtr ctxt;
PyObject *pyobj_ctxt;
xmlChar * prefix;
if (!_PyArg_ParseTuple_SizeT(args, (char *)"Oz:xmlXPathNsLookup", &pyobj_ctxt, &prefix))
return(((void *)0));
ctxt = (xmlXPathContextPtr) (((pyobj_ctxt) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyxmlXPathContext_Object *)(pyobj_ctxt))->obj));
c_retval = xmlXPathNsLookup(ctxt, prefix);
py_retval = libxml_xmlCharPtrConstWrap((const xmlChar *) c_retval);
return(py_retval);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#FIND_LARGEST_PRIME_FACTOR_NUMBER_prep#min.c | transcoder-set | FIND_LARGEST_PRIME_FACTOR_NUMBER.c | min | 1 | int min(int x, int y) { return (x < y)? x: y; }
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libosip2-5.3.1#osip_contact_prep#osip_message_set_contact.c | libosip2-5.3.1 | osip_contact.c | osip_message_set_contact | 17 | int osip_message_set_contact(osip_message_t *sip, const char *hvalue) {
int i;
osip_contact_t *contact;
if (hvalue == ((void *)0) || hvalue[0] == '\0')
return 0;
i = osip_contact_init(&contact);
if (i != 0)
return i;
i = osip_contact_parse(contact, hvalue);
if (i != 0) {
osip_contact_free(contact);
return i;
}
sip->message_property = 2;
osip_list_add(&sip->contacts, contact, -1);
return 0;
}
| {
"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": 1,
"return_statement": 4,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#N_TH_TERM_SERIES_2_12_36_80_150_prep#f_gold.c | transcoder-set | N_TH_TERM_SERIES_2_12_36_80_150.c | f_gold | 3 | int f_gold ( int n ) {
return ( n * n ) + ( n * n * n );
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libxml2#xmlsave_prep#xmlBufAttrSerializeTxtContent.c | libxml2 | xmlsave.c | xmlBufAttrSerializeTxtContent | 9 | void
xmlBufAttrSerializeTxtContent(xmlOutputBufferPtr buf, xmlDocPtr doc,
const xmlChar *string)
{
int flags = (1u << 0);
if ((doc == ((void *)0)) || (doc->encoding == ((void *)0)))
flags |= (1u << 1);
xmlSerializeText(buf, string, flags);
}
| {
"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": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#INTEGER_POSITIVE_VALUE_POSITIVE_NEGATIVE_VALUE_ARRAY_1_prep#main.c | transcoder-set | INTEGER_POSITIVE_VALUE_POSITIVE_NEGATIVE_VALUE_ARRAY_1.c | main | 25 | int main(void) {
int n_success = 0;
int param0_0[] = {49,98};
int param0_1[] = {82,66,-68,24,-10};
int param0_2[] = {0,0,0,0,0,0,0,1,1,1,1,1,1,1};
int param0_3[] = {56,3,18,5,20,56,47,29,60,98,60,40,42,2,54,56,91,8,93,14,31,27,61,49,23,12,71};
int param0_4[] = {-94,-94,-92,-86,-50,-48,-6,8,28,40,44,58,62,72,94};
int param0_5[] = {0,0,1,0,1,0,1,1,1,0,1,0,0,0,1,0,0,1,0,0,0,1,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,0,0,0,1,1,1,0,1,0,1};
int param0_6[] = {16,56,56};
int param0_7[] = {74,-90,-92,30,-18,66,-66,22};
int param0_8[] = {0,0,0,1,1,1,1,1,1,1,1,1,1,1};
int param0_9[] = {21,64,82,78,30,34,35};
int *param0[10] = {param0_0,param0_1,param0_2,param0_3,param0_4,param0_5,param0_6,param0_7,param0_8,param0_9};
int param1[] = {1,2,8,25,12,36,1,5,7,5};
for(int i = 0; i < len(param0); ++i)
{
if(f_filled(param0[i],param1[i]) == f_gold(param0[i],param1[i]))
{
n_success+=1;
}
break;
}
printf("#Results:", " ", n_success, ", ", len(param0));
return 0;
}
| {
"array_type": 2,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
gprolog-1.5.0#c_supp_prep#Pl_Rd_Integer_Check.c | gprolog-1.5.0 | c_supp.c | Pl_Rd_Integer_Check | 11 | PlLong
Pl_Rd_Integer_Check(WamWord start_word)
{
WamWord word, tag_mask;
do { WamWord deref_last_word; word = start_word; ; do { ; deref_last_word = word; tag_mask = ((PlLong) (word) & ((PlULong)0x7)); if (tag_mask != (PlULong)0) break; word = *(((WamWord *) (word))); } while (word != deref_last_word); } while (0);
if (tag_mask == (PlULong)0)
Pl_Err_Instantiation();
if (tag_mask != (PlULong)0x7)
Pl_Err_Type(pl_type_integer, word);
return ((PlLong) ((word) << 0) >> 3);
}
| {
"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": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
tulipindicators-0.9.1#lag_prep#ti_lag_start.c | tulipindicators-0.9.1 | lag.c | ti_lag_start | 3 | int ti_lag_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
} |
screen-4.9.0#acls_prep#AclLinkUser.c | screen-4.9.0 | acls.c | AclLinkUser | 20 | int
AclLinkUser(from, to)
char *from, *to;
{
struct acluser **u1, **u2;
struct aclusergroup **g;
if (!*(u1 = FindUserPtr(from)) && UserAdd(from, ((void *)0), u1))
return -1;
if (!*(u2 = FindUserPtr(to)) && UserAdd(to, ((void *)0), u2))
return -1;
if (*FindGroupPtr(&(*u2)->u_group, *u1, 1))
return 1;
if (*(g = FindGroupPtr(&(*u1)->u_group, *u2, 0)))
return 2;
if (!(*g = (struct aclusergroup *)malloc(sizeof(struct aclusergroup))))
return -1;
(*g)->u = (*u2);
(*g)->next = ((void *)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": 1,
"memory_operation": 0,
"pointer_type": 3,
"return_statement": 6,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
gprolog-1.5.0#wam2ma_prep#F_put_list.c | gprolog-1.5.0 | wam2ma.c | F_put_list | 7 | void
F_put_list(ArgVal arg[])
{
ArgVal *top = arg; PlLong a; ((a) = *((PlLong *) (top)) , (top)++);
Inst_Printf("call_c", "Pl_Put_List()");
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": 1,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
nano-7.2#winio_prep#convert_to_control.c | nano-7.2 | winio.c | convert_to_control | 16 | int convert_to_control(int kbinput)
{
if ('@' <= kbinput && kbinput <= '_')
return kbinput - '@';
if ('`' <= kbinput && kbinput <= '~')
return kbinput - '`';
if ('3' <= kbinput && kbinput <= '7')
return kbinput - 24;
if (kbinput == '?' || kbinput == '8')
return 0x7F;
if (kbinput == ' ' || kbinput == '2')
return 0;
if (kbinput == '/')
return 31;
return kbinput;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 6,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 7,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
rcs-5.10.1#rcsutil_prep#redefined.c | rcs-5.10.1 | rcsutil.c | redefined | 5 | void
redefined (int c)
{
generic_warn (((void *)0), "redefinition of -%c option", 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": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
grep-3.11#dfasearch_prep#dfawarn.c | grep-3.11 | dfasearch.c | dfawarn | 5 | void
dfawarn (char const *mesg)
{
error (0, 0, gettext("warning: %s"), mesg);
}
| {
"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#misc_prep#savedir_diag.c | tar-1.34 | misc.c | savedir_diag | 11 | void
savedir_diag (char const *name)
{
if (ignore_failed_read_option)
{
if ((warning_option & (0x00800000)))
savedir_warn (name);
}
else
savedir_error (name);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
gprolog-1.5.0#arith_inl_c_prep#Pl_Fct_Fast_Not.c | gprolog-1.5.0 | arith_inl_c.c | Pl_Fct_Fast_Not | 6 | WamWord
Pl_Fct_Fast_Not(WamWord x)
{
PlLong vx = ((PlLong) ((x) << 0) >> 3);
return (((PlULong) (~vx) << 3) | (PlULong)0x7);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#K_NUMBERS_DIFFERENCE_MAXIMUM_MINIMUM_K_NUMBER_MINIMIZED_prep#min.c | transcoder-set | K_NUMBERS_DIFFERENCE_MAXIMUM_MINIMUM_K_NUMBER_MINIMIZED.c | min | 1 | int min(int x, int y) { return (x < y)? x: y; }
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
tinycc#tccgen_prep#gaddrof.c | tinycc | tccgen.c | gaddrof | 6 | void gaddrof(void)
{
vtop->r &= ~0x0100;
if ((vtop->r & 0x003f) == 0x0031)
vtop->r = (vtop->r & ~(0x003f | (0x1000 | 0x2000 | 0x4000))) | 0x0032 | 0x0100;
}
| {
"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": 1,
"union_type": 0,
"while_loop": 0
} |
heman#vec2_prep#kmVec2Normalize.c | heman | vec2.c | kmVec2Normalize | 12 | kmVec2* kmVec2Normalize(kmVec2* pOut, const kmVec2* pIn)
{
if (!pIn->x && !pIn->y)
return kmVec2Assign(pOut, pIn);
float l = 1.0f / kmVec2Length(pIn);
kmVec2 v;
v.x = pIn->x * l;
v.y = pIn->y * l;
pOut->x = v.x;
pOut->y = v.y;
return pOut;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
gprolog-1.5.0#c_supp_prep#Pl_Mk_In_Code.c | gprolog-1.5.0 | c_supp.c | Pl_Mk_In_Code | 5 | WamWord
Pl_Mk_In_Code(int value)
{
return Pl_Put_Integer(value);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libxml2#debugXML_prep#xmlDebugDumpOneNode.c | libxml2 | debugXML.c | xmlDebugDumpOneNode | 11 | void
xmlDebugDumpOneNode(FILE * output, xmlNodePtr node, int depth)
{
xmlDebugCtxt ctxt;
if (output == ((void *)0)) return;
xmlCtxtDumpInitCtxt(&ctxt);
ctxt.output = output;
ctxt.depth = depth;
xmlCtxtDumpOneNode(&ctxt, node);
xmlCtxtDumpCleanCtxt(&ctxt);
}
| {
"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
} |
transcoder-set#WRITE_A_C_PROGRAM_TO_FIND_THE_PARITY_OF_AN_UNSIGNED_INTEGER_prep#f_filled.c | transcoder-set | WRITE_A_C_PROGRAM_TO_FIND_THE_PARITY_OF_AN_UNSIGNED_INTEGER.c | f_filled | 1 | _Bool f_filled ( unsigned int n ) {}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
tulipindicators-0.9.1#sin_prep#ti_sin.c | tulipindicators-0.9.1 | sin.c | ti_sin | 1 | int ti_sin(int size, double const *const *inputs, double const *options, double *const *outputs) { const double *in1 = inputs[0]; (void)options; double *output = outputs[0]; int i; for (i = 0; i < size; ++i) { output[i] = (sin(in1[i])); } return 0; }
| {
"array_type": 4,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 3,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
binn-3.0#binn_prep#binn_map_get_value.c | binn-3.0 | binn.c | binn_map_get_value | 13 | BOOL binn_map_get_value(void* ptr, int id, binn *value) {
int type, count, size=0, header_size;
unsigned char *p;
ptr = binn_ptr(ptr);
if ((ptr == 0) || (value == 0)) return 0;
if (IsValidBinnHeader(ptr, &type, &count, &size, &header_size) == 0) return 0;
if (type != 0xE1) return 0;
if (count == 0) return 0;
p = (unsigned char *) ptr;
p = SearchForID(p, header_size, size, count, id);
if (p == 0) return 0;
return GetValue(p, value);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 5,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 6,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#GCD_ELEMENTS_GIVEN_RANGE_prep#f_filled.c | transcoder-set | GCD_ELEMENTS_GIVEN_RANGE.c | f_filled | 1 | int f_filled ( int n, int m ) {}
| {
"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
} |
indent-2.2.13#output_prep#count_columns.c | indent-2.2.13 | output.c | count_columns | 26 | int count_columns (
int column,
char *bp,
int stop_char)
{
while (*bp != stop_char && *bp != '\0')
{
switch (*bp++)
{
case '\n':
case '\f':
column = 1;
break;
case '\t':
column += settings.tabsize - (column - 1) % settings.tabsize;
break;
case 010:
--column;
break;
default:
++column;
break;
}
}
return column;
}
| {
"array_type": 0,
"break_continue_statement": 4,
"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": 1,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
libxml2#buf_prep#xmlBufferCreateStatic.c | libxml2 | buf.c | xmlBufferCreateStatic | 6 | xmlBufferPtr
xmlBufferCreateStatic(void *mem, size_t size) {
xmlBufferPtr buf = xmlBufferCreateSize(size);
xmlBufferAdd(buf, mem, size);
return(buf);
}
| {
"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
} |
ed-1.19#main_loop_prep#unmark_line_node.c | ed-1.19 | main_loop.c | unmark_line_node | 7 | void unmark_line_node( const line_t * const lp )
{
int i;
for( i = 0; markno && i < 26; ++i )
if( mark[i] == lp )
{ mark[i] = 0; --markno; }
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#PROGRAM_OCTAL_DECIMAL_CONVERSION_prep#f_gold.c | transcoder-set | PROGRAM_OCTAL_DECIMAL_CONVERSION.c | f_gold | 13 | int f_gold ( int n ) {
int num = n;
int dec_value = 0;
int base = 1;
int temp = num;
while ( temp ) {
int last_digit = temp % 10;
temp = temp / 10;
dec_value += last_digit * base;
base = base * 8;
}
return dec_value;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
tar-1.34#rmt_prep#xalloc_die.c | tar-1.34 | rmt.c | xalloc_die | 6 | void
xalloc_die (void)
{
rmt_error (12);
exit (1);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
mcsim-6.2.0#mh_prep#SetFixedVars.c | mcsim-6.2.0 | mh.c | SetFixedVars | 12 | void SetFixedVars (PLEVEL plevel)
{
long n;
PVARMOD pFVar;
for (n = 0; n < plevel->nFixedVars; n++) {
pFVar = plevel->rgpFixedVars[n];
if (IsInput (pFVar->hvar))
SetInput (pFVar->hvar, pFVar->uvar.pifn);
else
SetVar (pFVar->hvar, pFVar->uvar.dVal);
}
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
optipng-0.7.8#trees_prep#_tr_stored_block.c | optipng-0.7.8 | trees.c | _tr_stored_block | 10 | void _tr_stored_block(deflate_state *s, charf *buf,
ulg stored_len, int last) {
{ int len = 3; if (s->bi_valid > (int)16 - len) { int val = (int)(0<<1) + last; s->bi_buf |= (ush)val << s->bi_valid; { {s->pending_buf[s->pending++] = (Bytef)((uch)((s->bi_buf) & 0xff));}; {s->pending_buf[s->pending++] = (Bytef)((uch)((ush)(s->bi_buf) >> 8));}; }; s->bi_buf = (ush)val >> (16 - s->bi_valid); s->bi_valid += len - 16; } else { s->bi_buf |= (ush)((0<<1) + last) << s->bi_valid; s->bi_valid += len; }};
bi_windup(s);
{ {s->pending_buf[s->pending++] = (Bytef)((uch)(((ush)stored_len) & 0xff));}; {s->pending_buf[s->pending++] = (Bytef)((uch)((ush)((ush)stored_len) >> 8));}; };
{ {s->pending_buf[s->pending++] = (Bytef)((uch)(((ush)~stored_len) & 0xff));}; {s->pending_buf[s->pending++] = (Bytef)((uch)((ush)((ush)~stored_len) >> 8));}; };
if (stored_len)
memcpy(s->pending_buf + s->pending, (Bytef *)buf, stored_len);
s->pending += stored_len;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 1,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libxml2#globals_prep#xmlThrDefBufferAllocScheme.c | libxml2 | globals.c | xmlThrDefBufferAllocScheme | 4 | xmlBufferAllocationScheme
xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v __attribute__((unused))) {
return xmlBufferAllocScheme;
}
| {
"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
} |
wget-1.21.4#utils_prep#vec_append.c | wget-1.21.4 | utils.c | vec_append | 17 | char **
vec_append (char **vec, const char *str)
{
int cnt;
if (vec != ((void *)0))
{
for (cnt = 0; vec[cnt]; cnt++)
;
++cnt;
}
else
cnt = 1;
vec = xrealloc (vec, (cnt + 1) * sizeof (char *));
vec[cnt - 1] = xstrdup (str);
vec[cnt] = ((void *)0);
return vec;
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 0
} |
uucp-1.07#prote_prep#festart.c | uucp-1.07 | prote.c | festart | 14 | boolean
festart (qdaemon, pzlog)
struct sdaemon *qdaemon;
char **pzlog;
{
*pzlog = ((void *)0);
if (! fconn_set (qdaemon->qconn, PARITYSETTING_NONE,
STRIPSETTING_EIGHTBITS, XONXOFF_OFF))
return (0);
zEbuf = (char *) xmalloc (((16384) / 2));
fEfile = (0);
usysdep_sleep (2);
return (1);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 2,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
tmux#colour_prep#colour_find_rgb.c | tmux | colour.c | colour_find_rgb | 24 | int
colour_find_rgb(u_char r, u_char g, u_char b)
{
static const int q2c[6] = { 0x00, 0x5f, 0x87, 0xaf, 0xd7, 0xff };
int qr, qg, qb, cr, cg, cb, d, idx;
int grey_avg, grey_idx, grey;
qr = colour_to_6cube(r); cr = q2c[qr];
qg = colour_to_6cube(g); cg = q2c[qg];
qb = colour_to_6cube(b); cb = q2c[qb];
if (cr == r && cg == g && cb == b)
return ((16 + (36 * qr) + (6 * qg) + qb) | 0x01000000);
grey_avg = (r + g + b) / 3;
if (grey_avg > 238)
grey_idx = 23;
else
grey_idx = (grey_avg - 3) / 10;
grey = 8 + (10 * grey_idx);
d = colour_dist_sq(cr, cg, cb, r, g, b);
if (colour_dist_sq(grey, grey, grey, r, g, b) < d)
idx = 232 + grey_idx;
else
idx = 16 + (36 * qr) + (6 * qg) + qb;
return (idx | 0x01000000);
}
| {
"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": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
nettle-3.9.1#ecc-secp384r1_prep#nettle_get_secp_384r1.c | nettle-3.9.1 | ecc-secp384r1.c | nettle_get_secp_384r1 | 4 | const struct ecc_curve *nettle_get_secp_384r1(void)
{
return &_nettle_secp_384r1;
}
| {
"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
} |
tmux#session_prep#session_detach.c | tmux | session.c | session_detach | 18 | int
session_detach(struct session *s, struct winlink *wl)
{
if (s->curw == wl &&
session_last(s) != 0 &&
session_previous(s, 0) != 0)
session_next(s, 0);
wl->flags &= ~(0x1|0x2|0x4);
notify_session_window("window-unlinked", s, wl->window);
winlink_stack_remove(&s->lastw, wl);
winlink_remove(&s->windows, wl);
session_group_synchronize_from(s);
if (((&s->windows)->rbh_root == ((void *)0))) {
session_destroy(s, __func__);
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": 2,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#FIND_THE_MISSING_NUMBER_1_prep#sort.c | transcoder-set | FIND_THE_MISSING_NUMBER_1.c | sort | 1 | void sort (int arr [ ], int n) {qsort (arr, n, sizeof(int), cmpfunc);}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
nettle-3.9.1#base64-decode_prep#nettle_base64_decode_final.c | nettle-3.9.1 | base64-decode.c | nettle_base64_decode_final | 5 | int
nettle_base64_decode_final(struct base64_decode_ctx *ctx)
{
return ctx->bits == 0;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
gawk-5.2.2#regex_prep#re_match.c | gawk-5.2.2 | regex.c | re_match | 6 | regoff_t
re_match (struct re_pattern_buffer *bufp, const char *string, Idx length,
Idx start, struct re_registers *regs)
{
return re_search_stub (bufp, string, length, start, 0, length, regs, 1);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 2,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#WRITE_A_C_PROGRAM_TO_FIND_THE_PARITY_OF_AN_UNSIGNED_INTEGER_prep#max.c | transcoder-set | WRITE_A_C_PROGRAM_TO_FIND_THE_PARITY_OF_AN_UNSIGNED_INTEGER.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
} |
less-633#ifile_prep#getoff_ifile.c | less-633 | ifile.c | getoff_ifile | 9 | void* getoff_ifile(void* ifile)
{
void* newifile;
if ((newifile = prev_ifile(ifile)) != ((void*)((void *)0)))
return (newifile);
if ((newifile = next_ifile(ifile)) != ((void*)((void *)0)))
return (newifile);
return (((void*)((void *)0)));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 0
} |
patch-2.7.6#fd-safer_prep#fd_safer.c | patch-2.7.6 | fd-safer.c | fd_safer | 13 | int
fd_safer (int fd)
{
if (0 <= fd && fd <= 2)
{
int f = dup_safer (fd);
int e = (*__errno_location ());
close (fd);
(*__errno_location ()) = e;
fd = f;
}
return fd;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libosip2-5.3.1#osip_www_authenticate_prep#osip_www_authenticate_set_nonce.c | libosip2-5.3.1 | osip_www_authenticate.c | osip_www_authenticate_set_nonce | 3 | void osip_www_authenticate_set_nonce(osip_www_authenticate_t *www_authenticate, char *nonce) {
www_authenticate->nonce = (char *) nonce;
}
| {
"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_offsets.c | tmux | layout.c | layout_fix_offsets | 25 | void
layout_fix_offsets(struct layout_cell *lc)
{
struct layout_cell *lcchild;
u_int xoff, yoff;
if (lc->type == LAYOUT_LEFTRIGHT) {
xoff = lc->xoff;
for((lcchild) = ((&lc->cells)->tqh_first); (lcchild) != ((void *)0); (lcchild) = ((lcchild)->entry.tqe_next)) {
lcchild->xoff = xoff;
lcchild->yoff = lc->yoff;
if (lcchild->type != LAYOUT_WINDOWPANE)
layout_fix_offsets(lcchild);
xoff += lcchild->sx + 1;
}
} else {
yoff = lc->yoff;
for((lcchild) = ((&lc->cells)->tqh_first); (lcchild) != ((void *)0); (lcchild) = ((lcchild)->entry.tqe_next)) {
lcchild->xoff = lc->xoff;
lcchild->yoff = yoff;
if (lcchild->type != LAYOUT_WINDOWPANE)
layout_fix_offsets(lcchild);
yoff += lcchild->sy + 1;
}
}
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 2,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 0,
"struct_type": 2,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
less-633#main_prep#skipsp.c | less-633 | main.c | skipsp | 6 | char * skipsp(char *s)
{
while (*s == ' ' || *s == '\t')
s++;
return (s);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
optipng-0.7.8#ratio_prep#opng_ulratio_to_factor_string.c | optipng-0.7.8 | ratio.c | opng_ulratio_to_factor_string | 8 | int
opng_ulratio_to_factor_string(char *buffer, size_t buffer_size,
const struct opng_ulratio *ratio)
{
opng_uxlong_impl_t num = ratio->num;
opng_uxlong_impl_t denom = ratio->denom;
return opng_sprint_uratio_impl(buffer, buffer_size, num, denom, 0);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
brotli-1.0.9#cluster_prep#BrotliCompareAndPushToQueueDistance.c | brotli-1.0.9 | cluster.c | BrotliCompareAndPushToQueueDistance | 4 | __attribute__ ((visibility ("hidden"))) void BrotliCompareAndPushToQueueDistance(
const HistogramDistance* out, const uint32_t* cluster_size, uint32_t idx1,
uint32_t idx2, size_t max_num_pairs, HistogramPair* pairs,
size_t* num_pairs) { int is_good_pair = 0; HistogramPair p; p.idx1 = p.idx2 = 0; p.cost_diff = p.cost_combo = 0; if (idx1 == idx2) { return; } if (idx2 < idx1) { uint32_t t = idx2; idx2 = idx1; idx1 = t; } p.idx1 = idx1; p.idx2 = idx2; p.cost_diff = 0.5 * ClusterCostDiff(cluster_size[idx1], cluster_size[idx2]); p.cost_diff -= out[idx1].bit_cost_; p.cost_diff -= out[idx2].bit_cost_; if (out[idx1].total_count_ == 0) { p.cost_combo = out[idx2].bit_cost_; is_good_pair = 1; } else if (out[idx2].total_count_ == 0) { p.cost_combo = out[idx1].bit_cost_; is_good_pair = 1; } else { double threshold = *num_pairs == 0 ? 1e99 : (brotli_max_double((0.0), (pairs[0].cost_diff))); HistogramDistance combo = out[idx1]; double cost_combo; HistogramAddHistogramDistance(&combo, &out[idx2]); cost_combo = BrotliPopulationCostDistance(&combo); if (cost_combo < threshold - p.cost_diff) { p.cost_combo = cost_combo; is_good_pair = 1; } } if (is_good_pair) { p.cost_diff += p.cost_combo; if (*num_pairs > 0 && HistogramPairIsLess(&pairs[0], &p)) { if (*num_pairs < max_num_pairs) { pairs[*num_pairs] = pairs[0]; ++(*num_pairs); } pairs[0] = p; } else if (*num_pairs < max_num_pairs) { pairs[*num_pairs] = p; ++(*num_pairs); } } }
| {
"array_type": 3,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
mcsim-6.2.0#lex_prep#GetOptPunct.c | mcsim-6.2.0 | lex.c | GetOptPunct | 10 | int GetOptPunct (PINPUTBUF pibIn, PSTR szLex, char chPunct)
{
int iReturn, iType;
iReturn = SkipWhitespace (pibIn);
if (NextChar (pibIn) == chPunct) {
iReturn = 1;
NextLex (pibIn, szLex, &iType);
}
return (iReturn);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#LARGEST_SUBARRAY_WITH_EQUAL_NUMBER_OF_0S_AND_1S_prep#main.c | transcoder-set | LARGEST_SUBARRAY_WITH_EQUAL_NUMBER_OF_0S_AND_1S.c | main | 25 | int main(void) {
int n_success = 0;
int param0_0[] = {56,8,67,35,19,82,81,66,10,24,82,2,42,48,18,63,48,74,60,64,64,95,95,20,95,55,63,96,54};
int param0_1[] = {78,67,1,78,48,83,17,19,21,44,99,68,16,54,9};
int param0_2[] = {3,69,97,21,12,67,45,53,77,70,26,43};
int param0_3[] = {21,80,29,22,77,64,42,4,71,75,62,27,30,36,66,37,49,97};
int param0_4[] = {18,66,9,90,21,95,74,48,44,9,43,17};
int param0_5[] = {42,41,87,3,64,25,96,55,99,57,32,64,10,75,69,95,11,36,15,2,78,70,14,54,11,28,55,47,27,85,47,62,97,68,44,70,12,27,36,85,76,91,17,75,83,34,32,89,55};
int param0_6[] = {44};
int param0_7[] = {1,43,28,17,30,46,89,51,15,70,96,79,65,55,8};
int param0_8[] = {25,91,68,4,35,49,33};
int param0_9[] = {14,86,22,42,94,54,28,41,48,8,82,84,99,92,33,75,38,31,59,86,21,6,77,89,79,83,57,26,89,45,60,55,60,76,76,6,40,57,38,44,7,98,64,65,88,73,88,99};
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[] = {26,8,9,10,10,41,0,9,4,26};
for(int i = 0; i < len(param0); ++i)
{
if(f_filled(param0[i],param1[i]) == f_gold(param0[i],param1[i]))
{
n_success+=1;
}
break;
}
printf("No such subarray");
return 0;
}
| {
"array_type": 2,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
lil#lil_prep#lil_set_error_at.c | lil | lil.c | lil_set_error_at | 8 | void lil_set_error_at(lil_t lil, size_t pos, const char* msg)
{
if (lil->error) return;
free(lil->err_msg);
lil->error = 1;
lil->err_head = pos;
lil->err_msg = strclone(msg ? msg : "");
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 1,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
cpio-2.14#copyout_prep#to_ascii_or_error.c | cpio-2.14 | copyout.c | to_ascii_or_error | 12 | int
to_ascii_or_error (char *where, uintmax_t n, size_t digits,
unsigned logbase,
const char *filename, const char *fieldname)
{
if (to_ascii (where, n, digits, logbase, 0))
{
field_width_error (filename, fieldname, n, digits, 0);
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": 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
} |
heman#points_prep#heman_points_from_grid.c | heman | points.c | heman_points_from_grid | 24 | heman_points* heman_points_from_grid(float width, float height,
float cellsize, float jitter)
{
int cols = width / cellsize;
int rows = height / cellsize;
int ncells = cols * rows;
heman_points* result = heman_image_create(ncells, 1, 2);
float rscale = 2.0 * jitter / (float) 2147483647;
int j;
#pragma omp parallel for
for (j = 0; j < rows; j++) {
float* dst = result->data + j * cols * 2;
float y = cellsize * 0.5 + cellsize * j;
float x = cellsize * 0.5;
for (int i = 0; i < cols; i++) {
float rx = rand() * rscale - jitter;
float ry = rand() * rscale - jitter;
*dst++ = x + rx;
*dst++ = y + ry;
x += cellsize;
}
}
return result;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 2,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.