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
can_ooze(struct monst *mtmp) { struct obj *chain, *obj; if (!amorphous(mtmp->data)) { return false; } if (mtmp == &youmonst) { if (u.ugold > 100L) { return false; } chain = invent; } else { if (mtmp->mgold > 100L) {...
false
false
false
false
false
0
gf_cache_flush_disk_cache ( const DownloadedCacheEntry entry ) { char buff[100]; CHECK_ENTRY; if ( !entry->properties) return GF_OK; GF_LOG(GF_LOG_DEBUG, GF_LOG_NETWORK, ("[CACHE] gf_cache_flush_disk_cache:%d for entry=%p\n", __LINE__, entry)); gf_cfg_set_key(entry->properties, CACHE_SECTION_NAME, CACHE_SECTION_...
true
true
false
false
true
1
fillchk_tim(word64 *tim, int32 *negdel, p_vpi_delay delay_p, struct itree_t *itp) { register int32 di; int32 stride, ofset, ndels; double d1; word64 t1; struct t_vpi_time *vpitimp; struct mod_t *mdp; ndels = delay_p->no_of_delays; for (di = 0; di < ndels; di++) negdel[di] = FALSE; stride = 1; ofset = 0; ...
false
false
false
false
false
0
sock_vfprintf(cddb_conn_t *c, const char *format, va_list ap) { char *buf; int rv; cddb_log_debug("sock_vfprintf()"); buf = (char*)malloc(c->buf_size); rv = vsnprintf(buf, c->buf_size, format, ap); cddb_log_debug("...buf = '%s'", buf); if (rv < 0 || rv >= c->buf_size) { /* buffer...
false
false
false
false
true
1
ntru_to_arr_64(NtruIntPoly *p, uint16_t q, uint8_t *a) { uint16_t N = p->N; uint8_t log_q = ntru_log2(q); typedef uint64_t __attribute__((__may_alias__)) *uint64_t_alias; uint64_t *a64 = (uint64_t_alias)a; uint16_t a_idx = 0; /* index into a64 */ uint8_t bit_idx = 0; /* next unused bit of a6...
false
false
false
false
false
0
pendconn_add(struct session *sess) { struct pendconn *p; struct server *srv; p = pool_alloc2(pool2_pendconn); if (!p) return NULL; sess->pend_pos = p; p->sess = sess; p->srv = srv = objt_server(sess->target); if (sess->flags & SN_ASSIGNED && srv) { LIST_ADDQ(&srv->pendconns, &p->list); srv->nbpend++; ...
false
false
false
false
false
0
send_assigned_job(ASSIGNMENT& asg) { int retval; DB_WORKUNIT wu; char suffix[256], path[MAXPATHLEN]; const char *rtfpath; static bool first=true; static int seqno=0; static R_RSA_PRIVATE_KEY key; BEST_APP_VERSION* bavp; if (first) { first = f...
false
false
false
false
false
0
canon_pathname(char *filename) { char *p; Ds ds; ds_init(&ds); for (p = filename; *p != '\0'; p++) { if (*p == '/') { while (*(p + 1) == '/') p++; } ds_appendc(&ds, (int) *p); } ds_appendc(&ds, (int) '\0'); return(ds_buf(&ds)); }
false
false
false
false
false
0
_gnutls_server_name_pack (extension_priv_data_t epriv, gnutls_buffer_st * ps) { server_name_ext_st *priv = epriv.ptr; int i, ret; BUFFER_APPEND_NUM (ps, priv->server_names_size); for (i = 0; i < priv->server_names_size; i++) { BUFFER_APPEND_NUM (ps, priv->server_names[i].type); BUFFER_APPEND_PF...
false
false
false
false
false
0
fun_fscanf (const char *input, const char *fmt, void *a1, void *a2) { FILE *fp; int ret; fp = fopen (TEMPFILE, "w+"); ASSERT_ALWAYS (fp != NULL); ASSERT_ALWAYS (fputs (input, fp) != EOF); ASSERT_ALWAYS (fflush (fp) == 0); rewind (fp); if (a2 == NULL) ret = fscanf (fp, fmt, a1); else ret =...
false
true
true
false
true
1
Cmd_Use_f (edict_t * ent) { gitem_t *it; char *s; s = gi.args (); //zucc - check for "special" if (Q_stricmp (s, "special") == 0) { ReadySpecialWeapon (ent); return; } //zucc - alias names if (!Q_stricmp (s, "blaster") || !Q_stricmp (s, "mark 23 pistol")) s = MK23_NAME; else if (!Q_stricmp (s, "A 2nd...
false
false
false
false
false
0
handle_incoming_call(DBusMessage *msg) { const char *number, *call_path; struct csd_call *call; if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_OBJECT_PATH, &call_path, DBUS_TYPE_STRING, &number, DBUS_TYPE_INVALID)) { error("Unexpected parameters in Call.Coming() signal"); return; } call = fin...
false
false
false
false
false
0
tmp006_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct iio_dev *indio_dev; struct tmp006_data *data; int ret; if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WORD_DATA)) return -ENODEV; if (!tmp006_check_identification(client)) { dev_err(&client->dev, "no TMP006 sen...
false
false
false
false
false
0
gfire_chat_proto_persistent_chat_infos(gfire_data *p_gfire, guint16 p_packet_len) { if(!p_gfire) return; guint32 offset = XFIRE_HEADER_LEN; GList *chat_ids = NULL; GList *chat_types = NULL; GList *chat_names = NULL; offset = gfire_proto_read_attr_list_bs(p_gfire->buff_in, &chat_ids, 0x04, offset); if(offset ...
false
false
false
false
false
0
globus_i_gram_request_stdio_update( globus_gram_jobmanager_request_t * request, globus_rsl_t * update_rsl) { int rc = GLOBUS_SUCCESS; const char * tmp_string; globus_rsl_t * tmp_rsl; globus_rsl_t * ...
false
false
false
false
false
0
fld_worklist_push (tree t, struct free_lang_data_d *fld) { if (t && !is_lang_specific (t) && !pointer_set_contains (fld->pset, t)) fld->worklist.safe_push ((t)); }
false
false
false
false
false
0
dri3_destroy_drawable(__GLXDRIdrawable *base) { struct dri3_screen *psc = (struct dri3_screen *) base->psc; struct dri3_drawable *pdraw = (struct dri3_drawable *) base; xcb_connection_t *c = XGetXCBConnection(pdraw->base.psc->dpy); int i; (*psc->core->destroyDrawable) (pdraw->driDrawable); for (...
false
false
false
false
false
0
ath9k_hw_ar9287_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr, u8 *buf, u32 len, u32 size) { struct ar9287_eeprom *eep = &ah->eeprom.map9287; struct base_eep_ar9287_header *pBase = &eep->baseEepHeader; if (!dump_base_hdr) { len += scnprintf(buf + len, size - len, "%20s :\n", "2GHz modal Header...
false
false
false
false
false
0
find_keys(const uint8_t* bmap, size_t last) { size_t percent = 0; const size_t increment = last / 100; if (gProgress) print_progress(percent); for (size_t i = 0; i < last; i++) { if (entropy(bmap,i)) continue; uint32_t* map = (uint32_t*)&(bmap[i]); // Check distance f...
false
false
false
false
true
1
bind(const QString& node, const QString& service) { if (state() >= Bound) return false; if (localResolver().isRunning()) localResolver().cancel(false); // no, we must do a host lookup localResolver().setAddress(node, service); if (!lookup()) return false; // see if lookup has finished alread...
false
false
false
false
false
0
check_tiny (void) { mpfr_t x, y; mpfr_init2 (x, 53); mpfr_init2 (y, 53); mpfr_set_ui (x, 1, MPFR_RNDN); mpfr_set_exp (x, mpfr_get_emin ()); mpfr_sin (y, x, MPFR_RNDD); if (mpfr_cmp (x, y) < 0) { printf ("Error in check_tiny: got sin(x) > x for x = 2^(emin-1)\n"); exit (1); } mpfr_...
false
false
false
false
false
0
doinit() { /* initializes variables */ inputnumbersseq(seqsets[0], &spp, &chars, &nonodes, 1); if(!threshold) threshold = spp; if (printdata) fprintf(outfile, "%2ld species, %3ld sites\n", spp, chars); alloctree(&treenode, nonodes, false); allocrest(); }
false
false
false
false
false
0
smi_ir_irq(struct smi_rc *ir, u32 int_status) { int handled = 0; if (int_status & IR_X_INT) { smi_ir_disableInterrupt(ir); smi_ir_clearInterrupt(ir); schedule_work(&ir->work); handled = 1; } return handled; }
false
false
false
false
false
0
pretty_print(orte_ps_mpirun_info_t *hnpinfo) { char *header; int len_hdr; /* * Print header and remember header length */ len_hdr = asprintf(&header, "Information from mpirun %s", ORTE_JOBID_PRINT(hnpinfo->hnp->name.jobid)); printf("\n\n%s\n", header); free(header); prett...
false
false
false
false
false
0
rc_gethostbyname(const char *hostname) { struct hostent *hp; #ifdef GETHOSTBYNAME_R #if defined (GETHOSTBYNAMERSTYLE_SYSV) || defined (GETHOSTBYNAMERSTYLE_GNU) struct hostent hostbuf; int res; int herr; if(!tmphostbuf) tmphostbuf = malloc(hostbuflen); #endif #endif #ifdef GETHOSTBYNAME_R #if defined (GETHOSTB...
false
false
false
false
false
0
clish_shell_tinyrl_key_help(tinyrl_t *this, int key) { bool_t result = BOOL_TRUE; if(BOOL_TRUE == tinyrl_is_quoting(this)) { /* if we are in the middle of a quote then simply enter a space */ result = tinyrl_insert_text(this,"?"); } else { ...
false
false
false
false
false
0
blockEncIdxSeqHeaderLength(const struct blockCompositionSeq *seqIdx, size_t numExtHeaders, const uint32_t *extHeaderSizes) { size_t headerSize = 4 /* BDX identifier */ + 4 /* length field */ + 8 /* block s...
false
false
false
false
false
0
SQLGetStmtAttrA ( SQLHSTMT statementHandle, SQLINTEGER Attribute, SQLPOINTER ValuePtr, SQLINTEGER BufferLength, SQLINTEGER * StringLengthPtr) { ENTER_STMT (statementHandle, trace_SQLGetStmtAttr (TRACE_ENTER, statementHandle, Attribute, ValuePtr, BufferLength, StringLengthPtr)); re...
false
false
false
false
false
0
cx24116_set_voltage(struct dvb_frontend *fe, enum fe_sec_voltage voltage) { struct cx24116_cmd cmd; int ret; dprintk("%s: %s\n", __func__, voltage == SEC_VOLTAGE_13 ? "SEC_VOLTAGE_13" : voltage == SEC_VOLTAGE_18 ? "SEC_VOLTAGE_18" : "??"); /* Wait for LNB ready */ ret = cx24116_wait_for_lnb(fe); if (ret !=...
false
false
false
false
false
0
ttm_ref_object_release(struct kref *kref) { struct ttm_ref_object *ref = container_of(kref, struct ttm_ref_object, kref); struct ttm_base_object *base = ref->obj; struct ttm_object_file *tfile = ref->tfile; struct drm_open_hash *ht; struct ttm_mem_global *mem_glob = tfile->tdev->mem_glob; ht = &tfile->ref_h...
false
false
false
false
false
0
stopPresampling() { thePresampling = false; lastXCombPtr()->head(theXCombBackup); projectionDipole()->setXComb(lastXCombPtr()); ME2byDipoles::setXComb(lastXCombPtr()); theGenerator->setDiscardNext(); }
false
false
false
false
false
0
output_p(void) { unsigned long ios[DDIR_RWDIR_CNT]; struct flist_head *e, *tmp; int depth_disabled = 0; int ret = 0; flist_for_each_safe(e, tmp, &pid_list) { struct btrace_pid *p; p = flist_entry(e, struct btrace_pid, pid_list); if (prune_entry(&p->o)) { free_p(p); continue; } p->o.start_delay = ...
false
false
false
false
false
0
test_status_renames__head2index_one(void) { git_index *index; git_status_list *statuslist; git_status_options opts = GIT_STATUS_OPTIONS_INIT; struct status_entry expected[] = { { GIT_STATUS_INDEX_RENAMED, "ikeepsix.txt", "newname.txt" }, }; opts.flags |= GIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX; cl_git_pass(git_...
false
false
false
false
false
0
compute_forces (GfsParticleForce * event, GfsParticulate * p) { FttComponent c; FttVector new_force = (event->force) (GFS_PARTICLE (p), event); FttVector total_force; for ( c = 0 ; c < FTT_DIMENSION; c++) (&total_force.x)[c] = (&new_force.x)[c]*p->volume + (&p->force.x)[c]; p->force = total_fo...
false
false
false
false
false
0
Tk_CreatePictImageFormat(formatPtr) Tk_PictImageFormat *formatPtr; /* Structure describing the format. All of * the fields except "nextPtr" must be filled * in by caller. Must not have been passed * to Tk_CreatePictImageFormat previously. */ { Tk_PictImageFormat *copyPtr; #ifdef DEBUG ...
false
false
false
false
false
0
is_decimal(const char *string, size_t length) { if (length > 1 && string[0] == '0' && string[1] != '.') return 0; if (length > 2 && !strncmp(string, "-0", 2) && string[2] != '.') return 0; while (length--) if (strchr("xX", string[length])) return 0; return 1; }
false
false
false
false
true
1
gr_opengl_bm_free_data(int n, bool release) { Assert( (n >= 0) && (n < MAX_BITMAPS) ); // might as well free up the on card texture data too in order to get rid // of old interface stuff but don't free USER types, unless it's a total release, // since we can reuse ANI slots for faster and less resource intensive r...
false
false
false
false
false
0
marker_string(unsigned int which, int end_marker) { int selector = (end_marker) ? 1 : 0; if (license_marker_valid(which)) { return boundaries[which].markers[selector]; } ERR("gen_marker: invalid marker %d\n", which); return NULL; }
false
false
false
false
false
0
ApplyInverseTransforms(VP8LDecoder* const dec, int num_rows, const uint32_t* const rows) { int n = dec->next_transform_; const int cache_pixs = dec->width_ * num_rows; const int start_row = dec->last_row_; const int end_row = start_row + num_rows; const uint32_t* rows_in = r...
false
true
false
false
false
1
paintEvent (QPaintEvent *) { QPainter painter (this); QLinearGradient gradient (0, 0, width (), height ()); //QRadialGradient gradient (50, 50, 50, 50, 50); QColor cBackgroundColor, cBackgroundColor2; cBackgroundColor2 = Qt::gray; if (m_bErroneous) cBackgroundColor = Qt::red; else if (m_bCpusolved) ...
false
false
false
false
false
0
clntraw_call(h, proc, xargs, argsp, xresults, resultsp, timeout) CLIENT *h; unsigned long proc; xdrproc_t xargs; char* argsp; xdrproc_t xresults; char* resultsp; struct timeval timeout; { register struct clntraw_private *clp = clntraw_private; register XDR *xdrs = &clp->xdr_stream; struct rpc_msg msg; enum clnt_sta...
false
false
false
false
false
0
reiserfs_abort_journal(struct super_block *sb, int errno) { struct reiserfs_journal *journal = SB_JOURNAL(sb); if (test_bit(J_ABORTED, &journal->j_state)) return; if (!journal->j_errno) journal->j_errno = errno; sb->s_flags |= MS_RDONLY; set_bit(J_ABORTED, &journal->j_state); #ifdef CONFIG_REISERFS_CHECK d...
false
false
false
false
false
0
EscapeString(const std::string &Label) { std::string Str(Label); for (unsigned i = 0; i != Str.length(); ++i) switch (Str[i]) { case '\n': Str.insert(Str.begin()+i, '\\'); // Escape character... ++i; Str[i] = 'n'; break; case '\t': Str.insert(Str.begin()+i, ' '); // Convert...
false
false
false
false
false
0
dispose_chunk(mstate m, mchunkptr p, size_t psize) { mchunkptr next = chunk_plus_offset(p, psize); if (!pinuse(p)) { mchunkptr prev; size_t prevsize = p->prev_foot; if (is_mmapped(p)) { psize += prevsize + MMAP_FOOT_PAD; if (CALL_MUNMAP((char*)p - prevsize, psize) == 0) m->footprint ...
false
false
false
false
false
0
zv_star(x1, x2, out) ZVEC *x1, *x2, *out; { int i; Real t_re, t_im; if ( ! x1 || ! x2 ) error(E_NULL,"zv_star"); if ( x1->dim != x2->dim ) error(E_SIZES,"zv_star"); out = zv_resize(out,x1->dim); for ( i = 0; i < x1->dim; i++ ) { /* out->ve[i] = x1->ve[i] * x2->ve[i]; */ t_re = x1->ve[...
false
false
false
true
false
1
dstrremovenewline(dstr_t *ds) { if (!ds->len) return; if (ds->data[ds->len -1] == '\r' || ds->data[ds->len -1] == '\n') { ds->data[ds->len -1] = '\0'; ds->len -= 1; } if (ds->len < 2) return; if (ds->data[ds->len -2] == '\r') { ds->data[ds->len -2] = '\0'; ...
false
false
false
false
false
0
ipw_ioctl(struct tty_struct *linux_tty, unsigned int cmd, unsigned long arg) { struct ipw_tty *tty = linux_tty->driver_data; if (!tty) return -ENODEV; if (!tty->port.count) return -EINVAL; /* FIXME: Exactly how is the tty object locked here .. */ switch (cmd) { case TIOCGSERIAL: return ipwireless...
false
false
false
false
false
0
window_get_current_zoom_level_index (DhWindow *window) { WebKitWebView *web_view; double previous, current, mean; double zoom_level = ZOOM_DEFAULT; int i; web_view = window_get_active_web_view (window); if (web_view) zoom_level = webkit_web_view_get_zoom_...
false
false
false
false
false
0
create_setup_data_nodes(struct kobject *parent) { struct kobject *setup_data_kobj, **kobjp; u64 pa_data; int i, j, nr, ret = 0; pa_data = boot_params.hdr.setup_data; if (!pa_data) return 0; setup_data_kobj = kobject_create_and_add("setup_data", parent); if (!setup_data_kobj) { ret = -ENOMEM; goto out; }...
false
false
false
false
false
0
displayExprLaxInt (expr) chain_list *expr; { int oper; if (ATOM (expr)) printf (" %s", VALUE_ATOM (expr)); else { oper = OPER (expr); if (oper >= 0 && oper <= 1000) { printf (" (%s", operToChar (OPER (expr))); mapExpr (displayExprLaxInt, expr); printf (")"); } else { ...
false
false
false
false
false
0
dmi_save_uuid(const struct dmi_header *dm, int slot, int index) { const u8 *d = (u8 *) dm + index; char *s; int is_ff = 1, is_00 = 1, i; if (dmi_ident[slot]) return; for (i = 0; i < 16 && (is_ff || is_00); i++) { if (d[i] != 0x00) is_00 = 0; if (d[i] != 0xFF) is_ff = 0; } if (is_ff || is_00) r...
false
false
false
false
false
0
GetCellSize( int &w, int &h ) { if( !m_pTermData->m_ColsPerPage || !m_pTermData->m_RowsPerPage ) { w = 0; h = 0; return; } w = ( m_Widget->allocation.width / m_pTermData->m_ColsPerPage ) - m_CharPaddingX; h = ( m_Widget->allocation.height / m_pTermData->m_RowsPerPage ) - m_CharPaddingY; }
false
false
false
false
false
0
system_mkdir(const char *path, mode_t mode) { return initIfNeeded() == 0 ? s_mkdir(path, mode) : -1; }
false
false
false
false
false
0
imapx_store_build_folder_info (CamelIMAPXStore *imapx_store, const gchar *folder_path, CamelFolderInfoFlags flags) { CamelStore *store = (CamelStore *) imapx_store; CamelSettings *settings; CamelFolderInfo *fi; const gchar *name; store = CAMEL_STORE (i...
false
false
false
false
false
0
ccp_init_sg_workarea(struct ccp_sg_workarea *wa, struct device *dev, struct scatterlist *sg, u64 len, enum dma_data_direction dma_dir) { memset(wa, 0, sizeof(*wa)); wa->sg = sg; if (!sg) return 0; wa->nents = sg_nents_for_len(sg, len); if (wa->nents < 0) return wa->nents; wa->bytes_left = len; wa-...
false
false
false
false
false
0
BuildRegionList() { if (this->Top == NULL) { return; } this->NumberOfRegions = vtkKdTree::SelfOrder(0, this->Top); this->RegionList = new vtkKdNode * [this->NumberOfRegions]; this->SelfRegister(this->Top); }
false
false
false
false
false
0
wave_close(void* theHandler) { SHOW_TIME("wave_close > ENTER"); static int aStopStreamCount = 0; #if (USE_PORTAUDIO == 19) if( pa_stream == NULL ) { SHOW_TIME("wave_close > LEAVE (NULL stream)"); return 0; } if( Pa_IsStreamStopped( pa_stream ) ) { SHOW_TIME("wave_close > L...
false
false
false
false
false
0
unmarshalArguments(cdrStream& _n) { arg_0_ = _n.unmarshalString(0); arg_0 = arg_0_.in(); arg_1_ = _n.unmarshalString(0); arg_1 = arg_1_.in(); arg_2_ = CosPropertyService::PropertySet_Helper::unmarshalObjRef(_n); arg_2 = arg_2_.in(); arg_3_ = CosEventComm::PushConsumer::_unmarshalObjRef(_n); arg_3 = arg_...
false
false
false
false
false
0
ProjectManager_GetProject(HSQUIRRELVM v) { StackHandler sa(v); int count = sa.GetParamCount(); if (count != 2) return sa.ThrowError("Invalid arguments to \"ProjectManager::GetProject\""); else { ProjectManager *manager = SqPlus::GetInstance<ProjectMana...
false
false
false
false
false
0
checkContainmentFurniture() { if (q->isContainment() && (type == Containment::DesktopContainment || type == Containment::PanelContainment)) { createToolBox(); } }
false
false
false
false
false
0
picsEndungWeg(const Str & p) { for (int i = 0; i < (int) p.length(); i++) { /* Etwas brutal: Alles ab dem ersten Punkt weg. */ if (p[i] == '.') return p.left(i); } /* Keine Endung... */ return p; }
false
false
false
false
false
0
CL_Heatbeam (const vec3_t start, const vec3_t forward) { vec3_t move, vec, right, up; cparticle_t *p; float i, c, s, len; vec3_t dir; float ltime; float step = 32.0f, rstep; float start_pt, rot, variance = 0.5f; vec3_t end; VectorMA (start, 4096, forward, end); VectorCopy (start, move); VectorSubtra...
false
false
false
false
false
0
hash_material_key(const board_t * board) { uint64 key; int piece_12, count; ASSERT(board!=NULL); // init key = 0; // counters for (piece_12 = 0; piece_12 < 12; piece_12++) { count = board->number[piece_12]; key ^= hash_counter_key(piece_12,count); } return key; }
false
false
false
false
false
0
SetWind(new) register Window *new; { if (!Asking && curbuf!=NULL) { /* can you say kludge? */ curwind->w_line = curline; curwind->w_char = curchar; curwind->w_bufp = curbuf; } if (new == curwind) return; SetBuf(new->w_bufp); if (!inlist(new->w_bufp->b_first, new->w_line)) { new->w_line = curline; new...
false
false
false
false
false
0
slotUrl(const QUrl& url) { if (!url.isEmpty()) { qDebug("SHOW %s!", qPrintable(url.toString())); } }
false
false
false
false
false
0
netxen_nic_remove(struct pci_dev *pdev) { struct netxen_adapter *adapter; struct net_device *netdev; adapter = pci_get_drvdata(pdev); if (adapter == NULL) return; netdev = adapter->netdev; netxen_cancel_fw_work(adapter); unregister_netdev(netdev); cancel_work_sync(&adapter->tx_timeout_task); netxen_fre...
false
false
false
false
false
0
PListOutputNameString(FILE *plist, char *key, SplineFont *sf, int strid) { char *value=NULL, *nonenglish=NULL, *freeme=NULL; struct ttflangname *nm; for ( nm=sf->names; nm!=NULL; nm=nm->next ) { if ( nm->names[strid]!=NULL ) { nonenglish = nm->names[strid]; if ( nm->lang == 0x409 ) { value = n...
false
false
false
false
false
0
asd_show_update_bios(struct device *dev, struct device_attribute *attr, char *buf) { int i; struct asd_ha_struct *asd_ha = dev_to_asd_ha(dev); for (i = 0; flash_error_table[i].err_code != 0; i++) { if (flash_error_table[i].err_code == asd_ha->bios_status) break; } if (asd_ha->bios_status != FLASH_IN_...
false
false
false
false
false
0
_get_num_bits(int fd) { uint64_t num_bits; errno = 0; if (pread(fd, &num_bits, sizeof(uint64_t), MBAMAGICSIZE) != sizeof(uint64_t)) { return 0; } return num_bits; }
false
false
false
false
false
0
load_simd_vreg (MonoCompile *cfg, MonoMethod *cmethod, MonoInst *src, gboolean *indirect) { if (indirect) *indirect = FALSE; if (src->opcode == OP_XMOVE) { return src->sreg1; } else if (src->opcode == OP_LDADDR) { int res = ((MonoInst*)src->inst_p0)->dreg; NULLIFY_INS (src); return res; } else if (src->ty...
false
false
false
false
false
0
handleAutoScroll(const XMotionEvent & /*mouse*/) { fVerticalScroll->scroll(fAutoScrollDelta); if (fAutoScrollDelta != 0) { int no = -1; if (fAutoScrollDelta < 0) no = findItemByPoint(0, 0); else no = findItemByPoint(0, height() - 1); if (no != -1) ...
false
false
false
false
false
0
GDALGetRasterColorInterpretation( GDALRasterBandH hBand ) { VALIDATE_POINTER1( hBand, "GDALGetRasterColorInterpretation", GCI_Undefined ); GDALRasterBand *poBand = static_cast<GDALRasterBand*>(hBand); return poBand->GetColorInterpretation(); }
false
false
false
false
false
0
splitinsert_nonfringe(void) { register int32 i; register struct bt_t *btp; int32 stki; struct bt_t *parbtp, *parhdr, *splt1, *splt2, *last_btp, *splt2par; /* notice fringe node not stacked, top of stack is parent of fringe */ splt1 = __btndstk[__topi]->ofsu.btofs; last_btp = NULL; for (stki = __topi;;) { ...
false
false
false
false
false
0
setreg (HP4200_Scanner * s, unsigned char reg, unsigned char reg_value) { s->regs[reg] = reg_value; /* dirty bit should be clear with this */ if ((reg < 0x08) || (reg > 0x5b)) { lm9830_write_register (s->fd, reg, reg_value); } }
false
false
false
false
false
0
callbackPilotsAdd (Component *comp, int key) { char buf [64]; if (key == MOUSE_BUTTON_LEFT) { strcpy (buf, ((EditField *) submenu [0]->components [9])->text); if (strlen (buf) > 0 && pilots->aktpilots < 5) { pilots->add (buf); ((EditField *) submenu [0]->components [9])->setText (""); ...
false
false
false
false
false
0
SetLastFragment(bool inLast) { const uint8_t flipped = ~2; if (inLast) { MessageHeader |= 2; } else { MessageHeader &= flipped;//set the second field to zero } }
false
false
false
false
false
0
purge_old_thumbnails (ThumbData *info, PurgeData *purge_data) { if ((purge_data->now - info->mtime) > purge_data->max_age) { g_unlink (info->path); info->size = 0; } else { purge_data->total_size += info->size; } }
false
false
false
false
false
0
isl_schedule_node_root( __isl_take isl_schedule_node *node) { int n; if (!node) return NULL; n = isl_schedule_node_get_tree_depth(node); if (n < 0) return isl_schedule_node_free(node); return isl_schedule_node_ancestor(node, n); }
false
false
false
false
false
0
saveRideExitDialog() { QList<RideItem*> dirtyList; // have we been told to not warn on exit? if (warnExit() == false) return true; // just close regardless! for (int i=0; i<allRides->childCount(); i++) { RideItem *curr = (RideItem *)allRides->child(i); if (curr->isDirty() == true) dirt...
false
false
false
false
false
0
names_equal (const char *n1, const char *n2) { return (n1 == NULL && n2 == NULL) || (n1 && n2 && !strcmp (n1, n2)); }
false
false
false
false
false
0
SetAnyAllowedFlags( CONSTRAINT_RECORD *theConstraint, int justOne) { int flag1, flag2; if (justOne) { flag1 = TRUE; flag2 = FALSE; } else { flag1 = FALSE; flag2 = TRUE; } theConstraint->anyAllowed = flag1; theConstraint->symbolsAllowed = flag2; theCo...
false
false
false
false
false
0
findmsgid(const char *msgid) { struct msgidtree *a; int c; /* domain part differs more than local-part, so try it first */ if (NULL == strchr(msgid, '@')) return 0; a = head; while (a) { c = comparemsgid(a->msgid, msgid); if (c < 0) a = a->left; else if (c > 0) a = a->right; el...
false
false
false
false
false
0
spool_fill_hdrcache(struct protstream *fin, FILE *fout, hdrcache_t cache, const char **skipheaders) { int r = 0; /* let's fill that header cache */ for (;;) { char *name = NULL, *body = NULL; if ((r = parseheader(fin, fout, &name, &body, skipheaders)) < 0) { break; } if (!name) { /* reach...
false
false
false
false
false
0
set(Tag tag, const QString& string) { switch(tag) { case Date: pdnDate=string; break; case Site: pdnSite=string; break; case Type: pdnType=string; break; case Event: pdnEvent=string;break; case Round: pdnRound=string;break; case White: pdnWhite=string;break; case Black: pdnBlack=string;break; default: pd...
false
false
false
false
false
0
SwitchDoorOrButton(bool activate, bool alternative /* = false */) { if (activate) SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); else RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); if (GetGoState() == GO_STATE_READY) // if closed -> open SetGoState(alternative ? GO_ST...
false
false
false
false
false
0
UnregisterExprContextCallback(ExprContext *econtext, ExprContextCallbackFunction function, Datum arg) { ExprContext_CB **prev_callback; ExprContext_CB *ecxt_callback; prev_callback = &econtext->ecxt_callbacks; while ((ecxt_callback = *prev_callback) != NULL) { if (ecxt_callback->function == f...
false
false
false
false
false
0
convolution_filter_update_symmetry(ConvolutionControls *controls) { ConvolutionArgs *args; guint i, size; gboolean sensitive; args = controls->args; size = args->preset->data.size; sensitive = (args->preset->vsym != CONVOLUTION_FILTER_SYMMETRY_ODD); for (i = 0; i < size; i++) gtk_w...
false
false
false
false
false
0
remFromFileParser(ArFileParser *fileParser) { if (fileParser == NULL) { return false; } fileParser->remHandler(&myMinPosCB); fileParser->remHandler(&myMaxPosCB); fileParser->remHandler(&myNumPointsCB); fileParser->remHandler(&myIsSortedPointsCB); fileParser->remHandler(&myLineMinPosCB); fileParser->...
false
false
false
false
false
0
GetMinimum( int *pbSuccess ) { if (pbSuccess) { *pbSuccess = 1; } return open_mode != MODE_RAD ? 1 : GDALRasterBand::GetMinimum(pbSuccess); }
false
false
false
false
false
0
load_profile(string filename) { if(!Utils::Io::check_file(filename)) // if file does not exists (or is no regular file) return 0; /*parse the file and get the DOM */ xmlDoc* doc = xmlReadFile(filename.c_str(), NULL, 0); if(doc == NULL) return 0; xmlNode* root = xmlDocGetRootElement(doc); if(ro...
false
false
false
false
false
0
has_no_solution() const { CYG_REPORT_FUNCNAMETYPE("CdlConflict::has_no_solution", "result %d"); CYG_REPORT_FUNCARG1XV(this); CYG_PRECONDITION_THISC(); bool result = no_solution; CYG_REPORT_RETVAL(result); return result; }
false
false
false
false
false
0
ReadCoScalarData(vtkDataSetAttributes *a, int numPts) { int i, j, idx, numComp=0, skipScalar=0; char name[256]; char buffer[1024]; if (!(this->ReadString(buffer) && this->Read(&numComp))) { vtkErrorMacro(<<"Cannot read color scalar data!" << " for file: " << (this->FileName?this->Fil...
false
false
false
false
false
0
set_widgets(P_Buttons *page) { Button *but; guint i; if((page->button != NULL) && ((but = btn_button_get(page->button)) != NULL)) { const gchar *str; for(i = 0; i < BTN_FACES; i++) { set_blocked_entry(page->def[i].label, btn_button_get_label(but, i), page->def[i].label_sig); set_blocked_entry(page->de...
false
false
false
false
false
0
SetScalar(int idx, double dist2, vtkDoubleArray *newScalars) { double v = (this->*SampleFactor)(this->S) * exp( static_cast<double> (this->ExponentFactor*(dist2)/(this->Radius2))); if ( ! this->Visited[idx] ) { this->Visited[idx] = 1; newScalars->SetTuple(id...
false
false
false
false
false
0
Coefficients_27_39 P3((LARpp_j_1, LARpp_j, LARp), register word * LARpp_j_1, register word * LARpp_j, register word * LARp) { register int i; register longword ltmp; for (i = 1; i <= 8; i++, LARpp_j_1++, LARpp_j++, LARp++) { *LARp = GSM_ADD( SASR( *LARpp_j_1, 2 ), SASR( *LARpp_j, 2 )); *LARp = GSM_ADD( *LARp...
false
false
false
false
false
0
put () const { std::vector<unsigned long> v; v.push_back (engineIDulong<DRand48Engine>()); unsigned short dummy[] = { 0, 0, 0 }; unsigned short* cseed = seed48(dummy); for (int i=0; i<3; ++i) { dummy[i] = cseed[i]; v.push_back (static_cast<unsigned long>(cseed[i])); } seed48(dummy); return v;...
false
false
false
false
false
0
mysql_cache_remove_dir(request_rec *r, const char *const curdir, MYSQL *mysql) { char *restrict sqlstr, *restrict query = NULL; int ret = CA_FATAL; if (!(sqlstr = apr_palloc(r->pool, 2*strlen(curdir)+1))) goto error; mysql_real_escape_string(mysql, sqlstr, curdir, strlen(curdir)); query = apr_psprintf(r->poo...
false
false
false
false
false
0
e_destination_store_iter_children (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreeIter *parent) { EDestinationStore *destination_store = E_DESTINATION_STORE (tree_model); g_return_val_if_fail (E_IS_DESTINATION_STORE (tree_model), FALSE); /*...
false
false
false
false
false
0
dio_read_error(struct inode *inode, struct bio *failed_bio, struct page *page, u64 start, u64 end, int failed_mirror, bio_end_io_t *repair_endio, void *repair_arg) { struct io_failure_record *failrec; struct bio *bio; int isector; int read_mode; int ret; BUG_ON(failed_bio->bi_rw & REQ_WRITE); re...
false
false
false
false
false
0
parse_port_range(const char *port, uint16_t *port_min_out, uint16_t *port_max_out) { int port_min, port_max, ok; tor_assert(port_min_out); tor_assert(port_max_out); if (!port || *port == '\0' || strcmp(port, "*") == 0) { port_min = 1; port_max = 65535; } else { char *endptr = NUL...
false
false
false
false
false
0