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 |
|---|---|---|---|---|---|---|
libxml2#libxml2-py_prep#libxml_valuePop.c | libxml2 | libxml2-py.c | libxml_valuePop | 13 | PyObject *
libxml_valuePop(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
xmlXPathObjectPtr c_retval;
xmlXPathParserContextPtr ctxt;
PyObject *pyobj_ctxt;
if (!_PyArg_ParseTuple_SizeT(args, (char *)"O:valuePop", &pyobj_ctxt))
return(((void *)0));
ctxt = (xmlXPathParserContextPtr) (((pyobj_ctxt) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyxmlXPathParserContext_Object *)(pyobj_ctxt))->obj));
c_retval = valuePop(ctxt);
py_retval = libxml_xmlXPathObjectPtrWrap((xmlXPathObjectPtr) c_retval);
return(py_retval);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 0
} |
mcsim-6.2.0#lexfn_prep#GetNNumbers.c | mcsim-6.2.0 | lexfn.c | GetNNumbers | 12 | BOOL GetNNumbers (PINPUTBUF pibIn, PSTR szLex, int nNumbers, PDOUBLE rgd)
{
BOOL bErr = 0;
int i;
for (i = 0; i < nNumbers && !bErr; i++) {
if (i)
GetOptPunct (pibIn, szLex, ',');
if (!(bErr = ENextLex (pibIn, szLex, (0x0002 | 0x0004))))
rgd[i] = atof(szLex);
}
return bErr;
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
nano-7.2#global_prep#dos_format.c | nano-7.2 | global.c | dos_format | 1 | void dos_format(void) {;}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#COUNT_POSSIBLE_WAYS_TO_CONSTRUCT_BUILDINGS_prep#main.c | transcoder-set | COUNT_POSSIBLE_WAYS_TO_CONSTRUCT_BUILDINGS.c | main | 14 | int main(void) {
int n_success = 0;
int param0[] = {17,66,53,97,34,54,9,99,59,87};
for(int i = 0; i < len(param0); ++i)
{
if(f_filled(param0[i]) == f_gold(param0[i]))
{
n_success+=1;
}
break;
}
printf("#Results:", " ", n_success, ", ", len(param0));
return 0;
}
| {
"array_type": 1,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libxml2#libxml2-py_prep#libxml_xmlXPathIsInf.c | libxml2 | libxml2-py.c | libxml_xmlXPathIsInf | 11 | PyObject *
libxml_xmlXPathIsInf(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
int c_retval;
double val;
if (!_PyArg_ParseTuple_SizeT(args, (char *)"d:xmlXPathIsInf", &val))
return(((void *)0));
c_retval = xmlXPathIsInf(val);
py_retval = libxml_intWrap((int) c_retval);
return(py_retval);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 0
} |
optipng-0.7.8#pngrio_prep#png_set_read_fn.c | optipng-0.7.8 | pngrio.c | png_set_read_fn | 20 | void
png_set_read_fn(png_structrp png_ptr, png_voidp io_ptr,
png_rw_ptr read_data_fn)
{
if (png_ptr == ((void *)0))
return;
png_ptr->io_ptr = io_ptr;
if (read_data_fn != ((void *)0))
png_ptr->read_data_fn = read_data_fn;
else
png_ptr->read_data_fn = png_default_read_data;
if (png_ptr->write_data_fn != ((void *)0))
{
png_ptr->write_data_fn = ((void *)0);
png_warning(png_ptr,
"Can't set both read_data_fn and write_data_fn in the"
" same structure");
}
png_ptr->output_flush_fn = ((void *)0);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 5,
"union_type": 0,
"while_loop": 0
} |
mcsim-6.2.0#modd_prep#SetEquation.c | mcsim-6.2.0 | modd.c | SetEquation | 8 | void SetEquation (PVMMAPSTRCT pvm, PSTR szEqn)
{
if (!pvm || !szEqn)
return;
if (pvm->szEqn)
free (pvm->szEqn);
pvm->szEqn = CopyString (szEqn);
}
| {
"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": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#FINDING_POWER_PRIME_NUMBER_P_N_1_prep#sort.c | transcoder-set | FINDING_POWER_PRIME_NUMBER_P_N_1.c | sort | 1 | void sort (int arr [ ], int n) {qsort (arr, n, sizeof(int), cmpfunc);}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#PROGRAM_PRINT_SUM_GIVEN_NTH_TERM_1_prep#max.c | transcoder-set | PROGRAM_PRINT_SUM_GIVEN_NTH_TERM_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
} |
libxml2#valid_prep#xmlValidGetPotentialChildren.c | libxml2 | valid.c | xmlValidGetPotentialChildren | 30 | int
xmlValidGetPotentialChildren(xmlElementContent *ctree,
const xmlChar **names,
int *len, int max) {
int i;
if ((ctree == ((void *)0)) || (names == ((void *)0)) || (len == ((void *)0)))
return(-1);
if (*len >= max) return(*len);
switch (ctree->type) {
case XML_ELEMENT_CONTENT_PCDATA:
for (i = 0; i < *len;i++)
if (xmlStrEqual((xmlChar *) "#PCDATA", names[i])) return(*len);
names[(*len)++] = (xmlChar *) "#PCDATA";
break;
case XML_ELEMENT_CONTENT_ELEMENT:
for (i = 0; i < *len;i++)
if (xmlStrEqual(ctree->name, names[i])) return(*len);
names[(*len)++] = ctree->name;
break;
case XML_ELEMENT_CONTENT_SEQ:
xmlValidGetPotentialChildren(ctree->c1, names, len, max);
xmlValidGetPotentialChildren(ctree->c2, names, len, max);
break;
case XML_ELEMENT_CONTENT_OR:
xmlValidGetPotentialChildren(ctree->c1, names, len, max);
xmlValidGetPotentialChildren(ctree->c2, names, len, max);
break;
}
return(*len);
}
| {
"array_type": 1,
"break_continue_statement": 4,
"enum_type": 0,
"for_loop": 2,
"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": 1,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
cpio-2.14#paxerror_prep#readlink_error.c | cpio-2.14 | paxerror.c | readlink_error | 5 | void
readlink_error (char const *name)
{
call_arg_error ("readlink", name);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
tmux#variadic_prep#screen_write_strlen.c | tmux | variadic.c | screen_write_strlen | 33 | size_t
screen_write_strlen(const char *fmt, ...)
{
va_list ap;
char *msg;
struct utf8_data ud;
u_char *ptr;
size_t left, size = 0;
enum utf8_state more;
__builtin_va_start(ap,fmt);
xvasprintf(&msg, fmt, ap);
__builtin_va_end(ap);
ptr = msg;
while (*ptr != '\0') {
if (*ptr > 0x7f && utf8_open(&ud, *ptr) == UTF8_MORE) {
ptr++;
left = strlen(ptr);
if (left < (size_t)ud.size - 1)
break;
while ((more = utf8_append(&ud, *ptr)) == UTF8_MORE)
ptr++;
ptr++;
if (more == UTF8_DONE)
size += ud.width;
} else {
if (*ptr > 0x1f && *ptr < 0x7f)
size++;
ptr++;
}
}
free(msg);
return (size);
}
| {
"array_type": 0,
"break_continue_statement": 1,
"enum_type": 1,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 4,
"memory_management": 1,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 2
} |
heman#aabb2_prep#kmAABB2Centre.c | heman | aabb2.c | kmAABB2Centre | 5 | kmVec2* kmAABB2Centre(const kmAABB2* aabb, kmVec2* pOut) {
kmVec2Add(pOut, &aabb->min, &aabb->max);
kmVec2Scale(pOut, pOut, 0.5);
return pOut;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libosip2-5.3.1#osip_call_id_prep#osip_call_id_set_host.c | libosip2-5.3.1 | osip_call_id.c | osip_call_id_set_host | 3 | void osip_call_id_set_host(osip_call_id_t *callid, char *host) {
callid->host = host;
}
| {
"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
} |
binn-3.0#binn_prep#binn_list_get.c | binn-3.0 | binn.c | binn_list_get | 11 | BOOL binn_list_get(void *ptr, int pos, int type, void *pvalue, int *psize) {
binn value;
int storage_type;
storage_type = binn_get_read_storage(type);
if ((storage_type != 0x00) && (pvalue == ((void *)0))) return 0;
zero_value(pvalue, type);
if (binn_list_get_value(ptr, pos, &value) == 0) return 0;
if (copy_value(value.ptr, pvalue, value.type, type, storage_type) == 0) return 0;
if (psize) *psize = value.size;
return 1;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 4,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 4,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
less-633#charset_prep#utf_skip_to_lead.c | less-633 | charset.c | utf_skip_to_lead | 6 | void utf_skip_to_lead(char **pp, char *limit)
{
do {
++(*pp);
} while (*pp < limit && !((((*pp)[0] & 0377) & 0xC0) == 0xC0 && !((((*pp)[0] & 0377) & 0xFE) == 0xFE)) && !((((*pp)[0]) & 0x80) == 0));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
findutils-4.9.0#strerror_r_prep#rpl_strerror_r.c | findutils-4.9.0 | strerror_r.c | rpl_strerror_r | 37 | int
rpl_strerror_r (int errnum, char *buf, size_t buflen)
{
if (buflen <= 1)
{
if (buflen)
*buf = '\0';
return 34;
}
*buf = '\0';
{
char const *msg = ((void *)0);
if (msg)
return safe_copy (buf, buflen, msg);
}
{
int ret;
int saved_errno = (*__errno_location ());
{
ret = 0;
ret = __xpg_strerror_r (errnum, buf, buflen);
if (ret < 0)
ret = (*__errno_location ());
if (!*buf)
{
char *errstring = strerror_r (errnum, buf, buflen);
ret = errstring ? safe_copy (buf, buflen, errstring) : (*__errno_location ());
}
}
if (ret == 22 && !*buf)
{
snprintf (buf, buflen, "Unknown error %d", errnum);
}
(*__errno_location ()) = saved_errno;
return ret;
}
}
| {
"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": 2,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
findutils-4.9.0#tempname_prep#gen_tempname.c | findutils-4.9.0 | tempname.c | gen_tempname | 5 | int
gen_tempname (char *tmpl, int suffixlen, int flags, int kind)
{
return gen_tempname_len (tmpl, suffixlen, flags, kind, 6);
}
| {
"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#PROBABILITY_THREE_RANDOMLY_CHOSEN_NUMBERS_AP_prep#main.c | transcoder-set | PROBABILITY_THREE_RANDOMLY_CHOSEN_NUMBERS_AP.c | main | 14 | int main(void) {
int n_success = 0;
int param0[] = {46,5,44,15,72,2,86,17,30,42};
for(int i = 0; i < len(param0); ++i)
{
if(abs(1 - (0.0000001 + abs(f_gold(param0[i])) )/ (abs(f_filled(param0[i])) + 0.0000001)) < 0.001)
{
n_success+=1;
}
break;
}
printf("#Results:", " ", n_success, ", ", len(param0));
return 0;
}
| {
"array_type": 1,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
optipng-0.7.8#pngrtran_prep#png_set_crc_action.c | optipng-0.7.8 | pngrtran.c | png_set_crc_action | 52 | void
png_set_crc_action(png_structrp png_ptr, int crit_action, int ancil_action)
{
((void)0);
if (png_ptr == ((void *)0))
return;
switch (crit_action)
{
case 5:
break;
case 3:
png_ptr->flags &= ~(0x0400U | 0x0800U);
png_ptr->flags |= 0x0400U;
break;
case 4:
png_ptr->flags &= ~(0x0400U | 0x0800U);
png_ptr->flags |= 0x0400U |
0x0800U;
break;
case 2:
png_warning(png_ptr,
"Can't discard critical data on CRC error");
case 1:
case 0:
default:
png_ptr->flags &= ~(0x0400U | 0x0800U);
break;
}
switch (ancil_action)
{
case 5:
break;
case 3:
png_ptr->flags &= ~(0x0100U | 0x0200U);
png_ptr->flags |= 0x0100U;
break;
case 4:
png_ptr->flags &= ~(0x0100U | 0x0200U);
png_ptr->flags |= 0x0100U |
0x0200U;
break;
case 1:
png_ptr->flags &= ~(0x0100U | 0x0200U);
png_ptr->flags |= 0x0200U;
break;
case 2:
case 0:
default:
png_ptr->flags &= ~(0x0100U | 0x0200U);
break;
}
}
| {
"array_type": 0,
"break_continue_statement": 9,
"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": 2,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
pexec-1.0rc8#linebuffer_prep#linebuffer_reset.c | pexec-1.0rc8 | linebuffer.c | linebuffer_reset | 6 | int linebuffer_reset(linebuffer *lb)
{
lb->buffer=((void *)0);
lb->length=0;
return(0);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libxml2#xmlunicode_prep#xmlUCSIsCJKUnifiedIdeographsExtensionB.c | libxml2 | xmlunicode.c | xmlUCSIsCJKUnifiedIdeographsExtensionB | 4 | int
xmlUCSIsCJKUnifiedIdeographsExtensionB(int code) {
return(((code >= 0x20000) && (code <= 0x2A6DF)));
}
| {
"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#dict_prep#xmlGlobalRandom.c | libxml2 | dict.c | xmlGlobalRandom | 8 | unsigned
xmlGlobalRandom(void) {
unsigned ret;
xmlMutexLock(&xmlRngMutex);
ret = xoroshiro64ss(globalRngState);
xmlMutexUnlock(&xmlRngMutex);
return(ret);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
gzip-1.12#unpack_prep#unpack.c | gzip-1.12 | unpack.c | unpack | 41 | int unpack(in, out)
int in, out;
{
int len;
unsigned eob;
register unsigned peek;
unsigned peek_mask;
ifd = in;
ofd = out;
read_tree();
build_tree();
(valid = 0, bitbuf = 0);
peek_mask = (1<<peek_bits)-1;
eob = leaves[max_len]-1;
;
for (;;) {
{ while (valid < (peek_bits)) bitbuf = (bitbuf<<8) | read_byte(), valid += 8; peek = (bitbuf >> (valid-(peek_bits))) & (peek_mask); };
len = outbuf[peek];
if (len > 0) {
peek >>= peek_bits - len;
} else {
ulg mask = peek_mask;
len = peek_bits;
while (peek < parents[len])
{
len++, mask = (mask<<1)+1;
{ while (valid < (len)) bitbuf = (bitbuf<<8) | read_byte(), valid += 8; peek = (bitbuf >> (valid-(len))) & (mask); };
}
}
if (peek == eob && len == max_len)
break;
{window[outcnt++]=(uch)(literal[peek+lit_base[len]]); if (outcnt==0x8000) flush_window();};
;
(valid -= (len));
}
flush_window();
if (orig_len != (ulg)(bytes_out & 0xffffffff)) {
gzip_error ("invalid compressed data--length error");
}
return 0;
}
| {
"array_type": 4,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 4,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 3
} |
units-2.22#units_prep#getprogramname.c | units-2.22 | units.c | getprogramname | 11 | char *
getprogramname(char *path)
{
size_t proglen;
char *p;
path = pathend(path);
proglen = strlen(path);
if ((p = strrchr(path, '.')) && ((strlen(p) == 4) && (tolower(p[1]) == 'e') && (tolower(p[2]) == 'x') && (tolower(p[3]) == 'e')))
proglen -= 4;
return dupnstr(path, proglen);
}
| {
"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": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
json.h#allow_inf_and_nan_prep#json_write_minified_get_value_size.c | json.h | allow_inf_and_nan.c | json_write_minified_get_value_size | 28 | int json_write_minified_get_value_size(const struct json_value_s *value,
size_t *size) {
switch (value->type) {
default:
return 1;
case json_type_number:
return json_write_get_number_size((struct json_number_s *)value->payload,
size);
case json_type_string:
return json_write_get_string_size((struct json_string_s *)value->payload,
size);
case json_type_array:
return json_write_minified_get_array_size(
(struct json_array_s *)value->payload, size);
case json_type_object:
return json_write_minified_get_object_size(
(struct json_object_s *)value->payload, size);
case json_type_true:
*size += 4;
return 0;
case json_type_false:
*size += 5;
return 0;
case json_type_null:
*size += 4;
return 0;
}
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 8,
"struct_type": 1,
"switch_statement": 1,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#COUNT_FIBONACCI_NUMBERS_GIVEN_RANGE_LOG_TIME_prep#sort.c | transcoder-set | COUNT_FIBONACCI_NUMBERS_GIVEN_RANGE_LOG_TIME.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
} |
json.h#allow_simplified_json_prep#json_write_minified_get_value_size.c | json.h | allow_simplified_json.c | json_write_minified_get_value_size | 28 | int json_write_minified_get_value_size(const struct json_value_s *value,
size_t *size) {
switch (value->type) {
default:
return 1;
case json_type_number:
return json_write_get_number_size((struct json_number_s *)value->payload,
size);
case json_type_string:
return json_write_get_string_size((struct json_string_s *)value->payload,
size);
case json_type_array:
return json_write_minified_get_array_size(
(struct json_array_s *)value->payload, size);
case json_type_object:
return json_write_minified_get_object_size(
(struct json_object_s *)value->payload, size);
case json_type_true:
*size += 4;
return 0;
case json_type_false:
*size += 5;
return 0;
case json_type_null:
*size += 4;
return 0;
}
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 8,
"struct_type": 1,
"switch_statement": 1,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#AREA_OF_A_HEXAGON_prep#min.c | transcoder-set | AREA_OF_A_HEXAGON.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
} |
nettle-3.9.1#rsa-pkcs1-sign-tr_prep#nettle_rsa_pkcs1_sign_tr.c | nettle-3.9.1 | rsa-pkcs1-sign-tr.c | nettle_rsa_pkcs1_sign_tr | 16 | int
nettle_rsa_pkcs1_sign_tr(const struct rsa_public_key *pub,
const struct rsa_private_key *key,
void *random_ctx, nettle_random_func *random,
size_t length, const uint8_t *digest_info,
mpz_t s)
{
mpz_t m;
int ret;
__gmpz_init(m);
ret = (nettle_pkcs1_rsa_digest_encode (m, key->size, length, digest_info)
&& nettle_rsa_compute_root_tr (pub, key, random_ctx, random,
s, m));
__gmpz_clear(m);
return ret;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 2,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#SUM_PAIRWISE_PRODUCTS_prep#f_filled.c | transcoder-set | SUM_PAIRWISE_PRODUCTS.c | f_filled | 1 | long long 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
} |
nano-7.2#move_prep#do_para_begin.c | nano-7.2 | move.c | do_para_begin | 7 | void do_para_begin(linestruct **line)
{
if ((*line)->prev != ((void *)0))
*line = (*line)->prev;
while (!begpar(*line, 0))
*line = (*line)->prev;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 1
} |
less-633#filename_prep#fexpand.c | less-633 | filename.c | fexpand | 61 | char * fexpand(char *s)
{
char *fr, *to;
int n;
char *e;
void* ifile;
n = 0;
for (fr = s; *fr != '\0'; fr++)
{
switch (*fr)
{
case '%':
case '#':
if (fr > s && fr[-1] == *fr)
{
n++;
} else if (fr[1] != *fr)
{
ifile = ((*fr) == '%' ? curr_ifile : (*fr) == '#' ? old_ifile : ((void*)((void *)0)));
if (ifile == ((void*)((void *)0)))
n++;
else
n += (int) strlen(get_filename(ifile));
}
break;
default:
n++;
break;
}
}
e = (char *) ecalloc(n+1, sizeof(char));
to = e;
for (fr = s; *fr != '\0'; fr++)
{
switch (*fr)
{
case '%':
case '#':
if (fr > s && fr[-1] == *fr)
{
*to++ = *fr;
} else if (fr[1] != *fr)
{
ifile = ((*fr) == '%' ? curr_ifile : (*fr) == '#' ? old_ifile : ((void*)((void *)0)));
if (ifile == ((void*)((void *)0)))
*to++ = *fr;
else
{
strcpy(to, get_filename(ifile));
to += strlen(to);
}
}
break;
default:
*to++ = *fr;
break;
}
}
*to = '\0';
return (e);
}
| {
"array_type": 1,
"break_continue_statement": 4,
"enum_type": 0,
"for_loop": 2,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 6,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 3,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 2,
"type_casting": 6,
"union_type": 0,
"while_loop": 0
} |
libxml2#xmlstring_prep#xmlStrndup.c | libxml2 | xmlstring.c | xmlStrndup | 12 | xmlChar *
xmlStrndup(const xmlChar *cur, int len) {
xmlChar *ret;
if ((cur == ((void *)0)) || (len < 0)) return(((void *)0));
ret = xmlMalloc((size_t) len + 1);
if (ret == ((void *)0)) {
return(((void *)0));
}
memcpy(ret, cur, len);
ret[len] = 0;
return(ret);
}
| {
"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": 1,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
cpio-2.14#dstring_prep#ds_append.c | cpio-2.14 | dstring.c | ds_append | 12 | void
ds_append (dynamic_string *s, int c)
{
ds_resize (s, 0);
s->ds_string[s->ds_idx] = c;
if (c)
{
s->ds_idx++;
ds_resize (s, 0);
s->ds_string[s->ds_idx] = 0;
}
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
binn-3.0#binn_prep#binn_get_read_storage.c | binn-3.0 | binn.c | binn_get_read_storage | 12 | int binn_get_read_storage(int type) {
int storage_type;
switch (type) {
case 0x80061:
case 0x01:
case 0x02:
return 0x60;
default:
binn_get_type_info(type, &storage_type, ((void *)0));
return storage_type;
}
}
| {
"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": 2,
"struct_type": 0,
"switch_statement": 1,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
gprolog-1.5.0#engine_prep#Pl_Reset_Prolog_In_Signal.c | gprolog-1.5.0 | engine.c | Pl_Reset_Prolog_In_Signal | 5 | void
Pl_Reset_Prolog_In_Signal(void)
{
do { if (pl_buff_signal_reg[4]) { do { pl_reg_bank = (WamWordP) pl_buff_signal_reg[0]; TR = (WamWordP) pl_buff_signal_reg[1]; B = (WamWordP) pl_buff_signal_reg[2]; H = (WamWordP) pl_buff_signal_reg[3]; } while(0); pl_buff_signal_reg[4] = 0;; } pl_reg_bank = save_reg_bank; } while(0);
}
| {
"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": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 1
} |
nano-7.2#chars_prep#mbstrchr.c | nano-7.2 | chars.c | mbstrchr | 25 | char *mbstrchr(const char *string, const char *chr)
{
if (use_utf8) {
_Bool bad_s = 0, bad_c = 0;
wchar_t ws, wc;
if (mbtowide(&wc, chr) < 0) {
wc = (unsigned char)*chr;
bad_c = 1;
}
while (*string != '\0') {
int symlen = mbtowide(&ws, string);
if (symlen < 0) {
ws = (unsigned char)*string;
bad_s = 1;
}
if (ws == wc && bad_s == bad_c)
break;
string += symlen;
}
if (*string == '\0')
return ((void *)0);
return (char *)string;
} else
return strchr(string, *chr);
}
| {
"array_type": 0,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 5,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 1
} |
tulipindicators-0.9.1#candles_prep#tc_big_black_candle.c | tulipindicators-0.9.1 | candles.c | tc_big_black_candle | 5 | int tc_big_black_candle(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 ((open[i]>close[i]) && ((fabs(open[(i)] - close[(i)])) > (options->body_long * avg_body))) { do { const tc_hit hit = {i, (1L<<2)}; 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
} |
gawk-5.2.2#symbol_prep#lookup.c | gawk-5.2.2 | symbol.c | lookup | 28 | NODE *
lookup(const char *name)
{
NODE *n;
NODE *tmp;
NODE *tables[5];
int i;
tables[0] = param_table;
tables[1] = global_table;
tables[2] = func_table;
tables[3] = symbol_table;
tables[4] = ((void *)0);
tmp = get_name_from_awk_ns(name);
n = ((void *)0);
for (i = 0; tables[i] != ((void *)0); i++) {
if ((((tables[i])->sub.nodep.reflags) == 0))
continue;
if (((do_flags & DO_POSIX) || (do_flags & DO_TRADITIONAL)) && tables[i] == global_table)
continue;
n = in_array(tables[i], tmp);
if (n != ((void *)0))
break;
}
unref(tmp);
if (n == ((void *)0) || n->type == Node_val)
return ((void *)0);
return n;
}
| {
"array_type": 1,
"break_continue_statement": 3,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 4,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 3,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 6,
"union_type": 0,
"while_loop": 0
} |
mtools-4.0.43#tty_prep#ask_confirmation.c | mtools-4.0.43 | tty.c | ask_confirmation | 29 | int ask_confirmation(const char *format, ...)
{
char ans[10];
va_list ap;
if(!opentty(-1))
return 0;
while (1) {
__builtin_va_start(ap,format);
vfprintf(stderr, format, ap);
__builtin_va_end(ap);
fflush(stderr);
fflush(opentty(-1));
if (mtools_raw_tty) {
int c = fgetc(opentty(1));
if(c < 0)
ans[0] = 'n';
else
ans[0] = (char) c;
fputs("\n", stderr);
} else {
if(fgets(ans,9, opentty(0)) == ((void *)0))
ans[0] = 'n';
}
if (ans[0] == 'y' || ans[0] == 'Y')
return 0;
if (ans[0] == 'n' || ans[0] == 'N')
return -1;
}
}
| {
"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": 0,
"pointer_type": 0,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 1
} |
transcoder-set#FLOOR_IN_A_SORTED_ARRAY_prep#cmpfunc.c | transcoder-set | FLOOR_IN_A_SORTED_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
} |
json.h#allow_json5_prep#json_write_number.c | json.h | allow_json5.c | json_write_number | 115 | char *json_write_number(const struct json_number_s *number, char *data) {
uintmax_t parsed_number, backup;
size_t i;
if (number->number_size >= 2) {
switch (number->number[1]) {
default:
break;
case 'x':
case 'X':
parsed_number = strtoumax(number->number, 0, 0);
backup = parsed_number;
i = 0;
while (0 != parsed_number) {
parsed_number /= 10;
i++;
}
parsed_number = backup;
backup = i;
do {
*(data + i - 1) = '0' + (char)(parsed_number % 10);
parsed_number /= 10;
i--;
} while (0 != parsed_number);
data += backup;
return data;
}
}
i = 0;
if ((i < number->number_size) &&
(('+' == number->number[i]) || ('-' == number->number[i]))) {
i++;
}
if ((i < number->number_size) && ('I' == number->number[i])) {
const char *inf = "Infinity";
size_t k;
for (k = i; k < number->number_size; k++) {
const char c = *inf++;
if ('\0' == c) {
break;
} else if (c != number->number[k]) {
break;
}
}
if ('\0' == *inf++) {
const char *dbl_max;
if ('-' == number->number[0]) {
*data++ = '-';
}
for (dbl_max = "1.7976931348623158e308"; '\0' != *dbl_max; dbl_max++) {
*data++ = *dbl_max;
}
return data;
}
}
if ((i < number->number_size) && ('N' == number->number[i])) {
const char *nan = "NaN";
size_t k;
for (k = i; k < number->number_size; k++) {
const char c = *nan++;
if ('\0' == c) {
break;
} else if (c != number->number[k]) {
break;
}
}
if ('\0' == *nan++) {
*data++ = '0';
return data;
}
}
if ((i < number->number_size) && ('.' == number->number[i])) {
i = 0;
if ('+' == number->number[i]) {
i++;
}
if ('-' == number->number[i]) {
*data++ = '-';
i++;
}
*data++ = '0';
for (; i < number->number_size; i++) {
*data++ = number->number[i];
}
return data;
}
for (; i < number->number_size; i++) {
const char c = number->number[i];
if (!('0' <= c && c <= '9')) {
break;
}
}
if ((i + 1 == number->number_size) && ('.' == number->number[i])) {
i = 0;
if ('+' == number->number[i]) {
i++;
}
if ('-' == number->number[i]) {
*data++ = '-';
i++;
}
for (; i < number->number_size; i++) {
*data++ = number->number[i];
}
*data++ = '0';
return data;
}
i = 0;
if ('+' == number->number[i]) {
i++;
}
for (; i < number->number_size; i++) {
*data++ = number->number[i];
}
return data;
}
| {
"array_type": 1,
"break_continue_statement": 6,
"enum_type": 0,
"for_loop": 7,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 19,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 3,
"return_statement": 6,
"struct_type": 1,
"switch_statement": 1,
"type_casting": 1,
"union_type": 0,
"while_loop": 2
} |
gprolog-1.5.0#foreign_supp_prep#Pl_Query_Begin.c | gprolog-1.5.0 | foreign_supp.c | Pl_Query_Begin | 9 | void
Pl_Query_Begin(Bool recoverable)
{
if (query_stack_top - query_stack >= 128)
Pl_Fatal_Error("too many nested Pl_Query_Start() (max: %d)",
128);
if (recoverable)
Pl_Create_Choice_Point(X1_24706C5F71756572795F7265636F7665725F616C74__a0, 0);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
tmux#session_prep#session_group_add.c | tmux | session.c | session_group_add | 6 | void
session_group_add(struct session_group *sg, struct session *s)
{
if (session_group_contains(s) == ((void *)0))
do { (s)->gentry.tqe_next = ((void *)0); (s)->gentry.tqe_prev = (&sg->sessions)->tqh_last; *(&sg->sessions)->tqh_last = (s); (&sg->sessions)->tqh_last = &(s)->gentry.tqe_next; } while (0);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 1
} |
tmux#mode-tree_prep#mode_tree_resize.c | tmux | mode-tree.c | mode_tree_resize | 9 | void
mode_tree_resize(struct mode_tree_data *mtd, u_int sx, u_int sy)
{
struct screen *s = &mtd->screen;
screen_resize(s, sx, sy, 0);
mode_tree_build(mtd);
mode_tree_draw(mtd);
mtd->wp->flags |= 0x1;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 0,
"struct_type": 2,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
gawk-5.2.2#eval_prep#update_NF.c | gawk-5.2.2 | eval.c | update_NF | 12 | void
update_NF()
{
long l;
l = (!(((NF_node->sub.nodep.l.lptr))->flags & (MPFN|MPZN)) ? ((long) (NF_node->sub.nodep.l.lptr)->sub.val.nm.fltnum) : ((((NF_node->sub.nodep.l.lptr))->flags & MPFN) ? (mpfr_get_si((NF_node->sub.nodep.l.lptr)->sub.val.nm.mpnum, ROUND_MODE)) : (__gmpz_get_si((NF_node->sub.nodep.l.lptr)->sub.val.nm.mpi))));
if (NF == -1 || l != NF) {
if (NF == -1)
(void) get_field(0x7fffffffffffffffL - 1, ((void *)0));
unref(NF_node->sub.nodep.l.lptr);
NF_node->sub.nodep.l.lptr = make_number(NF);
}
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
nano-7.2#prompt_prep#put_cursor_at_end_of_answer.c | nano-7.2 | prompt.c | put_cursor_at_end_of_answer | 4 | void put_cursor_at_end_of_answer(void)
{
typing_x = ((~(size_t)0) >> 1);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
brotli-1.0.9#entropy_encode_prep#BrotliOptimizeHuffmanCountsForRle.c | brotli-1.0.9 | entropy_encode.c | BrotliOptimizeHuffmanCountsForRle | 114 | void BrotliOptimizeHuffmanCountsForRle(size_t length, uint32_t* counts,
uint8_t* good_for_rle) {
size_t nonzero_count = 0;
size_t stride;
size_t limit;
size_t sum;
const size_t streak_limit = 1240;
size_t i;
for (i = 0; i < length; i++) {
if (counts[i]) {
++nonzero_count;
}
}
if (nonzero_count < 16) {
return;
}
while (length != 0 && counts[length - 1] == 0) {
--length;
}
if (length == 0) {
return;
}
{
size_t nonzeros = 0;
uint32_t smallest_nonzero = 1 << 30;
for (i = 0; i < length; ++i) {
if (counts[i] != 0) {
++nonzeros;
if (smallest_nonzero > counts[i]) {
smallest_nonzero = counts[i];
}
}
}
if (nonzeros < 5) {
return;
}
if (smallest_nonzero < 4) {
size_t zeros = length - nonzeros;
if (zeros < 6) {
for (i = 1; i < length - 1; ++i) {
if (counts[i - 1] != 0 && counts[i] == 0 && counts[i + 1] != 0) {
counts[i] = 1;
}
}
}
}
if (nonzeros < 28) {
return;
}
}
memset(good_for_rle, 0, length);
{
uint32_t symbol = counts[0];
size_t step = 0;
for (i = 0; i <= length; ++i) {
if (i == length || counts[i] != symbol) {
if ((symbol == 0 && step >= 5) ||
(symbol != 0 && step >= 7)) {
size_t k;
for (k = 0; k < step; ++k) {
good_for_rle[i - k - 1] = 1;
}
}
step = 1;
if (i != length) {
symbol = counts[i];
}
} else {
++step;
}
}
}
stride = 0;
limit = 256 * (counts[0] + counts[1] + counts[2]) / 3 + 420;
sum = 0;
for (i = 0; i <= length; ++i) {
if (i == length || good_for_rle[i] ||
(i != 0 && good_for_rle[i - 1]) ||
(256 * counts[i] - limit + streak_limit) >= 2 * streak_limit) {
if (stride >= 4 || (stride >= 3 && sum == 0)) {
size_t k;
size_t count = (sum + stride / 2) / stride;
if (count == 0) {
count = 1;
}
if (sum == 0) {
count = 0;
}
for (k = 0; k < stride; ++k) {
counts[i - k - 1] = (uint32_t)count;
}
}
stride = 0;
sum = 0;
if (i < length - 2) {
limit = 256 * (counts[i] + counts[i + 1] + counts[i + 2]) / 3 + 420;
} else if (i < length) {
limit = 256 * counts[i];
} else {
limit = 0;
}
}
++stride;
if (i != length) {
sum += counts[i];
if (stride >= 4) {
limit = (256 * sum + stride / 2) / stride;
}
if (stride == 4) {
limit += 120;
}
}
}
}
| {
"array_type": 2,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 7,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 22,
"memory_management": 0,
"memory_operation": 1,
"pointer_type": 0,
"return_statement": 4,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
libxml2#uri_prep#xmlURIEscape.c | libxml2 | uri.c | xmlURIEscape | 92 | xmlChar *
xmlURIEscape(const xmlChar * str)
{
xmlChar *ret, *segment = ((void *)0);
xmlURIPtr uri;
int ret2;
if (str == ((void *)0))
return (((void *)0));
uri = xmlCreateURI();
if (uri != ((void *)0)) {
uri->cleanup = 1;
ret2 = xmlParseURIReference(uri, (const char *)str);
if (ret2) {
xmlFreeURI(uri);
return (((void *)0));
}
}
if (!uri)
return ((void *)0);
ret = ((void *)0);
if (uri->scheme) {
segment = xmlURIEscapeStr((xmlChar *) uri->scheme, (xmlChar *) "+-.");
if(!segment) { xmlFreeURI(uri); xmlFree(ret); return ((void *)0); }
ret = xmlStrcat(ret, segment);
ret = xmlStrcat(ret, (xmlChar *) ":");
xmlFree(segment);
}
if (uri->authority) {
segment =
xmlURIEscapeStr((xmlChar *) uri->authority, (xmlChar *) "/?;:@");
if(!segment) { xmlFreeURI(uri); xmlFree(ret); return ((void *)0); }
ret = xmlStrcat(ret, (xmlChar *) "//");
ret = xmlStrcat(ret, segment);
xmlFree(segment);
}
if (uri->user) {
segment = xmlURIEscapeStr((xmlChar *) uri->user, (xmlChar *) ";:&=+$,");
if(!segment) { xmlFreeURI(uri); xmlFree(ret); return ((void *)0); }
ret = xmlStrcat(ret,(xmlChar *) "//");
ret = xmlStrcat(ret, segment);
ret = xmlStrcat(ret, (xmlChar *) "@");
xmlFree(segment);
}
if (uri->server) {
segment = xmlURIEscapeStr((xmlChar *) uri->server, (xmlChar *) "/?;:@");
if(!segment) { xmlFreeURI(uri); xmlFree(ret); return ((void *)0); }
if (uri->user == ((void *)0))
ret = xmlStrcat(ret, (xmlChar *) "//");
ret = xmlStrcat(ret, segment);
xmlFree(segment);
}
if (uri->port > 0) {
xmlChar port[11];
snprintf((char *) port, 11, "%d", uri->port);
ret = xmlStrcat(ret, (xmlChar *) ":");
ret = xmlStrcat(ret, port);
}
if (uri->path) {
segment =
xmlURIEscapeStr((xmlChar *) uri->path, (xmlChar *) ":@&=+$,/?;");
if(!segment) { xmlFreeURI(uri); xmlFree(ret); return ((void *)0); }
ret = xmlStrcat(ret, segment);
xmlFree(segment);
}
if (uri->query_raw) {
ret = xmlStrcat(ret, (xmlChar *) "?");
ret = xmlStrcat(ret, (xmlChar *) uri->query_raw);
}
else if (uri->query) {
segment =
xmlURIEscapeStr((xmlChar *) uri->query, (xmlChar *) ";/?:@&=+,$");
if(!segment) { xmlFreeURI(uri); xmlFree(ret); return ((void *)0); }
ret = xmlStrcat(ret, (xmlChar *) "?");
ret = xmlStrcat(ret, segment);
xmlFree(segment);
}
if (uri->opaque) {
segment = xmlURIEscapeStr((xmlChar *) uri->opaque, (xmlChar *) "");
if(!segment) { xmlFreeURI(uri); xmlFree(ret); return ((void *)0); }
ret = xmlStrcat(ret, segment);
xmlFree(segment);
}
if (uri->fragment) {
segment = xmlURIEscapeStr((xmlChar *) uri->fragment, (xmlChar *) "#");
if(!segment) { xmlFreeURI(uri); xmlFree(ret); return ((void *)0); }
ret = xmlStrcat(ret, (xmlChar *) "#");
ret = xmlStrcat(ret, segment);
xmlFree(segment);
}
xmlFreeURI(uri);
return (ret);
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 23,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 12,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 17,
"union_type": 0,
"while_loop": 0
} |
tulipindicators-0.9.1#aroon_prep#ti_aroon.c | tulipindicators-0.9.1 | aroon.c | ti_aroon | 54 | int ti_aroon(int size, double const *const *inputs, double const *options, double *const *outputs) {
const double *high = inputs[0];
const double *low = inputs[1];
double *adown = outputs[0];
double *aup = outputs[1];
const int period = (int)options[0];
if (period < 1) return 1;
if (size <= ti_aroon_start(options)) return 0;
const double scale = 100.0 / period;
int trail = 0, maxi = -1, mini = -1;
double max = high[0];
double min = low[0];
double bar;
int i, j;
for (i = period; i < size; ++i, ++trail) {
bar = high[i];
if (maxi < trail) {
maxi = trail;
max = high[maxi];
j = trail;
while(++j <= i) {
bar = high[j];
if (bar >= max) {
max = bar;
maxi = j;
}
}
} else if (bar >= max) {
maxi = i;
max = bar;
}
bar = low[i];
if (mini < trail) {
mini = trail;
min = low[mini];
j = trail;
while(++j <= i) {
bar = low[j];
if (bar <= min) {
min = bar;
mini = j;
}
}
} else if (bar <= min) {
mini = i;
min = bar;
}
*adown++ = ((double)period - (i-mini)) * scale;
*aup++ = ((double)period - (i-maxi)) * scale;
}
((void) sizeof ((adown - outputs[0] == size - ti_aroon_start(options)) ? 1 : 0), __extension__ ({ if (adown - outputs[0] == size - ti_aroon_start(options)) ; else __assert_fail ("adown - outputs[0] == size - ti_aroon_start(options)", "indicators/aroon.c", 96, __extension__ __PRETTY_FUNCTION__); }));
((void) sizeof ((aup - outputs[1] == size - ti_aroon_start(options)) ? 1 : 0), __extension__ ({ if (aup - outputs[1] == size - ti_aroon_start(options)) ; else __assert_fail ("aup - outputs[1] == size - ti_aroon_start(options)", "indicators/aroon.c", 97, __extension__ __PRETTY_FUNCTION__); }));
return 0;
}
| {
"array_type": 5,
"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": 4,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 5,
"union_type": 0,
"while_loop": 2
} |
transcoder-set#SUM_MATRIX_ELEMENT_ABSOLUTE_DIFFERENCE_ROW_COLUMN_NUMBERS_prep#main.c | transcoder-set | SUM_MATRIX_ELEMENT_ABSOLUTE_DIFFERENCE_ROW_COLUMN_NUMBERS.c | main | 14 | int main(void) {
int n_success = 0;
int param0[] = {60,44,72,90,99,45,27,11,65,52};
for(int i = 0; i < len(param0); ++i)
{
if(f_filled(param0[i]) == f_gold(param0[i]))
{
n_success+=1;
}
break;
}
printf("#Results:", " ", n_success, ", ", len(param0));
return 0;
}
| {
"array_type": 1,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
tinycc#tccpp_prep#cstr_reset.c | tinycc | tccpp.c | cstr_reset | 4 | void cstr_reset(CString *cstr)
{
cstr->size = 0;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
json.h#allow_no_commas_prep#json_write_pretty_get_object_size.c | json.h | allow_no_commas.c | json_write_pretty_get_object_size | 26 | int json_write_pretty_get_object_size(const struct json_object_s *object,
size_t depth, size_t indent_size,
size_t newline_size, size_t *size) {
struct json_object_element_s *element;
*size += 1;
if (0 < object->length) {
*size += newline_size;
*size += object->length - 1;
for (element = object->start; 0 != element;
element = element->next) {
*size += (depth + 1) * indent_size;
*size += newline_size;
if (json_write_get_string_size(element->name, size)) {
return 1;
}
*size += 3;
if (json_write_pretty_get_value_size(element->value, depth + 1,
indent_size, newline_size, size)) {
return 1;
}
}
*size += depth * indent_size;
}
*size += 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": 1,
"return_statement": 3,
"struct_type": 2,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#MAXIMUM_LENGTH_SUBSEQUENCE_DIFFERENCE_ADJACENT_ELEMENTS_EITHER_0_1_prep#main.c | transcoder-set | MAXIMUM_LENGTH_SUBSEQUENCE_DIFFERENCE_ADJACENT_ELEMENTS_EITHER_0_1.c | main | 25 | int main(void) {
int n_success = 0;
int param0_0[] = {4,5,9,31,31,37,41,55,56,61,79,81,89,93};
int param0_1[] = {-76,96,-68,-16,22,-24,-24,6,98,-82,54,-80,46,0,0,-50};
int param0_2[] = {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};
int param0_3[] = {97,93,43,51,15,33,13,96,39,89,78,25,45,6,64,54};
int param0_4[] = {-98,-78,-72,-70,-68,-58,-56,-54,-46,-44,-38,-34,-30,-24,-18,-16,-14,-12,2,6,8,8,10,10,16,24,26,28,40,42,44,56,58,62,66,66,78,86};
int param0_5[] = {1,1,0,1,0,0};
int param0_6[] = {7,8,10,11,12,15,16,16,19,21,23,23,23,25,26,35,38,43,46,47,51,52,53,57,60,61,66,67,69,74,75,81,83,84,88,92,94,98,98,99};
int param0_7[] = {14,-40};
int param0_8[] = {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,1,1,1,1,1,1,1,1};
int param0_9[] = {59,70,53};
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[] = {12,15,29,13,19,3,34,1,38,1};
for(int i = 0; i < len(param0); ++i)
{
if(f_filled(param0[i],param1[i]) == f_gold(param0[i],param1[i]))
{
n_success+=1;
}
break;
}
printf("#Results:", " ", n_success, ", ", len(param0));
return 0;
}
| {
"array_type": 2,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#PROGRAM_FIND_REMAINDER_LARGE_NUMBER_DIVIDED_11_prep#f_filled.c | transcoder-set | PROGRAM_FIND_REMAINDER_LARGE_NUMBER_DIVIDED_11.c | f_filled | 1 | int f_filled ( char str [] ) {}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libxml2#libxml2-py_prep#libxml_xmlUCSIsKhmer.c | libxml2 | libxml2-py.c | libxml_xmlUCSIsKhmer | 13 | PyObject *
libxml_xmlUCSIsKhmer(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
int c_retval;
int code;
if (libxml_deprecationWarning("xmlUCSIsKhmer") == -1)
return(((void *)0));
if (!_PyArg_ParseTuple_SizeT(args, (char *)"i:xmlUCSIsKhmer", &code))
return(((void *)0));
c_retval = xmlUCSIsKhmer(code);
py_retval = libxml_intWrap((int) c_retval);
return(py_retval);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#FIND_VALUE_OF_Y_MOD_2_RAISED_TO_POWER_X_prep#min.c | transcoder-set | FIND_VALUE_OF_Y_MOD_2_RAISED_TO_POWER_X.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
} |
nettle-3.9.1#dsa_prep#nettle_dsa_signature_clear.c | nettle-3.9.1 | dsa.c | nettle_dsa_signature_clear | 6 | void
nettle_dsa_signature_clear(struct dsa_signature *signature)
{
__gmpz_clear(signature->r);
__gmpz_clear(signature->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": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
less-633#edit_prep#back_textlist.c | less-633 | edit.c | back_textlist | 17 | char * back_textlist(struct textlist *tlist, char *prev)
{
char *s;
if (prev == ((void *)0))
s = tlist->endstring;
else if (prev <= tlist->string)
return (((void *)0));
else
s = prev - 1;
while (*s == '\0')
s--;
if (s <= tlist->string)
return (((void *)0));
while (s[-1] != '\0' && s > tlist->string)
s--;
return (s);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 3,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 2
} |
rcs-5.10.1#rcsgen_prep#buildrevision.c | rcs-5.10.1 | rcsgen.c | buildrevision | 38 | char const *
buildrevision (struct wlink const *deltas, struct delta *target,
FILE *outfile, _Bool expandflag)
{
struct editstuff *es = make_editstuff ();
struct wlink *ls = ((top->repository. r)-> deltas);
if (deltas->entry == target)
{
openfcopy (outfile);
scandeltatext (es, &ls, target,
expandflag ? expand : copy,
1);
}
else
{
scandeltatext (es, &ls, deltas->entry, enter, 0);
while (ls = ls->next,
(deltas = deltas->next)->next)
{
scandeltatext (es, &ls, deltas->entry, edit, 0);
}
if (expandflag || outfile)
{
finishedit (es, ((void *)0), outfile, 0);
}
scandeltatext (es, &ls, target,
expandflag ? edit_expand : edit,
1);
finishedit (es,
expandflag ? target : ((void *)0),
outfile, 1);
}
unmake_editstuff (es);
if (outfile)
return ((void *)0);
Ozclose (&(top->flow. res));
return (top->flow. result);
}
| {
"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": 2,
"return_statement": 2,
"struct_type": 3,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 1
} |
libxml2#xpath_prep#xmlXPathPopNumber.c | libxml2 | xpath.c | xmlXPathPopNumber | 16 | double
xmlXPathPopNumber (xmlXPathParserContextPtr ctxt) {
xmlXPathObjectPtr obj;
double ret;
obj = valuePop(ctxt);
if (obj == ((void *)0)) {
{ xmlXPatherror((ctxt), "/home/melih/storage/Transpiler/Dataset/projects/codebases_v2/libxml2/xpath.c", 2038, (XPATH_INVALID_OPERAND)); if ((ctxt) != ((void *)0)) (ctxt)->error = (XPATH_INVALID_OPERAND); };
return(0);
}
if (obj->type != XPATH_NUMBER)
ret = xmlXPathCastToNumberInternal(ctxt, obj);
else
ret = obj->floatval;
xmlXPathReleaseObject(ctxt->context, obj);
return(ret);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
optipng-0.7.8#tiffutil_prep#minitiff_error.c | optipng-0.7.8 | tiffutil.c | minitiff_error | 8 | void minitiff_error(const struct minitiff_info *info_ptr, const char *msg)
{
if (info_ptr->error_handler != ((void *)0))
info_ptr->error_handler(msg);
else
default_error_handler(msg);
abort();
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#FIND_MINIMUM_SUM_FACTORS_NUMBER_prep#len.c | transcoder-set | FIND_MINIMUM_SUM_FACTORS_NUMBER.c | len | 1 | int len (int arr [ ]) {return ((int) (sizeof (arr) / sizeof (arr)[0]));}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
grep-3.11#localename_prep#gl_locale_name_posix.c | grep-3.11 | localename.c | gl_locale_name_posix | 9 | const char *
gl_locale_name_posix (int category, __attribute__ ((__unused__)) const char *categoryname)
{
{
const char *locname;
locname = setlocale_null (category);
return locname;
}
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
wget-1.21.4#iri_prep#idn_encode.c | wget-1.21.4 | iri.c | idn_encode | 30 | char *
idn_encode (const struct iri *i, const char *host)
{
int ret;
char *ascii_encoded;
char *utf8_encoded = ((void *)0);
const char *src;
if (!i->utf8_encode)
{
if (!remote_to_utf8 (i, host, &utf8_encoded))
return ((void *)0);
src = utf8_encoded;
}
else
src = host;
ret = idn2_lookup_u8 ((uint8_t *) src, (uint8_t **) &ascii_encoded, IDN2_NONTRANSITIONAL);
if (ret != IDN2_OK)
ret = idn2_lookup_u8 ((uint8_t *) src, (uint8_t **) &ascii_encoded, IDN2_TRANSITIONAL);
if (ret != IDN2_OK)
logprintf (LOG_VERBOSE, gettext("idn_encode failed (%d): %s\n"), ret,
quote (idn2_strerror (ret)));
do { free ((void *) (utf8_encoded)); utf8_encoded = ((void *)0); } while (0);
if (ret == IDN2_OK && ascii_encoded)
{
char *tmp = xstrdup (ascii_encoded);
idn2_free (ascii_encoded);
ascii_encoded = tmp;
}
return ret == IDN2_OK ? ascii_encoded : ((void *)0);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 5,
"memory_management": 1,
"memory_operation": 0,
"pointer_type": 4,
"return_statement": 2,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 1
} |
tinycc#libtcc_prep#tcc_add_dll.c | tinycc | libtcc.c | tcc_add_dll | 5 | int tcc_add_dll(TCCState *s, const char *filename, int flags)
{
return tcc_add_library_internal(s, "%s/%s", filename, flags,
s->library_paths, s->nb_library_paths);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
rcs-5.10.1#rcsutil_prep#str_save.c | rcs-5.10.1 | rcsutil.c | str_save | 5 | char *
str_save (char const *s)
{
return intern (plexus, s, strlen (s));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
gprolog-1.5.0#char_io_c_prep#Pl_Get_Key_No_Echo_1.c | gprolog-1.5.0 | char_io_c.c | Pl_Get_Key_No_Echo_1 | 5 | Bool
Pl_Get_Key_No_Echo_1(WamWord code_word)
{
return Pl_Get_Key_No_Echo_2(((PlLong) (0) + ((PlULong)0)), code_word);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#SUM_LARGEST_PRIME_FACTOR_NUMBER_LESS_EQUAL_N_prep#min.c | transcoder-set | SUM_LARGEST_PRIME_FACTOR_NUMBER_LESS_EQUAL_N.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
} |
nettle-3.9.1#camellia-invert-key_prep#_nettle_camellia_invert_key.c | nettle-3.9.1 | camellia-invert-key.c | _nettle_camellia_invert_key | 12 | void
_nettle_camellia_invert_key(unsigned nkeys,
uint64_t *dst, const uint64_t *src)
{
unsigned i;
if (dst == src)
for (i = 0; i < nkeys - 1 - i; i++)
do { uint64_t t_swap = (dst[i]); (dst[i]) = (dst[nkeys - 1- i]); (dst[nkeys - 1- i]) = t_swap; } while(0);
else
for (i = 0; i < nkeys; i++)
dst[i] = src[nkeys - 1 - i];
}
| {
"array_type": 1,
"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": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
libosip2-5.3.1#osip_via_prep#osip_via_set_comment.c | libosip2-5.3.1 | osip_via.c | osip_via_set_comment | 3 | void osip_via_set_comment(osip_via_t *via, char *comment) {
via->comment = comment;
}
| {
"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
} |
wget-1.21.4#css__prep#yyget_leng.c | wget-1.21.4 | css_.c | yyget_leng | 4 | int yyget_leng (void)
{
return yyleng;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libxml2#libxml2-py_prep#libxml_xmlUCSIsCatMn.c | libxml2 | libxml2-py.c | libxml_xmlUCSIsCatMn | 13 | PyObject *
libxml_xmlUCSIsCatMn(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
int c_retval;
int code;
if (libxml_deprecationWarning("xmlUCSIsCatMn") == -1)
return(((void *)0));
if (!_PyArg_ParseTuple_SizeT(args, (char *)"i:xmlUCSIsCatMn", &code))
return(((void *)0));
c_retval = xmlUCSIsCatMn(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
} |
screen-4.9.0#misc_prep#centerline.c | screen-4.9.0 | misc.c | centerline | 13 | void
centerline(str, y)
char *str;
int y;
{
int l, n;
do {} while (0);
n = strlen(str);
if (n > flayer->l_width - 1)
n = flayer->l_width - 1;
l = (flayer->l_width - 1 - n) / 2;
LPutStr(flayer, str, n, &mchar_blank, l, y);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
libxml2#libxml2-py_prep#libxml_xmlValidateNmtokenValue.c | libxml2 | libxml2-py.c | libxml_xmlValidateNmtokenValue | 11 | PyObject *
libxml_xmlValidateNmtokenValue(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
int c_retval;
xmlChar * value;
if (!_PyArg_ParseTuple_SizeT(args, (char *)"z:xmlValidateNmtokenValue", &value))
return(((void *)0));
c_retval = xmlValidateNmtokenValue(value);
py_retval = libxml_intWrap((int) c_retval);
return(py_retval);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 0
} |
tar-1.34#c-strcasecmp_prep#c_strcasecmp.c | tar-1.34 | c-strcasecmp.c | c_strcasecmp | 23 | int
c_strcasecmp (const char *s1, const char *s2)
{
register const unsigned char *p1 = (const unsigned char *) s1;
register const unsigned char *p2 = (const unsigned char *) s2;
unsigned char c1, c2;
if (p1 == p2)
return 0;
do
{
c1 = c_tolower (*p1);
c2 = c_tolower (*p2);
if (c1 == '\0')
break;
++p1;
++p2;
}
while (c1 == c2);
if ((0x7f * 2 + 1) <= 0x7fffffff)
return c1 - c2;
else
return (((c1) > (c2)) - ((c1) < (c2)));
}
| {
"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": 2,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
gawk-5.2.2#debug_prep#do_condition.c | gawk-5.2.2 | debug.c | do_condition | 16 | int
do_condition(CMDARG *arg, int cmd __attribute__ ((__unused__)))
{
int type, num;
char *expr = ((void *)0);
num = arg->value.lval;
type = has_break_or_watch_point(&num, 0);
if (! type)
return 0;
arg = arg->next;
if (arg != ((void *)0))
expr = arg->value.sval;
if (parse_condition(type, num, expr) == 0 && arg != ((void *)0))
arg->value.sval = ((void *)0);
return 0;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
nano-7.2#chars_prep#is_zerowidth.c | nano-7.2 | chars.c | is_zerowidth | 9 | _Bool is_zerowidth(const char *ch)
{
wchar_t wc;
if ((unsigned char)*ch < 0xCC || !use_utf8)
return 0;
if (mbtowide(&wc, ch) < 0)
return 0;
return (wcwidth(wc) == 0);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#COUNT_POSSIBLE_WAYS_TO_CONSTRUCT_BUILDINGS_prep#cmpfunc.c | transcoder-set | COUNT_POSSIBLE_WAYS_TO_CONSTRUCT_BUILDINGS.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
} |
gawk-5.2.2#awkgram_prep#getfname.c | gawk-5.2.2 | awkgram.c | getfname | 17 | const char *
getfname(NODE *(*fptr)(int), _Bool prepend_awk)
{
int i, j;
static char buf[100];
j = sizeof(tokentab) / sizeof(tokentab[0]);
for (i = 0; i < j; i++) {
if (tokentab[i].ptr == fptr || tokentab[i].ptr2 == fptr) {
if (prepend_awk && (tokentab[i].flags & 0x0400) != 0) {
sprintf(buf, "awk::%s", tokentab[i].operator);
return buf;
}
return tokentab[i].operator;
}
}
return ((void *)0);
}
| {
"array_type": 2,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 1,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
units-2.22#units_prep#unit2num.c | units-2.22 | units.c | unit2num | 13 | int
unit2num(struct unittype *input)
{
struct unittype one;
int err;
initializeunit(&one);
if ((err=completereduce(input)))
return err;
if (compareunits(input,&one,ignore_nothing))
return 5;
freeunit(input);
return 0;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 3,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#MINIMUM_INSERTIONS_SORT_ARRAY_prep#main.c | transcoder-set | MINIMUM_INSERTIONS_SORT_ARRAY.c | main | 25 | int main(void) {
int n_success = 0;
int param0_0[] = {4,7,20,22,23,31,33,36,47,61,63,63,71,74,82,91,95,99};
int param0_1[] = {-84,12,-42,-78,22,72,56,70,28,-72};
int param0_2[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
int param0_3[] = {29,41,4,62,77,74,30,2,14,90,93,10,78,36,66,22,48,89,36,73,70,23,90};
int param0_4[] = {-80,-72,-68,-66,-58,-50,-48,-32,-28,-24,-22,-18,0,2,6,10,12,14,14,18,24,24,24,28,28,28,34,38,42,42,46,46,46,58,80,82,82,84,84,86,88,90,92,96};
int param0_5[] = {1,1,0,1,0,1,0,0,1,0};
int param0_6[] = {26,36,58,64,69,72,79,82,82,87,89,90,95};
int param0_7[] = {-52,-40,98,40,42,-50,60,-64,-92,36,-88,72,-72,38,-80,-52,68,70,16,22,-30,-74,56,-80,62,-54,-32,-22,-86,-70,88,-76,-46,28,40,-2,-84,68,-98,-16,90,36,-38,-86,20,-40,82,98,54};
int param0_8[] = {0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1};
int param0_9[] = {36,62,58,24,99,12,46,3,4,40,54,97,48,94,98,7,17,5,3,36,3};
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[] = {15,7,16,13,36,8,8,41,10,16};
for(int i = 0; i < len(param0); ++i)
{
if(f_filled(param0[i],param1[i]) == f_gold(param0[i],param1[i]))
{
n_success+=1;
}
break;
}
printf("#Results:", " ", n_success, ", ", len(param0));
return 0;
}
| {
"array_type": 2,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
tulipindicators-0.9.1#tiamalgamation_prep#ti_build.c | tulipindicators-0.9.1 | tiamalgamation.c | ti_build | 1 | long int ti_build(void) {return 1642469817;}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
tmux#imsg_prep#imsg_compose.c | tmux | imsg.c | imsg_compose | 13 | int
imsg_compose(struct imsgbuf *ibuf, uint32_t type, uint32_t peerid, pid_t pid,
int fd, const void *data, uint16_t datalen)
{
struct ibuf *wbuf;
if ((wbuf = imsg_create(ibuf, type, peerid, pid, datalen)) == ((void *)0))
return (-1);
if (imsg_add(wbuf, data, datalen) == -1)
return (-1);
wbuf->fd = fd;
imsg_close(ibuf, wbuf);
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": 1,
"return_statement": 3,
"struct_type": 2,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#PROGRAM_TO_FIND_THE_AREA_OF_PENTAGON_prep#f_gold.c | transcoder-set | PROGRAM_TO_FIND_THE_AREA_OF_PENTAGON.c | f_gold | 5 | float f_gold ( float a ) {
float area;
area = ( sqrt ( 5 * ( 5 + 2 * ( sqrt ( 5 ) ) ) ) * a * a ) / 4;
return area;
}
| {
"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
} |
units-2.22#parse.tab_prep#factorial.c | units-2.22 | parse.tab.c | factorial | 5 | double
factorial(double x)
{
return tgamma(x+1);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
nano-7.2#global_prep#back_it_up.c | nano-7.2 | global.c | back_it_up | 1 | void back_it_up(void) {;}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
optipng-0.7.8#pngrio_prep#png_read_data.c | optipng-0.7.8 | pngrio.c | png_read_data | 9 | void
png_read_data(png_structrp png_ptr, png_bytep data, size_t length)
{
((void)0);
if (png_ptr->read_data_fn != ((void *)0))
(*(png_ptr->read_data_fn))(png_ptr, data, length);
else
png_error(png_ptr, "Call to NULL read function");
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
bc-1.07.1#storage_prep#push_num.c | bc-1.07.1 | storage.c | push_num | 9 | void
push_num (bc_num num)
{
estack_rec *temp;
temp = bc_malloc (sizeof (estack_rec));
temp->s_num = num;
temp->s_next = ex_stack;
ex_stack = temp;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#COUNT_MINIMUM_NUMBER_SUBSETS_SUBSEQUENCES_CONSECUTIVE_NUMBERS_prep#main.c | transcoder-set | COUNT_MINIMUM_NUMBER_SUBSETS_SUBSEQUENCES_CONSECUTIVE_NUMBERS.c | main | 25 | int main(void) {
int n_success = 0;
int param0_0[] = {3,7,7,11,14,14,14,16,17,17,21,22,24,27,27,27,31,33,35,36,36,37,38,43,45,49,52,54,57,59,59,60,67,73,74,74,74,75,75,79,83,87,90,93,97};
int param0_1[] = {-28,72,60,62,40,64,50,-36,-24,40,-6,78,-80,-82,2,-30,70,94,-2,-30,92,12,-46,32,-96,-2,36,-40,-42,66,98};
int param0_2[] = {1,1};
int param0_3[] = {96,89,24,28,70,78,78,35,98,65,18,81,35,91,33,88,69,52,66,17,73,79,30,33,78,60,42,8,36,6,47,87,8,98,9,77,78,24,86,91,13,79,50,85,3,7,61,94,86};
int param0_4[] = {-92,-92,-90,-84,-78,-66,-60,-60,-46,-42,-38,-32,-24,-20,-18,-16,-14,-10,0,4,6,12,24,32,34,44,48,50,50,64,66,68,80,84,86,86,88,90,90,90,92,94,96,98,98};
int param0_5[] = {0,1,1,0,1,0,0,1,0,0,1,0,0,1,1,1,0,1,0,1,1,1,0,1,0,1,0,0,0,1,0,1,1,0,0,1,1,1,1,1,0,1,0,0,0};
int param0_6[] = {8,12,13,14,16,20,20,21,23,23,24,27,29,29,29,29,35,35,38,39,40,46,50,52,60,62,62,65,65,65,70,71,72,73,75,76,80,81,82,83,85,91,95,97,98,98};
int param0_7[] = {-84,92,70,-46,26,-94,-82,-26,-90,-62,52,62,-58,44,-14,-6,58,2,10,76,-34,42,-26,80,26,32,-82,38,2,72,68,44,24,84,-32,54,-96,-8,36,80,-82,32,98,-68};
int param0_8[] = {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};
int param0_9[] = {64,10,6,3,67,95,72,96,72,30,99,21,46,23,48,38,48,50,53,91,59,58,27,95,63,20,27,22,58,3,11,75,77,64,46,1,67,79,6,46,57,79,49,83,21,36,44};
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[] = {42,24,1,26,42,27,29,25,21,46};
for(int i = 0; i < len(param0); ++i)
{
if(f_filled(param0[i],param1[i]) == f_gold(param0[i],param1[i]))
{
n_success+=1;
}
break;
}
printf("#Results:", " ", n_success, ", ", len(param0));
return 0;
}
| {
"array_type": 2,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#SMALLEST_POWER_OF_2_GREATER_THAN_OR_EQUAL_TO_N_2_prep#cmpfunc.c | transcoder-set | SMALLEST_POWER_OF_2_GREATER_THAN_OR_EQUAL_TO_N_2.c | cmpfunc | 1 | int cmpfunc (const void * a, const void * b) {return ( *(int*)a - *(int*)b );}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
tulipindicators-0.9.1#candles_prep#tc_gravestone_doji.c | tulipindicators-0.9.1 | candles.c | tc_gravestone_doji | 5 | int tc_gravestone_doji(int size, TC_REAL const *const *inputs, tc_config const *options, tc_result *output) {
const TC_REAL *open = inputs[0]; const TC_REAL *high = inputs[1]; const TC_REAL *low = inputs[2]; const TC_REAL *close = inputs[3]; const int period = options->period; const TC_REAL div = 1.0 / period; TC_REAL avg_body_sum = 0; TC_REAL avg_total_sum = 0; if (period < 1) return 1; if (size < period) return 0; int i; for (i = 0; i < period; ++i) { avg_body_sum += (fabs(open[(i)] - close[(i)])); avg_total_sum += (high[(i)] - low[(i)]); }
while(i < size) { const TC_REAL top = (open[(i)] > close[(i)] ? open[(i)] : close[(i)]); const TC_REAL bottom = (open[(i)] < close[(i)] ? open[(i)] : close[(i)]); const TC_REAL body = (fabs(open[(i)] - close[(i)])); const TC_REAL total = (high[(i)] - low[(i)]); const TC_REAL upper = (high[(i)] - top); const TC_REAL lower = (bottom - low[(i)]); const TC_REAL avg_body = avg_body_sum * div; const TC_REAL avg_total = avg_total_sum * div; (void)top;(void)bottom;(void)body;(void)total; (void)upper;(void)lower;(void)avg_body;(void)avg_total; if (((fabs(open[(i)] - close[(i)])) < (options->body_none * avg_total)) && ((high[(i)] - top) > (options->wick_long * avg_body)) && ((bottom - low[(i)]) < (options->wick_none * avg_total))) { do { const tc_hit hit = {i, (1L<<12)}; 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": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 4,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 1
} |
transcoder-set#PROGRAM_PRINT_SUM_GIVEN_NTH_TERM_1_prep#sort.c | transcoder-set | PROGRAM_PRINT_SUM_GIVEN_NTH_TERM_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
} |
json.h#allow_equals_in_object_prep#json_write_minified_value.c | json.h | allow_equals_in_object.c | json_write_minified_value | 35 | char *json_write_minified_value(const struct json_value_s *value, char *data) {
switch (value->type) {
default:
return 0;
case json_type_number:
return json_write_number((struct json_number_s *)value->payload, data);
case json_type_string:
return json_write_string((struct json_string_s *)value->payload, data);
case json_type_array:
return json_write_minified_array((struct json_array_s *)value->payload,
data);
case json_type_object:
return json_write_minified_object((struct json_object_s *)value->payload,
data);
case json_type_true:
data[0] = 't';
data[1] = 'r';
data[2] = 'u';
data[3] = 'e';
return data + 4;
case json_type_false:
data[0] = 'f';
data[1] = 'a';
data[2] = 'l';
data[3] = 's';
data[4] = 'e';
return data + 5;
case json_type_null:
data[0] = 'n';
data[1] = 'u';
data[2] = 'l';
data[3] = 'l';
return data + 4;
}
}
| {
"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": 8,
"struct_type": 1,
"switch_statement": 1,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
libxml2#xmlschemas_prep#xmlSchemaSetValidOptions.c | libxml2 | xmlschemas.c | xmlSchemaSetValidOptions | 14 | int
xmlSchemaSetValidOptions(xmlSchemaValidCtxtPtr ctxt,
int options)
{
int i;
if (ctxt == ((void *)0))
return (-1);
for (i = 1; i < (int) sizeof(int) * 8; i++) {
if (options & 1<<i)
return (-1);
}
ctxt->options = options;
return (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": 0,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#FIND_ONE_EXTRA_CHARACTER_STRING_1_prep#f_filled.c | transcoder-set | FIND_ONE_EXTRA_CHARACTER_STRING_1.c | f_filled | 1 | char f_filled ( char strA [], char strB [] ) {}
| {
"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#PROGRAM_CALCULATE_AREA_OCTAGON_prep#f_filled.c | transcoder-set | PROGRAM_CALCULATE_AREA_OCTAGON.c | f_filled | 1 | double f_filled ( double 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#CHECK_ARRAY_REPRESENTS_INORDER_BINARY_SEARCH_TREE_NOT_prep#cmpfunc.c | transcoder-set | CHECK_ARRAY_REPRESENTS_INORDER_BINARY_SEARCH_TREE_NOT.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
} |
dap-3.10#dap_prep#suffix.c | dap-3.10 | dap.c | suffix | 20 | void suffix(char name[], char suff[])
{
int n;
n = strlen(name);
if (n > 2 && !strcmp(name + n - 2, ".c"))
{
name[n - 2] = '\0';
strcat(name, suff);
}
else if (n > 4 && !strcmp(name + n - 4, ".sbs"))
{
name[n - 4] = '\0';
strcat(name, suff);
}
else
{
fprintf(stderr, "dap: name must end in .c or .sbs: %s\n", name);
exit(1);
}
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.