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#COUNT_NUMBER_INCREASING_SUBSEQUENCES_SIZE_K_prep#f_gold.c | transcoder-set | COUNT_NUMBER_INCREASING_SUBSEQUENCES_SIZE_K.c | f_gold | 25 | int f_gold ( int arr [ ], int n, int k ) {
int dp [ k ] [ n ], sum = 0;
memset ( dp, 0, sizeof ( dp ) );
for ( int i = 0;
i < n;
i ++ ) dp [ 0 ] [ i ] = 1;
for ( int l = 1;
l < k;
l ++ ) {
for ( int i = l;
i < n;
i ++ ) {
dp [ l ] [ i ] = 0;
for ( int j = l - 1;
j < i;
j ++ ) {
if ( arr [ j ] < arr [ i ] ) dp [ l ] [ i ] += dp [ l - 1 ] [ j ];
}
}
}
for ( int i = k - 1;
i < n;
i ++ ) sum += dp [ k - 1 ] [ i ];
return sum;
}
| {
"array_type": 2,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 5,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 1,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libxml2#relaxng_prep#xmlRelaxNGSetParserErrors.c | libxml2 | relaxng.c | xmlRelaxNGSetParserErrors | 12 | void
xmlRelaxNGSetParserErrors(xmlRelaxNGParserCtxtPtr ctxt,
xmlRelaxNGValidityErrorFunc err,
xmlRelaxNGValidityWarningFunc warn, void *ctx)
{
if (ctxt == ((void *)0))
return;
ctxt->error = err;
ctxt->warning = warn;
ctxt->serror = ((void *)0);
ctxt->userData = ctx;
}
| {
"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": 2,
"union_type": 0,
"while_loop": 0
} |
libxml2#libxml2-py_prep#libxml_xmlUCSIsKangxiRadicals.c | libxml2 | libxml2-py.c | libxml_xmlUCSIsKangxiRadicals | 13 | PyObject *
libxml_xmlUCSIsKangxiRadicals(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
int c_retval;
int code;
if (libxml_deprecationWarning("xmlUCSIsKangxiRadicals") == -1)
return(((void *)0));
if (!_PyArg_ParseTuple_SizeT(args, (char *)"i:xmlUCSIsKangxiRadicals", &code))
return(((void *)0));
c_retval = xmlUCSIsKangxiRadicals(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
} |
nano-7.2#move_prep#to_para_begin.c | nano-7.2 | move.c | to_para_begin | 7 | void to_para_begin(void)
{
linestruct *was_current = openfile->current;
do_para_begin(&openfile->current);
openfile->current_x = 0;
edit_redraw(was_current, CENTERING);
}
| {
"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": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#FIND_PAIR_WITH_GREATEST_PRODUCT_IN_ARRAY_prep#len.c | transcoder-set | FIND_PAIR_WITH_GREATEST_PRODUCT_IN_ARRAY.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#PYTHAGOREAN_QUADRUPLE_prep#cmpfunc.c | transcoder-set | PYTHAGOREAN_QUADRUPLE.c | cmpfunc | 1 | int cmpfunc (const void * a, const void * b) {return ( *(int*)a - *(int*)b );}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#GIVEN_A_SORTED_AND_ROTATED_ARRAY_FIND_IF_THERE_IS_A_PAIR_WITH_A_GIVEN_SUM_prep#len.c | transcoder-set | GIVEN_A_SORTED_AND_ROTATED_ARRAY_FIND_IF_THERE_IS_A_PAIR_WITH_A_GIVEN_SUM.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
} |
ed-1.19#buffer_prep#isbinary.c | ed-1.19 | buffer.c | isbinary | 1 | bool isbinary( void ) { return isbinary_; }
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
tmux#tty_prep#tty_raw.c | tmux | tty.c | tty_raw | 18 | void
tty_raw(struct tty *tty, const char *s)
{
ssize_t n, slen;
u_int i;
slen = strlen(s);
for (i = 0; i < 5; i++) {
n = write(tty->fd, s, slen);
if (n >= 0) {
s += n;
slen -= n;
if (slen == 0)
break;
} else if (n == -1 && (*__errno_location ()) != 11)
break;
usleep(100);
}
}
| {
"array_type": 0,
"break_continue_statement": 2,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#COUNT_PAIRS_WHOSE_PRODUCTS_EXIST_IN_ARRAY_prep#cmpfunc.c | transcoder-set | COUNT_PAIRS_WHOSE_PRODUCTS_EXIST_IN_ARRAY.c | cmpfunc | 1 | int cmpfunc (const void * a, const void * b) {return ( *(int*)a - *(int*)b );}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
tulipindicators-0.9.1#willr_prep#ti_willr.c | tulipindicators-0.9.1 | willr.c | ti_willr | 53 | int ti_willr(int size, double const *const *inputs, double const *options, double *const *outputs) {
const double *high = inputs[0];
const double *low = inputs[1];
const double *close = inputs[2];
const int period = (int)options[0];
double *output = outputs[0];
if (period < 1) return 1;
if (size <= ti_willr_start(options)) return 0;
int trail = 0, maxi = -1, mini = -1;
double max = high[0];
double min = low[0];
double bar;
int i, j;
for (i = period-1; i < size; ++i, ++trail) {
bar = high[i];
if (maxi < trail) {
maxi = trail;
max = high[maxi];
j = trail;
while(++j <= i) {
bar = high[j];
if (bar >= max) {
max = bar;
maxi = j;
}
}
} else if (bar >= max) {
maxi = i;
max = bar;
}
bar = low[i];
if (mini < trail) {
mini = trail;
min = low[mini];
j = trail;
while(++j <= i) {
bar = low[j];
if (bar <= min) {
min = bar;
mini = j;
}
}
} else if (bar <= min) {
mini = i;
min = bar;
}
const double highlow = (max - min);
const double r = highlow == 0.0 ? 0.0 : -100 * ((max - close[i]) / highlow);
*output++ = r;
}
((void) sizeof ((output - outputs[0] == size - ti_willr_start(options)) ? 1 : 0), __extension__ ({ if (output - outputs[0] == size - ti_willr_start(options)) ; else __assert_fail ("output - outputs[0] == size - ti_willr_start(options)", "indicators/willr.c", 96, __extension__ __PRETTY_FUNCTION__); }));
return 0;
}
| {
"array_type": 6,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 9,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 4,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 2
} |
transcoder-set#PAIR_WITH_GIVEN_PRODUCT_SET_1_FIND_IF_ANY_PAIR_EXISTS_prep#max.c | transcoder-set | PAIR_WITH_GIVEN_PRODUCT_SET_1_FIND_IF_ANY_PAIR_EXISTS.c | max | 1 | int max(int x, int y) { return (x > y)? x: y; }
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libosip2-5.3.1#port_condv_prep#osip_cond_wait.c | libosip2-5.3.1 | port_condv.c | osip_cond_wait | 5 | int osip_cond_wait(struct osip_cond *_cond, struct osip_mutex *_mut) {
if (!_cond)
return -2;
return pthread_cond_wait(&_cond->cv, (pthread_mutex_t *) _mut);
}
| {
"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": 0,
"union_type": 0,
"while_loop": 0
} |
gprolog-1.5.0#stream_c_prep#Pl_Set_Stream_Type_2.c | gprolog-1.5.0 | stream_c.c | Pl_Set_Stream_Type_2 | 16 | void
Pl_Set_Stream_Type_2(WamWord sora_word, WamWord is_text_word)
{
int stm;
StmInf *pstm;
int text;
stm = Pl_Get_Stream_Or_Alias(sora_word, 1);
pstm = pl_stm_tbl[stm];
text = Pl_Rd_Integer_Check(is_text_word);
if ((unsigned) text == pstm->prop.text)
return;
if (pstm->char_count)
Pl_Err_Permission(pl_permission_operation_modify,
pl_permission_type_stream, sora_word);
pstm->prop.text = text;
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
pth-2.0.7#pth_data_prep#pth_key_delete.c | pth-2.0.7 | pth_data.c | pth_key_delete | 9 | int pth_key_delete(pth_key_t key)
{
if (key < 0 || key >= 256)
return ((*__errno_location ()) = (22), ((0)));
if (!pth_keytab[key].used)
return ((*__errno_location ()) = (2), ((0)));
pth_keytab[key].used = (0);
return (!(0));
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
uucp-1.07#xqtfil_prep#usysdep_get_xqt_free.c | uucp-1.07 | xqtfil.c | usysdep_get_xqt_free | 20 | void
usysdep_get_xqt_free (zsystem)
const char *zsystem __attribute__ ((__unused__));
{
if (qSxqt_topdir != ((void *)0))
{
(void) closedir (qSxqt_topdir);
qSxqt_topdir = ((void *)0);
}
if (qSxqt_dir != ((void *)0))
{
(void) closedir (qSxqt_dir);
qSxqt_dir = ((void *)0);
}
ubuffree (zSdir);
zSdir = ((void *)0);
ubuffree (zSsystem);
zSsystem = ((void *)0);
fSone_dir = (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": 8,
"union_type": 0,
"while_loop": 0
} |
libzahl-1.0#zmodsqr_prep#zmodsqr.c | libzahl-1.0 | zmodsqr.c | zmodsqr | 12 | void
zmodsqr(z_t a, z_t b, z_t c)
{
if (a == c) {
zset(libzahl_tmp_modsqr, c);
zsqr(a, b);
zmod(a, a, libzahl_tmp_modsqr);
} else {
zsqr(a, b);
zmod(a, a, 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": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libxml2#parser_prep#xmlParseEntity.c | libxml2 | parser.c | xmlParseEntity | 4 | xmlDocPtr
xmlParseEntity(const char *filename) {
return(xmlSAXParseEntity(((void *)0), filename));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
tulipindicators-0.9.1#candles_prep#tc_three_black_crows.c | tulipindicators-0.9.1 | candles.c | tc_three_black_crows | 5 | int tc_three_black_crows(int size, TC_REAL const *const *inputs, tc_config const *options, tc_result *output) {
const TC_REAL *open = inputs[0]; const TC_REAL *high = inputs[1]; const TC_REAL *low = inputs[2]; const TC_REAL *close = inputs[3]; const int period = options->period; const TC_REAL div = 1.0 / period; TC_REAL avg_body_sum = 0; TC_REAL avg_total_sum = 0; if (period < 1) return 1; if (size < period) return 0; int i; for (i = 0; i < period; ++i) { avg_body_sum += (fabs(open[(i)] - close[(i)])); avg_total_sum += (high[(i)] - low[(i)]); }
while(i < size) { const TC_REAL top = (open[(i)] > close[(i)] ? open[(i)] : close[(i)]); const TC_REAL bottom = (open[(i)] < close[(i)] ? open[(i)] : close[(i)]); const TC_REAL body = (fabs(open[(i)] - close[(i)])); const TC_REAL total = (high[(i)] - low[(i)]); const TC_REAL upper = (high[(i)] - top); const TC_REAL lower = (bottom - low[(i)]); const TC_REAL avg_body = avg_body_sum * div; const TC_REAL avg_total = avg_total_sum * div; (void)top;(void)bottom;(void)body;(void)total; (void)upper;(void)lower;(void)avg_body;(void)avg_total; if (i>=2 && (open[i-2]>close[i-2]) && (open[i-1]>close[i-1]) && (open[i]>close[i]) && (open[i-1] < (open[((i-1)-1)] > close[((i-1)-1)] ? open[((i-1)-1)] : close[((i-1)-1)]) && open[i-1] > (open[((i-1)-1)] < close[((i-1)-1)] ? open[((i-1)-1)] : close[((i-1)-1)])) && (open[i] < (open[((i)-1)] > close[((i)-1)] ? open[((i)-1)] : close[((i)-1)]) && open[i] > (open[((i)-1)] < close[((i)-1)] ? open[((i)-1)] : close[((i)-1)]))) { do { const tc_hit hit = {i, (1L<<22)}; const int r = tc_result_add(output, hit); if (r != 0) return r; } while (0); } avg_body_sum += body; avg_body_sum -= (fabs(open[(i-period)] - close[(i-period)])); avg_total_sum += total; avg_total_sum -= (high[(i-period)] - low[(i-period)]); ++i; };
return 0;
}
| {
"array_type": 3,
"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": 4,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 1
} |
libxml2#tree_prep#xmlGetProp.c | libxml2 | tree.c | xmlGetProp | 8 | xmlChar *
xmlGetProp(const xmlNode *node, const xmlChar *name) {
xmlAttrPtr prop;
prop = xmlHasProp(node, name);
if (prop == ((void *)0))
return(((void *)0));
return(xmlGetPropNodeValueInternal(prop));
}
| {
"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
} |
tulipindicators-0.9.1#di_prep#ti_di_start.c | tulipindicators-0.9.1 | di.c | ti_di_start | 3 | int ti_di_start(double const *options) {
return (int)options[0]-1;
}
| {
"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
} |
gprolog-1.5.0#fd_range_prep#Pl_Range_Mul_Range.c | gprolog-1.5.0 | fd_range.c | Pl_Range_Mul_Range | 24 | void
Pl_Range_Mul_Range(Range *range, Range *range1)
{
Range r;
if (((range)->min > (range)->max))
return;
if (((range1)->min > (range1)->max))
{
(range)->max = (int)(1 << (sizeof(int) * 8 - 1));
return;
}
if (((range)->vec == ((void *)0)))
Pl_Range_Becomes_Sparse(range);
if (((range1)->vec == ((void *)0)))
{
r.vec = ((void *)0);
Pl_Range_Copy(&r, range1);
range1 = &r;
Pl_Range_Becomes_Sparse(range1);
}
Pl_Vector_Mul_Vector(range->vec, range1->vec);
range->extra_cstr |= range1->extra_cstr;
Pl_Range_From_Vector(range);
}
| {
"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": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
nano-7.2#move_prep#do_scroll_down.c | nano-7.2 | move.c | do_scroll_down | 10 | void do_scroll_down(void)
{
if (openfile->current_y == 0)
do_down();
if (editwinrows > 1 && (openfile->edittop->next != ((void *)0)
|| (((flags[((SOFTWRAP) / (sizeof(unsigned) * 8))] & ((unsigned)1 << ((SOFTWRAP) % (sizeof(unsigned) * 8)))) != 0) && (extra_chunks_in(openfile->edittop) >
chunk_for(openfile->firstcolumn, openfile->edittop)))
))
edit_scroll(1);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 0
} |
tmux#screen-write_prep#screen_write_clearscreen.c | tmux | screen-write.c | screen_write_clearscreen | 15 | void
screen_write_clearscreen(struct screen_write_ctx *ctx, u_int bg)
{
struct screen *s = ctx->s;
struct tty_ctx ttyctx;
u_int sx = ((s)->grid->sx), sy = ((s)->grid->sy);
screen_write_initctx(ctx, &ttyctx);
ttyctx.bg = bg;
if (s->grid->flags & 0x1)
grid_view_clear_history(s->grid, bg);
else
grid_view_clear(s->grid, 0, 0, sx, sy, bg);
screen_write_collect_clear(ctx, 0, sy);
tty_write(tty_cmd_clearscreen, &ttyctx);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 0,
"struct_type": 2,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
findutils-4.9.0#util_prep#nonfatal_nontarget_file_error.c | findutils-4.9.0 | util.c | nonfatal_nontarget_file_error | 5 | void
nonfatal_nontarget_file_error (int errno_value, const char *name)
{
report_file_err (0, errno_value, 0, 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
} |
json-c#linkhash_prep#lh_table_free.c | json-c | linkhash.c | lh_table_free | 11 | void lh_table_free(struct lh_table *t)
{
struct lh_entry *c;
if (t->free_fn)
{
for (c = t->head; c != ((void *)0); c = c->next)
t->free_fn(c);
}
free(t->table);
free(t);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 2,
"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#tags_prep#gettagtype.c | less-633 | tags.c | gettagtype | 21 | int gettagtype(void)
{
int f;
if (strcmp(tags, "GTAGS") == 0)
return T_GTAGS;
if (strcmp(tags, "GRTAGS") == 0)
return T_GRTAGS;
if (strcmp(tags, "GSYMS") == 0)
return T_GSYMS;
if (strcmp(tags, "GPATH") == 0)
return T_GPATH;
if (strcmp(tags, "-") == 0)
return T_CTAGS_X;
f = open(tags, (00));
if (f >= 0)
{
close(f);
return T_CTAGS;
}
return T_GTAGS;
}
| {
"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": 1,
"union_type": 0,
"while_loop": 0
} |
units-2.22#units_prep#showdefinition.c | units-2.22 | units.c | showdefinition | 14 | void
showdefinition(char *unitstr, struct unittype *theunit)
{
logputs(deftext);
while((unitstr = lookupunit(unitstr,1))
&& strspn(unitstr,digits) != strlen(unitstr)
&& !strchr(unitstr,'!')) {
tightprint(stdout,unitstr);
if (logfile) tightprint(logfile,unitstr);
logputs(" = ");
}
showunit(theunit);
logputchar('\n');
}
| {
"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": 1
} |
patch-2.7.6#basename-lgpl_prep#base_len.c | patch-2.7.6 | basename-lgpl.c | base_len | 15 | size_t
base_len (char const *name)
{
size_t len;
size_t prefix_len = 0;
for (len = strlen (name); 1 < len && ((name[len - 1]) == '/'); len--)
continue;
if (0 && len == 1
&& ((name[0]) == '/') && ((name[1]) == '/') && ! name[2])
return 2;
if (0 && prefix_len
&& len == prefix_len && ((name[prefix_len]) == '/'))
return prefix_len + 1;
return len;
}
| {
"array_type": 1,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
mtools-4.0.43#mainloop_prep#main_loop.c | mtools-4.0.43 | mainloop.c | main_loop | 40 | int main_loop(MainParam_t *mp, char **argv, int argc)
{
int i;
int ret, Bret;
Bret = 0;
if(argc != 1 && mp->targetName) {
fprintf(stderr,
"Several file names given, but last argument (%s) not a directory\n", mp->targetName);
free_stream( (&mp->targetDir) );
return 1;
}
for (i = 0; i < argc; i++) {
if ( got_signal )
break;
mp->originalArg = argv[i];
mp->basenameHasWildcard = strpbrk(_basename(mp->originalArg),
"*[?") != 0;
if (mp->unixcallback && (!argv[i][0]
|| argv[i][1] != ':' ))
ret = unix_loop(0, mp, argv[i], 1);
else
ret = dos_loop(mp, argv[i]);
if (! (ret & (4 | 16)) ) {
fprintf(stderr, "%s: File \"%s\" not found\n",
progname, argv[i]);
ret |= 16;
}
Bret |= ret;
if(mp->fast_quit && (Bret & (2 | 16)))
break;
}
free_stream( (&mp->targetDir) );
if(Bret & 16)
return 1;
if ((Bret & 4) && ( Bret & 2))
return 2;
if (Bret & 2)
return 1;
return 0;
}
| {
"array_type": 1,
"break_continue_statement": 2,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 8,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 5,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
json-c#json_util_prep#_json_c_set_last_err.c | json-c | json_util.c | _json_c_set_last_err | 7 | void _json_c_set_last_err(const char *err_fmt, ...)
{
va_list ap;
__builtin_va_start(ap,err_fmt);
(void)vsnprintf(_last_err, sizeof(_last_err), err_fmt, ap);
__builtin_va_end(ap);
}
| {
"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#HIGHWAY_BILLBOARD_PROBLEM_prep#f_gold.c | transcoder-set | HIGHWAY_BILLBOARD_PROBLEM.c | f_gold | 19 | int f_gold ( int m, int x [ ], int revenue [ ], int n, int t ) {
int maxRev [ m + 1 ];
memset ( maxRev, 0, sizeof ( maxRev ) );
int nxtbb = 0;
for ( int i = 1;
i <= m;
i ++ ) {
if ( nxtbb < n ) {
if ( x [ nxtbb ] != i ) maxRev [ i ] = maxRev [ i - 1 ];
else {
if ( i <= t ) maxRev [ i ] = max ( maxRev [ i - 1 ], revenue [ nxtbb ] );
else maxRev [ i ] = max ( maxRev [ i - t - 1 ] + revenue [ nxtbb ], maxRev [ i - 1 ] );
nxtbb ++;
}
}
else maxRev [ i ] = maxRev [ i - 1 ];
}
return maxRev [ m ];
}
| {
"array_type": 3,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"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": 0
} |
tar-1.34#misc_prep#zap_slashes.c | tar-1.34 | misc.c | zap_slashes | 11 | char *
zap_slashes (char *name)
{
char *q;
if (!name || *name == 0)
return name;
q = name + strlen (name) - 1;
while (q > name && ((*q) == '/'))
*q-- = '\0';
return name;
}
| {
"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": 0,
"union_type": 0,
"while_loop": 1
} |
bc-1.07.1#number_prep#bc_divmod.c | bc-1.07.1 | number.c | bc_divmod | 22 | int
bc_divmod (bc_num num1, bc_num num2, bc_num *quot, bc_num *rem, int scale)
{
bc_num quotient = ((void *)0);
bc_num temp;
int rscale;
if (bc_is_zero (num2)) return -1;
rscale = ((num1->n_scale)>(num2->n_scale+scale)?(num1->n_scale):(num2->n_scale+scale));
bc_init_num(&temp);
bc_divide (num1, num2, &temp, scale);
if (quot)
quotient = bc_copy_num (temp);
bc_multiply (temp, num2, &temp, rscale);
bc_sub (num1, temp, rem, rscale);
bc_free_num (&temp);
if (quot)
{
bc_free_num (quot);
*quot = quotient;
}
return 0;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
nano-7.2#utils_prep#mark_is_before_cursor.c | nano-7.2 | utils.c | mark_is_before_cursor | 6 | _Bool mark_is_before_cursor(void)
{
return (openfile->mark->lineno < openfile->current->lineno ||
(openfile->mark == openfile->current &&
openfile->mark_x <= openfile->current_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": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#SUM_FIBONACCI_NUMBERS_prep#sort.c | transcoder-set | SUM_FIBONACCI_NUMBERS.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
} |
libosip2-5.3.1#osip_transaction_prep#osip_transaction_set_srv_record.c | libosip2-5.3.1 | osip_transaction.c | osip_transaction_set_srv_record | 6 | int osip_transaction_set_srv_record(osip_transaction_t *transaction, osip_srv_record_t *record) {
if (transaction == ((void *)0))
return -2;
memcpy(&transaction->record, record, sizeof(osip_srv_record_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": 0,
"memory_operation": 1,
"pointer_type": 0,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libxml2#HTMLparser_prep#UTF8ToHtml.c | libxml2 | HTMLparser.c | UTF8ToHtml | 63 | int
UTF8ToHtml(unsigned char* out, int *outlen,
const unsigned char* in, int *inlen) {
const unsigned char* instart = in;
const unsigned char* inend;
unsigned char* outstart = out;
unsigned char* outend;
int ret = XML_ENC_ERR_SPACE;
if ((out == ((void *)0)) || (outlen == ((void *)0)) || (inlen == ((void *)0)))
return(XML_ENC_ERR_INTERNAL);
if (in == ((void *)0)) {
*outlen = 0;
*inlen = 0;
return(XML_ENC_ERR_SUCCESS);
}
inend = in + *inlen;
outend = out + *outlen;
while (in < inend) {
const htmlEntityDesc *ent;
const char *cp;
char nbuf[16];
unsigned c, d;
int seqlen, len, i;
d = *in;
if (d < 0x80) {
if (out >= outend)
goto done;
*out++ = d;
in += 1;
continue;
}
if (d < 0xE0) { c = d & 0x1F; seqlen = 2; }
else if (d < 0xF0) { c = d & 0x0F; seqlen = 3; }
else { c = d & 0x07; seqlen = 4; }
if (inend - in < seqlen)
break;
for (i = 1; i < seqlen; i++) {
d = in[i];
c <<= 6;
c |= d & 0x3F;
}
ent = htmlEntityValueLookup(c);
if (ent == ((void *)0)) {
snprintf(nbuf, sizeof(nbuf), "#%u", c);
cp = nbuf;
} else {
cp = ent->name;
}
len = strlen(cp);
if (outend - out < len + 2)
goto done;
*out++ = '&';
memcpy(out, cp, len);
out += len;
*out++ = ';';
in += seqlen;
}
ret = out - outstart;
done:
*outlen = out - outstart;
*inlen = in - instart;
return(ret);
}
| {
"array_type": 2,
"break_continue_statement": 2,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 2,
"if_statement": 9,
"memory_management": 0,
"memory_operation": 1,
"pointer_type": 2,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 1
} |
libxml2#valid_prep#xmlFreeRefTable.c | libxml2 | valid.c | xmlFreeRefTable | 4 | void
xmlFreeRefTable(xmlRefTablePtr table) {
xmlHashFree(table, xmlFreeRefTableEntry);
}
| {
"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#cleanAttributeList.c | dap-3.10 | dap0.c | cleanAttributeList | 19 | void cleanAttributeList( AttributeList *list)
{
AttributeList *actualatt=list;
do{
actualatt=list;
AttributeList *prev=list;
AttributeList *prev2=list;
do{
prev2=prev;
prev=actualatt;
actualatt=actualatt->next;
}while(actualatt!=((void *)0));
if (prev!=list){
free(prev->word);
free(prev);
}
prev2->next=((void *)0);
}while(list->next!=((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": 2,
"memory_operation": 0,
"pointer_type": 3,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 2
} |
json.h#allow_multi_line_strings_prep#is_valid_unquoted_key_char.c | json.h | allow_multi_line_strings.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
} |
libxml2#xmlreader_prep#xmlTextReaderSetup.c | libxml2 | xmlreader.c | xmlTextReaderSetup | 159 | int
xmlTextReaderSetup(xmlTextReaderPtr reader,
xmlParserInputBufferPtr input, const char *URL,
const char *encoding, int options)
{
if (reader == ((void *)0)) {
if (input != ((void *)0))
xmlFreeParserInputBuffer(input);
return (-1);
}
options |= XML_PARSE_COMPACT;
reader->doc = ((void *)0);
reader->entNr = 0;
reader->parserFlags = options;
reader->validate = XML_TEXTREADER_NOT_VALIDATE;
if ((input != ((void *)0)) && (reader->input != ((void *)0)) &&
(reader->allocs & 1)) {
xmlFreeParserInputBuffer(reader->input);
reader->input = ((void *)0);
reader->allocs -= 1;
}
if (input != ((void *)0)) {
reader->input = input;
reader->allocs |= 1;
}
if (reader->buffer == ((void *)0))
reader->buffer = xmlBufCreate(50);
if (reader->buffer == ((void *)0)) {
return (-1);
}
if (reader->sax == ((void *)0))
reader->sax = (xmlSAXHandler *) xmlMalloc(sizeof(xmlSAXHandler));
if (reader->sax == ((void *)0)) {
return (-1);
}
xmlSAXVersion(reader->sax, 2);
reader->startElement = reader->sax->startElement;
reader->sax->startElement = xmlTextReaderStartElement;
reader->endElement = reader->sax->endElement;
reader->sax->endElement = xmlTextReaderEndElement;
if (reader->sax->initialized == 0xDEEDBEAF) {
reader->startElementNs = reader->sax->startElementNs;
reader->sax->startElementNs = xmlTextReaderStartElementNs;
reader->endElementNs = reader->sax->endElementNs;
reader->sax->endElementNs = xmlTextReaderEndElementNs;
} else {
reader->startElementNs = ((void *)0);
reader->endElementNs = ((void *)0);
}
reader->characters = reader->sax->characters;
reader->sax->characters = xmlTextReaderCharacters;
reader->sax->ignorableWhitespace = xmlTextReaderCharacters;
reader->cdataBlock = reader->sax->cdataBlock;
reader->sax->cdataBlock = xmlTextReaderCDataBlock;
reader->mode = XML_TEXTREADER_MODE_INITIAL;
reader->node = ((void *)0);
reader->curnode = ((void *)0);
if (input != ((void *)0)) {
if (xmlBufUse(reader->input->buffer) < 4) {
xmlParserInputBufferRead(input, 4);
}
if (reader->ctxt == ((void *)0)) {
if (xmlBufUse(reader->input->buffer) >= 4) {
reader->ctxt = xmlCreatePushParserCtxt(reader->sax, ((void *)0),
(const char *) xmlBufContent(reader->input->buffer),
4, URL);
reader->base = 0;
reader->cur = 4;
} else {
reader->ctxt =
xmlCreatePushParserCtxt(reader->sax, ((void *)0), ((void *)0), 0, URL);
reader->base = 0;
reader->cur = 0;
}
if (reader->ctxt == ((void *)0)) {
return (-1);
}
} else {
xmlParserInputPtr inputStream;
xmlParserInputBufferPtr buf;
xmlCtxtReset(reader->ctxt);
buf = xmlAllocParserInputBuffer(XML_CHAR_ENCODING_NONE);
if (buf == ((void *)0)) return(-1);
inputStream = xmlNewInputStream(reader->ctxt);
if (inputStream == ((void *)0)) {
xmlFreeParserInputBuffer(buf);
return(-1);
}
if (URL == ((void *)0))
inputStream->filename = ((void *)0);
else
inputStream->filename = (char *)
xmlCanonicPath((const xmlChar *) URL);
inputStream->buf = buf;
xmlBufResetInput(buf->buffer, inputStream);
if (inputPush(reader->ctxt, inputStream) < 0) {
xmlFreeInputStream(inputStream);
return(-1);
}
reader->cur = 0;
}
}
if (reader->dict != ((void *)0)) {
if (reader->ctxt->dict != ((void *)0)) {
if (reader->dict != reader->ctxt->dict) {
xmlDictFree(reader->dict);
reader->dict = reader->ctxt->dict;
}
} else {
reader->ctxt->dict = reader->dict;
}
} else {
if (reader->ctxt->dict == ((void *)0))
reader->ctxt->dict = xmlDictCreate();
reader->dict = reader->ctxt->dict;
}
reader->ctxt->_private = reader;
reader->ctxt->linenumbers = 1;
reader->ctxt->dictNames = 1;
reader->ctxt->parseMode = XML_PARSE_READER;
if (reader->xincctxt != ((void *)0)) {
xmlXIncludeFreeContext(reader->xincctxt);
reader->xincctxt = ((void *)0);
}
if (options & XML_PARSE_XINCLUDE) {
reader->xinclude = 1;
reader->xinclude_name = xmlDictLookup(reader->dict, (const xmlChar *) "include", -1);
if (reader->xinclude_name == ((void *)0))
return(-1);
options -= XML_PARSE_XINCLUDE;
} else
reader->xinclude = 0;
reader->in_xinclude = 0;
if (reader->patternTab == ((void *)0)) {
reader->patternNr = 0;
reader->patternMax = 0;
}
while (reader->patternNr > 0) {
reader->patternNr--;
if (reader->patternTab[reader->patternNr] != ((void *)0)) {
xmlFreePattern(reader->patternTab[reader->patternNr]);
reader->patternTab[reader->patternNr] = ((void *)0);
}
}
if (options & XML_PARSE_DTDVALID)
reader->validate = XML_TEXTREADER_VALIDATE_DTD;
xmlCtxtUseOptions(reader->ctxt, options);
if (encoding != ((void *)0))
xmlSwitchEncodingName(reader->ctxt, encoding);
if ((URL != ((void *)0)) && (reader->ctxt->input != ((void *)0)) &&
(reader->ctxt->input->filename == ((void *)0))) {
reader->ctxt->input->filename = (char *)
xmlStrdup((const xmlChar *) URL);
if (reader->ctxt->input->filename == ((void *)0))
return(-1);
}
reader->doc = ((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": 31,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 10,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 39,
"union_type": 0,
"while_loop": 1
} |
transcoder-set#EULERIAN_NUMBER_1_prep#main.c | transcoder-set | EULERIAN_NUMBER_1.c | main | 15 | int main(void) {
int n_success = 0;
int param0[] = {27,77,35,26,6,66,44,26,74,65};
int param1[] = {7,34,22,20,10,47,29,33,86,97};
for(int i = 0; i < len(param0); ++i)
{
if(f_filled(param0[i],param1[i]) == f_gold(param0[i],param1[i]))
{
n_success+=1;
}
break;
}
printf("#Results:", " ", n_success, ", ", len(param0));
return 0;
}
| {
"array_type": 2,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#SQUARE_PYRAMIDAL_NUMBER_SUM_SQUARES_prep#f_gold.c | transcoder-set | SQUARE_PYRAMIDAL_NUMBER_SUM_SQUARES.c | f_gold | 10 | int f_gold ( int s ) {
int sum = 0;
for ( int n = 1;
sum < s;
n ++ ) {
sum += n * n;
if ( sum == s ) return n;
}
return - 1;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#DYNAMIC_PROGRAMMING_HIGH_EFFORT_VS_LOW_EFFORT_TASKS_PROBLEM_prep#main.c | transcoder-set | DYNAMIC_PROGRAMMING_HIGH_EFFORT_VS_LOW_EFFORT_TASKS_PROBLEM.c | main | 36 | int main(void) {
int n_success = 0;
int param0_0[] = {1,3,9,10,13,14,15,15,17,22,23,28,30,31,37,42,45,62,62,68,68,68,78,79,82,84,87,90,99};
int param0_1[] = {-78,-12,26,80,50,4,-80,86,12,-2,18,-50,-90,56,-50,88,-62,96,-44,-82,56};
int param0_2[] = {1};
int param0_3[] = {21,28,13,48,26,49,16,70,81,35,74,12,97,61,10,84,94,78,40,30,30,84,41,4,95,79,38,29,9};
int param0_4[] = {-80,-36,-32,-20,-14,-12,10,12,72};
int param0_5[] = {1,1,0,1,0,0,0,0,0,1,1,0,1,0,0,1,0,0,1,0,0,0,0,0,1};
int param0_6[] = {1,7,9,10,13,14,15,20,23,24,24,24,26,27,29,31,32,33,34,35,46,48,49,51,51,53,53,56,56,60,62,64,64,70,73,73,73,74,77,78,79,79,79,80,86,89,89,92,98};
int param0_7[] = {56,48,40,-56,44,-86,-28,-32,-34,4,-94,-14,28,-74};
int param0_8[] = {0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1};
int param0_9[] = {85,13,35,57,8,48,65,54,88,7,66,30,47,51};
int *param0[10] = {param0_0,param0_1,param0_2,param0_3,param0_4,param0_5,param0_6,param0_7,param0_8,param0_9};
int param1_0[] = {5,10,11,14,16,22,24,30,34,35,37,37,39,41,42,42,43,55,57,63,71,76,83,83,85,90,91,97,99};
int param1_1[] = {-44,-14,14,0,30,78,40,-12,-44,-16,60,-12,-50,-66,70,-98,-56,48,-82,94,14};
int param1_2[] = {1};
int param1_3[] = {49,88,25,93,24,56,47,44,33,27,86,57,21,25,64,44,37,99,36,54,17,29,37,17,26,43,61,27,21};
int param1_4[] = {-76,-54,-50,-28,0,58,70,78,90};
int param1_5[] = {0,0,1,1,1,0,0,1,1,0,1,1,1,1,0,1,1,1,0,1,1,0,0,0,1};
int param1_6[] = {1,3,3,4,8,8,10,10,10,12,12,15,15,22,23,28,28,30,31,33,34,35,36,36,36,42,44,44,51,54,57,58,59,59,63,65,66,68,69,71,73,76,77,78,79,79,86,87,93};
int param1_7[] = {82,-40,-16,-64,12,-6,60,48,-58,-4,42,-28,24,-58};
int param1_8[] = {0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1};
int param1_9[] = {1,42,42,89,3,21,49,98,4,59,26,85,53,34};
int *param1[10] = {param1_0,param1_1,param1_2,param1_3,param1_4,param1_5,param1_6,param1_7,param1_8,param1_9};
int param2[] = {18,16,0,25,4,24,31,8,16,8};
for(int i = 0; i < len(param0); ++i)
{
if(f_filled(param0[i],param1[i],param2[i]) == f_gold(param0[i],param1[i],param2[i]))
{
n_success+=1;
}
break;
}
printf("#Results:", " ", n_success, ", ", len(param0));
return 0;
}
| {
"array_type": 3,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
tinycc#x86_64-gen_prep#gtst.c | tinycc | x86_64-gen.c | gtst | 36 | int gtst(int inv, int t)
{
int v = vtop->r & 0x003f;
if (nocode_wanted) {
;
} else if (v == 0x0033) {
if (vtop->c.i & 0x100)
{
vtop->c.i &= ~0x100;
if (inv == (vtop->c.i == 0x95))
o(0x067a);
else
{
g(0x0f);
t = oad(0x8a,t);
}
}
g(0x0f);
t = oad((vtop->c.i - 16) ^ inv,t);
} else if (v == 0x0034 || v == 0x0035) {
if ((v & 1) == inv) {
uint32_t n1, n = vtop->c.i;
if (n) {
while ((n1 = read32le(cur_text_section->data + n)))
n = n1;
write32le(cur_text_section->data + n, t);
t = vtop->c.i;
}
} else {
t = gjmp(t);
gsym(vtop->c.i);
}
}
vtop--;
return t;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 7,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
libxml2#parser_prep#xmlSAXParseMemory.c | libxml2 | parser.c | xmlSAXParseMemory | 5 | xmlDocPtr
xmlSAXParseMemory(xmlSAXHandlerPtr sax, const char *buffer,
int size, int recovery) {
return xmlSAXParseMemoryWithData(sax, buffer, size, recovery, ((void *)0));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#FIND_EQUAL_POINT_STRING_BRACKETS_prep#len.c | transcoder-set | FIND_EQUAL_POINT_STRING_BRACKETS.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
} |
gprolog-1.5.0#fd_math_c_prep#Pl_Fd_Set_Full_Ac_Flag_1.c | gprolog-1.5.0 | fd_math_c.c | Pl_Fd_Set_Full_Ac_Flag_1 | 5 | void
Pl_Fd_Set_Full_Ac_Flag_1(WamWord full_ac_word)
{
pl_full_ac = Pl_Rd_Integer(full_ac_word);
}
| {
"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
} |
json.h#allow_no_commas_prep#json_parse_key.c | json.h | allow_no_commas.c | json_parse_key | 23 | void json_parse_key(struct json_parse_state_s *state,
struct json_string_s *string) {
if (json_parse_flags_allow_unquoted_keys & state->flags_bitset) {
const char *const src = state->src;
char *const data = state->data;
size_t offset = state->offset;
if (('"' == src[offset]) || ('\'' == src[offset])) {
json_parse_string(state, string);
} else {
size_t size = 0;
string->string = state->data;
while (is_valid_unquoted_key_char(src[offset])) {
data[size++] = src[offset++];
}
data[size] = '\0';
string->string_size = size++;
state->data += size;
state->offset = offset;
}
} else {
json_parse_string(state, string);
}
}
| {
"array_type": 2,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 2,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
cpio-2.14#util_prep#set_new_media_message.c | cpio-2.14 | util.c | set_new_media_message | 29 | void
set_new_media_message (char *message)
{
char *p;
int prev_was_percent;
p = message;
prev_was_percent = 0;
while (*p != '\0')
{
if (*p == 'd' && prev_was_percent)
break;
prev_was_percent = (*p == '%');
++p;
}
if (*p == '\0')
{
new_media_message = xstrdup (message);
}
else
{
int length = p - message - 1;
new_media_message_with_number = xmalloc (length + 1);
strncpy (new_media_message_with_number, message, length);
new_media_message_with_number[length] = '\0';
length = strlen (p + 1);
new_media_message_after_number = xmalloc (length + 1);
strcpy (new_media_message_after_number, p + 1);
}
}
| {
"array_type": 1,
"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": 1,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
libxml2#xpath_prep#xmlXPathCastBooleanToString.c | libxml2 | xpath.c | xmlXPathCastBooleanToString | 9 | xmlChar *
xmlXPathCastBooleanToString (int val) {
xmlChar *ret;
if (val)
ret = xmlStrdup((const xmlChar *) "true");
else
ret = xmlStrdup((const xmlChar *) "false");
return(ret);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libxml2#encoding_prep#xmlInitCharEncodingHandlers.c | libxml2 | encoding.c | xmlInitCharEncodingHandlers | 4 | void
xmlInitCharEncodingHandlers(void) {
xmlInitParser();
}
| {
"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#iskeyword.c | dap-3.10 | sbstrans.c | iskeyword | 10 | int iskeyword(char *str)
{
int k;
for (k = 0; *keyword[k]; k++)
{
if (!linecmp(str, keyword[k]))
return 1;
}
return 0;
}
| {
"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": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
gprolog-1.5.0#arith_inl_c_prep#Pl_Blt_Fast_Eq.c | gprolog-1.5.0 | arith_inl_c.c | Pl_Blt_Fast_Eq | 5 | Bool
Pl_Blt_Fast_Eq(WamWord x, WamWord y)
{
return 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
} |
gprolog-1.5.0#stream_c_prep#Pl_Close_Input_Term_Stream_1.c | gprolog-1.5.0 | stream_c.c | Pl_Close_Input_Term_Stream_1 | 22 | void
Pl_Close_Input_Term_Stream_1(WamWord sora_word)
{
int stm;
StmInf *pstm;
StrSInf *str_stream;
int type;
stm = Pl_Get_Stream_Or_Alias(sora_word, 1);
pstm = pl_stm_tbl[stm];
type = pstm->prop.other;
if (type < 1 || type > 3)
Pl_Err_Domain(pl_domain_term_stream_or_alias, sora_word);
if (pstm->prop.output)
Pl_Err_Permission(pl_permission_operation_close,
pl_permission_type_stream, sora_word);
if (type != 1)
{
str_stream = (StrSInf *) (pstm->file);
free(str_stream->buff);
}
Pl_Delete_Str_Stream(stm);
}
| {
"array_type": 1,
"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": 2,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
optipng-0.7.8#pngget_prep#png_get_unknown_chunks.c | optipng-0.7.8 | pngget.c | png_get_unknown_chunks | 11 | int
png_get_unknown_chunks(png_const_structrp png_ptr, png_inforp info_ptr,
png_unknown_chunkpp unknowns)
{
if (png_ptr != ((void *)0) && info_ptr != ((void *)0) && unknowns != ((void *)0))
{
*unknowns = info_ptr->unknown_chunks;
return info_ptr->unknown_chunks_num;
}
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
} |
tinycc#tccasm_prep#tcc_assemble.c | tinycc | tccasm.c | tcc_assemble | 12 | int tcc_assemble(TCCState *s1, int do_preprocess)
{
int ret;
tcc_debug_start(s1);
cur_text_section = text_section;
ind = cur_text_section->data_offset;
nocode_wanted = 0;
ret = tcc_assemble_internal(s1, do_preprocess, 1);
cur_text_section->data_offset = ind;
tcc_debug_end(s1);
return ret;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
tulipindicators-0.9.1#tiamalgamation_prep#ti_ema.c | tulipindicators-0.9.1 | tiamalgamation.c | ti_ema | 17 | int ti_ema(int size, double const *const *inputs, double const *options, double *const *outputs) {
const double *input = inputs[0];
const int period = (int)options[0];
double *output = outputs[0];
if (period < 1) return 1;
if (size <= ti_ema_start(options)) return 0;
const double per = 2 / ((double)period + 1);
double val = input[0];
*output++ = val;
int i;
for (i = 1; i < size; ++i) {
val = (input[i]-val) * per + val;
*output++ = val;
}
((void) sizeof ((output - outputs[0] == size - ti_ema_start(options)) ? 1 : 0), __extension__ ({ if (output - outputs[0] == size - ti_ema_start(options)) ; else __assert_fail ("output - outputs[0] == size - ti_ema_start(options)", "tiamalgamation.c", 2432, __extension__ __PRETTY_FUNCTION__); }));
return 0;
}
| {
"array_type": 4,
"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": 2,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#COUNT_DIGITS_FACTORIAL_SET_2_prep#min.c | transcoder-set | COUNT_DIGITS_FACTORIAL_SET_2.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
} |
avl#avl_prep#height.c | avl | avl.c | height | 6 | int height(struct Node *N)
{
if (N == ((void *)0))
return 0;
return N->height;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 2,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#MAXIMUM_SUM_ALTERNATING_SUBSEQUENCE_SUM_prep#len.c | transcoder-set | MAXIMUM_SUM_ALTERNATING_SUBSEQUENCE_SUM.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#HTMLtree_prep#htmlDocDumpMemory.c | libxml2 | HTMLtree.c | htmlDocDumpMemory | 4 | void
htmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, int *size) {
htmlDocDumpMemoryFormat(cur, mem, size, 1);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libosip2-5.3.1#osip_uri_prep#osip_uri_param_get_byname.c | libosip2-5.3.1 | osip_uri.c | osip_uri_param_get_byname | 22 | int osip_uri_param_get_byname(osip_list_t *params, char *pname, osip_uri_param_t **url_param) {
size_t pname_len;
osip_uri_param_t *u_param;
osip_list_iterator_t it;
*url_param = ((void *)0);
if (pname == ((void *)0))
return -2;
pname_len = strlen(pname);
if (pname_len <= 0)
return -2;
u_param = (osip_uri_param_t *) osip_list_get_first(params, &it);
while (u_param != 0) {
size_t len;
len = strlen(u_param->gname);
if (pname_len == len && osip_strncasecmp(u_param->gname, pname, strlen(pname)) == 0) {
*url_param = u_param;
return 0;
}
u_param = (osip_uri_param_t *) osip_list_get_next(&it);
}
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": 1,
"return_statement": 4,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 1
} |
gprolog-1.5.0#wam2ma_prep#F_get_current_choice.c | gprolog-1.5.0 | wam2ma.c | F_get_current_choice | 7 | void
F_get_current_choice(ArgVal arg[])
{
ArgVal *top = arg; PlLong xy; char c; ((xy) = *((PlLong *) (top)) , (top)++); if (xy < 5000) c = 'X'; else xy -= 5000, c='Y';
Inst_Printf("call_c", "Pl_Get_Current_Choice()");
Inst_Printf("move_ret", "%c(%" "l" "d" ")", c, xy);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
mtools-4.0.43#stream_prep#get_data_pass_through.c | mtools-4.0.43 | stream.c | get_data_pass_through | 5 | int get_data_pass_through(Stream_t *Stream, time_t *date, mt_off_t *size,
int *type, uint32_t *address)
{
return (Stream->Next)->Class->get_data( (Stream->Next), (date), (size), (type), (address) );
}
| {
"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#SUM_SERIES_23_45_67_89_UPTO_N_TERMS_prep#max.c | transcoder-set | SUM_SERIES_23_45_67_89_UPTO_N_TERMS.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
} |
uucp-1.07#access_prep#fsysdep_access.c | uucp-1.07 | access.c | fsysdep_access | 9 | boolean
fsysdep_access (zfile)
const char *zfile;
{
if (access (zfile, 4) == 0)
return (1);
ulog (LOG_ERROR, "%s: %s", zfile, strerror ((*__errno_location ())));
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
} |
transcoder-set#LONGEST_COMMON_INCREASING_SUBSEQUENCE_LCS_LIS_prep#f_filled.c | transcoder-set | LONGEST_COMMON_INCREASING_SUBSEQUENCE_LCS_LIS.c | f_filled | 1 | int f_filled ( int arr1 [ ], int n, int arr2 [ ], 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
} |
gprolog-1.5.0#write_c_prep#Pl_Write_1.c | gprolog-1.5.0 | write_c.c | Pl_Write_1 | 8 | void
Pl_Write_1(WamWord term_word)
{
(pl_sys_var[0]) = 4 | 8;
(pl_sys_var[1]) = -1;
(pl_sys_var[2]) = 1200;
Pl_Write_Term_2(((PlLong) (0) + ((PlULong)0)), term_word);
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#FRIENDS_PAIRING_PROBLEM_prep#main.c | transcoder-set | FRIENDS_PAIRING_PROBLEM.c | main | 14 | int main(void) {
int n_success = 0;
int param0[] = {99,62,87,87,61,88,73,62,98,57};
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
} |
cflow-1.7#c_prep#yy_create_buffer.c | cflow-1.7 | c.c | yy_create_buffer | 14 | YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
{
YY_BUFFER_STATE b;
b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
if ( ! b )
yy_fatal_error( "out of dynamic memory in yy_create_buffer()" );
b->yy_buf_size = (yy_size_t)size;
b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
if ( ! b->yy_ch_buf )
yy_fatal_error( "out of dynamic memory in yy_create_buffer()" );
b->yy_is_our_buffer = 1;
yy_init_buffer(b,file );
return b;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#CHOCOLATE_DISTRIBUTION_PROBLEM_prep#cmpfunc.c | transcoder-set | CHOCOLATE_DISTRIBUTION_PROBLEM.c | cmpfunc | 1 | int cmpfunc (const void * a, const void * b) {return ( *(int*)a - *(int*)b );}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#PROGRAM_TO_FIND_THE_AREA_OF_PENTAGON_prep#cmpfunc.c | transcoder-set | PROGRAM_TO_FIND_THE_AREA_OF_PENTAGON.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
} |
nettle-3.9.1#ccm-aes128_prep#nettle_ccm_aes128_set_nonce.c | nettle-3.9.1 | ccm-aes128.c | nettle_ccm_aes128_set_nonce | 8 | void
nettle_ccm_aes128_set_nonce(struct ccm_aes128_ctx *ctx,
size_t length, const uint8_t *nonce,
size_t authlen, size_t msglen, size_t taglen)
{
nettle_ccm_set_nonce(&ctx->ccm, &ctx->cipher, (nettle_cipher_func *) nettle_aes128_encrypt,
length, nonce, authlen, msglen, taglen);
}
| {
"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
} |
libxml2#list_prep#xmlListReverseWalk.c | libxml2 | list.c | xmlListReverseWalk | 10 | void
xmlListReverseWalk(xmlListPtr l, xmlListWalker walker, void *user) {
xmlLinkPtr lk;
if ((l == ((void *)0)) || (walker == ((void *)0)))
return;
for(lk = l->sentinel->prev; lk != l->sentinel; lk = lk->prev) {
if((walker(lk->data, user)) == 0)
break;
}
}
| {
"array_type": 0,
"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": 1,
"union_type": 0,
"while_loop": 0
} |
wget-1.21.4#retr_prep#set_local_file.c | wget-1.21.4 | retr.c | set_local_file | 11 | void
set_local_file (const char **file, const char *default_file)
{
if (opt.output_document)
{
if (output_stream_regular)
*file = opt.output_document;
}
else
*file = default_file;
}
| {
"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
} |
json.h#allow_unquoted_keys_prep#json_write_string.c | json.h | allow_unquoted_keys.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
} |
libxml2#libxml2-py_prep#libxml_xmlUCSIsCatZl.c | libxml2 | libxml2-py.c | libxml_xmlUCSIsCatZl | 13 | PyObject *
libxml_xmlUCSIsCatZl(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
int c_retval;
int code;
if (libxml_deprecationWarning("xmlUCSIsCatZl") == -1)
return(((void *)0));
if (!_PyArg_ParseTuple_SizeT(args, (char *)"i:xmlUCSIsCatZl", &code))
return(((void *)0));
c_retval = xmlUCSIsCatZl(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_xmlAddEncodingAlias.c | libxml2 | libxml2-py.c | libxml_xmlAddEncodingAlias | 12 | PyObject *
libxml_xmlAddEncodingAlias(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
int c_retval;
char * name;
char * alias;
if (!_PyArg_ParseTuple_SizeT(args, (char *)"zz:xmlAddEncodingAlias", &name, &alias))
return(((void *)0));
c_retval = xmlAddEncodingAlias(name, alias);
py_retval = libxml_intWrap((int) c_retval);
return(py_retval);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 0
} |
tulipindicators-0.9.1#cvi_prep#ti_cvi.c | tulipindicators-0.9.1 | cvi.c | ti_cvi | 25 | int ti_cvi(int size, double const *const *inputs, double const *options, double *const *outputs) {
const double *high = inputs[0];
const double *low = inputs[1];
const int period = (int)options[0];
double *output = outputs[0];
if (period < 1) return 1;
if (size <= ti_cvi_start(options)) return 0;
const double per = 2 / ((double)period + 1);
ti_buffer *lag = ti_buffer_new(period);
double val = high[0]-low[0];
int i;
for (i = 1; i < period*2-1; ++i) {
val = ((high[i]-low[i])-val) * per + val;
do { (lag)->vals[(lag)->index] = (val); (lag)->index = ((lag)->index + 1); if ((lag)->index >= (lag)->size) (lag)->index = 0; } while (0);
}
for (i = period*2-1; i < size; ++i) {
val = ((high[i]-low[i])-val) * per + val;
const double old = lag->vals[lag->index];
*output++ = 100.0 * (val - old) / old;
do { (lag)->vals[(lag)->index] = (val); (lag)->index = ((lag)->index + 1); if ((lag)->index >= (lag)->size) (lag)->index = 0; } while (0);
}
ti_buffer_free(lag);
((void) sizeof ((output - outputs[0] == size - ti_cvi_start(options)) ? 1 : 0), __extension__ ({ if (output - outputs[0] == size - ti_cvi_start(options)) ; else __assert_fail ("output - outputs[0] == size - ti_cvi_start(options)", "indicators/cvi.c", 66, __extension__ __PRETTY_FUNCTION__); }));
return 0;
}
| {
"array_type": 5,
"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": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 2
} |
nano-7.2#cut_prep#cut_text.c | nano-7.2 | cut.c | cut_text | 12 | void cut_text(void)
{
if (!is_cuttable(((flags[((CUT_FROM_CURSOR) / (sizeof(unsigned) * 8))] & ((unsigned)1 << ((CUT_FROM_CURSOR) % (sizeof(unsigned) * 8)))) != 0) && openfile->mark == ((void *)0)))
return;
if (openfile->last_action != CUT || !keep_cutbuffer) {
keep_cutbuffer = 0;
add_undo(CUT, ((void *)0));
}
do_snip(openfile->mark != ((void *)0), 0, 0);
update_undo(CUT);
wipe_statusbar();
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#MAXIMUM_CONSECUTIVE_REPEATING_CHARACTER_STRING_prep#f_gold.c | transcoder-set | MAXIMUM_CONSECUTIVE_REPEATING_CHARACTER_STRING.c | f_gold | 21 | char f_gold ( char str [] ) {
int len = strlen(str);
int count = 0;
char res = str [ 0 ];
for ( int i = 0;
i < len;
i ++ ) {
int cur_count = 1;
for ( int j = i + 1;
j < len;
j ++ ) {
if ( str [ i ] != str [ j ] ) break;
cur_count ++;
}
if ( cur_count > count ) {
count = cur_count;
res = str [ i ];
}
}
return res;
}
| {
"array_type": 1,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 2,
"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
} |
transcoder-set#SUM_OF_ALL_ELEMENTS_UP_TO_NTH_ROW_IN_A_PASCALS_TRIANGLE_prep#sort.c | transcoder-set | SUM_OF_ALL_ELEMENTS_UP_TO_NTH_ROW_IN_A_PASCALS_TRIANGLE.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#lex_prep#GetNumber.c | mcsim-6.2.0 | lex.c | GetNumber | 80 | void GetNumber (PINPUTBUF pibIn, PSTR szLex, PINT piLexType)
{
int i = 0;
char c;
BOOL bHasSign = 0;
BOOL bLeadingDigits = 0;
enum States
{Start, Digits1, Point, Digits2, Exp, ExpSign, Digits3, End} eState;
if (!pibIn || !szLex || !piLexType)
return;
eState = Start;
*piLexType = 0x0000;
while ((c = *pibIn->pbufCur)
&& i < 255 -1
&& eState != End) {
switch (eState) {
case Start:
if (c == '.')
eState = Point;
else if (!bHasSign && ((c) == '+' || (c) == '-'))
bHasSign = 1;
else if (((*__ctype_b_loc ())[(int) ((*pibIn->pbufCur))] & (unsigned short int) _ISdigit)) {
bLeadingDigits = *piLexType = 0x0002;
eState = Digits1;
}
else
eState = End;
break;
case Digits1:
if (c == '.')
eState = Point;
else if (c == 'e' || c == 'E')
eState = Exp;
else if (!((*__ctype_b_loc ())[(int) ((c))] & (unsigned short int) _ISdigit))
eState = End;
break;
case Point:
*piLexType = 0x0004;
if (bLeadingDigits && (c == 'e' || c == 'E'))
eState = Exp;
else if (((*__ctype_b_loc ())[(int) ((c))] & (unsigned short int) _ISdigit))
eState = Digits2;
else {
if (!bLeadingDigits)
*piLexType = 0x0000;
eState = End;
}
break;
case Digits2:
if (c == 'e' || c == 'E')
eState = Exp;
else if (!((*__ctype_b_loc ())[(int) ((c))] & (unsigned short int) _ISdigit))
eState = End;
break;
case Exp:
*piLexType = 0x0004;
if (((c) == '+' || (c) == '-')) {
eState = ExpSign;
break;
}
case ExpSign:
if (((*__ctype_b_loc ())[(int) ((c))] & (unsigned short int) _ISdigit))
eState = Digits3;
else {
*piLexType = 0x0000;
eState = End;
}
break;
case Digits3:
if (!((*__ctype_b_loc ())[(int) ((c))] & (unsigned short int) _ISdigit))
eState = End;
break;
case End:
break;
}
if (eState != End)
szLex[i++] = *pibIn->pbufCur++;
}
szLex[i] = '\0';
}
| {
"array_type": 1,
"break_continue_statement": 8,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 16,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 1,
"type_casting": 6,
"union_type": 0,
"while_loop": 1
} |
mcsim-6.2.0#mod_prep#InitInfo.c | mcsim-6.2.0 | mod.c | InitInfo | 17 | void InitInfo (PINPUTINFO pinfo, PSTR szModGenName)
{
pinfo->wContext = 0x0001;
pinfo->bDelays = 0;
pinfo->bforR = 0;
pinfo->bTemplateInUse = 0;
pinfo->szModGenName = szModGenName;
pinfo->pvmGloVars = ((void *)0);
pinfo->pvmDynEqns = ((void *)0);
pinfo->pvmScaleEqns = ((void *)0);
pinfo->pvmJacobEqns = ((void *)0);
pinfo->pvmCalcOutEqns = ((void *)0);
pinfo->pvmEventEqns = ((void *)0);
pinfo->pvmRootEqns = ((void *)0);
pinfo->pvmCpts = ((void *)0);
pinfo->pvmLocalCpts = ((void *)0);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 9,
"union_type": 0,
"while_loop": 0
} |
findutils-4.9.0#safe-atoi_prep#safe_atoi.c | findutils-4.9.0 | safe-atoi.c | safe_atoi | 33 | int
safe_atoi (const char *s, enum quoting_style style)
{
long lval;
char *end;
(*__errno_location ()) = 0;
lval = strtol (s, &end, 10);
if ( (0x7fffffffffffffffL == lval) || ((-0x7fffffffffffffffL - 1L) == lval) )
{
if ((*__errno_location ()) == 34)
{
((!!sizeof (struct { _Static_assert (1, "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", s), assume (false))" ")"); int _gl_dummy; })) ? ((error (1, (*__errno_location ()), "%s", s), ((0) ? (void) 0 : __builtin_unreachable ()))) : ((error (1, (*__errno_location ()), "%s", s), ((0) ? (void) 0 : __builtin_unreachable ()))));
}
else
{
((!!sizeof (struct { _Static_assert (1, "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", s), assume (false))" ")"); int _gl_dummy; })) ? ((error (1, (*__errno_location ()), "%s", s), ((0) ? (void) 0 : __builtin_unreachable ()))) : ((error (1, (*__errno_location ()), "%s", s), ((0) ? (void) 0 : __builtin_unreachable ()))));
}
}
if (lval > 0x7fffffff || lval < (-0x7fffffff - 1))
{
(*__errno_location ()) = 34;
((!!sizeof (struct { _Static_assert (1, "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", s), assume (false))" ")"); int _gl_dummy; })) ? ((error (1, (*__errno_location ()), "%s", s), ((0) ? (void) 0 : __builtin_unreachable ()))) : ((error (1, (*__errno_location ()), "%s", s), ((0) ? (void) 0 : __builtin_unreachable ()))));
}
else if (*end)
{
((!!sizeof (struct { _Static_assert (1, "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"Unexpected suffix %s on %s\"), quotearg_n_style (0, style, end), quotearg_n_style (1, style, s)), assume (false))" ")"); int _gl_dummy; })) ? ((error (1, (*__errno_location ()), gettext ("Unexpected suffix %s on %s"), quotearg_n_style (0, style, end), quotearg_n_style (1, style, s)), ((0) ? (void) 0 : __builtin_unreachable ()))) : ((error (1, (*__errno_location ()), gettext ("Unexpected suffix %s on %s"), quotearg_n_style (0, style, end), quotearg_n_style (1, style, s)), ((0) ? (void) 0 : __builtin_unreachable ()))));
}
else if (end == s)
{
((!!sizeof (struct { _Static_assert (1, "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"Expected an integer: %s\"), quotearg_n_style (0, style, s)), assume (false))" ")"); int _gl_dummy; })) ? ((error (1, (*__errno_location ()), gettext ("Expected an integer: %s"), quotearg_n_style (0, style, s)), ((0) ? (void) 0 : __builtin_unreachable ()))) : ((error (1, (*__errno_location ()), gettext ("Expected an integer: %s"), quotearg_n_style (0, style, s)), ((0) ? (void) 0 : __builtin_unreachable ()))));
}
return (int)lval;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 1,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 5,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 6,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#MAXIMUM_REMOVAL_FROM_ARRAY_WHEN_REMOVAL_TIME_WAITING_TIME_prep#f_filled.c | transcoder-set | MAXIMUM_REMOVAL_FROM_ARRAY_WHEN_REMOVAL_TIME_WAITING_TIME.c | f_filled | 1 | int f_filled ( int arr [ ], int n ) {}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
heman#mat3_prep#kmMat3Adjugate.c | heman | mat3.c | kmMat3Adjugate | 13 | kmMat3* kmMat3Adjugate(kmMat3* pOut, const kmMat3* pIn)
{
pOut->mat[0] = pIn->mat[4] * pIn->mat[8] - pIn->mat[5] * pIn->mat[7];
pOut->mat[1] = pIn->mat[2] * pIn->mat[7] - pIn->mat[1] * pIn->mat[8];
pOut->mat[2] = pIn->mat[1] * pIn->mat[5] - pIn->mat[2] * pIn->mat[4];
pOut->mat[3] = pIn->mat[5] * pIn->mat[6] - pIn->mat[3] * pIn->mat[8];
pOut->mat[4] = pIn->mat[0] * pIn->mat[8] - pIn->mat[2] * pIn->mat[6];
pOut->mat[5] = pIn->mat[2] * pIn->mat[3] - pIn->mat[0] * pIn->mat[5];
pOut->mat[6] = pIn->mat[3] * pIn->mat[7] - pIn->mat[4] * pIn->mat[6];
pOut->mat[7] = pIn->mat[1] * pIn->mat[6] - pIn->mat[0] * pIn->mat[7];
pOut->mat[8] = pIn->mat[0] * pIn->mat[4] - pIn->mat[1] * pIn->mat[3];
return pOut;
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libxml2#parser_prep#xmlParseEntityRef.c | libxml2 | parser.c | xmlParseEntityRef | 10 | xmlEntityPtr
xmlParseEntityRef(xmlParserCtxtPtr ctxt) {
const xmlChar *name;
if (ctxt == ((void *)0))
return(((void *)0));
name = xmlParseEntityRefInternal(ctxt);
if (name == ((void *)0))
return(((void *)0));
return(xmlLookupGeneralEntity(ctxt, name, 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": 0,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
tulipindicators-0.9.1#tiamalgamation_prep#tc_black_marubozu.c | tulipindicators-0.9.1 | tiamalgamation.c | tc_black_marubozu | 5 | int tc_black_marubozu(int size, TC_REAL const *const *inputs, tc_config const *options, tc_result *output) {
const TC_REAL *open = inputs[0]; const TC_REAL *high = inputs[1]; const TC_REAL *low = inputs[2]; const TC_REAL *close = inputs[3]; const int period = options->period; const TC_REAL div = 1.0 / period; TC_REAL avg_body_sum = 0; TC_REAL avg_total_sum = 0; if (period < 1) return 1; if (size < period) return 0; int i; for (i = 0; i < period; ++i) { avg_body_sum += (fabs(open[(i)] - close[(i)])); avg_total_sum += (high[(i)] - low[(i)]); }
while(i < size) { const TC_REAL top = (open[(i)] > close[(i)] ? open[(i)] : close[(i)]); const TC_REAL bottom = (open[(i)] < close[(i)] ? open[(i)] : close[(i)]); const TC_REAL body = (fabs(open[(i)] - close[(i)])); const TC_REAL total = (high[(i)] - low[(i)]); const TC_REAL upper = (high[(i)] - top); const TC_REAL lower = (bottom - low[(i)]); const TC_REAL avg_body = avg_body_sum * div; const TC_REAL avg_total = avg_total_sum * div; (void)top;(void)bottom;(void)body;(void)total; (void)upper;(void)lower;(void)avg_body;(void)avg_total; if (((fabs(open[(i)] - close[(i)])) > (options->body_long * avg_body)) && ((high[(i)] - top) < (options->wick_none * avg_total)) && ((bottom - low[(i)]) < (options->wick_none * avg_total)) && (open[i]>close[i])) { do { const tc_hit hit = {i, (1L<<4)}; const int r = tc_result_add(output, hit); if (r != 0) return r; } while (0); } avg_body_sum += body; avg_body_sum -= (fabs(open[(i-period)] - close[(i-period)])); avg_total_sum += total; avg_total_sum -= (high[(i-period)] - low[(i-period)]); ++i; };
return 0;
}
| {
"array_type": 3,
"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": 4,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 1
} |
libxml2#libxml2-py_prep#libxml_xmlUCSIsBengali.c | libxml2 | libxml2-py.c | libxml_xmlUCSIsBengali | 13 | PyObject *
libxml_xmlUCSIsBengali(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
int c_retval;
int code;
if (libxml_deprecationWarning("xmlUCSIsBengali") == -1)
return(((void *)0));
if (!_PyArg_ParseTuple_SizeT(args, (char *)"i:xmlUCSIsBengali", &code))
return(((void *)0));
c_retval = xmlUCSIsBengali(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#MINIMUM_TIME_WRITE_CHARACTERS_USING_INSERT_DELETE_COPY_OPERATION_prep#len.c | transcoder-set | MINIMUM_TIME_WRITE_CHARACTERS_USING_INSERT_DELETE_COPY_OPERATION.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
} |
pth-2.0.7#test_philo_prep#main.c | pth-2.0.7 | test_philo.c | main | 65 | int main(int argc, char *argv[])
{
int i;
sigset_t ss;
int sig;
pth_event_t ev;
pth_init();
printf("This is TEST_PHILO, a Pth test showing the Five Dining Philosophers\n");
printf("\n");
printf("This is a demonstration showing the famous concurrency problem of the\n");
printf("Five Dining Philosophers as analysed 1965 by E.W.Dijkstra:\n");
printf("\n");
printf("Five philosophers are sitting around a round table, each with a bowl of\n");
printf("Chinese food in front of him. Between periods of talking they may start\n");
printf("eating whenever they want to, with their bowls being filled frequently.\n");
printf("But there are only five chopsticks available, one each to the left of\n");
printf("each bowl - and for eating Chinese food one needs two chopsticks. When\n");
printf("a philosopher wants to start eating, he must pick up the chopstick to\n");
printf("the left of his bowl and the chopstick to the right of his bowl. He\n");
printf("may find, however, that either one (or even both) of the chopsticks is\n");
printf("unavailable as it is being used by another philosopher sitting on his\n");
printf("right or left, so he has to wait.\n");
printf("\n");
printf("This situation shows classical contention under concurrency (the\n");
printf("philosophers want to grab the chopsticks) and the possibility of a\n");
printf("deadlock (all philosophers wait that the chopstick to their left becomes\n");
printf("available).\n");
printf("\n");
printf("The demonstration runs max. 60 seconds. To stop before, press CTRL-C.\n");
printf("\n");
printf("+----P1----+----P2----+----P3----+----P4----+----P5----+\n");
tab = (table *)malloc(sizeof(table));
if (!pth_mutex_init(&(tab->mutex))) {
perror("pth_mutex_init");
exit(1);
}
for (i = 0; i < 5; i++) {
(tab->self)[i] = i;
(tab->status)[i] = thinking;
if (!pth_cond_init(&((tab->condition)[i]))) {
perror("pth_cond_init");
exit(1);
}
}
for (i = 0; i < 5; i++) {
if (((tab->tid)[i] =
pth_spawn((pth_attr_t)(0), philosopher,
&((tab->self)[i]))) == ((void *)0)) {
perror("pth_spawn");
exit(1);
}
}
sigemptyset(&ss);
sigaddset(&ss, 2);
ev = pth_event((1<<(4)), pth_timeout(60,0));
pth_sigwait_ev(&ss, &sig, ev);
pth_event_free(ev, PTH_FREE_ALL);
for (i = 0; i < 5; i++)
pth_cancel((tab->tid)[i]);
while (pth_join(((void *)0), ((void *)0)));
printf("+----------+----------+----------+----------+----------+\n");
free(tab);
pth_kill();
return 0;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 3,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 2,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 1
} |
transcoder-set#SUM_MATRIX_ELEMENT_ABSOLUTE_DIFFERENCE_ROW_COLUMN_NUMBERS_2_prep#sort.c | transcoder-set | SUM_MATRIX_ELEMENT_ABSOLUTE_DIFFERENCE_ROW_COLUMN_NUMBERS_2.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#assert_c_prep#Pl_Assert_5.c | gprolog-1.5.0 | assert_c.c | Pl_Assert_5 | 10 | void
Pl_Assert_5(WamWord head_word, WamWord body_word,
WamWord asserta_word, WamWord check_perm_word, WamWord pl_file_word)
{
Bool asserta = Pl_Rd_Integer(asserta_word);
Bool check_perm = Pl_Rd_Integer(check_perm_word);
int pl_file = Pl_Rd_Atom(pl_file_word);
last_clause = Pl_Add_Dynamic_Clause(head_word, body_word, asserta,
check_perm, pl_file);
}
| {
"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
} |
tmux#variadic_prep#fatalx.c | tmux | variadic.c | fatalx | 12 | __attribute__ ((__noreturn__)) void
fatalx(const char *msg, ...)
{
char *fmt;
va_list ap;
__builtin_va_start(ap,msg);
if (asprintf(&fmt, "fatal: %s", msg) == -1)
exit(1);
log_vwrite(fmt, ap);
__builtin_va_end(ap);
exit(1);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#MINIMUM_SUM_SUBSEQUENCE_LEAST_ONE_EVERY_FOUR_CONSECUTIVE_ELEMENTS_PICKED_prep#len.c | transcoder-set | MINIMUM_SUM_SUBSEQUENCE_LEAST_ONE_EVERY_FOUR_CONSECUTIVE_ELEMENTS_PICKED.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_SERIES_0_6_0_06_0_006_0_0006_N_TERMS_prep#f_filled.c | transcoder-set | SUM_SERIES_0_6_0_06_0_006_0_0006_N_TERMS.c | f_filled | 1 | float f_filled ( int n ) {}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
nettle-3.9.1#nettle-hash_prep#main.c | nettle-3.9.1 | nettle-hash.c | main | 87 | int
main (int argc, char **argv)
{
const char *alg_name = ((void *)0);
const struct nettle_hash *alg;
unsigned length = 0;
int raw = 0;
int c;
enum { OPT_HELP = 0x300, OPT_RAW, OPT_LIST };
static const struct option options[] =
{
{ "help", 0, ((void *)0), OPT_HELP },
{ "version", 0, ((void *)0), 'V' },
{ "algorithm", 1, ((void *)0), 'a' },
{ "length", 1, ((void *)0), 'l' },
{ "list", 0, ((void *)0), OPT_LIST },
{ "raw", 0, ((void *)0), OPT_RAW },
{ ((void *)0), 0, ((void *)0), 0 }
};
while ( (c = getopt_long(argc, argv, "Va:l:", options, ((void *)0))) != -1)
switch (c)
{
default:
abort();
case '?':
usage (stderr);
return 1;
case OPT_HELP:
usage (stdout);
return 0;
case 'V':
printf("nettle-hash (" "nettle 3.9.1" ")\n");
return 0;
case 'a':
alg_name = optarg;
break;
case 'l':
{
int arg;
arg = atoi (optarg);
if (arg <= 0)
die ("Invalid length argument: `%s'\n", optarg);
length = arg;
}
break;
case OPT_RAW:
raw = 1;
break;
case OPT_LIST:
list_algorithms();
return 0;
}
if (!alg_name)
die("Algorithm argument (-a option) is mandatory.\n"
"See nettle-hash --help for further information.\n");
alg = nettle_lookup_hash (alg_name);
if (!alg)
die("Hash algorithm `%s' not supported or .\n"
"Use nettle-hash --list to list available algorithms.\n",
alg_name);
if (length == 0)
length = alg->digest_size;
else if (length > alg->digest_size)
die ("Length argument %d too large for selected algorithm.\n",
length);
argv += optind;
argc -= optind;
if (argc == 0)
digest_file (alg, length, raw, stdin);
else
{
int i;
for (i = 0; i < argc; i++)
{
FILE *f = fopen (argv[i], "rb");
if (!f)
die ("Cannot open `%s': %s\n", argv[i], strerror((*__errno_location ())));
printf("%s: ", argv[i]);
if (!digest_file (alg, length, raw, f))
die("Reading `%s' failed: %s\n", argv[i], strerror((*__errno_location ())));
fclose(f);
}
}
if (fflush(stdout) != 0 )
die("Write failed: %s\n", strerror((*__errno_location ())));
return 0;
}
| {
"array_type": 1,
"break_continue_statement": 3,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 9,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 3,
"return_statement": 5,
"struct_type": 1,
"switch_statement": 1,
"type_casting": 9,
"union_type": 0,
"while_loop": 1
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.