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#NEXT_POWER_OF_2_2_prep#min.c | transcoder-set | NEXT_POWER_OF_2_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
} |
transcoder-set#COUNTING_PAIRS_PERSON_CAN_FORM_PAIR_ONE_1_prep#sort.c | transcoder-set | COUNTING_PAIRS_PERSON_CAN_FORM_PAIR_ONE_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
} |
gawk-5.2.2#array_prep#indent.c | gawk-5.2.2 | array.c | indent | 7 | void
indent(int indent_level)
{
int i;
for (i = 0; i < indent_level; i++)
fprintf(output_fp, "%s", indent_char);
}
| {
"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": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
uucp-1.07#debug_prep#cdebug_char.c | uucp-1.07 | debug.c | cdebug_char | 37 | size_t
cdebug_char (z, ichar)
char *z;
int ichar;
{
char b;
if (((*__ctype_b_loc ())[(int) ((((unsigned char) (ichar))))] & (unsigned short int) _ISprint)
&& ichar != '\"'
&& ichar != '\\')
{
*z++ = (char) ichar;
*z = '\0';
return 1;
}
*z++ = '\\';
switch (ichar)
{
case '\n':
b = 'n';
break;
case '\r':
b = 'r';
break;
case '\"':
b = '\"';
break;
case '\\':
b = '\\';
break;
default:
sprintf (z, "%03o", (unsigned int) ((unsigned char) (ichar)));
return strlen (z) + 1;
}
*z++ = b;
*z = '\0';
return 2;
}
| {
"array_type": 0,
"break_continue_statement": 4,
"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": 3,
"struct_type": 0,
"switch_statement": 1,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
libxml2#libxml2-py_prep#libxml_xmlFreeProp.c | libxml2 | libxml2-py.c | libxml_xmlFreeProp | 11 | PyObject *
libxml_xmlFreeProp(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
xmlAttrPtr cur;
PyObject *pyobj_cur;
if (!_PyArg_ParseTuple_SizeT(args, (char *)"O:xmlFreeProp", &pyobj_cur))
return(((void *)0));
cur = (xmlAttrPtr) (((pyobj_cur) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyxmlNode_Object *)(pyobj_cur))->obj));
xmlFreeProp(cur);
_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
} |
json.h#allow_leading_or_trailing_decimal_point_prep#utest_run_allow_leading_or_trailing_decimal_point_read_write_minified_read.c | json.h | allow_leading_or_trailing_decimal_point.c | utest_run_allow_leading_or_trailing_decimal_point_read_write_minified_read | 7 | void utest_run_allow_leading_or_trailing_decimal_point_read_write_minified_read(int *utest_result, struct allow_leading_or_trailing_decimal_point *utest_fixture) {
size_t size = 0;
void *json = json_write_minified(utest_fixture->value, &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#WAYS_TRANSFORMING_ONE_STRING_REMOVING_0_CHARACTERS_prep#len.c | transcoder-set | WAYS_TRANSFORMING_ONE_STRING_REMOVING_0_CHARACTERS.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#MINIMUM_XOR_VALUE_PAIR_1_prep#max.c | transcoder-set | MINIMUM_XOR_VALUE_PAIR_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
} |
json.h#allow_location_information_prep#utest_should_filter_test.c | json.h | allow_location_information.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
} |
enscript-1.6.6#gram_prep#yyparse.c | enscript-1.6.6 | gram.c | yyparse | 459 | int
yyparse (void)
{
int yystate;
int yyerrstatus;
yytype_int16 yyssa[200];
yytype_int16 *yyss;
yytype_int16 *yyssp;
YYSTYPE yyvsa[200];
YYSTYPE *yyvs;
YYSTYPE *yyvsp;
long unsigned int yystacksize;
int yyn;
int yyresult;
int yytoken;
YYSTYPE yyval;
int yylen = 0;
yytoken = 0;
yyss = yyssa;
yyvs = yyvsa;
yystacksize = 200;
;
yystate = 0;
yyerrstatus = 0;
yynerrs = 0;
yychar = (-2);
yyssp = yyss;
yyvsp = yyvs;
goto yysetstate;
yynewstate:
yyssp++;
yysetstate:
*yyssp = yystate;
if (yyss + yystacksize - 1 <= yyssp)
{
long unsigned int yysize = yyssp - yyss + 1;
if (10000 <= yystacksize)
goto yyexhaustedlab;
yystacksize *= 2;
if (10000 < yystacksize)
yystacksize = 10000;
{
yytype_int16 *yyss1 = yyss;
union yyalloc *yyptr =
(union yyalloc *) malloc (((yystacksize) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) + (sizeof (union yyalloc) - 1)));
if (! yyptr)
goto yyexhaustedlab;
do { long unsigned int yynewbytes; __builtin_memcpy (&yyptr->yyss_alloc, yyss, (yysize) * sizeof (*(yyss))); yyss = &yyptr->yyss_alloc; yynewbytes = yystacksize * sizeof (*yyss) + (sizeof (union yyalloc) - 1); yyptr += yynewbytes / sizeof (*yyptr); } while ((0));
do { long unsigned int yynewbytes; __builtin_memcpy (&yyptr->yyvs_alloc, yyvs, (yysize) * sizeof (*(yyvs))); yyvs = &yyptr->yyvs_alloc; yynewbytes = yystacksize * sizeof (*yyvs) + (sizeof (union yyalloc) - 1); yyptr += yynewbytes / sizeof (*yyptr); } while ((0));
if (yyss1 != yyssa)
free (yyss1);
}
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
;
if (yyss + yystacksize - 1 <= yyssp)
goto yyabortlab;
}
;
if (yystate == 2)
goto yyacceptlab;
goto yybackup;
yybackup:
yyn = yypact[yystate];
if (((yyn) == (-41)))
goto yydefault;
if (yychar == (-2))
{
;
yychar = yylex ();
}
if (yychar <= 0)
{
yychar = yytoken = 0;
;
}
else
{
yytoken = ((unsigned int) (yychar) <= 289 ? yytranslate[yychar] : 2);
;
}
yyn += yytoken;
if (yyn < 0 || 571 < yyn || yycheck[yyn] != yytoken)
goto yydefault;
yyn = yytable[yyn];
if (yyn <= 0)
{
if ((0))
goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
if (yyerrstatus)
yyerrstatus--;
;
yychar = (-2);
yystate = yyn;
*++yyvsp = yylval;
goto yynewstate;
yydefault:
yyn = yydefact[yystate];
if (yyn == 0)
goto yyerrlab;
goto yyreduce;
yyreduce:
yylen = yyr2[yyn];
yyval = yyvsp[1-yylen];
;
switch (yyn)
{
case 4:
{ start_stmts = (yyvsp[(3) - (4)].lst); }
break;
case 5:
{ startrules = (yyvsp[(3) - (4)].lst); }
break;
case 6:
{ namerules = (yyvsp[(3) - (4)].lst); }
break;
case 7:
{ define_state ((yyvsp[(2) - (5)].node), ((void *)0), (yyvsp[(4) - (5)].lst)); }
break;
case 8:
{ define_state ((yyvsp[(2) - (7)].node), (yyvsp[(4) - (7)].node), (yyvsp[(6) - (7)].lst)); }
break;
case 9:
{ list_append (global_stmts, (yyvsp[(1) - (1)].stmt)); }
break;
case 10:
{ (yyval.lst) = list (); }
break;
case 11:
{ list_append ((yyvsp[(1) - (4)].lst), cons ((yyvsp[(2) - (4)].node), (yyvsp[(3) - (4)].node))); }
break;
case 12:
{ (yyval.lst) = list (); }
break;
case 13:
{ list_append ((yyvsp[(1) - (2)].lst), (yyvsp[(2) - (2)].cons)); }
break;
case 14:
{ (yyval.cons) = cons (((void *) 0), (yyvsp[(3) - (4)].lst)); }
break;
case 15:
{ (yyval.cons) = cons (((void *) 1), (yyvsp[(3) - (4)].lst)); }
break;
case 16:
{ (yyval.cons) = cons ((yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].lst)); }
break;
case 17:
{ (yyval.cons) = cons ((yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].lst)); }
break;
case 18:
{ (yyval.lst) = list (); }
break;
case 19:
{ (yyval.lst) = (yyvsp[(1) - (1)].lst); }
break;
case 20:
{ (yyval.lst) = list (); list_append ((yyval.lst), (yyvsp[(1) - (1)].node)); }
break;
case 21:
{ list_append ((yyvsp[(1) - (3)].lst), (yyvsp[(3) - (3)].node)); }
break;
case 22:
{ (yyval.lst) = list (); }
break;
case 23:
{ (yyval.lst) = (yyvsp[(2) - (3)].lst); }
break;
case 24:
{ (yyval.lst) = list (); list_append ((yyval.lst), (yyvsp[(1) - (1)].cons)); }
break;
case 25:
{ list_append ((yyvsp[(1) - (3)].lst), (yyvsp[(3) - (3)].cons)); }
break;
case 26:
{ (yyval.cons) = cons ((yyvsp[(1) - (1)].node), ((void *)0)); }
break;
case 27:
{ (yyval.cons) = cons ((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].expr)); }
break;
case 28:
{ (yyval.lst) = list (); }
break;
case 29:
{ list_append ((yyvsp[(1) - (2)].lst), (yyvsp[(2) - (2)].stmt)); }
break;
case 30:
{ (yyval.stmt) = mk_stmt (sRETURN, ((void *)0), ((void *)0),
((void *)0), ((void *)0)); }
break;
case 31:
{ (yyval.stmt) = mk_stmt (sRETURN, (yyvsp[(2) - (3)].expr), ((void *)0),
((void *)0), ((void *)0)); }
break;
case 32:
{ (yyval.stmt) = mk_stmt (sDEFSUB, (yyvsp[(2) - (9)].node),
cons (cons ((yyvsp[(4) - (9)].lst), (yyvsp[(7) - (9)].lst)),
(yyvsp[(8) - (9)].lst)),
((void *)0), ((void *)0)); }
break;
case 33:
{ (yyval.stmt) = mk_stmt (sBLOCK, (yyvsp[(2) - (3)].lst), ((void *)0),
((void *)0), ((void *)0)); }
break;
case 34:
{ (yyval.stmt) = mk_stmt (sIF, (yyvsp[(3) - (5)].expr), (yyvsp[(5) - (5)].stmt), ((void *)0),
((void *)0)); }
break;
case 35:
{ (yyval.stmt) = mk_stmt (sIF, (yyvsp[(3) - (7)].expr), (yyvsp[(5) - (7)].stmt), (yyvsp[(7) - (7)].stmt),
((void *)0)); }
break;
case 36:
{ (yyval.stmt) = mk_stmt (sWHILE, (yyvsp[(3) - (5)].expr), (yyvsp[(5) - (5)].stmt),
((void *)0), ((void *)0)); }
break;
case 37:
{ (yyval.stmt) = mk_stmt (sFOR, (yyvsp[(3) - (9)].expr), (yyvsp[(5) - (9)].expr), (yyvsp[(7) - (9)].expr),
(yyvsp[(9) - (9)].stmt)); }
break;
case 38:
{ (yyval.stmt) = mk_stmt (sEXPR, (yyvsp[(1) - (2)].expr), ((void *)0),
((void *)0), ((void *)0)); }
break;
case 39:
{ (yyval.expr) = mk_expr (eSTRING, (yyvsp[(1) - (1)].node), ((void *)0),
((void *)0)); }
break;
case 40:
{ (yyval.expr) = mk_expr (eREGEXP, (yyvsp[(1) - (1)].node), ((void *)0),
((void *)0)); }
break;
case 41:
{ (yyval.expr) = mk_expr (eINTEGER, (yyvsp[(1) - (1)].node), ((void *)0),
((void *)0)); }
break;
case 42:
{ (yyval.expr) = mk_expr (eREAL, (yyvsp[(1) - (1)].node), ((void *)0),
((void *)0)); }
break;
case 43:
{ (yyval.expr) = mk_expr (eSYMBOL, (yyvsp[(1) - (1)].node), ((void *)0),
((void *)0)); }
break;
case 44:
{ (yyval.expr) = mk_expr (eNOT, (yyvsp[(2) - (2)].expr), ((void *)0),
((void *)0)); }
break;
case 45:
{ (yyval.expr) = mk_expr (eAND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), ((void *)0)); }
break;
case 46:
{ (yyval.expr) = mk_expr (eOR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), ((void *)0)); }
break;
case 47:
{ (yyval.expr) = mk_expr (eFCALL, (yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].lst),
((void *)0)); }
break;
case 48:
{ (yyval.expr) = mk_expr (eASSIGN, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].expr),
((void *)0)); }
break;
case 49:
{ (yyval.expr) = mk_expr (eADDASSIGN, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].expr),
((void *)0)); }
break;
case 50:
{ (yyval.expr) = mk_expr (eSUBASSIGN, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].expr),
((void *)0)); }
break;
case 51:
{ (yyval.expr) = mk_expr (eMULASSIGN, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].expr),
((void *)0)); }
break;
case 52:
{ (yyval.expr) = mk_expr (eDIVASSIGN, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].expr),
((void *)0)); }
break;
case 53:
{ (yyval.expr) = mk_expr (ePOSTFIXADD, (yyvsp[(1) - (2)].node), ((void *)0),
((void *)0)); }
break;
case 54:
{ (yyval.expr) = mk_expr (ePOSTFIXSUB, (yyvsp[(1) - (2)].node), ((void *)0),
((void *)0)); }
break;
case 55:
{ (yyval.expr) = mk_expr (ePREFIXADD, (yyvsp[(2) - (2)].node), ((void *)0),
((void *)0)); }
break;
case 56:
{ (yyval.expr) = mk_expr (ePREFIXSUB, (yyvsp[(2) - (2)].node), ((void *)0),
((void *)0)); }
break;
case 57:
{ (yyval.expr) = mk_expr (eARRAYASSIGN, (yyvsp[(1) - (6)].expr), (yyvsp[(3) - (6)].expr),
(yyvsp[(6) - (6)].expr)); }
break;
case 58:
{ (yyval.expr) = (yyvsp[(2) - (3)].expr); }
break;
case 59:
{ (yyval.expr) = mk_expr (eARRAYREF, (yyvsp[(1) - (4)].expr), (yyvsp[(3) - (4)].expr),
((void *)0)); }
break;
case 60:
{ (yyval.expr) = mk_expr (eQUESTCOLON, (yyvsp[(1) - (5)].expr), (yyvsp[(3) - (5)].expr),
(yyvsp[(5) - (5)].expr)); }
break;
case 61:
{ (yyval.expr) = mk_expr (eMULT, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), ((void *)0)); }
break;
case 62:
{ (yyval.expr) = mk_expr (eDIV, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), ((void *)0)); }
break;
case 63:
{ (yyval.expr) = mk_expr (ePLUS, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), ((void *)0)); }
break;
case 64:
{ (yyval.expr) = mk_expr (eMINUS, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr),
((void *)0)); }
break;
case 65:
{ (yyval.expr) = mk_expr (eLT, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), ((void *)0)); }
break;
case 66:
{ (yyval.expr) = mk_expr (eGT, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), ((void *)0)); }
break;
case 67:
{ (yyval.expr) = mk_expr (eEQ, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), ((void *)0)); }
break;
case 68:
{ (yyval.expr) = mk_expr (eNE, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), ((void *)0)); }
break;
case 69:
{ (yyval.expr) = mk_expr (eGE, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), ((void *)0)); }
break;
case 70:
{ (yyval.expr) = mk_expr (eLE, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr), ((void *)0)); }
break;
case 71:
{ (yyval.expr) = ((void *)0); }
break;
case 72:
{ (yyval.expr) = (yyvsp[(1) - (1)].expr); }
break;
case 73:
{ (yyval.lst) = list (); }
break;
case 74:
{ (yyval.lst) = (yyvsp[(1) - (1)].lst); }
break;
case 75:
{ (yyval.lst) = list (); list_append ((yyval.lst), (yyvsp[(1) - (1)].expr)); }
break;
case 76:
{ list_append ((yyvsp[(1) - (3)].lst), (yyvsp[(3) - (3)].expr)); }
break;
default: break;
}
;
(yyvsp -= (yylen), yyssp -= (yylen));
yylen = 0;
;
*++yyvsp = yyval;
yyn = yyr1[yyn];
yystate = yypgoto[yyn - 52] + *yyssp;
if (0 <= yystate && yystate <= 571 && yycheck[yystate] == *yyssp)
yystate = yytable[yystate];
else
yystate = yydefgoto[yyn - 52];
goto yynewstate;
yyerrlab:
yytoken = yychar == (-2) ? (-2) : ((unsigned int) (yychar) <= 289 ? yytranslate[yychar] : 2);
if (!yyerrstatus)
{
++yynerrs;
yyerror ("syntax error");
}
if (yyerrstatus == 3)
{
if (yychar <= 0)
{
if (yychar == 0)
goto yyabortlab;
}
else
{
yydestruct ("Error: discarding",
yytoken, &yylval);
yychar = (-2);
}
}
goto yyerrlab1;
yyerrorlab:
if ( 0)
goto yyerrorlab;
(yyvsp -= (yylen), yyssp -= (yylen));
yylen = 0;
;
yystate = *yyssp;
goto yyerrlab1;
yyerrlab1:
yyerrstatus = 3;
for (;;)
{
yyn = yypact[yystate];
if (!((yyn) == (-41)))
{
yyn += 1;
if (0 <= yyn && yyn <= 571 && yycheck[yyn] == 1)
{
yyn = yytable[yyn];
if (0 < yyn)
break;
}
}
if (yyssp == yyss)
goto yyabortlab;
yydestruct ("Error: popping",
yystos[yystate], yyvsp);
(yyvsp -= (1), yyssp -= (1));
yystate = *yyssp;
;
}
*++yyvsp = yylval;
;
yystate = yyn;
goto yynewstate;
yyacceptlab:
yyresult = 0;
goto yyreturn;
yyabortlab:
yyresult = 1;
goto yyreturn;
yyexhaustedlab:
yyerror ("memory exhausted");
yyresult = 2;
yyreturn:
if (yychar != (-2))
{
yytoken = ((unsigned int) (yychar) <= 289 ? yytranslate[yychar] : 2);
yydestruct ("Cleanup: discarding lookahead",
yytoken, &yylval);
}
(yyvsp -= (yylen), yyssp -= (yylen));
;
while (yyssp != yyss)
{
yydestruct ("Cleanup: popping",
yystos[*yyssp], yyvsp);
(yyvsp -= (1), yyssp -= (1));
}
if (yyss != yyssa)
free (yyss);
return (yyresult);
}
| {
"array_type": 10,
"break_continue_statement": 75,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 22,
"if_statement": 27,
"memory_management": 3,
"memory_operation": 0,
"pointer_type": 6,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 1,
"type_casting": 61,
"union_type": 4,
"while_loop": 3
} |
less-633#optfunc_prep#opt_o.c | less-633 | optfunc.c | opt_o | 45 | void opt_o(int type, char *s)
{
PARG parg;
char *filename;
if (secure)
{
error("log file support is not available", ((PARG *)((void *)0)));
return;
}
switch (type)
{
case 0:
namelogfile = save(s);
break;
case 2:
if (ch_getflags() & 001)
{
error("Input is not a pipe", ((PARG *)((void *)0)));
return;
}
if (logfile >= 0)
{
error("Log file is already in use", ((PARG *)((void *)0)));
return;
}
s = skipsp(s);
if (namelogfile != ((void *)0))
free(namelogfile);
filename = lglob(s);
namelogfile = shell_unquote(filename);
free(filename);
use_logfile(namelogfile);
sync_logfile();
break;
case 1:
if (logfile < 0)
error("No log file", ((PARG *)((void *)0)));
else
{
parg.p_string = namelogfile;
error("Log file \"%s\"", &parg);
}
break;
}
}
| {
"array_type": 0,
"break_continue_statement": 3,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 5,
"memory_management": 2,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 1,
"type_casting": 5,
"union_type": 0,
"while_loop": 0
} |
libxml2#libxml2-py_prep#libxml_xmlXIncludeProcessTree.c | libxml2 | libxml2-py.c | libxml_xmlXIncludeProcessTree | 13 | PyObject *
libxml_xmlXIncludeProcessTree(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
int c_retval;
xmlNodePtr tree;
PyObject *pyobj_tree;
if (!_PyArg_ParseTuple_SizeT(args, (char *)"O:xmlXIncludeProcessTree", &pyobj_tree))
return(((void *)0));
tree = (xmlNodePtr) (((pyobj_tree) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyxmlNode_Object *)(pyobj_tree))->obj));
c_retval = xmlXIncludeProcessTree(tree);
py_retval = libxml_intWrap((int) c_retval);
return(py_retval);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
wget-1.21.4#ftp-basic_prep#ftp_process_type.c | wget-1.21.4 | ftp-basic.c | ftp_process_type | 10 | char
ftp_process_type (const char *params)
{
if (params
&& 0 == strncasecmp (params, "type=", 5)
&& params[5] != '\0')
return c_toupper (params[5]);
else
return 'I';
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#DYNAMIC_PROGRAMMING_SET_14_MAXIMUM_SUM_INCREASING_SUBSEQUENCE_prep#len.c | transcoder-set | DYNAMIC_PROGRAMMING_SET_14_MAXIMUM_SUM_INCREASING_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
} |
nano-7.2#chars_prep#has_blank_char.c | nano-7.2 | chars.c | has_blank_char | 6 | _Bool has_blank_char(const char *string)
{
while (*string != '\0' && !is_blank_char(string))
string += char_length(string);
return *string;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
transcoder-set#NUMBER_RECTANGLES_NM_GRID_prep#f_filled.c | transcoder-set | NUMBER_RECTANGLES_NM_GRID.c | f_filled | 1 | int f_filled ( int n, int m ) {}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
nettle-3.9.1#ocb-aes128_prep#nettle_ocb_aes128_update.c | nettle-3.9.1 | ocb-aes128.c | nettle_ocb_aes128_update | 7 | void
nettle_ocb_aes128_update (struct ocb_ctx *ctx, const struct ocb_aes128_encrypt_key *key,
size_t length, const uint8_t *data)
{
nettle_ocb_update (ctx, &key->ocb, &key->encrypt, (nettle_cipher_func *) nettle_aes128_encrypt,
length, data);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
json-c#arraylist_prep#array_list_new2.c | json-c | arraylist.c | array_list_new2 | 18 | struct array_list *array_list_new2(array_list_free_fn *free_fn, int initial_size)
{
struct array_list *arr;
if (initial_size < 0 || (size_t)initial_size >= (0x7fffffffffffffffL * 2UL + 1UL) / sizeof(void *))
return ((void *)0);
arr = (struct array_list *)malloc(sizeof(struct array_list));
if (!arr)
return ((void *)0);
arr->size = initial_size;
arr->length = 0;
arr->free_fn = free_fn;
if (!(arr->array = (void **)malloc(arr->size * sizeof(void *))))
{
free(arr);
return ((void *)0);
}
return arr;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 3,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 4,
"struct_type": 2,
"switch_statement": 0,
"type_casting": 6,
"union_type": 0,
"while_loop": 0
} |
libxml2#xmlregexp_prep#xmlRegNewExecCtxt.c | libxml2 | xmlregexp.c | xmlRegNewExecCtxt | 46 | xmlRegExecCtxtPtr
xmlRegNewExecCtxt(xmlRegexpPtr comp, xmlRegExecCallbacks callback, void *data) {
xmlRegExecCtxtPtr exec;
if (comp == ((void *)0))
return(((void *)0));
if ((comp->compact == ((void *)0)) && (comp->states == ((void *)0)))
return(((void *)0));
exec = (xmlRegExecCtxtPtr) xmlMalloc(sizeof(xmlRegExecCtxt));
if (exec == ((void *)0))
return(((void *)0));
memset(exec, 0, sizeof(xmlRegExecCtxt));
exec->inputString = ((void *)0);
exec->index = 0;
exec->determinist = 1;
exec->maxRollbacks = 0;
exec->nbRollbacks = 0;
exec->rollbacks = ((void *)0);
exec->status = 0;
exec->comp = comp;
if (comp->compact == ((void *)0))
exec->state = comp->states[0];
exec->transno = 0;
exec->transcount = 0;
exec->callback = callback;
exec->data = data;
if (comp->nbCounters > 0) {
exec->counts = (int *) xmlMalloc(comp->nbCounters * sizeof(int)
* 2);
if (exec->counts == ((void *)0)) {
xmlFree(exec);
return(((void *)0));
}
memset(exec->counts, 0, comp->nbCounters * sizeof(int) * 2);
exec->errCounts = &exec->counts[comp->nbCounters];
} else {
exec->counts = ((void *)0);
exec->errCounts = ((void *)0);
}
exec->inputStackMax = 0;
exec->inputStackNr = 0;
exec->inputStack = ((void *)0);
exec->errStateNo = -1;
exec->errString = ((void *)0);
exec->nbPush = 0;
return(exec);
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 6,
"memory_management": 0,
"memory_operation": 2,
"pointer_type": 0,
"return_statement": 5,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 17,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#PROGRAM_AREA_SQUARE_prep#f_filled.c | transcoder-set | PROGRAM_AREA_SQUARE.c | f_filled | 1 | int f_filled ( int side ) {}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#SUM_MANHATTAN_DISTANCES_PAIRS_POINTS_prep#f_filled.c | transcoder-set | SUM_MANHATTAN_DISTANCES_PAIRS_POINTS.c | f_filled | 1 | int f_filled ( int x [ ], int y [ ], 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
} |
nano-7.2#utils_prep#nrealloc.c | nano-7.2 | utils.c | nrealloc | 7 | void *nrealloc(void *section, size_t howmuch)
{
section = realloc(section, 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": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
lodepng#lodepng_prep#lodepng_info_copy.c | lodepng | lodepng.c | lodepng_info_copy | 14 | unsigned lodepng_info_copy(LodePNGInfo* dest, const LodePNGInfo* source) {
lodepng_info_cleanup(dest);
lodepng_memcpy(dest, source, sizeof(LodePNGInfo));
lodepng_color_mode_init(&dest->color);
{ unsigned error = lodepng_color_mode_copy(&dest->color, &source->color); if(error) return error;};
{ unsigned error = LodePNGText_copy(dest, source); if(error) return error;};
{ unsigned error = LodePNGIText_copy(dest, source); if(error) return error;};
if(source->iccp_defined) {
{ unsigned error = lodepng_assign_icc(dest, source->iccp_name, source->iccp_profile, source->iccp_profile_size); if(error) return error;};
}
LodePNGUnknownChunks_init(dest);
{ unsigned error = LodePNGUnknownChunks_copy(dest, source); if(error) return error;};
return 0;
}
| {
"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": 6,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
make-4.4.1#misc_prep#make_pid.c | make-4.4.1 | misc.c | make_pid | 4 | pid_t make_pid ()
{
return getpid ();
}
| {
"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_BINARY_DECIMAL_CONVERSION_prep#max.c | transcoder-set | PROGRAM_BINARY_DECIMAL_CONVERSION.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#FREQUENT_ELEMENT_ARRAY_prep#cmpfunc.c | transcoder-set | FREQUENT_ELEMENT_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
} |
less-633#mark_prep#badmark.c | less-633 | mark.c | badmark | 4 | int badmark(LWCHAR c)
{
return (getmark(c) == ((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_ONE_EXTRA_CHARACTER_STRING_1_prep#len.c | transcoder-set | FIND_ONE_EXTRA_CHARACTER_STRING_1.c | len | 1 | int len (int arr [ ]) {return ((int) (sizeof (arr) / sizeof (arr)[0]));}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
heman#plane_prep#kmPlaneExtractFromMat4.c | heman | plane.c | kmPlaneExtractFromMat4 | 9 | kmPlane* kmPlaneExtractFromMat4(kmPlane* pOut, const struct kmMat4* pIn, int row) {
int scale = (row < 0) ? -1 : 1;
row = abs(row) - 1;
pOut->a = pIn->mat[3] + scale * pIn->mat[row];
pOut->b = pIn->mat[7] + scale * pIn->mat[row + 4];
pOut->c = pIn->mat[11] + scale * pIn->mat[row + 8];
pOut->d = pIn->mat[15] + scale * pIn->mat[row + 12];
return kmPlaneNormalize(pOut, 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
} |
dap-3.10#ps1_prep#pict_axes.c | dap-3.10 | ps1.c | pict_axes | 122 | void pict_axes(pict *p, double minx, double maxx, tick xtick[], int nxticks,
double miny, double maxy, tick ytick[], int nyticks,
char style[], double bpos, double lpos, double tpos, double rpos)
{
double xpos, ypos;
int rmarks, tmarks;
xpos = 0.0;
ypos = 0.0;
rmarks = 0;
tmarks = 0;
if (style[0] == '+' || style[0] == '#')
tmarks = 1;
if (style[1] == '+' || style[1] == '#')
rmarks = 1;
if (style[0] != '=' && style[1] != '=' &&
style[0] != '#' && style[1] != '#')
{
switch (style[0])
{
case '-':
xpos = bpos;
break;
case '+':
xpos = tpos;
break;
case '0':
case 'n':
xpos = 0.0;
break;
}
switch (style[1])
{
case '-':
ypos = lpos;
break;
case '+':
ypos = rpos;
break;
case '0':
case 'n':
ypos = 0.0;
break;
}
switch (style[0])
{
case '-':
case '0':
xaxis(p, minx, maxx, xtick, nxticks, xpos, ypos, 1.0, tmarks);
break;
case '+':
xaxis(p, minx, maxx, xtick, nxticks, xpos, ypos, -1.0, tmarks);
break;
case 'n':
break;
}
switch (style[1])
{
case '-':
case '0':
yaxis(p, miny, maxy, ytick, nyticks, xpos, ypos, 1.0, rmarks);
break;
case '+':
yaxis(p, miny, maxy, ytick, nyticks, xpos, ypos, -1.0, rmarks);
break;
case 'n':
break;
}
}
else if (style[0] != '=' && style[0] != '#')
{
switch (style[0])
{
case '-':
xpos = bpos;
case '0':
yaxis(p, miny, maxy, ytick, nyticks, xpos, lpos, 1.0, rmarks);
xaxis(p, minx, maxx, xtick, nxticks, xpos, lpos, 1.0, tmarks);
xaxis(p, minx, maxx, xtick, nxticks, xpos, rpos, 1.0, tmarks);
yaxis(p, miny, maxy, ytick, nyticks, xpos, rpos, -1.0, rmarks);
break;
case '+':
yaxis(p, miny, maxy, ytick, nyticks, tpos, lpos, 1.0, rmarks);
xaxis(p, minx, maxx, xtick, nxticks, tpos, lpos, -1.0, tmarks);
xaxis(p, minx, maxx, xtick, nxticks, tpos, rpos, -1.0, tmarks);
yaxis(p, miny, maxy, ytick, nyticks, tpos, rpos, -1.0, rmarks);
break;
case 'n':
fputs("(axes) Can't have double y-axes and no x-axis.\n", dap_err);
exit(1);
}
}
else if (style[1] != '=' && style[1] != '#')
{
switch (style[1])
{
case '-':
ypos = lpos;
case '0':
xaxis(p, minx, maxx, xtick, nxticks, bpos, ypos, 1.0, tmarks);
yaxis(p, miny, maxy, ytick, nyticks, bpos, ypos, 1.0, rmarks);
yaxis(p, miny, maxy, ytick, nyticks, tpos, ypos, 1.0, rmarks);
xaxis(p, minx, maxx, xtick, nxticks, tpos, ypos, -1.0, tmarks);
break;
case '+':
xaxis(p, minx, maxx, xtick, nxticks, bpos, rpos, 1.0, tmarks);
yaxis(p, miny, maxy, ytick, nyticks, bpos, rpos, -1.0, rmarks);
yaxis(p, miny, maxy, ytick, nyticks, tpos, rpos, -1.0, rmarks);
xaxis(p, minx, maxx, xtick, nxticks, tpos, rpos, -1.0, tmarks);
break;
case 'n':
fputs("(axes) Can't have double x-axes and no y-axis.\n", dap_err);
exit(1);
}
}
else
{
yaxis(p, miny, maxy, ytick, nyticks, bpos, lpos, 1.0, rmarks);
xaxis(p, minx, maxx, xtick, nxticks, bpos, rpos, 1.0, tmarks);
yaxis(p, miny, maxy, ytick, nyticks, tpos, rpos, -1.0, rmarks);
xaxis(p, minx, maxx, xtick, nxticks, tpos, lpos, -1.0, tmarks);
}
}
| {
"array_type": 1,
"break_continue_statement": 16,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 5,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 6,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libosip2-5.3.1#ict_prep#__osip_ict_init.c | libosip2-5.3.1 | ict.c | __osip_ict_init | 74 | int __osip_ict_init(osip_ict_t **ict, osip_t *osip, osip_message_t *invite) {
osip_route_t *route;
int i;
osip_trace("ict.c", 30, TRACE_LEVEL5, ((void *)0), "allocating ICT context\n");
*ict = (osip_ict_t *) (osip_malloc_func ? osip_malloc_func(sizeof(osip_ict_t)) : malloc(sizeof(osip_ict_t)));
if (*ict == ((void *)0))
return -4;
memset(*ict, 0, sizeof(osip_ict_t));
{
osip_via_t *via;
char *proto;
i = osip_message_get_via(invite, 0, &via);
if (i < 0) {
{ if (*ict != ((void *)0)) { if (osip_free_func) osip_free_func(*ict); else free(*ict); } };
return i;
}
proto = osip_via_get_protocol(via);
if (proto == ((void *)0)) {
{ if (*ict != ((void *)0)) { if (osip_free_func) osip_free_func(*ict); else free(*ict); } };
return -5;
}
if (osip_strcasecmp(proto, "TCP") != 0 && osip_strcasecmp(proto, "TLS") != 0 && osip_strcasecmp(proto, "SCTP") != 0) {
(*ict)->timer_a_length = 500;
if (64 * 500 < 32000)
(*ict)->timer_d_length = 32000;
else
(*ict)->timer_d_length = 64 * 500;
osip_gettimeofday(&(*ict)->timer_a_start, ((void *)0));
add_gettimeofday(&(*ict)->timer_a_start, (*ict)->timer_a_length);
(*ict)->timer_d_start.tv_sec = -1;
} else {
(*ict)->timer_a_length = 500;
(*ict)->timer_d_length = 0;
osip_gettimeofday(&(*ict)->timer_a_start, ((void *)0));
add_gettimeofday(&(*ict)->timer_a_start, (*ict)->timer_a_length);
(*ict)->timer_d_start.tv_sec = -1;
}
}
osip_message_get_route(invite, 0, &route);
if (route != ((void *)0) && route->url != ((void *)0)) {
osip_uri_param_t *lr_param;
osip_uri_param_get_byname((&(route->url)->url_params), "lr", &lr_param);
if (lr_param == ((void *)0)) {
route = ((void *)0);
}
}
if (route != ((void *)0) && route->url != ((void *)0)) {
int port = 5060;
if (route->url->port != ((void *)0))
port = osip_atoi(route->url->port);
osip_ict_set_destination((*ict), osip_strdup(route->url->host), port);
} else {
int port = 5060;
osip_uri_param_t *maddr_param = ((void *)0);
osip_uri_param_t *obr_param = ((void *)0);
osip_uri_param_t *obp_param = ((void *)0);
port = 5060;
if (invite->req_uri->port != ((void *)0))
port = osip_atoi(invite->req_uri->port);
osip_uri_param_get_byname((&(invite->req_uri)->url_params), "x-obr", &obr_param);
osip_uri_param_get_byname((&(invite->req_uri)->url_params), "x-obp", &obp_param);
osip_uri_param_get_byname((&(invite->req_uri)->url_params), "maddr", &maddr_param);
if (maddr_param != ((void *)0) && maddr_param->gvalue != ((void *)0))
osip_ict_set_destination((*ict), osip_strdup(maddr_param->gvalue), port);
else if (obr_param != ((void *)0) && obr_param->gvalue != ((void *)0) && obp_param != ((void *)0) && obp_param->gvalue != ((void *)0))
osip_ict_set_destination((*ict), osip_strdup(obr_param->gvalue), osip_atoi(obp_param->gvalue));
else
osip_ict_set_destination((*ict), osip_strdup(invite->req_uri->host), port);
}
(*ict)->timer_b_length = 64 * 500;
osip_gettimeofday(&(*ict)->timer_b_start, ((void *)0));
add_gettimeofday(&(*ict)->timer_b_start, (*ict)->timer_b_length);
return 0;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 14,
"memory_management": 3,
"memory_operation": 1,
"pointer_type": 7,
"return_statement": 4,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 19,
"union_type": 0,
"while_loop": 0
} |
tar-1.34#exclist_prep#exclude_vcs_ignores.c | tar-1.34 | exclist.c | exclude_vcs_ignores | 7 | void
exclude_vcs_ignores (void)
{
struct vcs_ignore_file *p;
for (p = vcs_ignore_files; p->filename; p++)
excfile_add (p->filename, 0x00);
}
| {
"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": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libxml2#globals_prep#__oldXMLWDcompatibility.c | libxml2 | globals.c | __oldXMLWDcompatibility | 4 | const int *
__oldXMLWDcompatibility(void) {
return &oldXMLWDcompatibility;
}
| {
"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#valid_prep#xmlIsMixedElement.c | libxml2 | valid.c | xmlIsMixedElement | 20 | int
xmlIsMixedElement(xmlDocPtr doc, const xmlChar *name) {
xmlElementPtr elemDecl;
if ((doc == ((void *)0)) || (doc->intSubset == ((void *)0))) return(-1);
elemDecl = xmlGetDtdElementDesc(doc->intSubset, name);
if ((elemDecl == ((void *)0)) && (doc->extSubset != ((void *)0)))
elemDecl = xmlGetDtdElementDesc(doc->extSubset, name);
if (elemDecl == ((void *)0)) return(-1);
switch (elemDecl->etype) {
case XML_ELEMENT_TYPE_UNDEFINED:
return(-1);
case XML_ELEMENT_TYPE_ELEMENT:
return(0);
case XML_ELEMENT_TYPE_EMPTY:
case XML_ELEMENT_TYPE_ANY:
case XML_ELEMENT_TYPE_MIXED:
return(1);
}
return(1);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 6,
"struct_type": 0,
"switch_statement": 1,
"type_casting": 3,
"union_type": 0,
"while_loop": 0
} |
nano-7.2#nano_prep#delete_node.c | nano-7.2 | nano.c | delete_node | 10 | void delete_node(linestruct *line)
{
if (line == openfile->edittop)
openfile->edittop = line->prev;
if (line == openfile->spillage_line)
openfile->spillage_line = ((void *)0);
free(line->data);
free(line->multidata);
free(line);
}
| {
"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": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
tar-1.34#timespec-sub_prep#timespec_sub.c | tar-1.34 | timespec-sub.c | timespec_sub | 34 | struct timespec
timespec_sub (struct timespec a, struct timespec b)
{
time_t rs = a.tv_sec;
time_t bs = b.tv_sec;
int ns = a.tv_nsec - b.tv_nsec;
int rns = ns;
if (ns < 0)
{
rns = ns + TIMESPEC_HZ;
time_t bs1;
if (!__builtin_add_overflow (bs, 1, &bs1))
bs = bs1;
else if (- (! ((time_t) 0 < (time_t) -1)) < rs)
rs--;
else
goto low_overflow;
}
if (__builtin_sub_overflow (rs, bs, &rs))
{
if (0 < bs)
{
low_overflow:
rs = ((time_t) ~ ((time_t) (! (! ((time_t) 0 < (time_t) -1)) ? (time_t) -1 : ((((time_t) 1 << ((sizeof (time_t) * 8) - 2)) - 1) * 2 + 1))));
rns = 0;
}
else
{
rs = ((time_t) (! (! ((time_t) 0 < (time_t) -1)) ? (time_t) -1 : ((((time_t) 1 << ((sizeof (time_t) * 8) - 2)) - 1) * 2 + 1)));
rns = TIMESPEC_HZ - 1;
}
}
return make_timespec (rs, rns);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 1,
"if_statement": 5,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#WRITE_YOU_OWN_POWER_WITHOUT_USING_MULTIPLICATION_AND_DIVISION_prep#f_gold.c | transcoder-set | WRITE_YOU_OWN_POWER_WITHOUT_USING_MULTIPLICATION_AND_DIVISION.c | f_gold | 17 | int f_gold ( int a, int b ) {
if ( b == 0 ) return 1;
int answer = a;
int increment = a;
int i, j;
for ( i = 1;
i < b;
i ++ ) {
for ( j = 1;
j < a;
j ++ ) {
answer += increment;
}
increment = answer;
}
return answer;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 2,
"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#MINIMUM_ROTATIONS_UNLOCK_CIRCULAR_LOCK_prep#f_gold.c | transcoder-set | MINIMUM_ROTATIONS_UNLOCK_CIRCULAR_LOCK.c | f_gold | 12 | int f_gold ( int input, int unlock_code ) {
int rotation = 0;
int input_digit, code_digit;
while ( input || unlock_code ) {
input_digit = input % 10;
code_digit = unlock_code % 10;
rotation += min ( abs ( input_digit - code_digit ), 10 - abs ( input_digit - code_digit ) );
input /= 10;
unlock_code /= 10;
}
return rotation;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
libxml2#libxml2-py_prep#libxml_xmlUCSIsCombiningDiacriticalMarksforSymbols.c | libxml2 | libxml2-py.c | libxml_xmlUCSIsCombiningDiacriticalMarksforSymbols | 13 | PyObject *
libxml_xmlUCSIsCombiningDiacriticalMarksforSymbols(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
int c_retval;
int code;
if (libxml_deprecationWarning("xmlUCSIsCombiningDiacriticalMarksforSymbols") == -1)
return(((void *)0));
if (!_PyArg_ParseTuple_SizeT(args, (char *)"i:xmlUCSIsCombiningDiacriticalMarksforSymbols", &code))
return(((void *)0));
c_retval = xmlUCSIsCombiningDiacriticalMarksforSymbols(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
} |
tar-1.34#renameatu_prep#renameatu.c | tar-1.34 | renameatu.c | renameatu | 67 | int
renameatu (int fd1, char const *src, int fd2, char const *dst,
unsigned int flags)
{
int ret_val = -1;
int err = 22;
ret_val = renameat2 (fd1, src, fd2, dst, flags);
err = (*__errno_location ());
if (! (ret_val < 0 && (err == 22 || err == 38 || err == 95)))
return ret_val;
{
size_t src_len;
size_t dst_len;
char *src_temp = (char *) src;
char *dst_temp = (char *) dst;
_Bool src_slash;
_Bool dst_slash;
int rename_errno = 20;
struct stat src_st;
struct stat dst_st;
_Bool dst_found_nonexistent = 0;
if (flags & ~(1 << 0))
return errno_fail (95);
if ((flags & (1 << 0)) != 0)
{
if (lstatat (fd2, dst, &dst_st) == 0 || (*__errno_location ()) == 75)
return errno_fail (17);
if ((*__errno_location ()) != 2)
return -1;
dst_found_nonexistent = 1;
}
src_len = strlen (src);
dst_len = strlen (dst);
if (!src_len || !dst_len)
return renameat (fd1, src, fd2, dst);
src_slash = src[src_len - 1] == '/';
dst_slash = dst[dst_len - 1] == '/';
if (!src_slash && !dst_slash)
return renameat (fd1, src, fd2, dst);
if (lstatat (fd1, src, &src_st))
return -1;
if (dst_found_nonexistent)
{
if (!((((src_st.st_mode)) & 0170000) == (0040000)))
return errno_fail (2);
}
else if (lstatat (fd2, dst, &dst_st))
{
if ((*__errno_location ()) != 2 || !((((src_st.st_mode)) & 0170000) == (0040000)))
return -1;
}
else if (!((((dst_st.st_mode)) & 0170000) == (0040000)))
return errno_fail (20);
else if (!((((src_st.st_mode)) & 0170000) == (0040000)))
return errno_fail (21);
ret_val = renameat (fd1, src_temp, fd2, dst_temp);
rename_errno = (*__errno_location ());
goto out;
out:
if (src_temp != src)
free (src_temp);
if (dst_temp != dst)
free (dst_temp);
(*__errno_location ()) = rename_errno;
return ret_val;
}
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 1,
"if_statement": 16,
"memory_management": 2,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 12,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#COUNT_NUMBER_WAYS_REACH_GIVEN_SCORE_GAME_prep#cmpfunc.c | transcoder-set | COUNT_NUMBER_WAYS_REACH_GIVEN_SCORE_GAME.c | cmpfunc | 1 | int cmpfunc (const void * a, const void * b) {return ( *(int*)a - *(int*)b );}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
nano-7.2#history_prep#history_init.c | nano-7.2 | history.c | history_init | 15 | void history_init(void)
{
search_history = make_new_node(((void *)0));
search_history->data = copy_of("");
searchtop = search_history;
searchbot = search_history;
replace_history = make_new_node(((void *)0));
replace_history->data = copy_of("");
replacetop = replace_history;
replacebot = replace_history;
execute_history = make_new_node(((void *)0));
execute_history->data = copy_of("");
executetop = execute_history;
executebot = execute_history;
}
| {
"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": 4,
"union_type": 0,
"while_loop": 0
} |
gprolog-1.5.0#stream_supp_prep#Pl_Make_Stream_Tagged_Word.c | gprolog-1.5.0 | stream_supp.c | Pl_Make_Stream_Tagged_Word | 8 | WamWord
Pl_Make_Stream_Tagged_Word(int stm)
{
static WamWord h[2];
h[0] = stream_1;
h[1] = (((PlULong) (stm) << 3) | (PlULong)0x7);
return ((PlLong) (h) + ((PlULong)0x2));
}
| {
"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
} |
gprolog-1.5.0#error_supp_prep#Pl_Set_Last_Syntax_Error.c | gprolog-1.5.0 | error_supp.c | Pl_Set_Last_Syntax_Error | 9 | void
Pl_Set_Last_Syntax_Error(char *file_name, int err_line, int err_col,
char *err_msg)
{
last_err_file = file_name;
last_err_line = err_line;
last_err_col = err_col;
last_err_msg = err_msg;
}
| {
"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
} |
optipng-0.7.8#trees_prep#_tr_init.c | optipng-0.7.8 | trees.c | _tr_init | 12 | void _tr_init(deflate_state *s) {
tr_static_init();
s->l_desc.dyn_tree = s->dyn_ltree;
s->l_desc.stat_desc = &static_l_desc;
s->d_desc.dyn_tree = s->dyn_dtree;
s->d_desc.stat_desc = &static_d_desc;
s->bl_desc.dyn_tree = s->bl_tree;
s->bl_desc.stat_desc = &static_bl_desc;
s->bi_buf = 0;
s->bi_valid = 0;
init_block(s);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libxml2#xpath_prep#xmlXPathNextFollowingSibling.c | libxml2 | xpath.c | xmlXPathNextFollowingSibling | 12 | xmlNodePtr
xmlXPathNextFollowingSibling(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
if ((ctxt == ((void *)0)) || (ctxt->context == ((void *)0))) return(((void *)0));
if ((ctxt->context->node->type == XML_ATTRIBUTE_NODE) ||
(ctxt->context->node->type == XML_NAMESPACE_DECL))
return(((void *)0));
if (cur == (xmlNodePtr) ctxt->context->doc)
return(((void *)0));
if (cur == ((void *)0))
return(ctxt->context->node->next);
return(cur->next);
}
| {
"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": 5,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
json.h#allow_inf_and_nan_prep#json_skip_all_skippables.c | json.h | allow_inf_and_nan.c | json_skip_all_skippables | 31 | int json_skip_all_skippables(struct json_parse_state_s *state) {
int did_consume = 0;
const size_t size = state->size;
if (json_parse_flags_allow_c_style_comments & state->flags_bitset) {
do {
if (state->offset == size) {
state->error = json_parse_error_premature_end_of_buffer;
return 1;
}
did_consume = json_skip_whitespace(state);
if (state->offset >= size) {
state->error = json_parse_error_premature_end_of_buffer;
return 1;
}
did_consume |= json_skip_c_style_comments(state);
} while (0 != did_consume);
} else {
do {
if (state->offset == size) {
state->error = json_parse_error_premature_end_of_buffer;
return 1;
}
did_consume = json_skip_whitespace(state);
} while (0 != did_consume);
}
if (state->offset == size) {
state->error = json_parse_error_premature_end_of_buffer;
return 1;
}
return 0;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 5,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 5,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 2
} |
cflow-1.7#hash_prep#hash_lookup.c | cflow-1.7 | hash.c | hash_lookup | 12 | void *
hash_lookup (const Hash_table *table, const void *entry)
{
struct hash_entry const *bucket = safe_hasher (table, entry);
struct hash_entry const *cursor;
if (bucket->data == ((void *)0))
return ((void *)0);
for (cursor = bucket; cursor; cursor = cursor->next)
if (entry == cursor->data || table->comparator (entry, cursor->data))
return cursor->data;
return ((void *)0);
}
| {
"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": 2,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 0
} |
nano-7.2#winio_prep#full_refresh.c | nano-7.2 | winio.c | full_refresh | 4 | void full_refresh(void)
{
wrefresh(curscr);
}
| {
"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
} |
json.h#test_prep#json_write_minified_object.c | json.h | test.c | json_write_minified_object | 21 | char *json_write_minified_object(const struct json_object_s *object,
char *data) {
struct json_object_element_s *element = 0;
*data++ = '{';
for (element = object->start; 0 != element; element = element->next) {
if (element != object->start) {
*data++ = ',';
}
data = json_write_string(element->name, data);
if (0 == data) {
return 0;
}
*data++ = ':';
data = json_write_minified_value(element->value, data);
if (0 == data) {
return 0;
}
}
*data++ = '}';
return data;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 3,
"struct_type": 2,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#NEWMAN_CONWAY_SEQUENCE_1_prep#len.c | transcoder-set | NEWMAN_CONWAY_SEQUENCE_1.c | len | 1 | int len (int arr [ ]) {return ((int) (sizeof (arr) / sizeof (arr)[0]));}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
gawk-5.2.2#debug_prep#do_finish.c | gawk-5.2.2 | debug.c | do_finish | 18 | int
do_finish(CMDARG *arg __attribute__ ((__unused__)), int cmd)
{
do { if (! prog_running) { d_error(gettext("program not running")); return 0; } } while (0);
if (cur_frame == fcall_count) {
fprintf(out_fp,
gettext("'finish' not meaningful in the outermost frame main()\n"));
return 0;
}
stop.fcall_count = fcall_count - cur_frame - 1;
((void) (0));
fprintf(out_fp, gettext("Run until return from "));
print_numbered_frame(cur_frame);
stop.check_func = check_finish;
stop.command = (enum argtype) cmd;
stop.print_ret = 1;
return 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": 4,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 1
} |
ed-1.19#regex_prep#next_matching_node_addr.c | ed-1.19 | regex.c | next_matching_node_addr | 21 | int next_matching_node_addr( const char ** const ibufpp )
{
const bool forward = ( **ibufpp == '/' );
const regex_t * const exp = get_compiled_regex( ibufpp );
int addr = current_addr();
if( !exp ) return -1;
do {
addr = ( forward ? inc_addr( addr ) : dec_addr( addr ) );
if( addr )
{
const line_t * const lp = search_line_node( addr );
char * const s = get_sbuf_line( lp );
if( !s ) return -1;
if( isbinary() ) nul_to_newline( s, lp->len );
if( !regexec( exp, s, 0, 0, 0 ) ) return addr;
}
}
while( addr != current_addr() );
set_error_msg( no_match );
return -1;
}
| {
"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": 4,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
tmux#server-fn_prep#server_status_session_group.c | tmux | server-fn.c | server_status_session_group | 11 | void
server_status_session_group(struct session *s)
{
struct session_group *sg;
if ((sg = session_group_contains(s)) == ((void *)0))
server_status_session(s);
else {
for((s) = ((&sg->sessions)->tqh_first); (s) != ((void *)0); (s) = ((s)->gentry.tqe_next))
server_status_session(s);
}
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 0,
"struct_type": 2,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
libosip2-5.3.1#osip_www_authenticate_prep#osip_www_authenticate_get_targetname.c | libosip2-5.3.1 | osip_www_authenticate.c | osip_www_authenticate_get_targetname | 3 | char *osip_www_authenticate_get_targetname(osip_www_authenticate_t *www_authenticate) {
return www_authenticate->targetname;
}
| {
"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
} |
screen-4.9.0#encoding_prep#EncodeChar.c | screen-4.9.0 | encoding.c | EncodeChar | 167 | int
EncodeChar(bp, c, encoding, fontp)
char *bp;
int c;
int encoding;
int *fontp;
{
int t, f, l;
do {} while (0);
if (c == -1 && fontp)
{
if (*fontp == 0)
return 0;
if (bp)
{
*bp++ = 033;
*bp++ = '(';
*bp++ = 'B';
}
return 3;
}
f = (c >> 16) & 0xff;
if (encoding == 8)
{
if (f)
{
if (((f) && ((f) & 0x60) == 0))
{
int c2 = c & 0xff;
c = (c >> 8 & 0xff) | (f << 8);
c = recode_char_dw_to_encoding(c, &c2, encoding);
}
else
{
c = (c & 0xff) | (f << 8);
c = recode_char_to_encoding(c, encoding);
}
}
return ToUtf8(bp, c);
}
if (f == 0 && (c & 0x7f00ff00) != 0)
{
if (c >= 0x10000)
c = (c & 0x7f0000) >> 8 | (c & 0xffff);
if (utf8_isdouble(c))
{
int c2 = 0xffff;
c = recode_char_dw_to_encoding(c, &c2, encoding);
c = (c << 8) | (c2 & 0xff);
}
else
{
c = recode_char_to_encoding(c, encoding);
c = ((c & 0xff00) << 8) | (c & 0xff);
}
do {} while (0);
f = c >> 16;
}
if (f & 0x80)
f = 0;
if (encoding == 2)
{
if (f == 'I')
c = (c & 0xff) | 0x80;
else if (f == ('B' & 037))
{
if (!bp)
return 2;
t = c & 0xff;
c = (c >> 8) & 0xff;
t += (c & 1) ? ((t <= 0x5f) ? 0x1f : 0x20) : 0x7e;
c = (c - 0x21) / 2 + ((c < 0x5f) ? 0x81 : 0xc1);
*bp++ = c;
*bp++ = t;
return 2;
}
}
if (encoding == 1)
{
if (f == 'I')
{
if (bp)
{
*bp++ = 0x8e;
*bp++ = c;
}
return 2;
}
if (f == ('B' & 037))
{
if (bp)
{
*bp++ = (c >> 8) | 0x80;
*bp++ = c | 0x80;
}
return 2;
}
if (f == ('D' & 037))
{
if (bp)
{
*bp++ = 0x8f;
*bp++ = c >> 8;
*bp++ = c;
}
return 3;
}
}
if ((encoding == 3 && f == 3) || (encoding == 4 && f == 1))
{
if (bp)
{
*bp++ = (c >> 8) | 0x80;
*bp++ = c | 0x80;
}
return 2;
}
if ((encoding == 5 && f == 030) || (encoding == 20 && f == 031))
{
if (bp)
{
*bp++ = (c >> 8) | 0x80;
*bp++ = c;
}
return 2;
}
if (encoding == 20 && f == 0 && c == 0xa4)
c = 0x80;
l = 0;
if (fontp && f != *fontp)
{
*fontp = f;
if (f && f < ' ')
{
if (bp)
{
*bp++ = 033;
*bp++ = '$';
if (f > 2)
*bp++ = '(';
*bp++ = '@' + f;
}
l += f > 2 ? 4 : 3;
}
else if (f < 128)
{
if (f == 0)
f = 'B';
if (bp)
{
*bp++ = 033;
*bp++ = '(';
*bp++ = f;
}
l += 3;
}
}
if (c & 0xff00)
{
if (bp)
*bp++ = c >> 8;
l++;
}
if (bp)
*bp++ = c;
return l + 1;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 36,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 11,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 2
} |
mtools-4.0.43#misc_prep#str_to_offset_with_end.c | mtools-4.0.43 | misc.c | str_to_offset_with_end | 19 | off_t str_to_offset_with_end(const char *str, char **endp) {
char s;
off_t ofs;
*endp = ((void *)0);
ofs = strtol(str, endp, 0);
s = **endp;
if (s == 's' || s == 'S')
ofs <<= 9;
else if (s == 'k' || s == 'K')
ofs <<= 10;
else if (s == 'm' || s == 'M')
ofs <<= 20;
else if (s == 'g' || s == 'G')
ofs <<= 30;
else
return ofs;
(*endp)++;
return ofs;
}
| {
"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": 1,
"union_type": 0,
"while_loop": 0
} |
tulipindicators-0.9.1#candles_prep#tc_engulfing_bear.c | tulipindicators-0.9.1 | candles.c | tc_engulfing_bear | 5 | int tc_engulfing_bear(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>=1 && (open[i]>close[i]) && (open[i-1]<close[i-1]) && close[i] < open[i-1] && open[i] > close[i-1]) { do { const tc_hit hit = {i, (1L<<7)}; 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
} |
enscript-1.6.6#strhash_prep#strhash_get.c | enscript-1.6.6 | strhash.c | strhash_get | 25 | int
strhash_get (StringHashPtr hash, const char *key, int keylen, void **data)
{
HashList *list;
int pos, cmp_val;
if (!hash || !key || keylen <= 0 || !data)
return 0;
*data = ((void *)0);
pos = count_hash (key, keylen);
for (list = hash->hash_table[pos]; list; list = list->next)
if (list->keylen == keylen)
{
cmp_val = memcmp (key, list->key, keylen);
if (cmp_val == 0)
{
*data = list->data;
return 1;
}
else if (cmp_val < 0)
break;
}
else if (list->keylen > keylen)
break;
return 0;
}
| {
"array_type": 1,
"break_continue_statement": 2,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 5,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
tmux#xmalloc_prep#xmalloc.c | tmux | xmalloc.c | xmalloc | 12 | void *
xmalloc(size_t size)
{
void *ptr;
if (size == 0)
fatalx("xmalloc: zero size");
ptr = malloc(size);
if (ptr == ((void *)0))
fatalx("xmalloc: allocating %zu bytes: %s",
size, strerror((*__errno_location ())));
return ptr;
}
| {
"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": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
tulipindicators-0.9.1#tiamalgamation_prep#ti_fisher_start.c | tulipindicators-0.9.1 | tiamalgamation.c | ti_fisher_start | 3 | int ti_fisher_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
} |
transcoder-set#FIND_EQUAL_POINT_STRING_BRACKETS_prep#min.c | transcoder-set | FIND_EQUAL_POINT_STRING_BRACKETS.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
} |
libxml2#libxml2-py_prep#libxml_xmlReaderForDoc.c | libxml2 | libxml2-py.c | libxml_xmlReaderForDoc | 14 | PyObject *
libxml_xmlReaderForDoc(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
xmlTextReaderPtr c_retval;
xmlChar * cur;
char * URL;
char * encoding;
int options;
if (!_PyArg_ParseTuple_SizeT(args, (char *)"zzzi:xmlReaderForDoc", &cur, &URL, &encoding, &options))
return(((void *)0));
c_retval = xmlReaderForDoc(cur, URL, encoding, options);
py_retval = libxml_xmlTextReaderPtrWrap((xmlTextReaderPtr) c_retval);
return(py_retval);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
libxml2#xmlunicode_prep#xmlUCSIsSupplementaryPrivateUseAreaA.c | libxml2 | xmlunicode.c | xmlUCSIsSupplementaryPrivateUseAreaA | 4 | int
xmlUCSIsSupplementaryPrivateUseAreaA(int code) {
return(((code >= 0xF0000) && (code <= 0xFFFFF)));
}
| {
"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#ecc-size_prep#nettle_ecc_size.c | nettle-3.9.1 | ecc-size.c | nettle_ecc_size | 5 | mp_size_t
nettle_ecc_size (const struct ecc_curve *ecc)
{
return ecc->p.size;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
cflow-1.7#wordsplit_prep#wordsplit_free_envbuf.c | cflow-1.7 | wordsplit.c | wordsplit_free_envbuf | 15 | void
wordsplit_free_envbuf (struct wordsplit *ws)
{
if (!(ws->ws_flags & 0x00080000))
return;
if (ws->ws_envbuf)
{
size_t i;
for (i = 0; ws->ws_envbuf[i]; i++)
free (ws->ws_envbuf[i]);
free (ws->ws_envbuf);
ws->ws_envidx = ws->ws_envsiz = 0;
ws->ws_envbuf = ((void *)0);
}
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 2,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#CHECK_IF_A_NUMBER_IS_JUMBLED_OR_NOT_prep#max.c | transcoder-set | CHECK_IF_A_NUMBER_IS_JUMBLED_OR_NOT.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
} |
findutils-4.9.0#fstype_prep#is_used_fs_type.c | findutils-4.9.0 | fstype.c | is_used_fs_type | 26 | _Bool
is_used_fs_type(const char *name)
{
if (0 == strcmp("afs", name))
{
return 1;
}
else
{
const struct mount_entry *entries = get_file_system_list(0);
if (entries)
{
const struct mount_entry *entry;
for (entry = entries; entry; entry = entry->me_next)
{
if (0 == strcmp(name, entry->me_type))
return 1;
}
}
else
{
return 1;
}
}
return 0;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 4,
"struct_type": 2,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#QUERIES_COUNTS_ARRAY_ELEMENTS_VALUES_GIVEN_RANGE_prep#main.c | transcoder-set | QUERIES_COUNTS_ARRAY_ELEMENTS_VALUES_GIVEN_RANGE.c | main | 27 | int main(void) {
int n_success = 0;
int param0_0[] = {9,16,19,24,36,38,42,49,51,53,53,57,57,58,71,78,78,92,92,93};
int param0_1[] = {28,-74,-18,10,26,28,-96,-80,82,94,22,50,72,-90,76,50,20,-44,-80};
int param0_2[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
int param0_3[] = {25,8,66,90,50,65,76,90,27};
int param0_4[] = {-98,-96,-90,-82,-80,-78,-70,-66,-60,-60,-50,-48,-34,-26,-24,-16,-14,-8,-6,4,22,24,26,30,30,48,52,56,60,62,74,76,78,86};
int param0_5[] = {1,1,1,0,1,1,0,0,0,1,1,0,1,1,0,0,0,0};
int param0_6[] = {4,6,17,19,24,29,30,31,32,37,37,40,43,44,44,45,57,64,69,70,73,78,86,89,91,92,94};
int param0_7[] = {32,-88,70,-6,28,-48};
int param0_8[] = {0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1};
int param0_9[] = {37,84,97,74,12,26,47,10,14,33};
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[] = {13,18,30,4,32,15,17,4,13,5};
int param2[] = {12,13,21,8,24,16,21,3,12,9};
int param3[] = {13,13,31,5,24,12,15,4,11,8};
for(int i = 0; i < len(param0); ++i)
{
if(f_filled(param0[i],param1[i],param2[i],param3[i]) == f_gold(param0[i],param1[i],param2[i],param3[i]))
{
n_success+=1;
}
break;
}
printf("#Results:", " ", n_success, ", ", len(param0));
return 0;
}
| {
"array_type": 4,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libzahl-1.0#zrsh_prep#zrsh.c | libzahl-1.0 | zrsh.c | zrsh | 34 | void
zrsh(z_t a, z_t b, size_t bits)
{
size_t i, chars, cbits;
if (!bits) {
do { if ((a) != (b)) zset(a, b); } while (0);
return;
}
chars = ((bits) >> 5);
if (zzero(b) || chars >= b->used || zbits(b) <= bits) {
((a)->sign = (0));
return;
}
bits = ((bits) & (32 - 1));
cbits = 32 - bits;
if (chars && a == b) {
a->used -= chars;
memmove(a->chars, a->chars + chars, (a->used) * sizeof(zahl_char_t));
} else if (a != b) {
a->used = b->used - chars;
do { if ((a)->alloced < (a->used)) libzahl_realloc(a, (a->used)); } while (0);
memcpy(a->chars, b->chars + chars, (a->used) * sizeof(zahl_char_t));
}
if (bits) {
a->chars[0] >>= bits;
for (i = 1; i < a->used; i++) {
a->chars[i - 1] |= a->chars[i] << cbits;
a->chars[i] >>= bits;
}
while (!a->chars[a->used - 1])
a->used--;
}
((a)->sign = (zsignum(b)));
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 7,
"memory_management": 0,
"memory_operation": 2,
"pointer_type": 0,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 3
} |
transcoder-set#FIND_THE_FIRST_MISSING_NUMBER_prep#f_filled.c | transcoder-set | FIND_THE_FIRST_MISSING_NUMBER.c | f_filled | 1 | int f_filled ( int array [ ], int start, int 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": 0
} |
diffutils-3.10#dtotimespec_prep#dtotimespec.c | diffutils-3.10 | dtotimespec.c | dtotimespec | 23 | struct timespec
dtotimespec (double sec)
{
if (! (((time_t) ~ ((time_t) (! (! ((time_t) 0 < (time_t) -1)) ? (time_t) -1 : ((((time_t) 1 << ((sizeof (time_t) * 8) - 2)) - 1) * 2 + 1)))) < sec))
return make_timespec (((time_t) ~ ((time_t) (! (! ((time_t) 0 < (time_t) -1)) ? (time_t) -1 : ((((time_t) 1 << ((sizeof (time_t) * 8) - 2)) - 1) * 2 + 1)))), 0);
else if (! (sec < 1.0 + ((time_t) (! (! ((time_t) 0 < (time_t) -1)) ? (time_t) -1 : ((((time_t) 1 << ((sizeof (time_t) * 8) - 2)) - 1) * 2 + 1)))))
return make_timespec (((time_t) (! (! ((time_t) 0 < (time_t) -1)) ? (time_t) -1 : ((((time_t) 1 << ((sizeof (time_t) * 8) - 2)) - 1) * 2 + 1))), TIMESPEC_HZ - 1);
else
{
time_t s = sec;
double frac = TIMESPEC_HZ * (sec - s);
long ns = frac;
ns += ns < frac;
s += ns / TIMESPEC_HZ;
ns %= TIMESPEC_HZ;
if (ns < 0)
{
s--;
ns += TIMESPEC_HZ;
}
return make_timespec (s, ns);
}
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
lodepng#lodepng_prep#lodepng_get_raw_size.c | lodepng | lodepng.c | lodepng_get_raw_size | 3 | size_t lodepng_get_raw_size(unsigned w, unsigned h, const LodePNGColorMode* color) {
return lodepng_get_raw_size_lct(w, h, color->colortype, color->bitdepth);
}
| {
"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#c_supp_prep#Pl_Rd_Boolean_Check.c | gprolog-1.5.0 | c_supp.c | Pl_Rd_Boolean_Check | 13 | int
Pl_Rd_Boolean_Check(WamWord start_word)
{
WamWord word, tag_mask;
int atom;
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();
atom = ((PlULong) (word) >> 3);
if (tag_mask != (PlULong)0x3 || (atom != pl_atom_true && atom != pl_atom_false))
Pl_Err_Type(pl_type_boolean, word);
return atom != pl_atom_false;
}
| {
"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
} |
json.h#allow_simplified_json_prep#json_get_key_size.c | json.h | allow_simplified_json.c | json_get_key_size | 31 | int json_get_key_size(struct json_parse_state_s *state) {
const size_t flags_bitset = state->flags_bitset;
if (json_parse_flags_allow_unquoted_keys & flags_bitset) {
size_t offset = state->offset;
const size_t size = state->size;
const char *const src = state->src;
size_t data_size = state->data_size;
if ('"' == src[offset]) {
return json_get_string_size(state, 1);
} else if ((json_parse_flags_allow_single_quoted_strings & flags_bitset) &&
('\'' == src[offset])) {
return json_get_string_size(state, 1);
} else {
while ((offset < size) && is_valid_unquoted_key_char(src[offset])) {
offset++;
data_size++;
}
data_size++;
if (json_parse_flags_allow_location_information & flags_bitset) {
state->dom_size += sizeof(struct json_string_ex_s);
} else {
state->dom_size += sizeof(struct json_string_s);
}
state->offset = offset;
state->data_size = data_size;
return 0;
}
} else {
return json_get_string_size(state, 1);
}
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 4,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 4,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 1
} |
nano-7.2#prompt_prep#do_statusbar_delete.c | nano-7.2 | prompt.c | do_statusbar_delete | 10 | void do_statusbar_delete(void)
{
if (answer[typing_x] != '\0') {
int charlen = char_length(answer + typing_x);
memmove(answer + typing_x, answer + typing_x + charlen,
strlen(answer) - typing_x - charlen + 1);
if (is_zerowidth(answer + typing_x))
do_statusbar_delete();
}
}
| {
"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": 1,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
gawk-5.2.2#re_prep#refree.c | gawk-5.2.2 | re.c | refree | 17 | void
refree(Regexp *rp)
{
if (rp == ((void *)0))
return;
rp->pat.translate = ((void *)0);
regfree(& rp->pat);
if (rp->regs.start)
pma_free(rp->regs.start);
if (rp->regs.end)
pma_free(rp->regs.end);
if (rp->dfareg != ((void *)0)) {
dfafree(rp->dfareg);
pma_free(rp->dfareg);
}
pma_free(rp);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 4,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 0
} |
wget-1.21.4#convert_prep#register_download.c | wget-1.21.4 | convert.c | register_download | 27 | void
register_download (const char *url, const char *file)
{
char *old_file, *old_url;
do { if (!dl_file_url_map) dl_file_url_map = make_string_hash_table (0); if (!dl_url_file_map) dl_url_file_map = make_string_hash_table (0); } while (0);
if (hash_table_get_pair (dl_file_url_map, file, &old_file, &old_url))
{
if (0 == strcmp (url, old_url))
return;
if (match_except_index (url, old_url)
&& !hash_table_contains (dl_url_file_map, url))
goto url_only;
hash_table_remove (dl_file_url_map, file);
do { free ((void *) (old_file)); old_file = ((void *)0); } while (0);
do { free ((void *) (old_url)); old_url = ((void *)0); } while (0);
dissociate_urls_from_file (file);
}
hash_table_put (dl_file_url_map, xstrdup (file), xstrdup (url));
url_only:
if (hash_table_get_pair (dl_url_file_map, url, &old_url, &old_file))
{
hash_table_remove (dl_url_file_map, url);
do { free ((void *) (old_url)); old_url = ((void *)0); } while (0);
do { free ((void *) (old_file)); old_file = ((void *)0); } while (0);
}
hash_table_put (dl_url_file_map, xstrdup (url), xstrdup (file));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 1,
"if_statement": 5,
"memory_management": 4,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 5
} |
transcoder-set#FIND_LAST_DIGIT_FACTORIAL_DIVIDES_FACTORIAL_B_prep#f_gold.c | transcoder-set | FIND_LAST_DIGIT_FACTORIAL_DIVIDES_FACTORIAL_B.c | f_gold | 11 | int f_gold ( long long int A, long long int B ) {
int variable = 1;
if ( A == B ) return 1;
else if ( ( B - A ) >= 5 ) return 0;
else {
for ( long long int i = A + 1;
i <= B;
i ++ ) variable = ( variable * ( i % 10 ) ) % 10;
return variable % 10;
}
}
| {
"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": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libxml2#parser_prep#xmlParseContent.c | libxml2 | parser.c | xmlParseContent | 9 | void
xmlParseContent(xmlParserCtxtPtr ctxt) {
if ((ctxt == ((void *)0)) || (ctxt->input == ((void *)0)))
return;
xmlCtxtInitializeLate(ctxt);
xmlParseContentInternal(ctxt);
if (ctxt->input->cur < ctxt->input->end)
xmlFatalErr(ctxt, XML_ERR_NOT_WELL_BALANCED, ((void *)0));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
nettle-3.9.1#der-iterator_prep#nettle_asn1_der_iterator_next.c | nettle-3.9.1 | der-iterator.c | nettle_asn1_der_iterator_next | 47 | enum asn1_iterator_result
nettle_asn1_der_iterator_next(struct asn1_der_iterator *i)
{
uint8_t tag;
if (!((i)->buffer_length - (i)->pos))
return ASN1_ITERATOR_END;
tag = ((i)->buffer[(i)->pos++]);
if (!((i)->buffer_length - (i)->pos))
return ASN1_ITERATOR_ERROR;
if ( (tag & TAG_MASK) == TAG_MASK)
{
return ASN1_ITERATOR_ERROR;
}
i->length = ((i)->buffer[(i)->pos++]);
if (i->length & 0x80)
{
unsigned k = i->length & 0x7f;
unsigned j;
const uint8_t *data = i->buffer + i->pos;
if (k == 0)
return ASN1_ITERATOR_ERROR;
if (((i)->buffer_length - (i)->pos) < k)
return ASN1_ITERATOR_ERROR;
if (k > sizeof(i->length))
return ASN1_ITERATOR_ERROR;
i->pos += k;
i->length = data[0];
if (i->length == 0
|| (k == 1 && i->length < 0x80))
return ASN1_ITERATOR_ERROR;
for (j = 1; j < k; j++)
i->length = (i->length << 8) | data[j];
}
if (((i)->buffer_length - (i)->pos) < i->length)
return ASN1_ITERATOR_ERROR;
i->data = i->buffer + i->pos;
i->pos += i->length;
i->type = tag & TAG_MASK;
i->type |= (tag & CLASS_MASK) << (ASN1_CLASS_SHIFT - 6);
if (tag & CONSTRUCTED_MASK)
{
i->type |= ASN1_TYPE_CONSTRUCTED;
return ASN1_ITERATOR_CONSTRUCTED;
}
else
return ASN1_ITERATOR_PRIMITIVE;
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 10,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 10,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
tinycc#tccelf_prep#put_stabs_r.c | tinycc | tccelf.c | put_stabs_r | 8 | void put_stabs_r(const char *str, int type, int other, int desc,
unsigned long value, Section *sec, int sym_index)
{
put_stabs(str, type, other, desc, value);
put_elf_reloc(symtab_section, stab_section,
stab_section->data_offset - sizeof(unsigned int),
11, sym_index);
}
| {
"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
} |
less-633#lesskey_prep#homefile.c | less-633 | lesskey.c | homefile | 13 | char * homefile(char *filename)
{
char *p;
char *pathname;
if ((p = getenv("HOME")) != ((void *)0) && *p != '\0')
pathname = mkpathname(p, filename);
else
{
fprintf(stderr, "cannot find $HOME - using current directory\n");
pathname = mkpathname(".", filename);
}
return (pathname);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
mtools-4.0.43#strtonum_prep#atou8.c | mtools-4.0.43 | strtonum.c | atou8 | 3 | uint8_t atou8(const char *str) {
return strtou8(str, 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": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
json.h#allow_leading_plus_sign_prep#json_get_value_size.c | json.h | allow_leading_plus_sign.c | json_get_value_size | 94 | int json_get_value_size(struct json_parse_state_s *state,
int is_global_object) {
const size_t flags_bitset = state->flags_bitset;
const char *const src = state->src;
size_t offset;
const size_t size = state->size;
if (json_parse_flags_allow_location_information & flags_bitset) {
state->dom_size += sizeof(struct json_value_ex_s);
} else {
state->dom_size += sizeof(struct json_value_s);
}
if (is_global_object) {
return json_get_object_size(state, 1);
} else {
if (json_skip_all_skippables(state)) {
state->error = json_parse_error_premature_end_of_buffer;
return 1;
}
offset = state->offset;
switch (src[offset]) {
case '"':
return json_get_string_size(state, 0);
case '\'':
if (json_parse_flags_allow_single_quoted_strings & flags_bitset) {
return json_get_string_size(state, 0);
} else {
state->error = json_parse_error_invalid_value;
return 1;
}
case '{':
return json_get_object_size(state, 0);
case '[':
return json_get_array_size(state);
case '-':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
return json_get_number_size(state);
case '+':
if (json_parse_flags_allow_leading_plus_sign & flags_bitset) {
return json_get_number_size(state);
} else {
state->error = json_parse_error_invalid_number_format;
return 1;
}
case '.':
if (json_parse_flags_allow_leading_or_trailing_decimal_point &
flags_bitset) {
return json_get_number_size(state);
} else {
state->error = json_parse_error_invalid_number_format;
return 1;
}
default:
if ((offset + 4) <= size && 't' == src[offset + 0] &&
'r' == src[offset + 1] && 'u' == src[offset + 2] &&
'e' == src[offset + 3]) {
state->offset += 4;
return 0;
} else if ((offset + 5) <= size && 'f' == src[offset + 0] &&
'a' == src[offset + 1] && 'l' == src[offset + 2] &&
's' == src[offset + 3] && 'e' == src[offset + 4]) {
state->offset += 5;
return 0;
} else if ((offset + 4) <= size && 'n' == state->src[offset + 0] &&
'u' == state->src[offset + 1] &&
'l' == state->src[offset + 2] &&
'l' == state->src[offset + 3]) {
state->offset += 4;
return 0;
} else if ((json_parse_flags_allow_inf_and_nan & flags_bitset) &&
(offset + 3) <= size && 'N' == src[offset + 0] &&
'a' == src[offset + 1] && 'N' == src[offset + 2]) {
return json_get_number_size(state);
} else if ((json_parse_flags_allow_inf_and_nan & flags_bitset) &&
(offset + 8) <= size && 'I' == src[offset + 0] &&
'n' == src[offset + 1] && 'f' == src[offset + 2] &&
'i' == src[offset + 3] && 'n' == src[offset + 4] &&
'i' == src[offset + 5] && 't' == src[offset + 6] &&
'y' == src[offset + 7]) {
return json_get_number_size(state);
}
state->error = json_parse_error_invalid_value;
return 1;
}
}
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 11,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 18,
"struct_type": 1,
"switch_statement": 1,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
cflow-1.7#c_prep#yy_flush_buffer.c | cflow-1.7 | c.c | yy_flush_buffer | 13 | void yy_flush_buffer (YY_BUFFER_STATE b )
{
if ( ! b )
return;
b->yy_n_chars = 0;
b->yy_ch_buf[0] = 0;
b->yy_ch_buf[1] = 0;
b->yy_buf_pos = &b->yy_ch_buf[0];
b->yy_at_bol = 1;
b->yy_buffer_status = 0;
if ( b == ( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)] : ((void *)0)) )
yy_load_buffer_state( );
}
| {
"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": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
tar-1.34#exclude_prep#new_exclude.c | tar-1.34 | exclude.c | new_exclude | 5 | struct exclude *
new_exclude (void)
{
return xzalloc (sizeof *new_exclude ());
}
| {
"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#benchmark_prep#vidya_option_setter.c | tulipindicators-0.9.1 | benchmark.c | vidya_option_setter | 6 | void vidya_option_setter(double period, double *options, int ti) {
(void)ti;
options[0] = period;
options[1] = period + 10;
options[2] = .2;
}
| {
"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
} |
libosip2-5.3.1#osip_prep#osip_get_application_context.c | libosip2-5.3.1 | osip.c | osip_get_application_context | 5 | void *osip_get_application_context(osip_t *osip) {
if (osip == ((void *)0))
return ((void *)0);
return osip->application_context;
}
| {
"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
} |
pth-2.0.7#pth_fork_prep#pth_atfork_push.c | pth-2.0.7 | pth_fork.c | pth_atfork_push | 12 | int pth_atfork_push(void (*prepare)(void *), void (*parent)(void *),
void (*child)(void *), void *arg)
{
if (pth_atfork_idx > 128 -1)
return ((*__errno_location ()) = (12), ((0)));
pth_atfork_list[pth_atfork_idx].prepare = prepare;
pth_atfork_list[pth_atfork_idx].parent = parent;
pth_atfork_list[pth_atfork_idx].child = child;
pth_atfork_list[pth_atfork_idx].arg = arg;
pth_atfork_idx++;
return (!(0));
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 2,
"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
} |
binn-3.0#binn_prep#binn_list_bool.c | binn-3.0 | binn.c | binn_list_bool | 5 | BOOL binn_list_bool(void *list, int pos) {
BOOL value;
binn_list_get(list, pos, 0x80061, &value, ((void *)0));
return value;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
patch-2.7.6#patch_prep#fatal_exit.c | patch-2.7.6 | patch.c | fatal_exit | 8 | void
fatal_exit (int sig)
{
cleanup ();
if (sig)
exit_with_signal (sig);
exit (2);
}
| {
"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
} |
optipng-0.7.8#tiffutil_prep#minitiff_validate_info.c | optipng-0.7.8 | tiffutil.c | minitiff_validate_info | 15 | void minitiff_validate_info(const struct minitiff_info *info_ptr)
{
if (info_ptr->width == 0 || info_ptr->height == 0)
minitiff_error(info_ptr, "Invalid image dimensions in TIFF file");
if (info_ptr->bits_per_sample == 0 || info_ptr->samples_per_pixel == 0)
minitiff_error(info_ptr, "Invalid pixel info in TIFF file");
if (info_ptr->strip_offsets == ((void *)0) || info_ptr->rows_per_strip == 0)
minitiff_error(info_ptr, "Invalid strip info in TIFF file");
if (info_ptr->compression != MINITIFF_COMPRESSION_NONE)
minitiff_error(info_ptr,
"Unsupported compression method in TIFF file");
if (info_ptr->photometric >= MINITIFF_PHOTOMETRIC_PALETTE)
minitiff_error(info_ptr,
"Unsupported photometric interpretation in TIFF file");
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 5,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
nano-7.2#utils_prep#actual_x.c | nano-7.2 | utils.c | actual_x | 12 | size_t actual_x(const char *text, size_t column)
{
const char *start = text;
size_t width = 0;
while (*text != '\0') {
int charlen = advance_over(text, &width);
if (width > column)
break;
text += charlen;
}
return (text - start);
}
| {
"array_type": 0,
"break_continue_statement": 1,
"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": 1
} |
transcoder-set#SUM_SERIES_555555_N_TERMS_prep#f_filled.c | transcoder-set | SUM_SERIES_555555_N_TERMS.c | f_filled | 1 | int f_filled ( int n ) {}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
optipng-0.7.8#inffast_prep#inflate_fast.c | optipng-0.7.8 | inffast.c | inflate_fast | 211 | void inflate_fast(z_streamp strm, unsigned start) {
struct inflate_state *state;
const unsigned char *in;
const unsigned char *last;
unsigned char *out;
unsigned char *beg;
unsigned char *end;
unsigned wsize;
unsigned whave;
unsigned wnext;
unsigned char *window;
unsigned long hold;
unsigned bits;
code const *lcode;
code const *dcode;
unsigned lmask;
unsigned dmask;
code const *here;
unsigned op;
unsigned len;
unsigned dist;
unsigned char *from;
state = (struct inflate_state *)strm->state;
in = strm->next_in;
last = in + (strm->avail_in - 5);
out = strm->next_out;
beg = out - (start - strm->avail_out);
end = out + (strm->avail_out - 257);
wsize = state->wsize;
whave = state->whave;
wnext = state->wnext;
window = state->window;
hold = state->hold;
bits = state->bits;
lcode = state->lencode;
dcode = state->distcode;
lmask = (1U << state->lenbits) - 1;
dmask = (1U << state->distbits) - 1;
do {
if (bits < 15) {
hold += (unsigned long)(*in++) << bits;
bits += 8;
hold += (unsigned long)(*in++) << bits;
bits += 8;
}
here = lcode + (hold & lmask);
dolen:
op = (unsigned)(here->bits);
hold >>= op;
bits -= op;
op = (unsigned)(here->op);
if (op == 0) {
;
*out++ = (unsigned char)(here->val);
}
else if (op & 16) {
len = (unsigned)(here->val);
op &= 15;
if (op) {
if (bits < op) {
hold += (unsigned long)(*in++) << bits;
bits += 8;
}
len += (unsigned)hold & ((1U << op) - 1);
hold >>= op;
bits -= op;
}
;
if (bits < 15) {
hold += (unsigned long)(*in++) << bits;
bits += 8;
hold += (unsigned long)(*in++) << bits;
bits += 8;
}
here = dcode + (hold & dmask);
dodist:
op = (unsigned)(here->bits);
hold >>= op;
bits -= op;
op = (unsigned)(here->op);
if (op & 16) {
dist = (unsigned)(here->val);
op &= 15;
if (bits < op) {
hold += (unsigned long)(*in++) << bits;
bits += 8;
if (bits < op) {
hold += (unsigned long)(*in++) << bits;
bits += 8;
}
}
dist += (unsigned)hold & ((1U << op) - 1);
hold >>= op;
bits -= op;
;
op = (unsigned)(out - beg);
if (dist > op) {
op = dist - op;
if (op > whave) {
if (state->sane) {
strm->msg =
(char *)"invalid distance too far back";
state->mode = BAD;
break;
}
}
from = window;
if (wnext == 0) {
from += wsize - op;
if (op < len) {
len -= op;
do {
*out++ = *from++;
} while (--op);
from = out - dist;
}
}
else if (wnext < op) {
from += wsize + wnext - op;
op -= wnext;
if (op < len) {
len -= op;
do {
*out++ = *from++;
} while (--op);
from = window;
if (wnext < len) {
op = wnext;
len -= op;
do {
*out++ = *from++;
} while (--op);
from = out - dist;
}
}
}
else {
from += wnext - op;
if (op < len) {
len -= op;
do {
*out++ = *from++;
} while (--op);
from = out - dist;
}
}
while (len > 2) {
*out++ = *from++;
*out++ = *from++;
*out++ = *from++;
len -= 3;
}
if (len) {
*out++ = *from++;
if (len > 1)
*out++ = *from++;
}
}
else {
from = out - dist;
do {
*out++ = *from++;
*out++ = *from++;
*out++ = *from++;
len -= 3;
} while (len > 2);
if (len) {
*out++ = *from++;
if (len > 1)
*out++ = *from++;
}
}
}
else if ((op & 64) == 0) {
here = dcode + here->val + (hold & ((1U << op) - 1));
goto dodist;
}
else {
strm->msg = (char *)"invalid distance code";
state->mode = BAD;
break;
}
}
else if ((op & 64) == 0) {
here = lcode + here->val + (hold & ((1U << op) - 1));
goto dolen;
}
else if (op & 32) {
;
state->mode = TYPE;
break;
}
else {
strm->msg = (char *)"invalid literal/length code";
state->mode = BAD;
break;
}
} while (in < last && out < end);
len = bits >> 3;
in -= len;
bits -= len << 3;
hold &= (1U << bits) - 1;
strm->next_in = in;
strm->next_out = out;
strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last));
strm->avail_out = (unsigned)(out < end ?
257 + (end - out) : 257 - (out - end));
state->hold = hold;
state->bits = bits;
return;
}
| {
"array_type": 0,
"break_continue_statement": 4,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 2,
"if_statement": 25,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 11,
"return_statement": 1,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 15,
"union_type": 0,
"while_loop": 7
} |
libxml2#relaxng_prep#xmlRelaxNGValidatePushCData.c | libxml2 | relaxng.c | xmlRelaxNGValidatePushCData | 21 | int
xmlRelaxNGValidatePushCData(xmlRelaxNGValidCtxtPtr ctxt,
const xmlChar * data, int len __attribute__((unused)))
{
int ret = 1;
if ((ctxt == ((void *)0)) || (ctxt->elem == ((void *)0)) || (data == ((void *)0)))
return (-1);
while (*data != 0) {
if (!(((*data) == 0x20) || ((0x9 <= (*data)) && ((*data) <= 0xa)) || ((*data) == 0xd)))
break;
data++;
}
if (*data == 0)
return (1);
ret = xmlRegExecPushString(ctxt->elem, (xmlChar *) "#text", ctxt);
if (ret < 0) {
xmlRelaxNGAddValidError(ctxt, XML_RELAXNG_ERR_TEXTWRONG, (xmlChar *) " TODO ", ((void *)0), 0);;
return (-1);
}
return (1);
}
| {
"array_type": 0,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 4,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 4,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 1
} |
enscript-1.6.6#util_prep#is_ungetc.c | enscript-1.6.6 | util.c | is_ungetc | 11 | int
is_ungetc (int ch, InputStream *is)
{
if (is->unget_pos >= is->unget_alloc)
{
is->unget_alloc += 1024;
is->unget_ch = xrealloc (is->unget_ch, is->unget_alloc);
}
is->unget_ch[is->unget_pos++] = ch;
return 1;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
mcsim-6.2.0#random_prep#NormalRandom.c | mcsim-6.2.0 | random.c | NormalRandom | 18 | double NormalRandom (double dMean, double dSD)
{
double dRacine, dTemp1, dTemp2, dTemp3;
static double memGauss;
if (vbSwitchGauss) {
vbSwitchGauss = 0;
return (dMean + dSD * memGauss);
}
do {
dTemp1 = 2 * Randoms() - 1;
dTemp2 = 2 * Randoms() - 1;
dRacine = dTemp1 * dTemp1 + dTemp2 * dTemp2;
} while ((dRacine >= 1) || (dRacine == 0));
dTemp3 = sqrt(-2 * log(dRacine) / dRacine);
vbSwitchGauss = 1;
memGauss = dTemp1 * dTemp3;
return (dMean + dSD * (dTemp2 * dTemp3));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
grep-3.11#offtostr_prep#offtostr.c | grep-3.11 | offtostr.c | offtostr | 20 | __attribute__ ((__warn_unused_result__)) char *
offtostr (off_t i, char *buf)
{
char *p = buf + (((((sizeof (off_t) * 8) - (! ((__typeof__ (off_t)) 0 < (__typeof__ (off_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (off_t)) 0 < (__typeof__ (off_t)) -1)));
*p = 0;
if (i < 0)
{
do
*--p = '0' - i % 10;
while ((i /= 10) != 0);
*--p = '-';
}
else
{
do
*--p = '0' + i % 10;
while ((i /= 10) != 0);
}
return p;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 2
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.