functionSource
stringlengths
20
97.4k
CWE-119
bool
2 classes
CWE-120
bool
2 classes
CWE-469
bool
2 classes
CWE-476
bool
2 classes
CWE-other
bool
2 classes
combine
int64
0
1
encode_bMaxPower(enum usb_device_speed speed, struct usb_configuration *c) { unsigned val; if (c->MaxPower) val = c->MaxPower; else val = CONFIG_USB_GADGET_VBUS_DRAW; if (!val) return 0; switch (speed) { case USB_SPEED_SUPER: return DIV_ROUND_UP(val, 8); default: return DIV_ROUND_UP(val, 2); } }
false
false
false
false
false
0
eliminate_doubles(struct entry *root, struct entry *orig) { if (orig) { if (orig->size && (orig->path || orig->uncompressed)) find_identical_file(root, orig); eliminate_doubles(root, orig->child); eliminate_doubles(root, orig->next); } }
false
false
false
false
false
0
readFromStream(mrpt::utils::CStream &in, int version) { switch(version) { case 0: { uint32_t i,n; in >> n; possibleTypes.clear(); for (i=0;i<n;i++) { std::string aux; in >> aux; possibleTypes.push_back( aux ); } // Selection: in >> i; selection = i; } break; default: M...
false
false
false
false
false
0
i915_gem_shrink(struct drm_i915_private *dev_priv, unsigned long target, unsigned flags) { const struct { struct list_head *list; unsigned int bit; } phases[] = { { &dev_priv->mm.unbound_list, I915_SHRINK_UNBOUND }, { &dev_priv->mm.bound_list, I915_SHRINK_BOUND }, { NULL, 0 }, }, *phase; unsigned long c...
false
false
false
false
false
0
crossesPageBreak(int t, int b) const { RenderObject* cb = container(); if (cb) return cb->crossesPageBreak(yPos()+t, yPos()+b); else return false; }
false
false
false
false
false
0
Scm_DoubleToHalf(double v) { u_long mant1, mant0; int exp0, sign0; int e, mbits; unsigned long m, r; decode_double(v, &mant1, &mant0, &exp0, &sign0); if (exp0 == 0x7ff) { /* special */ if ( #if SIZEOF_LONG >= 8 mant0 == 0 #else /*SIZEOF_LONG < 8*/ mant0 == 0 &...
false
false
false
false
false
0
outputHeader ( PTIF_INST g, /* in: ptr to instance structure */ DWORD dwOutputAvail, /* in: # avail bytes in out-buf */ PBYTE pbOutputBuf, /* in: ptr to out-buffer */ PDWORD pdwOutputUsed, /* out: # bytes written in out-buf */ PDWORD pdwOutputThisPos) /* ou...
false
false
false
false
false
0
draw (Canvas* c, Graphic* gs) { PSBrush* br = gs->GetBrush(); if (!Head() && !Tail()) { SFH_OpenBSpline::draw(c, gs); } else if (!br->None()) { int j = count()-3, k = count()-2, l = count()-1; Coord x0 = x()[0], y0 = y()[0], x1 = x()[l], y1 = y()[l]; Coord tx0 = x0, ty0 = y...
false
false
false
false
false
0
ath10k_wmi_10_2_op_pull_fw_stats(struct ath10k *ar, struct sk_buff *skb, struct ath10k_fw_stats *stats) { const struct wmi_10_2_stats_event *ev = (void *)skb->data; u32 num_pdev_stats; u32 num_pdev_ext_stats; u32 num_vdev_stats; u32 num_peer_stats; int i; if (!skb_pull(skb, sizeof(*ev))) ret...
false
false
false
false
false
0
bignum_bitcount(Bignum bn) { int bitcount = bn[0] * BIGNUM_INT_BITS - 1; while (bitcount >= 0 && (bn[bitcount / BIGNUM_INT_BITS + 1] >> (bitcount % BIGNUM_INT_BITS)) == 0) bitcount--; return bitcount + 1; }
false
false
false
false
false
0
split_tokens(char* line) { char** tokens; if ((tokens = malloc(sizeof(char*))) == NULL) { cmd_error("out of memory\n"); } tokens[0] = NULL; while (1) { for (; *line != '\0' && isspace((int)*line); line++) ; if (*line == '\0') { break; } tokens = sa_concat(tokens, line); ...
false
false
true
true
false
1
nvme_trans_fmt_set_blk_size_count(struct nvme_ns *ns, struct sg_io_hdr *hdr) { int res = 0; int nvme_sc; u8 flbas; /* * SCSI Expects a MODE SELECT would have been issued prior to * a FORMAT UNIT, and the block size and number would be used * from the block descriptor in it. If a MODE SELECT had not...
false
false
false
false
false
0
eng_image_max_size_get(void *data, int *maxw, int *maxh) { Render_Engine *re = (Render_Engine *)data; if (maxw) *maxw = re->win->gl_context->shared->info.max_texture_size; if (maxh) *maxh = re->win->gl_context->shared->info.max_texture_size; }
false
false
false
false
false
0
update_bonus_level_display() { /* Michael! What are you doing? You're messing this all up! Who the fuck are you? Your conscience! You can do better! I can do this way cleaner. I know! This is just another terrible hack. Stop it! Shhiiiiit, who cares? It's too goddamn late you bastard. Y...
false
false
false
false
false
0
is_escape_byte(const unsigned char status) { if (status == 0xF7) return (1); return (0); }
false
false
false
false
false
0
Init() { static ClassDocumentation<SplittingFunction> documentation ("The SplittingFunction class is the based class for 1->2 splitting functions" " in Herwig++"); static Switch<SplittingFunction,ColourStructure> interfaceColourStructure ("ColourStructure", "The colour structure for the splittin...
false
false
false
false
false
0
Iquote (int argc, lvar_t *argv) { Tobj so, ao=NULL, qo=NULL; char *s=NULL, *s1, *s2, *qs, *as; char buf2[50]; int n, bufi; if ( (Tgettype ((so = argv[0].o)) != T_STRING && !T_ISNUMBER (so)) || (argc > 1 && Tgettype ((qo = argv[1].o)) != T_STRING) || (argc > 2 && Tgettype ((a...
false
false
false
false
true
1
gt_transcript_exons_uniq_in_place_count(GtTranscriptExons *te) { GtTranscriptCounts *tc; GtArray *counts; gt_assert(te); tc = gt_transcript_counts_new(); counts = gt_ranges_uniq_in_place_count(te->exon_array_all); gt_transcript_counts_...
false
false
false
false
false
0
getcolor(const char* color) { XColor c; Colormap map = DefaultColormap(dis,screen); if(!XAllocNamedColor(dis,map,color,&c,&c)) die("Error parsing color!"); return c.pixel; }
false
false
false
false
false
0
ipmi_sel_parse_first (ipmi_sel_parse_ctx_t ctx) { if (!ctx || ctx->magic != IPMI_SEL_PARSE_CTX_MAGIC) { ERR_TRACE (ipmi_sel_parse_ctx_errormsg (ctx), ipmi_sel_parse_ctx_errnum (ctx)); return (-1); } if (!ctx->sel_entries_itr) { ctx->errnum = IPMI_SEL_PARSE_ERR_NO_SEL_ENTRIES; re...
false
false
false
false
false
0
JDK_execvpe(const char *file, const char *argv[], const char *const envp[]) { if (envp == NULL || (char **) envp == environ) { execvp(file, (char **) argv); return; } if (*file == '\0') { errno = ENOENT; return; } if (strchr(file, '/') != NUL...
false
false
false
false
false
0
setNetmask(const QString &netm, bool inverted_netmask) { InetAddr inetaddr_nm; try { inetaddr_nm = InetAddr(netm.toStdString()); if (inverted_netmask) inetaddr_nm = ~inetaddr_nm; } catch (FWException &ex) { if (netm.contains('.')) { // netmask has '.' in...
false
false
false
false
false
0
Append(Tcl_Interp *interp, char *flag, char *val) { Tcl_AppendElement(interp, flag); Tcl_AppendElement(interp, val ? val : ""); }
false
false
false
false
false
0
statHistBin(const StatHist * H, double v) { int bin; #if BROKEN_STAT_HIST_BIN return 0; /* NOTREACHED */ #endif v -= H->min; /* offset */ if (v <= 0.0) /* too small */ return 0; bin = (int) floor(H->scale * H->val_in(v) + 0.5); if (bin < 0) /* should not happen */ bin = 0; if (bin >...
false
false
false
false
false
0
decrypt_opcode(int a,int src) { if ( BIT(a,9) & BIT(a,8)) src ^= 0x80; if ( BIT(a,11) & BIT(a,4) & BIT(a,1)) src ^= 0x40; if (~BIT(a,13) & BIT(a,12)) src ^= 0x20; if (~BIT(a,6) & BIT(a,1)) src ^= 0x10; if (~BIT(a,12) & BIT(a,2)) src ^= 0x08; if ( BIT(a...
false
false
false
false
false
0
phar_compile_file(zend_file_handle *file_handle, int type TSRMLS_DC) /* {{{ */ { zend_op_array *res; char *name = NULL; int failed; phar_archive_data *phar; if (!file_handle || !file_handle->filename) { return phar_orig_compile_file(file_handle, type TSRMLS_CC); } if (strstr(file_handle->filename, ".phar") &&...
false
false
false
false
false
0
png_build_grayscale_palette(int bit_depth, png_colorp palette) { int num_palette; int color_inc; int i; int v; png_debug(1, "in png_do_build_grayscale_palette"); if (palette == NULL) return; switch (bit_depth) { case 1: num_palette = 2; color_inc = 0xff; ...
false
false
false
false
false
0
AST_callCompFunc (Node *node, SymTable *st, Program *p, CompContext *cc, bool follow) { int i; if (NULL == node) return; for (i = 0; i < N_COMPFUNCS; i++) if (CompFuncs[i].type == node->type) break; /* printf ("> %s, (%p:%s)\n", */ /* CompFuncs[i].name, (void *) node, Node_name(node)); */ Co...
false
false
false
false
false
0
xatou(const char *s) { unsigned long out; char *endp; errno = 0; out = strtoul(s, &endp, 10); if (endp == s || *endp != '\0' || errno == ERANGE || out > UINT_MAX) die("%s: error converting %s to unsigned integer\n", prog_name, s); return (unsigned)out; }
false
false
false
false
false
0
ov2659_read(struct i2c_client *client, u16 reg, u8 *val) { struct i2c_msg msg[2]; u8 buf[2]; int ret; buf[0] = reg >> 8; buf[1] = reg & 0xFF; msg[0].addr = client->addr; msg[0].flags = client->flags; msg[0].buf = buf; msg[0].len = sizeof(buf); msg[1].addr = client->addr; msg[1].flags = client->flags | I2C...
false
false
false
false
false
0
move_fill(piece_info_t *obj) { if (obj->count == obj_capacity (obj)) /* full? */ obj->func = NOFUNC; /* awaken full boat */ else obj->moved = piece_attr[obj->type].speed; }
false
false
false
false
false
0
fs_binding_create(fs_binding *b, const char *name, fs_rid val, int projected) { int i; for (i=0; i < FS_BINDING_MAX_VARS && b[i].name; i++); if (i == FS_BINDING_MAX_VARS) { fs_error(LOG_ERR, "variable limit of %d exceeded", FS_BINDING_MAX_VARS); return NULL; } b[i].name = g_strdup(...
false
false
false
false
false
0
DumpBacktrace(std::ostream & os) { #if defined(__linux__) void *bt_array[100]; // 100 should be enough ?!? char **bt_strings; int num_entries; if ((num_entries = backtrace(bt_array, 100)) < 0) { os << " Unable to generate a backtrace" << std::endl; return; } if ((bt_strings = backtrace_symbols(bt_array,...
false
false
false
false
false
0
viewConnectorItemInfo(QGraphicsSceneHoverEvent *, ConnectorItem * connectorItem) { int count = connectorItem ? connectorItem->connectionsCount() : 0; if (m_lastConnectorItem == connectorItem && m_lastConnectorItemCount == count) return; m_lastConnectorItem = connectorItem; m_lastConnectorItemCount = count; Conn...
false
false
false
false
false
0
url_decode(string str) { // replace + characters with spaces for (size_t i = 0; i < str.size(); i++) { if (str[i] == '+') str[i] = ' '; } // escape characters for (size_t i = 0; i < str.size(); i++) { if (str[i] == '%') { // get the next two characters string code = str...
false
false
false
false
false
0
usbtiny_powerdown(PROGRAMMER * pgm) { if (!PDATA(pgm)->usb_handle) { return; // wasn't connected in the first place } usb_control(pgm, USBTINY_POWERDOWN, 0, 0); // Send USB control command to device }
false
false
false
false
false
0
isl_tab_set_initial_basis_with_cone(struct isl_tab *tab, struct isl_tab *tab_cone) { struct isl_mat *eq; struct isl_mat *cone_eq; struct isl_mat *U, *Q; if (!tab || !tab_cone) return -1; if (tab_cone->n_col == tab_cone->n_dead) { tab->basis = initial_basis(tab); return tab->basis ? 0 : -1; } eq = tab_e...
false
false
false
false
false
0
getpool(struct arena *a, ulong n, int exp) { struct block *b, *pool; DXlock(&a->pool_lock, 0); /* lock the pool */ if (a->pool_size < n) { /* is pool big enough? */ if (!exp || !expand(a, n)) { /* no; can we expand? */ DXunlock(&a->pool_lock, 0); /* no; unlock */ return NULL; /* return failur...
false
false
false
false
false
0
traceResponse(const fxStackBuffer& buf) { const char* extra = ""; u_int len = buf.getLength(); if (len > 0) { const char* cp = buf; do { if (!isprint(*cp++)) { extra = "unknown paging central response"; break; } } while (--len); /* * No unprintable characters, just log the string w/o *...
false
false
false
false
false
0
data_message_init(char * data, size_t len) { struct generic_message_t * msg_data; mailmessage * msg; int r; struct mailimf_fields * fields; msg = mailmessage_new(); if (msg == NULL) goto err; r = mailmessage_init(msg, NULL, data_message_driver, 0, len); if (r < 0) goto free; msg_data = ms...
false
false
false
false
false
0
inf_adopted_session_replay_synchronization_failed_cb(InfSession* session, InfXmlConnection* conn, GError* error, gpointer user_data) { InfAdoptedSessionReplay*...
false
false
false
false
false
0
nvbios_disp_table(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *sub) { struct bit_entry U; if (!bit_entry(bios, 'U', &U)) { if (U.version == 1) { u16 data = nvbios_rd16(bios, U.offset); if (data) { *ver = nvbios_rd08(bios, data + 0x00); switch (*ver) { case 0x20: case 0x...
false
false
false
false
false
0
unparent_objects_recurse (GladeWidget *widget) { GladeWidget *child; GList *children, *list; /* Unparent all children */ if ((children = glade_widget_get_children (widget)) != NULL) { for (list = children; list; list = list->next) { child = glade_widget_get_from_gobject (list->data)...
false
false
false
false
false
0
__ecereInstMeth___ecereNameSpace__ecere__gui__controls__EditBox_OnActivate__00000003(struct __ecereNameSpace__ecere__com__Instance * this, unsigned int active, struct __ecereNameSpace__ecere__com__Instance * previous, unsigned int * goOnWithActivation, unsigned int direct) { struct __ecereNameSpace__ecere__gui__control...
false
false
false
false
false
0
getannotatestoredata(char *tag, struct entryattlist **entryatts) { int c, islist = 0; static struct buf entry, attrib, value; struct attvaluelist *attvalues = NULL; *entryatts = NULL; c = prot_getc(imapd_in); if (c == EOF) { prot_printf(imapd_out, "%s BAD Missing annotation entry\r\n", ...
false
false
false
false
false
0
client_discard_input(struct client *client) { if (http_conn_current_message_has_body(client->conn)) { log_debug("proxy: will discard client msg body"); http_conn_disable_persistence(client->conn); client->state = CLIENT_STATE_DISCARD_INPUT; } }
false
false
false
false
false
0
test_verified_connection (TestConnection *test, gconstpointer data) { GIOStream *connection; GError *error = NULL; test->database = g_tls_file_database_new (tls_test_file_path ("ca-roots.pem"), &error); g_assert_no_error (error); g_assert (test->database); connection = start_as...
false
false
false
false
false
0
DealignMSeq(mseq_t *mseq) { int i; /* aux */ for (i=0; i<mseq->nseqs; i++) { DealignSeq(mseq->seq[i]); mseq->sqinfo[i].len = strlen(mseq->seq[i]); } mseq->aligned = FALSE; return; }
false
false
false
false
false
0
ix2505v_write(struct ix2505v_state *state, u8 buf[], u8 count) { struct i2c_msg msg[1] = { { .addr = state->config->tuner_address, .flags = 0, .buf = buf, .len = count }, }; int ret; ret = i2c_transfer(state->i2c, msg, 1); if (ret != 1) { deb_i2c("%s: i2c error, ret=%d\n", __func__, ret); return -EIO;...
false
false
false
false
false
0
action_free_record (Unit *unit, dpacket packet) { Key *k = lookup_key (unit, GET_PCK_ARG1 (packet)); uae_u32 pos = GET_PCK_ARG2 (packet); uae_u32 len = GET_PCK_ARG3 (packet); write_log (_T("action_free_record('%s',%d,%d)\n"), k ? k->aino->nname : _T("null"), pos, len); if (!k) { PUT_PCK_RES1 (packet, DOS_FALSE...
false
false
false
false
false
0
vfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp, struct fb_info *info) { if (regno >= 256) /* no. of hw registers */ return 1; /* * Program hardware... do anything you want with transp */ /* grayscale works only partially under directcolor */ if (info->var.grayscale) { /* gr...
false
false
false
false
false
0
Read(socket_queue* sock) { int RetCode; int SelRet; fd_set readmask; struct timeval timeout = {0,0}; static buffer *buf = NULL; if (sock->descriptor < 0) { #ifdef DEBUG syslog(LOG_DEBUG,"Write: Invalid Descriptor %d",sock->descriptor); #endif return 1; } if (sock->restbuf.len > BUF_SIZE && sock->restbuf...
false
true
false
false
true
1
dump_tv_tag (size_t n, struct ld_plugin_tv *tv) { size_t tag; char unknownbuf[40]; const char *name; for (tag = 0; tag < ARRAY_SIZE (tag_names); tag++) if (tag_names[tag].tag == tv->tv_tag) break; sprintf (unknownbuf, "unknown tag #%d", tv->tv_tag); name = (tag < ARRAY_SIZE (tag_names)) ? tag_nam...
true
true
false
false
false
1
ilCopyImage(ILuint Src) { ILuint DestName = ilGetCurName(); ILimage *DestImage = iCurImage, *SrcImage; if (iCurImage == NULL || DestName == 0) { ilSetError(IL_ILLEGAL_OPERATION); return IL_FALSE; } ilBindImage(Src); SrcImage = iCurImage; ilBindImage(DestName); ilTexImage(SrcImage->Width, SrcImage->Heigh...
false
true
false
false
false
1
netsnmp_trapd_check_auth(int authtypes) { if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_APP_NO_AUTHORIZATION)) { DEBUGMSGTL(("snmptrapd:auth", "authorization turned off\n")); return 1; } DEBUGMSGTL(("snmptrapd:auth", "Compari...
false
false
false
false
false
0
bu21013_cs_disable(struct bu21013_ts_data *bu21013_data) { int error; error = gpio_direction_output(bu21013_data->chip->cs_pin, 0); if (error < 0) dev_warn(&bu21013_data->client->dev, "%s: gpio direction failed, error: %d\n", __func__, error); else gpio_set_value(bu21013_data->chip->cs_pin, 0); gpio_...
false
false
false
false
false
0
buffindexed_add(const char *group, ARTNUM artnum, TOKEN token, char *data, int len, time_t arrived, time_t expires) { GROUPLOC gloc; GROUPENTRY *ge; if (len > OV_BLOCKSIZE) { warn("buffindexed: overview data is too large %d", len); return true; } gloc = GROUPfind(group, false); if ...
false
false
false
false
false
0
get_random_fd(void) { struct timeval tv; static int fd = -2; int i; if (fd == -2) { gettimeofday(&tv, 0); fd = open("/dev/urandom", O_RDONLY); if (fd == -1) fd = open("/dev/random", O_RDONLY | O_NONBLOCK); srand((getpid() << 16) ^ getuid() ^ tv.tv_sec ^ tv.tv_usec); } /* Crank th...
false
false
false
false
true
1
snd_seq_oss_oob_user(struct seq_oss_devinfo *dp, void __user *arg) { unsigned char ev[8]; struct snd_seq_event tmpev; if (copy_from_user(ev, arg, 8)) return -EFAULT; memset(&tmpev, 0, sizeof(tmpev)); snd_seq_oss_fill_addr(dp, &tmpev, dp->addr.port, dp->addr.client); tmpev.time.tick = 0; if (! snd_seq_oss_proc...
true
true
false
false
false
1
endDrag(UT_sint32 xPos, UT_sint32 yPos) { if (!m_pAutoScrollTimer) return; // figure out whether we're still on screen bool bOnScreen = true; if ((xPos < 0 || xPos > getWindowWidth()) || (yPos < 0 || yPos > getWindowHeight())) bOnScreen = false; if (!bOnScreen) { // remember where mouse is m_xLastMou...
false
false
false
false
false
0
drm_legacy_reclaim_buffers(struct drm_device *dev, struct drm_file *file_priv) { struct drm_device_dma *dma = dev->dma; int i; if (!dma) return; for (i = 0; i < dma->buf_count; i++) { if (dma->buflist[i]->file_priv == file_priv) { switch (dma->buflist[i]->list) { case DRM_LIST_NONE: drm_legacy_fr...
false
false
false
false
false
0
opj_v4dwt_interleave_v(opj_v4dwt_t* restrict v , OPJ_FLOAT32* restrict a , OPJ_INT32 x, OPJ_INT32 nb_elts_read){ opj_v4_t* restrict bi = v->wavelet + v->cas; OPJ_INT32 i; for(i = 0; i < v->sn; ++i){ memcpy(&bi[i*2], &a[i*x], nb_elts_read * sizeof(OPJ_FLOAT32)); } a += v->sn * x; bi = v->wavelet + 1 - v->cas; ...
false
false
false
false
false
0
iconPixmap(const QString &name) { const PsiIcon *i = iconPtr(name); if ( i ) return i->impix().pixmap(); return IconsetFactoryPrivate::instance()->emptyPixmap(); }
false
false
false
false
false
0
dbiblast_memfread(void* dest, size_t size, size_t num_items, PMemFile mf) { size_t i; if(mf->IsMem) { /* memory mapped */ i = size * num_items; memcpy(dest, &mf->Mem[mf->Pos], i); mf->Pos += (ajlong) i; return i; } return ajReadbinBinary(mf->File, num_items, size, dest); }
false
false
false
false
false
0
get_block_desc(int block) const { for (size_t i=0; block_lookup[i].desc; i++) { if (block_lookup[i].type == block) { return _(block_lookup[i].desc); } } return _(UNKNOWN_BLOCK); }
false
false
false
false
false
0
ssdv_fill_gap(ssdv_t *s, uint16_t next_mcu) { if(s->mcupart > 0 || s->acpart > 0) { /* Cleanly end the current MCU part */ if(s->acpart > 0) { ssdv_out_jpeg_int(s, 0, 0); s->mcupart++; } /* End the current MCU block */ for(; s->mcupart < s->ycparts + 2; s->mcupart++) { if(s->mcupart < s->ycp...
false
false
false
false
false
0
S_sortcv_stacked(pTHX_ SV *const a, SV *const b) { dVAR; const I32 oldsaveix = PL_savestack_ix; const I32 oldscopeix = PL_scopestack_ix; I32 result; AV * const av = GvAV(PL_defgv); PMOP * const pm = PL_curpm; OP * const sortop = PL_op; COP * const cop = PL_curcop; SV **pad; PERL...
false
false
false
false
false
0
dblayer_memp_stat_instance(ldbm_instance *inst, DB_MPOOL_STAT **gsp, DB_MPOOL_FSTAT ***fsp) { DB_ENV *env = NULL; dblayer_private *priv = NULL; PR_ASSERT(NULL != inst); if (inst->import_env->dblayer_DB_ENV) { env = inst->import_env->dblayer_DB_ENV; } else { ...
false
false
false
false
false
0
fill_cmd_set_event_receiver (uint8_t event_receiver_slave_address, uint8_t event_receiver_lun, fiid_obj_t obj_cmd_rq) { if (!IPMI_BMC_LUN_VALID (event_receiver_lun) || !fiid_obj_valid (obj_cmd_rq)) { SET_ERRNO (EINVAL); return (-1); }...
false
false
false
false
false
0
close_serial_port(CSERIALPORT *_object) { if (THIS->status) { release_callback(THIS); THIS->stream.desc = NULL; CloseSerialPort(THIS->port, &THIS->oldtio); THIS->status = 0; } }
false
false
false
false
false
0
main(void) { int i, pass; pass = 1; for(i = 0; tests[i] != NULL; i++) { if(!(*tests[i])()) { pass = 0; printf("Failed!!! Test no. %i\n", i+1); } } if(pass) printf("Ok\n"); }
false
false
false
false
false
0
__lambda60_ (FolksIndividual* self, FolksPersona* p) { gboolean result = FALSE; FolksPersona* _tmp0_ = NULL; gboolean _tmp1_ = FALSE; gboolean _tmp2_ = FALSE; g_return_val_if_fail (p != NULL, FALSE); _tmp0_ = p; _tmp1_ = folks_favourite_details_get_is_favourite (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, FOLKS_TYPE_FAV...
false
false
false
false
false
0
ipr_reset_block_config_access_wait(struct ipr_cmnd *ipr_cmd) { struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg; int rc = IPR_RC_JOB_CONTINUE; if (pci_cfg_access_trylock(ioa_cfg->pdev)) { ioa_cfg->cfg_locked = 1; ipr_cmd->job_step = ioa_cfg->reset; } else { if (ipr_cmd->u.time_left) { rc = IPR_RC_JOB_RETURN...
false
false
false
false
false
0
gretl_maybe_switch_dir (const char *fname) { if (fname[0] == '~' && fname[1] == '/') { char *home = getenv("HOME"); if (home != NULL && chdir(home) == 0) { fname += 2; } } else if (!g_path_is_absolute(fname)) { if (dotpath(fname) || libset_get_bool(USE_CWD)) { char *sdir = get_shelldir(); ...
false
false
false
false
false
0
mono_linterval_get_intersect_pos (MonoLiveInterval *i1, MonoLiveInterval *i2) { MonoLiveRange2 *r1, *r2; /* FIXME: Optimize this */ for (r1 = i1->range; r1 != NULL; r1 = r1->next) { for (r2 = i2->range; r2 != NULL; r2 = r2->next) { if (r2->to > r1->from && r2->from < r1->to) { if (r2->from <= r1->from) ...
false
false
false
false
false
0
accept() { for( int i = 0; i < MAX_UNIT; i++ ) { _troop[i]->save( i, _base ); } }
false
false
false
false
false
0
stp_printvars_create_from_xmltree(stp_mxml_node_t *printer, const char *family) { stp_mxml_node_t *prop; /* Temporary node pointer */ const char *stmp; /* Temporary string */ char *sbuf; stp_printvars_t *outprintvars; outprintvars = stp_zalloc(sizeof(stp_printvars_t)); if (!outprintvars) return N...
false
false
false
false
false
0
revert_item_cb (GtkWidget *w, gpointer key) { xine_cfg_entry_t entry; xine_config_lookup_entry (xine, key, &entry); if (entry.type == XINE_CONFIG_TYPE_STRING) entry.str_value = g_object_get_data ((GObject *) w, "revert"); else entry.num_value = (int) (intptr_t) g_object_get_data ((GObject *) w, "revert"...
false
false
false
false
false
0
gdk_pixbuf__svg_image_stop_load (gpointer data, GError **error) { SvgContext *context = (SvgContext *)data; GdkPixbuf *pixbuf; gboolean result = TRUE; if (error) *error = NULL; if (!context->handle) { rsvg_propegate_error (error, _("Error display...
false
false
false
false
false
0
getRenderedStringParser() const { // if parsing is disabled, we use a DefaultRenderedStringParser that creates // a RenderedString to renderi the input text verbatim (i.e. no parsing). if (!d_textParsingEnabled) return d_defaultStringParser; // Next prefer a custom RenderedStringParser assigned...
false
false
false
false
false
0
finish_node(struct r300_emit_state * emit) { struct r300_fragment_program_compiler * c = emit->compiler; struct r300_fragment_program_code *code = &emit->compiler->code->code.r300; unsigned alu_offset; unsigned alu_end; unsigned tex_offset; unsigned tex_end; unsigned int alu_offset_msbs, alu_end_msbs; if (cod...
false
false
false
false
false
0
onGo() { if (d->data.isNull()) { send(d->iq); } else { setSuccess(); } }
false
false
false
false
false
0
filterz (struct DATA *data, GMT_LONG ndata, double z_filter, double *fwork, GMT_LONG hilow) { double half_width, sum, dt, tmp; GMT_LONG i, j, k, istart, istop; half_width = 0.5 * z_filter; sum = 0.0; dt = SPLITXYZ_F_RES/half_width; tmp = M_PI / SPLITXYZ_F_RES; for (i = 0; i < SPLITXYZ_F_RES; i++) { fwork[i] ...
false
false
false
false
false
0
rtrim(char *str) { char *tmp = str + strlen(str) - 1; while (tmp >= str && isspace(*tmp)) *tmp-- = '\0'; }
false
false
false
false
false
0
write(hsStream* S) { hsKeyFrame::write(S); if (fType == kBezPoint3KeyFrame) { fInTan.write(S); fOutTan.write(S); } fValue.write(S); }
false
false
false
false
false
0
apply_patch(int fd, const char *filename, int inaccurate_eof) { unsigned long offset, size; char *buffer = read_patch_file(fd, &size); struct patch *list = NULL, **listp = &list; int skipped_patch = 0; patch_input_file = filename; if (!buffer) return -1; offset = 0; while (size > 0) { struct patch *patch; ...
false
false
false
false
false
0
scs_output_trigger(struct snd_rawmidi_substream *stream, int up) { struct scs *scs = stream->rmidi->private_data; ACCESS_ONCE(scs->output) = up ? stream : NULL; if (up) { scs->output_idle = false; tasklet_schedule(&scs->tasklet); } }
false
false
false
false
false
0
gim_hash(const char *name) { #define ROL(x) (((x>>25)&0x7f)|((x<<7)&0xffffff80)) int hash = 0; for (; *name; name++) { hash ^= *name; hash = ROL(hash); } return hash; #undef ROL }
true
true
false
false
false
1
matrix_toString(const fn_call& fn) { // Doesn't have to be a Matrix as_object* ptr = ensure<ValidThis>(fn); as_value a, b, c, d, tx, ty; ptr->get_member(NSV::PROP_A, &a); ptr->get_member(NSV::PROP_B, &b); ptr->get_member(NSV::PROP_C, &c); ptr->get_member(NSV::PROP_D, &d); ptr->get_memb...
false
false
false
false
false
0
introsort_loop_u32_inner(uint32_t a[], size_t n, unsigned depth_limit) { struct p_res p; size_t n_s, n_b; uint32_t *a_s, *a_b; prefetch(a); p = partition_u32(a, n, pseudo_median_u32(a, n)); /* * recurse into the smaller partition first (costs _real_ * stack), 'cause it should be easier to sort, while the *...
false
false
false
false
false
0
shutdown(Poco::UInt16 statusCode, const std::string& statusMessage) { Poco::Buffer<char> buffer(statusMessage.size() + 2); Poco::MemoryOutputStream ostr(buffer.begin(), buffer.size()); Poco::BinaryWriter writer(ostr, Poco::BinaryWriter::NETWORK_BYTE_ORDER); writer << statusCode; writer.writeRaw(statusMessage); se...
false
false
false
false
false
0
child_is_raw_stream (const GstCaps * parent, const GstCaps * child) { const GstStructure *st1, *st2; const gchar *name1, *name2; st1 = gst_caps_get_structure (parent, 0); name1 = gst_structure_get_name (st1); st2 = gst_caps_get_structure (child, 0); name2 = gst_structure_get_name (st2); if ((g_str_has_p...
false
false
false
false
false
0
matrix_lle_float(float* y,const float* x,const float* X,const float* invC,size_t n,size_t m) { size_t i,k; /* double alpha = 1; double beta = 0; for (i=0;i<m;i++) { for (k=0;k<m;k++) { double t = invC[k+i*m]; beta += t; alpha -= t*vector_ps_float(x,X+k*n,n); } } double lambda = ...
false
false
false
false
false
0
navi_dyn_frame_size_allocate (GtkWidget *widget, GtkAllocation *allocation, gpointer user_data) { if(naviD == NULL) { return; } if(gap_debug) printf("\n# on_vid_preview_size_allocate: START new: w:%d h:%d \n" ,...
false
false
false
false
false
0
AddDReg(MachineInstrBuilder &MIB, unsigned Reg, unsigned SubIdx, unsigned State, const TargetRegisterInfo *TRI) const { if (!SubIdx) return MIB.addReg(Reg, State); if (TargetRegisterInfo::isPhysicalRegister(Reg)) return MIB.addReg(TRI->getSubReg(Reg, SubI...
false
false
false
false
false
0
rotate(float s, float c) { if(parent != 0) { pos = rotate_vec2(pos, s, c); spos = rotate_vec2(spos, s, c); } for(std::list<RDirNode*>::iterator it = children.begin(); it != children.end(); it++) { RDirNode* child = (*it); child->rotate(s, c); } }
false
false
false
false
false
0
alarm_settings_changed_repeat (GtkToggleButton *togglebutton, gpointer data) { AlarmApplet *applet = (AlarmApplet *)data; AlarmSettingsDialog *dialog = applet->settings_dialog; g_assert (dialog->alarm != NULL); const gchar *name; AlarmRepeat rep, new_rep; gboolean active; /* The check buttons have the sam...
false
false
false
false
false
0
ivtvfb_set_display_window(struct ivtv *itv, struct v4l2_rect *ivtv_window) { int osd_height_limit = itv->is_out_50hz ? 576 : 480; /* Only fail if resolution too high, otherwise fudge the start coords. */ if ((ivtv_window->height > osd_height_limit) || (ivtv_window->width > IVTV_OSD_MAX_WIDTH)) return -EINVAL; /...
false
false
false
false
false
0
sendIViewerGui(_WebClientConnection* cc) { INFO2("[WS]: sendIViewerGui"); sendData(cc, IVIEW_HEAD1); if (!cc->conn->serverIP) { ERROR2("[WS]: sendIViewerGui can not determine TCP address"); return; } sendData(cc, cc->conn->serverIP->str); sendData(cc, IVIEW_HEAD2)...
true
true
false
false
false
1
remove(Window win) { FbTk::FbWindow *fbwin = find(win); if (fbwin == 0) return; FbTk::EventManager::instance()->remove(*fbwin); // FbTk::EventManager::instance()->remove(win); delete fbwin; if (fbwin == m_focused_window) m_focused_window = 0; m_windowlist.erase(win); }
false
false
false
false
false
0