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 |
|---|---|---|---|---|---|---|
indent-2.2.13#handletoken_prep#check_code_size.c | indent-2.2.13 | handletoken.c | check_code_size | 11 | extern void check_code_size(void)
{
if (e_code >= l_code)
{
int nsize = l_code - s_code + 400;
codebuf = xrealloc(codebuf, nsize);
e_code = codebuf + (e_code - s_code) + 1;
l_code = codebuf + nsize - 5;
s_code = codebuf + 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": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
tar-1.34#paxerror_prep#seek_error.c | tar-1.34 | paxerror.c | seek_error | 5 | void
seek_error (char const *name)
{
call_arg_error ("seek", 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
} |
transcoder-set#FIND_MAXIMUM_HEIGHT_PYRAMID_FROM_THE_GIVEN_ARRAY_OF_OBJECTS_prep#cmpfunc.c | transcoder-set | FIND_MAXIMUM_HEIGHT_PYRAMID_FROM_THE_GIVEN_ARRAY_OF_OBJECTS.c | cmpfunc | 1 | int cmpfunc (const void * a, const void * b) {return ( *(int*)a - *(int*)b );}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
mcsim-6.2.0#random_prep#CalcCumulative.c | mcsim-6.2.0 | random.c | CalcCumulative | 25 | void CalcCumulative (long cDim, double *rg_x, double *rg_pdf,
double *rg_Cdf, int iOrder)
{
long i;
if (iOrder > 1) {
printf ("CalcCumulative: Order %d not supported"
"-> using piecewise-linear\n", iOrder);
iOrder = 1;
}
rg_Cdf[0] = 0.0;
switch (iOrder) {
case 0:
for (i = 1; i < cDim; i++)
rg_Cdf[i] = rg_Cdf[i-1] + rg_pdf[i]*(rg_x[i] - rg_x[i-1]);
break;
case 1:
for (i = 1; i < cDim; i++)
rg_Cdf[i] = rg_Cdf[i-1] + ((rg_x[i] - rg_x[i - 1]) *
(rg_pdf[i] + rg_pdf[i - 1]) / 2);
break;
default:
((void) sizeof ((0) ? 1 : 0), __extension__ ({ if (0) ; else __assert_fail ("0", "random.c", 1476, __extension__ __PRETTY_FUNCTION__); }));
break;
}
}
| {
"array_type": 3,
"break_continue_statement": 3,
"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": 0,
"struct_type": 0,
"switch_statement": 1,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libxml2#libxml2-py_prep#libxml_xmlXPathRegisteredVariablesCleanup.c | libxml2 | libxml2-py.c | libxml_xmlXPathRegisteredVariablesCleanup | 11 | PyObject *
libxml_xmlXPathRegisteredVariablesCleanup(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
xmlXPathContextPtr ctxt;
PyObject *pyobj_ctxt;
if (!_PyArg_ParseTuple_SizeT(args, (char *)"O:xmlXPathRegisteredVariablesCleanup", &pyobj_ctxt))
return(((void *)0));
ctxt = (xmlXPathContextPtr) (((pyobj_ctxt) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyxmlXPathContext_Object *)(pyobj_ctxt))->obj));
xmlXPathRegisteredVariablesCleanup(ctxt);
_Py_INCREF(((PyObject*)((&_Py_NoneStruct))));
return((&_Py_NoneStruct));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 0
} |
libxml2#libxml2-py_prep#libxml_xmlLastElementChild.c | libxml2 | libxml2-py.c | libxml_xmlLastElementChild | 13 | PyObject *
libxml_xmlLastElementChild(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
xmlNodePtr c_retval;
xmlNodePtr parent;
PyObject *pyobj_parent;
if (!_PyArg_ParseTuple_SizeT(args, (char *)"O:xmlLastElementChild", &pyobj_parent))
return(((void *)0));
parent = (xmlNodePtr) (((pyobj_parent) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyxmlNode_Object *)(pyobj_parent))->obj));
c_retval = xmlLastElementChild(parent);
py_retval = libxml_xmlNodePtrWrap((xmlNodePtr) c_retval);
return(py_retval);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 0
} |
tulipindicators-0.9.1#tiamalgamation_prep#ti_stderr_start.c | tulipindicators-0.9.1 | tiamalgamation.c | ti_stderr_start | 3 | int ti_stderr_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
} |
hello-2.12.1#quotearg_prep#quotearg_alloc.c | hello-2.12.1 | quotearg.c | quotearg_alloc | 6 | char *
quotearg_alloc (char const *arg, size_t argsize,
struct quoting_options const *o)
{
return quotearg_alloc_mem (arg, argsize, ((void *)0), o);
}
| {
"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#DYNAMIC_PROGRAMMING_HIGH_EFFORT_VS_LOW_EFFORT_TASKS_PROBLEM_prep#max.c | transcoder-set | DYNAMIC_PROGRAMMING_HIGH_EFFORT_VS_LOW_EFFORT_TASKS_PROBLEM.c | max | 1 | int max(int x, int y) { return (x > y)? x: y; }
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#SUM_OF_ALL_PROPER_DIVISORS_OF_A_NATURAL_NUMBER_prep#f_gold.c | transcoder-set | SUM_OF_ALL_PROPER_DIVISORS_OF_A_NATURAL_NUMBER.c | f_gold | 12 | int f_gold ( int num ) {
int result = 0;
for ( int i = 2;
i <= sqrt ( num );
i ++ ) {
if ( num % i == 0 ) {
if ( i == ( num / i ) ) result += i;
else result += ( i + num / i );
}
}
return ( result + 1 );
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#SUM_SERIES_ALTERNATE_SIGNED_SQUARES_AP_prep#f_gold.c | transcoder-set | SUM_SERIES_ALTERNATE_SIGNED_SQUARES_AP.c | f_gold | 10 | int f_gold ( int n, int a [ ] ) {
int res = 0;
for ( int i = 0;
i < 2 * n;
i ++ ) {
if ( i % 2 == 0 ) res += a [ i ] * a [ i ];
else res -= a [ i ] * a [ i ];
}
return res;
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
cpio-2.14#dstring_prep#ds_fgetstr.c | cpio-2.14 | dstring.c | ds_fgetstr | 17 | char *
ds_fgetstr (FILE *f, dynamic_string *s, char eos)
{
int next_ch;
s->ds_idx = 0;
while ((next_ch = getc (f)) != eos && next_ch != (-1))
{
ds_resize (s, 0);
s->ds_string[s->ds_idx++] = next_ch;
}
ds_resize (s, 0);
s->ds_string[s->ds_idx] = '\0';
if (s->ds_idx == 0 && next_ch == (-1))
return ((void *)0);
else
return s->ds_string;
}
| {
"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": 1
} |
transcoder-set#NUMBER_OF_BINARY_TREES_FOR_GIVEN_PREORDER_SEQUENCE_LENGTH_prep#sort.c | transcoder-set | NUMBER_OF_BINARY_TREES_FOR_GIVEN_PREORDER_SEQUENCE_LENGTH.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#MEDIAN_OF_TWO_SORTED_ARRAYS_prep#min.c | transcoder-set | MEDIAN_OF_TWO_SORTED_ARRAYS.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
} |
findutils-4.9.0#fdleak_prep#remember_non_cloexec_fds.c | findutils-4.9.0 | fdleak.c | remember_non_cloexec_fds | 13 | void
remember_non_cloexec_fds (void)
{
int max_fd = get_max_fd ();
struct remember_fd_context cb_data;
cb_data.buf = ((void *)0);
cb_data.used = cb_data.allocated = 0;
if (max_fd < 0x7fffffff)
++max_fd;
visit_open_fds (0, max_fd, remember_fd_if_non_cloexec, &cb_data);
non_cloexec_fds = cb_data.buf;
num_cloexec_fds = cb_data.used;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
make-4.4.1#function_prep#patsubst_expand.c | make-4.4.1 | function.c | patsubst_expand | 12 | char *
patsubst_expand (char *o, const char *text, char *pattern, char *replace)
{
const char *pattern_percent = find_percent (pattern);
const char *replace_percent = find_percent (replace);
if (replace_percent)
++replace_percent;
if (pattern_percent)
++pattern_percent;
return patsubst_expand_pat (o, text, pattern, replace,
pattern_percent, replace_percent);
}
| {
"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": 2,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
cflow-1.7#symbol_prep#clear_starters.c | cflow-1.7 | symbol.c | clear_starters | 5 | void
clear_starters(void)
{
linked_list_destroy(&start_symbol_list);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libxml2#pattern_prep#xmlStreamWantsAnyNode.c | libxml2 | pattern.c | xmlStreamWantsAnyNode | 12 | int
xmlStreamWantsAnyNode(xmlStreamCtxtPtr streamCtxt)
{
if (streamCtxt == ((void *)0))
return(-1);
while (streamCtxt != ((void *)0)) {
if (streamCtxt->comp->flags & 1<<14)
return(1);
streamCtxt = streamCtxt->next;
}
return(0);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 1
} |
json.h#allow_simplified_json_prep#utest_run_allow_simplified_json_read_write_pretty_read.c | json.h | allow_simplified_json.c | utest_run_allow_simplified_json_read_write_pretty_read | 7 | void utest_run_allow_simplified_json_read_write_pretty_read(int *utest_result, struct allow_simplified_json *utest_fixture) {
size_t size = 0;
void *json = json_write_pretty(utest_fixture->value, " ", "\n", &size);
free(utest_fixture->value);
utest_fixture->value = json_parse(json, size - 1);
free(json);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 2,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#MINIMUM_PERIMETER_N_BLOCKS_prep#main.c | transcoder-set | MINIMUM_PERIMETER_N_BLOCKS.c | main | 14 | int main(void) {
int n_success = 0;
int param0[] = {45,80,54,48,83,68,32,20,68,66};
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
} |
gawk-5.2.2#regex_prep#re_compile_fastmap.c | gawk-5.2.2 | regex.c | re_compile_fastmap | 16 | int
re_compile_fastmap (struct re_pattern_buffer *bufp)
{
re_dfa_t *dfa = bufp->buffer;
char *fastmap = bufp->fastmap;
memset (fastmap, '\0', sizeof (char) * ((0x7f * 2 + 1) + 1));
re_compile_fastmap_iter (bufp, dfa->init_state, fastmap);
if (dfa->init_state != dfa->init_state_word)
re_compile_fastmap_iter (bufp, dfa->init_state_word, fastmap);
if (dfa->init_state != dfa->init_state_nl)
re_compile_fastmap_iter (bufp, dfa->init_state_nl, fastmap);
if (dfa->init_state != dfa->init_state_begbuf)
re_compile_fastmap_iter (bufp, dfa->init_state_begbuf, fastmap);
bufp->fastmap_accurate = 1;
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": 1,
"pointer_type": 2,
"return_statement": 1,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
nano-7.2#utils_prep#nmalloc.c | nano-7.2 | utils.c | nmalloc | 7 | void *nmalloc(size_t howmuch)
{
void *section = malloc(howmuch);
if (section == ((void *)0))
die(gettext("Nano is out of memory!\n"));
return section;
}
| {
"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": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
gprolog-1.5.0#stream_supp_prep#Pl_Term_Write_Str_Stream.c | gprolog-1.5.0 | stream_supp.c | Pl_Term_Write_Str_Stream | 8 | char *
Pl_Term_Write_Str_Stream(int stm)
{
StrSInf *str_stream;
str_stream = (StrSInf *) (pl_stm_tbl[stm]->file);
*(str_stream->ptr) = '\0';
return str_stream->buff;
}
| {
"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": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
optipng-0.7.8#pngrutil_prep#png_get_uint_16.c | optipng-0.7.8 | pngrutil.c | png_get_uint_16 | 8 | png_uint_16 (
png_get_uint_16)(png_const_bytep buf)
{
unsigned int val =
((unsigned int)(*buf) << 8) +
((unsigned int)(*(buf + 1)));
return (png_uint_16)val;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
nettle-3.9.1#buffer_prep#nettle_buffer_init_size.c | nettle-3.9.1 | buffer.c | nettle_buffer_init_size | 10 | void
nettle_buffer_init_size(struct nettle_buffer *buffer,
size_t length, uint8_t *space)
{
buffer->contents = space;
buffer->alloc = length;
buffer->realloc = ((void *)0);
buffer->realloc_ctx = ((void *)0);
buffer->size = 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": 1,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#SQUARE_ROOT_OF_AN_INTEGER_1_prep#sort.c | transcoder-set | SQUARE_ROOT_OF_AN_INTEGER_1.c | sort | 1 | void sort (int arr [ ], int n) {qsort (arr, n, sizeof(int), cmpfunc);}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libxml2#dict_prep#xmlDictComputeHash.c | libxml2 | dict.c | xmlDictComputeHash | 5 | unsigned
xmlDictComputeHash(const xmlDict *dict, const xmlChar *string) {
size_t len;
return(xmlDictHashName(dict->seed, string, ((size_t) -1), &len));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
tulipindicators-0.9.1#tiamalgamation_prep#ti_trix_start.c | tulipindicators-0.9.1 | tiamalgamation.c | ti_trix_start | 4 | int ti_trix_start(double const *options) {
const int period = (int)options[0];
return ((period-1)*3)+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
} |
screen-4.9.0#process_prep#FindCommnr.c | screen-4.9.0 | process.c | FindCommnr | 18 | int
FindCommnr(str)
const char *str;
{
int x, m, l = 0, r = 189;
while (l <= r)
{
m = (l + r) / 2;
x = strcmp(str, comms[m].name);
if (x > 0)
l = m + 1;
else if (x < 0)
r = m - 1;
else
return m;
}
return -1;
}
| {
"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": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
libxml2#libxml2-py_prep#libxml_htmlIsScriptAttribute.c | libxml2 | libxml2-py.c | libxml_htmlIsScriptAttribute | 11 | PyObject *
libxml_htmlIsScriptAttribute(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
int c_retval;
xmlChar * name;
if (!_PyArg_ParseTuple_SizeT(args, (char *)"z:htmlIsScriptAttribute", &name))
return(((void *)0));
c_retval = htmlIsScriptAttribute(name);
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
} |
json.h#allow_single_quoted_strings_prep#json_extract_value_ex.c | json.h | allow_single_quoted_strings.c | json_extract_value_ex | 23 | struct json_value_s *json_extract_value_ex(const struct json_value_s *value,
void *(*alloc_func_ptr)(void *,
size_t),
void *user_data) {
void *allocation;
struct json_extract_result_s result;
struct json_extract_state_s state;
size_t total_size;
if (0 == value) {
return 0;
}
result = json_extract_get_value_size(value);
total_size = result.dom_size + result.data_size;
if (0 == alloc_func_ptr) {
allocation = malloc(total_size);
} else {
allocation = alloc_func_ptr(user_data, total_size);
}
state.dom = (char *)allocation;
state.data = state.dom + result.dom_size;
json_extract_copy_value(&state, value);
return (struct json_value_s *)allocation;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 1,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 1,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 2,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
gprolog-1.5.0#c_supp_prep#Pl_Rd_Float_Check.c | gprolog-1.5.0 | c_supp.c | Pl_Rd_Float_Check | 11 | double
Pl_Rd_Float_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)0x4)
Pl_Err_Type(pl_type_float, word);
return Pl_Obtain_Float(((WamWord *) ((word) & (PlULong)0xfffffffffffffff8)));
}
| {
"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
} |
bzip2#bzip2_prep#main.c | bzip2 | bzip2.c | main | 207 | IntNative main ( IntNative argc, Char *argv[] )
{
Int32 i, j;
Char *tmp;
Cell *argList;
Cell *aa;
Bool decode;
if (sizeof(Int32) != 4 || sizeof(UInt32) != 4 ||
sizeof(Int16) != 2 || sizeof(UInt16) != 2 ||
sizeof(Char) != 1 || sizeof(UChar) != 1)
configError();
outputHandleJustInCase = ((void *)0);
smallMode = ((Bool)0);
keepInputFiles = ((Bool)0);
forceOverwrite = ((Bool)0);
noisy = ((Bool)1);
verbosity = 0;
blockSize100k = 9;
testFailsExist = ((Bool)0);
unzFailsExist = ((Bool)0);
numFileNames = 0;
numFilesProcessed = 0;
workFactor = 30;
deleteOutputOnInterrupt = ((Bool)0);
exitValue = 0;
i = j = 0;
signal (11, mySIGSEGVorSIGBUScatcher);
signal (7, mySIGSEGVorSIGBUScatcher);
copyFileName ( inName, (Char*)"(none)" );
copyFileName ( outName, (Char*)"(none)" );
copyFileName ( progNameReally, argv[0] );
progName = &progNameReally[0];
for (tmp = &progNameReally[0]; *tmp != '\0'; tmp++)
if (*tmp == '/') progName = tmp + 1;
argList = ((void *)0);
addFlagsFromEnvVar ( &argList, (Char*)"BZIP2" );
addFlagsFromEnvVar ( &argList, (Char*)"BZIP" );
for (i = 1; i <= argc-1; i++)
argList=snocString((argList), (argv[i]));
longestFileName = 7;
numFileNames = 0;
decode = ((Bool)1);
for (aa = argList; aa != ((void *)0); aa = aa->link) {
if ((strcmp(aa->name, ("--"))==0)) { decode = ((Bool)0); continue; }
if (aa->name[0] == '-' && decode) continue;
numFileNames++;
if (longestFileName < (Int32)strlen(aa->name) )
longestFileName = (Int32)strlen(aa->name);
}
if (numFileNames == 0)
srcMode = 1; else srcMode = 3;
opMode = 1;
if ( (strstr ( progName, "unzip" ) != 0) ||
(strstr ( progName, "UNZIP" ) != 0) )
opMode = 2;
if ( (strstr ( progName, "z2cat" ) != 0) ||
(strstr ( progName, "Z2CAT" ) != 0) ||
(strstr ( progName, "zcat" ) != 0) ||
(strstr ( progName, "ZCAT" ) != 0) ) {
opMode = 2;
srcMode = (numFileNames == 0) ? 1 : 2;
}
for (aa = argList; aa != ((void *)0); aa = aa->link) {
if ((strcmp(aa->name, ("--"))==0)) break;
if (aa->name[0] == '-' && aa->name[1] != '-') {
for (j = 1; aa->name[j] != '\0'; j++) {
switch (aa->name[j]) {
case 'c': srcMode = 2; break;
case 'd': opMode = 2; break;
case 'z': opMode = 1; break;
case 'f': forceOverwrite = ((Bool)1); break;
case 't': opMode = 3; break;
case 'k': keepInputFiles = ((Bool)1); break;
case 's': smallMode = ((Bool)1); break;
case 'q': noisy = ((Bool)0); break;
case '1': blockSize100k = 1; break;
case '2': blockSize100k = 2; break;
case '3': blockSize100k = 3; break;
case '4': blockSize100k = 4; break;
case '5': blockSize100k = 5; break;
case '6': blockSize100k = 6; break;
case '7': blockSize100k = 7; break;
case '8': blockSize100k = 8; break;
case '9': blockSize100k = 9; break;
case 'V':
case 'L': license(); break;
case 'v': verbosity++; break;
case 'h': usage ( progName );
exit ( 0 );
break;
default: fprintf ( stderr, "%s: Bad flag `%s'\n",
progName, aa->name );
usage ( progName );
exit ( 1 );
break;
}
}
}
}
for (aa = argList; aa != ((void *)0); aa = aa->link) {
if ((strcmp(aa->name, ("--"))==0)) break;
if ((strcmp(aa->name, ("--stdout"))==0)) srcMode = 2; else
if ((strcmp(aa->name, ("--decompress"))==0)) opMode = 2; else
if ((strcmp(aa->name, ("--compress"))==0)) opMode = 1; else
if ((strcmp(aa->name, ("--force"))==0)) forceOverwrite = ((Bool)1); else
if ((strcmp(aa->name, ("--test"))==0)) opMode = 3; else
if ((strcmp(aa->name, ("--keep"))==0)) keepInputFiles = ((Bool)1); else
if ((strcmp(aa->name, ("--small"))==0)) smallMode = ((Bool)1); else
if ((strcmp(aa->name, ("--quiet"))==0)) noisy = ((Bool)0); else
if ((strcmp(aa->name, ("--version"))==0)) license(); else
if ((strcmp(aa->name, ("--license"))==0)) license(); else
if ((strcmp(aa->name, ("--exponential"))==0)) workFactor = 1; else
if ((strcmp(aa->name, ("--repetitive-best"))==0)) redundant(aa->name); else
if ((strcmp(aa->name, ("--repetitive-fast"))==0)) redundant(aa->name); else
if ((strcmp(aa->name, ("--fast"))==0)) blockSize100k = 1; else
if ((strcmp(aa->name, ("--best"))==0)) blockSize100k = 9; else
if ((strcmp(aa->name, ("--verbose"))==0)) verbosity++; else
if ((strcmp(aa->name, ("--help"))==0)) { usage ( progName ); exit ( 0 ); }
else
if (strncmp ( aa->name, "--", 2) == 0) {
fprintf ( stderr, "%s: Bad flag `%s'\n", progName, aa->name );
usage ( progName );
exit ( 1 );
}
}
if (verbosity > 4) verbosity = 4;
if (opMode == 1 && smallMode && blockSize100k > 2)
blockSize100k = 2;
if (opMode == 3 && srcMode == 2) {
fprintf ( stderr, "%s: -c and -t cannot be used together.\n",
progName );
exit ( 1 );
}
if (srcMode == 2 && numFileNames == 0)
srcMode = 1;
if (opMode != 1) blockSize100k = 0;
if (srcMode == 3) {
signal (2, mySignalCatcher);
signal (15, mySignalCatcher);
signal (1, mySignalCatcher);
}
if (opMode == 1) {
if (srcMode == 1) {
compress ( ((void *)0) );
} else {
decode = ((Bool)1);
for (aa = argList; aa != ((void *)0); aa = aa->link) {
if ((strcmp(aa->name, ("--"))==0)) { decode = ((Bool)0); continue; }
if (aa->name[0] == '-' && decode) continue;
numFilesProcessed++;
compress ( aa->name );
}
}
}
else
if (opMode == 2) {
unzFailsExist = ((Bool)0);
if (srcMode == 1) {
uncompress ( ((void *)0) );
} else {
decode = ((Bool)1);
for (aa = argList; aa != ((void *)0); aa = aa->link) {
if ((strcmp(aa->name, ("--"))==0)) { decode = ((Bool)0); continue; }
if (aa->name[0] == '-' && decode) continue;
numFilesProcessed++;
uncompress ( aa->name );
}
}
if (unzFailsExist) {
setExit(2);
exit(exitValue);
}
}
else {
testFailsExist = ((Bool)0);
if (srcMode == 1) {
testf ( ((void *)0) );
} else {
decode = ((Bool)1);
for (aa = argList; aa != ((void *)0); aa = aa->link) {
if ((strcmp(aa->name, ("--"))==0)) { decode = ((Bool)0); continue; }
if (aa->name[0] == '-' && decode) continue;
numFilesProcessed++;
testf ( aa->name );
}
}
if (testFailsExist) {
if (noisy) {
fprintf ( stderr,
"\n"
"You can use the `bzip2recover' program to attempt to recover\n"
"data from undamaged sections of corrupted files.\n\n"
);
}
setExit(2);
exit(exitValue);
}
}
aa = argList;
while (aa != ((void *)0)) {
Cell* aa2 = aa->link;
if (aa->name != ((void *)0)) free(aa->name);
free(aa);
aa = aa2;
}
return exitValue;
}
| {
"array_type": 3,
"break_continue_statement": 31,
"enum_type": 0,
"for_loop": 9,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 50,
"memory_management": 2,
"memory_operation": 0,
"pointer_type": 3,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 1,
"type_casting": 13,
"union_type": 0,
"while_loop": 1
} |
rcs-5.10.1#b-excwho_prep#nosetid.c | rcs-5.10.1 | b-excwho.c | nosetid | 5 | void
nosetid (void)
{
(top->behavior. stick_with_euid) = 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
} |
less-633#line_prep#skip_ansi.c | less-633 | line.c | skip_ansi | 7 | void skip_ansi(struct ansi_state *pansi, char **pp, const char *limit)
{
LWCHAR c;
do {
c = step_char(pp, +1, limit);
} while (*pp < limit && ansi_step(pansi, c) == 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": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
units-2.22#units_prep#readunits.c | units-2.22 | units.c | readunits | 282 | int
readunits(char *file, FILE *errfile,
int *unitcount, int *prefixcount, int *funccount, int depth)
{
FILE *unitfile;
char *line = 0, *lineptr, *unitdef, *unitname, *permfile;
int linenum, linebufsize, goterr, retcode;
int locunitcount, locprefixcount, locfunccount, redefinition;
int wronglocale = 0;
int inlocale = 0;
int in_utf8 = 0;
int invar = 0;
int wrongvar = 0;
locunitcount = 0;
locprefixcount = 0;
locfunccount = 0;
linenum = 0;
linebufsize = 0;
goterr = 0;
unitfile = openfile(file, "rt");
if (!unitfile){
if (errfile)
fprintf(errfile, "%s: Unable to read units file '%s': %s\n", progname, file, strerror((*__errno_location ())));
return 16;
}
growbuffer(&line,&linebufsize);
permfile = dupstr(file);
while (!feof(unitfile)) {
if (!fgetslong(&line, &linebufsize, unitfile, &linenum))
break;
if (linenum==1 && (!strncmp(line, "\xEF\xBB\xBF", strlen("\xEF\xBB\xBF")))){
int i;
for(lineptr=line,i=0;i<strlen("\xEF\xBB\xBF");i++, lineptr++)
*lineptr=' ';
}
strip_comment(line);
if (-1 == strwidth(line)){
(goterr=1) && errfile && fprintf(errfile, "%s: %s on line %d of '%s'\n",
progname, invalid_utf8, linenum, file);
continue;
}
replace_minus(line);
if (*line == '!') {
unitname = strtok(line+1, " ");
if (!unitname){
(goterr=1) && errfile && fprintf(errfile, "%s: error in units file '%s' line %d\n", progname, file, linenum);
continue;
}
if (!strcmp(unitname,"var") || !strcmp(unitname,"varnot")){
int not = 0;
if (unitname[3]=='n')
not = 1;
unitname=strtok(0," ");
unitdef=strtok(0,"");
if (!unitname)
(goterr=1) && errfile && fprintf(errfile,
"%s: no variable name specified on line %d of '%s'\n",
progname, linenum, file);
else if (!unitdef)
(goterr=1) && errfile && fprintf(errfile,
"%s: no value specified on line %d of '%s'\n",
progname, linenum, file);
else if (invar)
(goterr=1) && errfile && fprintf(errfile,
"%s: nested var statements not allowed, line %d of '%s'\n",
progname, linenum, file);
else {
int check;
invar = 1;
check = checkvar(unitname, unitdef);
if (check==2){
(goterr=1) && errfile && fprintf(errfile,
"%s: environment variable %s not set at line %d of '%s'\n",
progname, unitname, linenum, file);
wrongvar = 1;
}
else if (!(not^check))
wrongvar = 1;
}
continue;
}
else if (!strcmp(unitname, "endvar")){
if (!invar)
(goterr=1) && errfile && fprintf(errfile,
"%s: unmatched !endvar on line %d of '%s'\n",
progname, linenum, file);
wrongvar = 0;
invar = 0;
continue;
}
else if (!strcmp(unitname,"locale")){
unitname = strtok(0, " ");
if (!unitname)
(goterr=1) && errfile && fprintf(errfile,
"%s: no locale specified on line %d of '%s'\n",
progname, linenum, file);
else if (inlocale)
(goterr=1) && errfile && fprintf(errfile,
"%s: nested locales not allowed, line %d of '%s'\n",
progname, linenum, file);
else {
inlocale = 1;
if (strcmp(unitname,mylocale))
wronglocale = 1;
}
continue;
}
else if (!strcmp(unitname, "endlocale")){
if (!inlocale)
(goterr=1) && errfile && fprintf(errfile,
"%s: unmatched !endlocale on line %d of '%s'\n",
progname, linenum, file);
wronglocale = 0;
inlocale = 0;
continue;
}
else if (!strcmp(unitname, "utf8")){
if (in_utf8)
(goterr=1) && errfile && fprintf(errfile,"%s: nested utf8 not allowed, line %d of '%s'\n",
progname, linenum, file);
else in_utf8 = 1;
continue;
}
else if (!strcmp(unitname, "endutf8")){
if (!in_utf8)
(goterr=1) && errfile && fprintf(errfile,"%s: unmatched !endutf8 on line %d of '%s'\n",
progname, linenum, file);
in_utf8 = 0;
continue;
}
if (in_utf8 && !utf8mode) continue;
if (wronglocale || wrongvar) continue;
if (!strcmp(unitname,"prompt")){
unitname = strtok(0,"");
if (promptprefix)
free(promptprefix);
if (!unitname)
promptprefix=0;
else
promptprefix = dupstr(unitname);
continue;
}
if (!strcmp(unitname,"message")){
unitname = strtok(0,"");
if (!flags.quiet){
if (unitname) logputs(unitname);
logputchar('\n');
}
continue;
}
else if (!strcmp(unitname,"set")) {
unitname = strtok(0," ");
unitdef = strtok(0," ");
if (!unitname)
(goterr=1) && errfile && fprintf(errfile,
"%s: no variable name specified on line %d of '%s'\n",
progname, linenum, file);
else if (!unitdef)
(goterr=1) && errfile && fprintf(errfile,
"%s: no value specified on line %d of '%s'\n",
progname, linenum, file);
else
setenv(unitname, unitdef, 0);
continue;
}
else if (!strcmp(unitname,"unitlist")){
splitline(0,&unitname, &unitdef);
if (!unitname || !unitdef)
(goterr=1) && errfile && fprintf(errfile,"%s: error in units file '%s' line %d\n", progname, file, linenum);
else {
if (newalias(unitname, unitdef, linenum, permfile, errfile))
goterr = 1;
}
continue;
}
else if (!strcmp(unitname, "include")){
if (depth>5){
(goterr=1) && errfile && fprintf(errfile,
"%s: max include depth of %d exceeded in file '%s' line %d\n",
progname, 5, file, linenum);
} else {
int readerr;
char *includefile;
unitname = strtok(0, " ");
if (!unitname){
(goterr=1) && errfile && fprintf(errfile,
"%s: missing include filename on line %d of '%s'\n",
progname, linenum, file);
continue;
}
includefile = mymalloc(strlen(file)+strlen(unitname)+1, "(readunits)");
if (isfullpath(unitname))
strcpy(includefile,unitname);
else {
strcpy(includefile,file);
strcpy(pathend(includefile), unitname);
}
readerr = readunits(includefile, errfile, unitcount, prefixcount,
funccount, depth+1);
if (readerr == 18){
fclose(unitfile);
free(line);
free(includefile);
return readerr;
}
if (readerr == 16) {
(goterr=1) && errfile && fprintf(errfile, "%s: file was included at line %d of file '%s'\n", progname,linenum, file);
}
if (readerr)
goterr = 1;
free(includefile);
}
} else
(goterr=1) && errfile && fprintf(errfile,"%s: error in units file '%s' line %d\n", progname, file, linenum);
continue;
}
if (in_utf8 && !utf8mode) continue;
if (wronglocale || wrongvar) continue;
splitline(line, &unitname, &unitdef);
if (!unitname) continue;
if (*unitname == '+'){
unitname++;
redefinition=1;
if (strlen(unitname)==0){
(goterr=1) && errfile && fprintf(errfile,
"%s: expecting name of unit to redefine after '+' at line %d of '%s'\n",
progname, linenum,file);
continue;
}
} else
redefinition=0;
if (!strcmp(unitname,"-")) {
(goterr=1) && errfile && fprintf(errfile,
"%s: expecting prefix name before '-' at line %d of '%s'\n",
progname, linenum,file);
continue;
}
if (!unitdef){
(goterr=1) && errfile && fprintf(errfile,
"%s: unit '%s' lacks a definition at line %d of '%s'\n",
progname, unitname, linenum, file);
continue;
}
if ((*((unitname)+strlen(unitname)-1)) == '-'){
if (newprefix(unitname,unitdef,&locprefixcount,linenum,
permfile,errfile,redefinition))
goterr=1;
}
else if (strchr(unitname,'[')){
retcode=newtable(unitname,unitdef,&locfunccount,linenum,
permfile,errfile,redefinition);
if (retcode){
if (retcode != 17){
fclose(unitfile);
free(line);
return retcode;
}
goterr=1;
}
}
else if (strchr(unitname,'(')){
if (newfunction(unitname,unitdef,&locfunccount,linenum,
permfile,errfile,redefinition))
goterr = 1;
}
else {
if (newunit(unitname,unitdef,&locunitcount,linenum,permfile,errfile,redefinition))
goterr = 1;
}
}
fclose(unitfile);
free(line);
if (unitcount)
*unitcount+=locunitcount;
if (prefixcount)
*prefixcount+=locprefixcount;
if (funccount)
*funccount+=locfunccount;
if (goterr)
return 17;
else return 0;
}
| {
"array_type": 1,
"break_continue_statement": 23,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 66,
"memory_management": 6,
"memory_operation": 0,
"pointer_type": 7,
"return_statement": 5,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
json.h#allow_equals_in_object_prep#utest_should_filter_test.c | json.h | allow_equals_in_object.c | utest_should_filter_test | 42 | __attribute__((weak)) int utest_should_filter_test(const char *filter,
const char *testcase) {
if (filter) {
const char *filter_cur = filter;
const char *testcase_cur = testcase;
const char *filter_wildcard = 0;
while (('\0' != *filter_cur) && ('\0' != *testcase_cur)) {
if ('*' == *filter_cur) {
filter_wildcard = filter_cur;
filter_cur++;
while (('\0' != *filter_cur) && ('\0' != *testcase_cur)) {
if ('*' == *filter_cur) {
break;
} else if (*filter_cur != *testcase_cur) {
filter_cur = filter_wildcard;
}
testcase_cur++;
filter_cur++;
}
if (('\0' == *filter_cur) && ('\0' == *testcase_cur)) {
return 0;
}
if ('\0' == *testcase_cur) {
return 1;
}
} else {
if (*testcase_cur != *filter_cur) {
return 1;
} else {
testcase_cur++;
filter_cur++;
}
}
}
if (('\0' != *filter_cur) ||
(('\0' != *testcase_cur) &&
((filter == filter_cur) || ('*' != filter_cur[-1])))) {
return 1;
}
}
return 0;
}
| {
"array_type": 0,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 8,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 3,
"return_statement": 5,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 2
} |
json.h#allow_unquoted_keys_prep#json_extract_get_object_size.c | json.h | allow_unquoted_keys.c | json_extract_get_object_size | 21 | struct json_extract_result_s
json_extract_get_object_size(const struct json_object_s *const object) {
struct json_extract_result_s result;
size_t i;
const struct json_object_element_s *element = object->start;
result.dom_size = sizeof(struct json_object_s) +
(sizeof(struct json_object_element_s) * object->length);
result.data_size = 0;
for (i = 0; i < object->length; i++) {
const struct json_extract_result_s string_result =
json_extract_get_string_size(element->name);
const struct json_extract_result_s value_result =
json_extract_get_value_size(element->value);
result.dom_size += string_result.dom_size;
result.data_size += string_result.data_size;
result.dom_size += value_result.dom_size;
result.data_size += value_result.data_size;
element = element->next;
}
return result;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 2,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#COUNTING_PAIRS_PERSON_CAN_FORM_PAIR_ONE_1_prep#main.c | transcoder-set | COUNTING_PAIRS_PERSON_CAN_FORM_PAIR_ONE_1.c | main | 14 | int main(void) {
int n_success = 0;
int param0[] = {22,92,15,81,3,30,88,4,43,92};
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
} |
nettle-3.9.1#hmac-md5_prep#nettle_hmac_md5_set_key.c | nettle-3.9.1 | hmac-md5.c | nettle_hmac_md5_set_key | 6 | void
nettle_hmac_md5_set_key(struct hmac_md5_ctx *ctx,
size_t key_length, const uint8_t *key)
{
nettle_hmac_set_key( &(ctx)->outer, &(ctx)->inner, &(ctx)->state, (&nettle_md5), (key_length), (key) );
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libxml2#catalog_prep#xmlCatalogDump.c | libxml2 | catalog.c | xmlCatalogDump | 8 | void
xmlCatalogDump(FILE *out) {
if (out == ((void *)0))
return;
if (!xmlCatalogInitialized)
xmlInitializeCatalog();
xmlACatalogDump(xmlDefaultCatalog, out);
}
| {
"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": 1,
"union_type": 0,
"while_loop": 0
} |
tulipindicators-0.9.1#tiamalgamation_prep#ti_wilders_start.c | tulipindicators-0.9.1 | tiamalgamation.c | ti_wilders_start | 3 | int ti_wilders_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
} |
json.h#allow_multi_line_strings_prep#json_parse_string.c | json.h | allow_multi_line_strings.c | json_parse_string | 102 | void json_parse_string(struct json_parse_state_s *state,
struct json_string_s *string) {
size_t offset = state->offset;
size_t bytes_written = 0;
const char *const src = state->src;
const char quote_to_use = '\'' == src[offset] ? '\'' : '"';
char *data = state->data;
unsigned long high_surrogate = 0;
unsigned long codepoint;
string->string = data;
offset++;
while (quote_to_use != src[offset]) {
if ('\\' == src[offset]) {
offset++;
switch (src[offset++]) {
default:
return;
case 'u': {
codepoint = 0;
if (!json_hexadecimal_value(&src[offset], 4, &codepoint)) {
return;
}
offset += 4;
if (codepoint <= 0x7fu) {
data[bytes_written++] = (char)codepoint;
} else if (codepoint <= 0x7ffu) {
data[bytes_written++] =
(char)(0xc0u | (codepoint >> 6));
data[bytes_written++] =
(char)(0x80u | (codepoint & 0x3fu));
} else if (codepoint >= 0xd800 &&
codepoint <= 0xdbff) {
high_surrogate = codepoint;
continue;
} else if (codepoint >= 0xdc00 &&
codepoint <= 0xdfff) {
const unsigned long surrogate_offset =
0x10000u - (0xD800u << 10) - 0xDC00u;
codepoint = (high_surrogate << 10) + codepoint + surrogate_offset;
high_surrogate = 0;
data[bytes_written++] =
(char)(0xF0u | (codepoint >> 18));
data[bytes_written++] =
(char)(0x80u | ((codepoint >> 12) & 0x3fu));
data[bytes_written++] =
(char)(0x80u | ((codepoint >> 6) & 0x3fu));
data[bytes_written++] =
(char)(0x80u | (codepoint & 0x3fu));
} else {
data[bytes_written++] =
(char)(0xe0u | (codepoint >> 12));
data[bytes_written++] =
(char)(0x80u | ((codepoint >> 6) & 0x3fu));
data[bytes_written++] =
(char)(0x80u | (codepoint & 0x3fu));
}
} break;
case '"':
data[bytes_written++] = '"';
break;
case '\\':
data[bytes_written++] = '\\';
break;
case '/':
data[bytes_written++] = '/';
break;
case 'b':
data[bytes_written++] = '\b';
break;
case 'f':
data[bytes_written++] = '\f';
break;
case 'n':
data[bytes_written++] = '\n';
break;
case 'r':
data[bytes_written++] = '\r';
break;
case 't':
data[bytes_written++] = '\t';
break;
case '\r':
data[bytes_written++] = '\r';
if ('\n' == src[offset]) {
data[bytes_written++] = '\n';
offset++;
}
break;
case '\n':
data[bytes_written++] = '\n';
break;
}
} else {
data[bytes_written++] = src[offset++];
}
}
offset++;
string->string_size = bytes_written;
data[bytes_written++] = '\0';
state->data += bytes_written;
state->offset = offset;
}
| {
"array_type": 1,
"break_continue_statement": 12,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 7,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 2,
"struct_type": 2,
"switch_statement": 1,
"type_casting": 10,
"union_type": 0,
"while_loop": 1
} |
libxml2#libxml2-py_prep#libxml_xmlIsRef.c | libxml2 | libxml2-py.c | libxml_xmlIsRef | 21 | PyObject *
libxml_xmlIsRef(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
int c_retval;
xmlDocPtr doc;
PyObject *pyobj_doc;
xmlNodePtr elem;
PyObject *pyobj_elem;
xmlAttrPtr attr;
PyObject *pyobj_attr;
if (libxml_deprecationWarning("xmlIsRef") == -1)
return(((void *)0));
if (!_PyArg_ParseTuple_SizeT(args, (char *)"OOO:xmlIsRef", &pyobj_doc, &pyobj_elem, &pyobj_attr))
return(((void *)0));
doc = (xmlDocPtr) (((pyobj_doc) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyxmlNode_Object *)(pyobj_doc))->obj));
elem = (xmlNodePtr) (((pyobj_elem) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyxmlNode_Object *)(pyobj_elem))->obj));
attr = (xmlAttrPtr) (((pyobj_attr) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyxmlNode_Object *)(pyobj_attr))->obj));
c_retval = xmlIsRef(doc, elem, attr);
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": 4,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 7,
"union_type": 0,
"while_loop": 0
} |
nano-7.2#utils_prep#digits.c | nano-7.2 | utils.c | digits | 28 | int digits(ssize_t n)
{
if (n < 100000) {
if (n < 1000) {
if (n < 100)
return 2;
else
return 3;
} else {
if (n < 10000)
return 4;
else
return 5;
}
} else {
if (n < 10000000) {
if (n < 1000000)
return 6;
else
return 7;
} else {
if (n < 100000000)
return 8;
else
return 9;
}
}
}
| {
"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": 8,
"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_And.c | gprolog-1.5.0 | arith_inl_c.c | Pl_Fct_And | 5 | WamWord
Pl_Fct_And(WamWord x, WamWord y)
{
if ((((PlLong) (x) & ((PlULong)0x7)) == (PlULong)0x4)) Pl_Err_Type(pl_type_integer, x); if ((((PlLong) (y) & ((PlULong)0x7)) == (PlULong)0x4)) Pl_Err_Type(pl_type_integer, y); return Pl_Fct_Fast_And(x, y);
}
| {
"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
} |
nano-7.2#prompt_prep#do_statusbar_verbatim_input.c | nano-7.2 | prompt.c | do_statusbar_verbatim_input | 11 | void do_statusbar_verbatim_input(void)
{
size_t count = 1;
char *bytes;
bytes = get_verbatim_kbinput(footwin, &count);
if (0 < count && count < 999)
inject_into_answer(bytes, count);
else if (count == 0)
beep();
free(bytes);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 1,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libxml2#xpath_prep#xmlXPathCompile.c | libxml2 | xpath.c | xmlXPathCompile | 4 | xmlXPathCompExprPtr
xmlXPathCompile(const xmlChar *str) {
return(xmlXPathCtxtCompile(((void *)0), str));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#COUNT_OBTUSE_ANGLES_CIRCLE_K_EQUIDISTANT_POINTS_2_GIVEN_POINTS_prep#main.c | transcoder-set | COUNT_OBTUSE_ANGLES_CIRCLE_K_EQUIDISTANT_POINTS_2_GIVEN_POINTS.c | main | 16 | int main(void) {
int n_success = 0;
int param0[] = {83,3,11,50,40,62,40,66,6,25};
int param1[] = {98,39,96,67,16,86,78,11,9,5};
int param2[] = {86,87,30,48,32,76,71,74,19,5};
for(int i = 0; i < len(param0); ++i)
{
if(f_filled(param0[i],param1[i],param2[i]) == f_gold(param0[i],param1[i],param2[i]))
{
n_success+=1;
}
break;
}
printf("#Results:", " ", n_success, ", ", len(param0));
return 0;
}
| {
"array_type": 3,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
tulipindicators-0.9.1#tiamalgamation_prep#ti_aroon_start.c | tulipindicators-0.9.1 | tiamalgamation.c | ti_aroon_start | 3 | int ti_aroon_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
} |
transcoder-set#COUNTING_PAIRS_PERSON_CAN_FORM_PAIR_ONE_1_prep#f_gold.c | transcoder-set | COUNTING_PAIRS_PERSON_CAN_FORM_PAIR_ONE_1.c | f_gold | 8 | int f_gold ( int x ) {
int dp [ x + 1 ];
dp [ 0 ] = dp [ 1 ] = 1;
for ( int i = 2;
i <= x;
i ++ ) dp [ i ] = dp [ i - 1 ] + ( i - 1 ) * dp [ i - 2 ];
return dp [ x ];
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
tmux#screen-write_prep#screen_write_reverseindex.c | tmux | screen-write.c | screen_write_reverseindex | 14 | void
screen_write_reverseindex(struct screen_write_ctx *ctx, u_int bg)
{
struct screen *s = ctx->s;
struct tty_ctx ttyctx;
screen_write_initctx(ctx, &ttyctx);
ttyctx.bg = bg;
if (s->cy == s->rupper)
grid_view_scroll_region_down(s->grid, s->rupper, s->rlower, bg);
else if (s->cy > 0)
s->cy--;
screen_write_collect_flush(ctx, 0);
tty_write(tty_cmd_reverseindex, &ttyctx);
}
| {
"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": 0,
"struct_type": 2,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#LONGEST_REPEATING_SUBSEQUENCE_prep#len.c | transcoder-set | LONGEST_REPEATING_SUBSEQUENCE.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
} |
rcs-5.10.1#ident_prep#main.c | rcs-5.10.1 | ident.c | main | 51 | int
main (int argc, char *argv[static argc])
{
FILE *fp;
int status = 0;
char const *a;
do { program.invoke = argv[0]; program.name = "ident"; check_hv (argc, argv, &program); } while (0);
gnurcs_init (&program);
while ((a = *++argv) && *a == '-')
while (*++a)
switch (*a)
{
case 'q':
(top->behavior. quiet) = 1;
break;
case 'V':
if (! a[1])
{
display_version (&program, 1);
gnurcs_goodbye ();
return 0;
}
default:
bad_option (a - 1);
gnurcs_goodbye ();
return exit_failure;
break;
}
if (!a)
scanfile (stdin, ((void *)0));
else
do
{
if (!(fp = fopen (a, "r")))
{
syserror ((*__errno_location ()), a);
status = exit_failure;
}
else if ((0 > (scanfile (fp, a)))
|| (argv[1] && putchar ('\n') == (-1)))
break;
}
while ((a = *++argv));
if (ferror (stdout) || (0 > (fclose (stdout))))
{
syserror ((*__errno_location ()), "standard output");
status = exit_failure;
}
gnurcs_goodbye ();
return status;
}
| {
"array_type": 2,
"break_continue_statement": 3,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 5,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 1,
"type_casting": 1,
"union_type": 0,
"while_loop": 4
} |
tmux#layout_prep#layout_resize.c | tmux | layout.c | layout_resize | 32 | void
layout_resize(struct window *w, u_int sx, u_int sy)
{
struct layout_cell *lc = w->layout_root;
int xlimit, ylimit, xchange, ychange;
xchange = sx - w->sx;
xlimit = layout_resize_check(w, lc, LAYOUT_LEFTRIGHT);
if (xchange < 0 && xchange < -xlimit)
xchange = -xlimit;
if (xlimit == 0) {
if (sx <= lc->sx)
xchange = 0;
else
xchange = sx - lc->sx;
}
if (xchange != 0)
layout_resize_adjust(w, lc, LAYOUT_LEFTRIGHT, xchange);
ychange = sy - w->sy;
ylimit = layout_resize_check(w, lc, LAYOUT_TOPBOTTOM);
if (ychange < 0 && ychange < -ylimit)
ychange = -ylimit;
if (ylimit == 0) {
if (sy <= lc->sy)
ychange = 0;
else
ychange = sy - lc->sy;
}
if (ychange != 0)
layout_resize_adjust(w, lc, LAYOUT_TOPBOTTOM, ychange);
layout_fix_offsets(lc);
layout_fix_panes(w, sx, sy);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 8,
"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
} |
tinycc#libtcc_prep#tcc_add_include_path.c | tinycc | libtcc.c | tcc_add_include_path | 5 | int tcc_add_include_path(TCCState *s, const char *pathname)
{
tcc_split_path(s, &s->include_paths, &s->nb_include_paths, pathname);
return 0;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
nettle-3.9.1#camellia256-set-decrypt-key_prep#nettle_camellia256_set_decrypt_key.c | nettle-3.9.1 | camellia256-set-decrypt-key.c | nettle_camellia256_set_decrypt_key | 7 | void
nettle_camellia256_set_decrypt_key(struct camellia256_ctx *ctx,
const uint8_t *key)
{
nettle_camellia256_set_encrypt_key(ctx, key);
nettle_camellia256_invert_key(ctx, ctx);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#K_TH_PRIME_FACTOR_GIVEN_NUMBER_prep#max.c | transcoder-set | K_TH_PRIME_FACTOR_GIVEN_NUMBER.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
} |
libxml2#types_prep#libxml_xmlCharPtrConstWrap.c | libxml2 | types.c | libxml_xmlCharPtrConstWrap | 11 | PyObject *
libxml_xmlCharPtrConstWrap(const xmlChar * str)
{
PyObject *ret;
if (str == ((void *)0)) {
_Py_INCREF(((PyObject*)((&_Py_NoneStruct))));
return ((&_Py_NoneStruct));
}
ret = PyUnicode_FromString((char *) str);
return (ret);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
libosip2-5.3.1#osip_uri_prep#osip_uri_param_clone.c | libosip2-5.3.1 | osip_uri.c | osip_uri_param_clone | 19 | int osip_uri_param_clone(const osip_uri_param_t *uparam, osip_uri_param_t **dest) {
int i;
osip_uri_param_t *up;
*dest = ((void *)0);
if (uparam == ((void *)0))
return -2;
if (uparam->gname == ((void *)0))
return -2;
i = osip_uri_param_init(&up);
if (i != 0)
return i;
up->gname = osip_strdup(uparam->gname);
if (uparam->gvalue != ((void *)0))
up->gvalue = osip_strdup(uparam->gvalue);
else
up->gvalue = ((void *)0);
*dest = up;
return 0;
}
| {
"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": 1,
"return_statement": 4,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 5,
"union_type": 0,
"while_loop": 0
} |
less-633#filename_prep#fcomplete.c | less-633 | filename.c | fcomplete | 22 | char * fcomplete(char *s)
{
char *fpat;
char *qs;
if (secure)
return (((void *)0));
{
int len = (int) strlen(s) + 2;
fpat = (char *) ecalloc(len, sizeof(char));
snprintf((fpat), (len), ("%s*"), (s));
}
qs = lglob(fpat);
s = shell_unquote(qs);
if (strcmp(s,fpat) == 0)
{
free(qs);
qs = ((void *)0);
}
free(s);
free(fpat);
return (qs);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 3,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#SUM_SERIES_23_45_67_89_UPTO_N_TERMS_prep#f_gold.c | transcoder-set | SUM_SERIES_23_45_67_89_UPTO_N_TERMS.c | f_gold | 17 | double f_gold ( int n ) {
int i = 1;
double res = 0.0;
_Bool sign = 1;
while ( n > 0 ) {
n --;
if ( sign ) {
sign = ! sign;
res = res + ( double ) ++ i / ++ i;
}
else {
sign = ! sign;
res = res - ( double ) ++ i / ++ i;
}
}
return res;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 1
} |
libxml2#libxml2-py_prep#libxml_xmlUCSIsDevanagari.c | libxml2 | libxml2-py.c | libxml_xmlUCSIsDevanagari | 13 | PyObject *
libxml_xmlUCSIsDevanagari(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
int c_retval;
int code;
if (libxml_deprecationWarning("xmlUCSIsDevanagari") == -1)
return(((void *)0));
if (!_PyArg_ParseTuple_SizeT(args, (char *)"i:xmlUCSIsDevanagari", &code))
return(((void *)0));
c_retval = xmlUCSIsDevanagari(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
} |
mcsim-6.2.0#yourcode_prep#Interpolate_Poly.c | mcsim-6.2.0 | yourcode.c | Interpolate_Poly | 38 | void Interpolate_Poly (double rgdX[], double rgdY[], int n, double x,
double *pdY, double *pdDY)
{
int i, j, nIndex = 1;
double dDenom, dDiff, dTemp1, dTemp2;
static PDOUBLE pdTerm1 = ((void *)0), pdTerm2 = ((void *)0);
if (!pdTerm1)
if ( !(pdTerm1 = InitdVector (n+1)) || !(pdTerm2 = InitdVector (n+1)))
ReportError (((void *)0), 0x0004 | 0x8000, "Interpolate_Poly", ((void *)0));
dDiff = fabs (x - rgdX[0]);
pdTerm1[0] = rgdY[0];
pdTerm2[0] = rgdY[0];
for (i = 1; i < n; i++) {
if ((dTemp1 = fabs (x - rgdX[i])) < dDiff) {
nIndex = i;
dDiff = dTemp1;
}
pdTerm1[i] = rgdY[i];
pdTerm2[i] = rgdY[i];
}
*pdY = rgdY[nIndex--];
for (j = 1; j < n; j++) {
for (i = 0; i < n - j; i++) {
dTemp1 = rgdX[i] - x;
dTemp2 = rgdX[i+j] - x;
if ((dDenom = dTemp1 - dTemp2) == 0) {
printf ("\nError: null denominator in Interpolate_Poly - Exiting\n\n");
exit (0);
}
dDenom = (pdTerm1[i+1] - pdTerm2[i]) / dDenom;
pdTerm2[i] = dTemp2 * dDenom;
pdTerm1[i] = dTemp1 * dDenom;
}
*pdDY = (2 * (nIndex + 1) < (n - j) ?
pdTerm1[nIndex+1] : pdTerm2[nIndex--]);
*pdY = *pdY + *pdDY;
}
}
| {
"array_type": 4,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 3,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 4,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#SUBSET_SUM_DIVISIBLE_M_prep#sort.c | transcoder-set | SUBSET_SUM_DIVISIBLE_M.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#SkipComment.c | mcsim-6.2.0 | lex.c | SkipComment | 14 | void SkipComment (PINPUTBUF pibIn)
{
if (!pibIn)
return;
if (!*pibIn->pbufCur)
FillBuffer (pibIn);
while (*pibIn->pbufCur++ != ('\n'))
if (!*pibIn->pbufCur)
if (FillBuffer (pibIn) == (-1))
break;
pibIn->iLineNum++;
if (!*pibIn->pbufCur)
FillBuffer (pibIn);
}
| {
"array_type": 0,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 5,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
transcoder-set#NUMBER_WAYS_NODE_MAKE_LOOP_SIZE_K_UNDIRECTED_COMPLETE_CONNECTED_GRAPH_N_NODES_prep#len.c | transcoder-set | NUMBER_WAYS_NODE_MAKE_LOOP_SIZE_K_UNDIRECTED_COMPLETE_CONNECTED_GRAPH_N_NODES.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#MAXIMUM_NUMBER_2X2_SQUARES_CAN_FIT_INSIDE_RIGHT_ISOSCELES_TRIANGLE_prep#sort.c | transcoder-set | MAXIMUM_NUMBER_2X2_SQUARES_CAN_FIT_INSIDE_RIGHT_ISOSCELES_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
} |
gprolog-1.5.0#fd_symbolic_c_prep#Pl_Fd_Element_V_To_I.c | gprolog-1.5.0 | fd_symbolic_c.c | Pl_Fd_Element_V_To_I | 17 | void
Pl_Fd_Element_V_To_I(Range *i, Range *v, WamWord *l)
{
int val;
int n;
int j;
do { i->vec = (Vector) (((WamWordP *) pl_reg_bank)[256 +3]); (((WamWordP *) pl_reg_bank)[256 +3]) += pl_vec_size; } while (0);
Pl_Vector_Empty(i->vec);
n = *l;
for (j = 1; j <= n; j++)
{
val = l[j];
if (Pl_Range_Test_Value(v, val))
(i->vec[((VecWord) (j) >> 6)] |= ((VecWord) 1 << ((j) & (((VecWord) 1 << 6)-1))));
}
Pl_Range_From_Vector(i);
}
| {
"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": 1
} |
tulipindicators-0.9.1#willr_prep#ti_willr_start.c | tulipindicators-0.9.1 | willr.c | ti_willr_start | 3 | int ti_willr_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
} |
libzahl-1.0#zmodpow_prep#zmodpow.c | libzahl-1.0 | zmodpow.c | zmodpow | 45 | void
zmodpow(z_t a, z_t b, z_t c, z_t d)
{
size_t i, j, n, bits;
zahl_char_t x;
if (zsignum(c) <= 0) {
if (zzero(c)) {
if (zzero(b))
(libzahl_error = (33), longjmp(libzahl_jmp_buf, 1));
else if (zzero(d))
(libzahl_error = (33), longjmp(libzahl_jmp_buf, 1));
zsetu(a, 1);
} else if (zzero(b) || zzero(d)) {
(libzahl_error = (33), longjmp(libzahl_jmp_buf, 1));
} else {
((a)->sign = (0));
}
return;
} else if (zzero(d)) {
(libzahl_error = (33), longjmp(libzahl_jmp_buf, 1));
} else if (zzero(b)) {
((a)->sign = (0));
return;
}
bits = zbits(c);
n = ((bits) >> 5);
zmod(libzahl_tmp_pow_b, b, d);
zset(libzahl_tmp_pow_c, c);
zset(libzahl_tmp_pow_d, d);
zsetu(a, 1);
for (i = 0; i < n; i++) {
x = libzahl_tmp_pow_c->chars[i];
for (j = 32; j--; x >>= 1) {
if (x & 1)
zmodmul(a, a, libzahl_tmp_pow_b, libzahl_tmp_pow_d);
zmodsqr(libzahl_tmp_pow_b, libzahl_tmp_pow_b, libzahl_tmp_pow_d);
}
}
x = libzahl_tmp_pow_c->chars[i];
for (; x; x >>= 1) {
if (x & 1)
zmodmul(a, a, libzahl_tmp_pow_b, libzahl_tmp_pow_d);
zmodsqr(libzahl_tmp_pow_b, libzahl_tmp_pow_b, libzahl_tmp_pow_d);
}
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 3,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 9,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
nano-7.2#chars_prep#mbrevstrpbrk.c | nano-7.2 | chars.c | mbrevstrpbrk | 15 | char *mbrevstrpbrk(const char *head, const char *accept, const char *pointer)
{
if (*pointer == '\0') {
if (pointer == head)
return ((void *)0);
pointer = head + step_left(head, pointer - head);
}
while (1) {
if (mbstrchr(accept, pointer) != ((void *)0))
return (char *)pointer;
if (pointer == head)
return ((void *)0);
pointer = head + step_left(head, pointer - head);
}
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 4,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 1
} |
screen-4.9.0#tty_prep#CheckTtyname.c | screen-4.9.0 | tty.c | CheckTtyname | 16 | int CheckTtyname (char *tty)
{
struct stat st;
char realbuf[4096];
const char *real;
int rc;
real = realpath(tty, realbuf);
if (!real)
return -1;
realbuf[sizeof(realbuf)-1]='\0';
if (lstat(real, &st) || !((((st.st_mode)) & 0170000) == (0020000)) || (st.st_nlink > 1 && strncmp(real, "/dev", 4)))
rc = -1;
else
rc = 0;
return rc;
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
dap-3.10#ps_prep#nport.c | dap-3.10 | ps.c | nport | 18 | void nport(pict *p, int nplots, int nperpage)
{
int pn;
if (nplots % nperpage)
{
fprintf(dap_err,
"(nport) Number of plots %d not a multiple of number per page %d\n",
nplots, nperpage);
exit(1);
}
pict_port(nplots / nperpage);
for (pn = 0; pn < nplots; pn += nperpage)
{
pict_page();
pict_show(p + pn);
}
pict_end();
}
| {
"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": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libxml2#xmlwriter_prep#xmlTextWriterStartDTDEntity.c | libxml2 | xmlwriter.c | xmlTextWriterStartDTDEntity | 78 | int
xmlTextWriterStartDTDEntity(xmlTextWriterPtr writer,
int pe, const xmlChar * name)
{
int count;
int sum;
xmlLinkPtr lk;
xmlTextWriterStackEntry *p;
if (writer == ((void *)0) || name == ((void *)0) || *name == '\0')
return -1;
sum = 0;
lk = xmlListFront(writer->nodes);
if (lk != 0) {
p = (xmlTextWriterStackEntry *) xmlLinkGetData(lk);
if (p != 0) {
switch (p->state) {
case XML_TEXTWRITER_DTD:
count = xmlOutputBufferWriteString(writer->out, " [");
if (count < 0)
return -1;
sum += count;
if (writer->indent) {
count =
xmlOutputBufferWriteString(writer->out, "\n");
if (count < 0)
return -1;
sum += count;
}
p->state = XML_TEXTWRITER_DTD_TEXT;
case XML_TEXTWRITER_DTD_TEXT:
case XML_TEXTWRITER_NONE:
break;
default:
return -1;
}
}
}
p = (xmlTextWriterStackEntry *)
xmlMalloc(sizeof(xmlTextWriterStackEntry));
if (p == 0) {
xmlWriterErrMsg(writer, XML_ERR_NO_MEMORY,
"xmlTextWriterStartDTDElement : out of memory!\n");
return -1;
}
p->name = xmlStrdup(name);
if (p->name == 0) {
xmlWriterErrMsg(writer, XML_ERR_NO_MEMORY,
"xmlTextWriterStartDTDElement : out of memory!\n");
xmlFree(p);
return -1;
}
if (pe != 0)
p->state = XML_TEXTWRITER_DTD_PENT;
else
p->state = XML_TEXTWRITER_DTD_ENTY;
xmlListPushFront(writer->nodes, p);
if (writer->indent) {
count = xmlTextWriterWriteIndent(writer);
if (count < 0)
return -1;
sum += count;
}
count = xmlOutputBufferWriteString(writer->out, "<!ENTITY ");
if (count < 0)
return -1;
sum += count;
if (pe != 0) {
count = xmlOutputBufferWriteString(writer->out, "% ");
if (count < 0)
return -1;
sum += count;
}
count = xmlOutputBufferWriteString(writer->out, (const char *) name);
if (count < 0)
return -1;
sum += count;
return sum;
}
| {
"array_type": 0,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 15,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 11,
"struct_type": 0,
"switch_statement": 1,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
screen-4.9.0#list_generic_prep#glist_remove_rows.c | screen-4.9.0 | list_generic.c | glist_remove_rows | 13 | void
glist_remove_rows(struct ListData *ldata)
{
struct ListRow *row;
for (row = ldata->root; row; )
{
struct ListRow *r = row;
row = row->next;
ldata->list_fn->gl_freerow(ldata, r);
free(r);
}
ldata->root = ldata->selected = ldata->top = ((void *)0);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 1,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 0,
"struct_type": 3,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#MAXIMIZE_VOLUME_CUBOID_GIVEN_SUM_SIDES_1_prep#max.c | transcoder-set | MAXIMIZE_VOLUME_CUBOID_GIVEN_SUM_SIDES_1.c | max | 1 | int max(int x, int y) { return (x > y)? x: y; }
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#PROGRAM_FOR_FACTORIAL_OF_A_NUMBER_2_prep#len.c | transcoder-set | PROGRAM_FOR_FACTORIAL_OF_A_NUMBER_2.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#CALCULATE_AREA_TETRAHEDRON_prep#main.c | transcoder-set | CALCULATE_AREA_TETRAHEDRON.c | main | 14 | int main(void) {
int n_success = 0;
int param0[] = {58,56,35,99,13,45,40,92,7,13};
for(int i = 0; i < len(param0); ++i)
{
if(abs(1 - (0.0000001 + abs(f_gold(param0[i])) )/ (abs(f_filled(param0[i])) + 0.0000001)) < 0.001)
{
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
} |
diffutils-3.10#util_prep#print_1_line_nl.c | diffutils-3.10 | util.c | print_1_line_nl | 24 | void
print_1_line_nl (char const *line_flag, char const *const *line, _Bool skip_nl)
{
char const *base = line[0], *limit = line[1];
FILE *out = outfile;
char const *flag_format = 0;
if (line_flag && *line_flag)
{
char const *flag_format_1 = flag_format = initial_tab ? "%s\t" : "%s ";
char const *line_flag_1 = line_flag;
if (suppress_blank_empty && **line == '\n')
{
flag_format_1 = "%s";
line_flag_1 += *line_flag_1 == ' ';
}
fprintf (out, flag_format_1, line_flag_1);
}
output_1_line (base, limit - (skip_nl && limit[-1] == '\n'), flag_format, line_flag);
if ((!line_flag || line_flag[0]) && limit[-1] != '\n')
{
set_color_context (RESET_CONTEXT);
fprintf (out, "\n\\ %s\n", gettext ("No newline at end of file"));
}
}
| {
"array_type": 2,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 6,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
pexec-1.0rc8#fifo_prep#fifo_read.c | pexec-1.0rc8 | fifo.c | fifo_read | 22 | size_t fifo_read(fifo *f,void *vbuffer,size_t size)
{
unsigned char *buffer=(unsigned char *)vbuffer;
size_t rsize,rsize0,msize;
if ( size<f->wrts ) rsize=size;
else rsize=f->wrts;
rsize0=rsize;
while ( rsize>0 )
{ msize=f->size-f->rpnt;
if ( rsize<msize ) msize=rsize;
if ( buffer != ((void *)0) )
{ memcpy(buffer,f->buffer+f->rpnt,msize);
buffer+=msize;
}
f->rpnt+=msize;
f->wrts-=msize;
if ( f->rpnt >= f->size )
f->rpnt=0;
rsize-=msize;
}
return(rsize0);
}
| {
"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": 1,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 1
} |
transcoder-set#DETECT_IF_TWO_INTEGERS_HAVE_OPPOSITE_SIGNS_prep#min.c | transcoder-set | DETECT_IF_TWO_INTEGERS_HAVE_OPPOSITE_SIGNS.c | min | 1 | int min(int x, int y) { return (x < y)? x: y; }
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#SEQUENCES_GIVEN_LENGTH_EVERY_ELEMENT_EQUAL_TWICE_PREVIOUS_1_prep#main.c | transcoder-set | SEQUENCES_GIVEN_LENGTH_EVERY_ELEMENT_EQUAL_TWICE_PREVIOUS_1.c | main | 15 | int main(void) {
int n_success = 0;
int param0[] = {10,5,2,83,91,18,83,98,43,31};
int param1[] = {4,2,8,7,0,53,41,53,37,20};
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
} |
nettle-3.9.1#poly1305-update_prep#_nettle_poly1305_update.c | nettle-3.9.1 | poly1305-update.c | _nettle_poly1305_update | 15 | unsigned
_nettle_poly1305_update (struct poly1305_ctx *ctx,
uint8_t *block, unsigned index,
size_t length, const uint8_t *m)
{
if (index > 0)
{
do { unsigned __md_left = (16) - (index); if ((length) < __md_left) { memcpy(block + (index), (m), (length)); return (index) + (length); } memcpy((block) + (index), (m), __md_left); (m) += __md_left; (length) -= __md_left; } while(0);
_nettle_poly1305_block(ctx, block, 1);
}
m = _nettle_poly1305_blocks (ctx, length >> 4, m);
length &= 15;
memcpy (block, m, length);
return length;
}
| {
"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": 2,
"pointer_type": 0,
"return_statement": 2,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
gprolog-1.5.0#fd_range_prep#Pl_Vector_Empty.c | gprolog-1.5.0 | fd_range.c | Pl_Vector_Empty | 8 | void
Pl_Vector_Empty(Vector vec)
{
Vector end = vec + pl_vec_size;
do
*vec++ = 0;
while (vec < end);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
libxml2#xmlreader_prep#xmlTextReaderConstLocalName.c | libxml2 | xmlreader.c | xmlTextReaderConstLocalName | 21 | const xmlChar *
xmlTextReaderConstLocalName(xmlTextReaderPtr reader) {
xmlNodePtr node;
if ((reader == ((void *)0)) || (reader->node == ((void *)0)))
return(((void *)0));
if (reader->curnode != ((void *)0))
node = reader->curnode;
else
node = reader->node;
if (node->type == XML_NAMESPACE_DECL) {
xmlNsPtr ns = (xmlNsPtr) node;
if (ns->prefix == ((void *)0))
return(constString(reader, (xmlChar *) "xmlns"));
else
return(ns->prefix);
}
if ((node->type != XML_ELEMENT_NODE) &&
(node->type != XML_ATTRIBUTE_NODE))
return(xmlTextReaderConstName(reader));
return(node->name);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 5,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 5,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#MAXIMUM_CONSECUTIVE_REPEATING_CHARACTER_STRING_prep#max.c | transcoder-set | MAXIMUM_CONSECUTIVE_REPEATING_CHARACTER_STRING.c | max | 1 | int max(int x, int y) { return (x > y)? x: y; }
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#LONGEST_COMMON_SUBSTRING_SPACE_OPTIMIZED_DP_SOLUTION_prep#cmpfunc.c | transcoder-set | LONGEST_COMMON_SUBSTRING_SPACE_OPTIMIZED_DP_SOLUTION.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_xmlUCSIsArrows.c | libxml2 | libxml2-py.c | libxml_xmlUCSIsArrows | 13 | PyObject *
libxml_xmlUCSIsArrows(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
int c_retval;
int code;
if (libxml_deprecationWarning("xmlUCSIsArrows") == -1)
return(((void *)0));
if (!_PyArg_ParseTuple_SizeT(args, (char *)"i:xmlUCSIsArrows", &code))
return(((void *)0));
c_retval = xmlUCSIsArrows(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
} |
hello-2.12.1#version-etc_prep#version_etc_ar.c | hello-2.12.1 | version-etc.c | version_etc_ar | 10 | void
version_etc_ar (FILE *stream,
const char *command_name, const char *package,
const char *version, const char * const * authors)
{
size_t n_authors;
for (n_authors = 0; authors[n_authors]; n_authors++)
;
version_etc_arn (stream, command_name, package, version, authors, n_authors);
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#FIND_FIRST_NATURAL_NUMBER_WHOSE_FACTORIAL_DIVISIBLE_X_prep#main.c | transcoder-set | FIND_FIRST_NATURAL_NUMBER_WHOSE_FACTORIAL_DIVISIBLE_X.c | main | 13 | int main(void) {
int n_success = 0;
int param0[] = {67,47,57,89,67,40,16,83,93,43};
for(int i = 0; i < len(param0); ++i)
{
if(f_filled(param0[i]) == f_gold(param0[i]))
{
n_success+=1;
}
}
printf("#Results:", " ", n_success, ", ", len(param0));
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": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
tulipindicators-0.9.1#cos_prep#ti_cos_start.c | tulipindicators-0.9.1 | cos.c | ti_cos_start | 1 | int ti_cos_start(double const *options) { (void)options; return 0; }
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
optipng-0.7.8#ioutil_prep#opng_os_copy_file_attr.c | optipng-0.7.8 | ioutil.c | opng_os_copy_file_attr | 22 | int
opng_os_copy_file_attr(const char *src_path, const char *dest_path)
{
struct stat sbuf;
int result;
if (stat(src_path, &sbuf) != 0)
return -1;
result = 0;
if (chown(dest_path, sbuf.st_uid, sbuf.st_gid) != 0)
{
}
if (chmod(dest_path, sbuf.st_mode) != 0)
result = -1;
{
struct timespec times[2];
times[0] = sbuf.st_atim;
times[1] = sbuf.st_mtim;
if (utimensat(-100, dest_path, times, 0) != 0)
result = -1;
}
return result;
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 4,
"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
} |
tulipindicators-0.9.1#benchmark_prep#ppo_option_setter.c | tulipindicators-0.9.1 | benchmark.c | ppo_option_setter | 5 | void ppo_option_setter(double period, double *options, int ti) {
(void)ti;
options[0] = period;
options[1] = period + 10;
}
| {
"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": 1,
"union_type": 0,
"while_loop": 0
} |
json.h#allow_location_information_prep#json_extract_value.c | json.h | allow_location_information.c | json_extract_value | 3 | struct json_value_s *json_extract_value(const struct json_value_s *value) {
return json_extract_value_ex(value, 0, 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
} |
screen-4.9.0#utmp_prep#RemoveUtmp.c | screen-4.9.0 | utmp.c | RemoveUtmp | 35 | int
RemoveUtmp(wi)
struct win *wi;
{
struct utmp u, *uu;
slot_t slot;
slot = wi->w_slot;
do {} while (0);
if (!utmpok)
return -1;
if (slot == (slot_t)0 || slot == (slot_t)-1)
{
wi->w_slot = (slot_t)-1;
return 0;
}
bzero((char *) &u, sizeof(u));
if ((uu = getutslot(slot)) == 0)
{
Msg(0, "Utmp slot not found -> not removed");
return -1;
}
bcopy((char *)uu, (char *)&wi->w_savut, sizeof(wi->w_savut));
u = *uu;
makedead(&u);
if (pututslot(slot, &u, (char *)0, wi) == 0)
{
Msg((*__errno_location ()),"Could not write %s", UtmpName);
;
return -1;
}
do {} while (0);
wi->w_slot = (slot_t)-1;
;
return 0;
}
| {
"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": 2,
"return_statement": 5,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 2
} |
nettle-3.9.1#siv-gcm_prep#nettle_siv_gcm_decrypt_message.c | nettle-3.9.1 | siv-gcm.c | nettle_siv_gcm_decrypt_message | 28 | int
nettle_siv_gcm_decrypt_message (const struct nettle_cipher *nc,
const void *ctx,
void *ctr_ctx,
size_t nlength, const uint8_t *nonce,
size_t alength, const uint8_t *adata,
size_t mlength, uint8_t *dst, const uint8_t *src)
{
union nettle_block16 authentication_key;
uint8_t *encryption_key;
union nettle_block16 state;
uint8_t tag[16];
((void) sizeof ((nlength == 12) ? 1 : 0), __extension__ ({ if (nlength == 12) ; else __assert_fail ("nlength == SIV_GCM_NONCE_SIZE", "siv-gcm.c", 204, __extension__ __PRETTY_FUNCTION__); }));
(encryption_key = __builtin_alloca (sizeof (*encryption_key) * (nc->key_size)));
siv_gcm_derive_keys (ctx, nc->encrypt, nc->key_size, nlength, nonce,
&authentication_key, encryption_key);
memcpy (state.b, src + mlength, 16);
state.b[15] |= 0x80;
nc->set_encrypt_key (ctr_ctx, encryption_key);
_nettle_ctr_crypt16 (ctr_ctx, nc->encrypt, siv_gcm_fill, state.b,
mlength, dst, src);
siv_gcm_authenticate (ctr_ctx, nc,
&authentication_key,
nonce, alength, adata,
mlength, dst,
tag);
return nettle_memeql_sec (tag, src + mlength, 16);
}
| {
"array_type": 2,
"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": 1,
"return_statement": 1,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 2,
"while_loop": 0
} |
heman#utility_prep#kmMin.c | heman | utility.c | kmMin | 3 | float kmMin(float lhs, float rhs) {
return (lhs < rhs)? lhs : rhs;
}
| {
"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#div_prep#ti_div.c | tulipindicators-0.9.1 | div.c | ti_div | 1 | int ti_div(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
} |
wget-1.21.4#gnutls_prep#ssl_cleanup.c | wget-1.21.4 | gnutls.c | ssl_cleanup | 10 | void
ssl_cleanup (void)
{
if (!ssl_initialized)
return;
if (credentials)
gnutls_certificate_free_credentials(credentials);
gnutls_global_deinit();
ssl_initialized = 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": 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.