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
consolidateRules() { typedef vector<ExtractedRule>::iterator R; map<int, map<int, map<int, map<int,int> > > > spanCount; // compute number of rules per span if (m_options.fractionalCounting) { for(R rule = m_extractedRules.begin(); rule != m_extractedRules.end(); rule++ ) { spanCount[ rule->startT ][ rule->en...
false
false
false
false
false
0
afr_mark_child_as_source_by_uid (int32_t *sources, struct iatt *bufs, int32_t *valid_children, int child_count, uint32_t uid) { int i = 0; int nsources = 0; int child = 0; GF_ASSERT (bufs); G...
false
false
false
true
false
1
Deinit() { if (state_ == INITIALIZED) { TRACE_ISOLATE(deinit); if (FLAG_hydrogen_stats) HStatistics::Instance()->Print(); // We must stop the logger before we tear down other components. logger_->EnsureTickerStopped(); delete deoptimizer_data_; deoptimizer_data_ = NULL; if (FLAG_preempt...
false
false
false
false
false
0
print_pseudo_costs (FILE *f) { int regno, k; int rclass; cost_classes_t cost_classes_ptr; enum reg_class *cost_classes; ira_assert (! allocno_p); fprintf (f, "\n"); for (regno = max_reg_num () - 1; regno >= FIRST_PSEUDO_REGISTER; regno--) { if (REG_N_REFS (regno) <= 0) continue; cost_cla...
false
false
false
false
false
0
_gen_job_prio(struct job_record *job_ptr) { uint32_t job_prio; slurmdb_qos_rec_t *qos_ptr = job_ptr->qos_ptr; if (qos_ptr) job_prio = (qos_ptr->priority & 0xffff) << 16; else job_prio = 0; if (job_ptr->node_cnt >= 0xffff) job_prio += 0xffff; else job_prio += job_ptr->node_cnt; return job_prio; }
false
false
false
false
false
0
authenticate_cb (SoupSession *session, SoupMessage *msg, SoupAuth *auth, gboolean retrying, DMAPConnection *connection) { if (retrying || ! connection->priv->password) { g_debug ("Requesting password from application"); soup_session_pause_message (session, msg); // FIXME: GDK_THREADS_ENTER (); g_signal_emit (c...
false
false
false
false
false
0
via_mem_free(struct drm_device *dev, void *data, struct drm_file *file_priv) { drm_via_private_t *dev_priv = dev->dev_private; drm_via_mem_t *mem = data; struct via_memblock *obj; mutex_lock(&dev->struct_mutex); obj = idr_find(&dev_priv->object_idr, mem->index); if (obj == NULL) { mutex_unlock(&dev->struct_mut...
false
false
false
false
false
0
_g_time_val_from_exif_date (const char *exif_date, GTimeVal *time_) { struct tm tm; long val; g_return_val_if_fail (time_ != NULL, FALSE); if (exif_date == NULL) return FALSE; while (g_ascii_isspace (*exif_date)) exif_date++; if (*exif_date == '\0') return FALSE; if (! g_ascii_isdigit (*exi...
false
false
false
false
false
0
processEndElement(const EndElementEvent &event, Allocator &alloc) { Boolean wasArc = (openElementFlags_.back() & isArc); openElementFlags_.resize(openElementFlags_.size() - 1); if (wasArc) { EndElementEvent *genEvent = new (alloc) EndElementEvent(currentElement().type(), metaDtd_, eve...
false
false
false
false
false
0
find_def_preds (VEC(use_pred_info_t, heap) ***preds, size_t *num_preds, gimple phi) { size_t num_chains = 0, i, n; VEC(edge, heap) **dep_chains = 0; VEC(edge, heap) *cur_chain = 0; VEC(edge, heap) *def_edges = 0; bool has_valid_pred = false; basic_block phi_bb, cd_root = 0; struct pointer_...
false
false
false
false
false
0
alloc_workspace(void) { lzo_mem = vmalloc(LZO1X_MEM_COMPRESS); lzo_compress_buf = vmalloc(lzo1x_worst_compress(PAGE_SIZE)); if (!lzo_mem || !lzo_compress_buf) { free_workspace(); return -ENOMEM; } return 0; }
false
false
false
false
false
0
do_check(char * buffer, int try, unsigned int current_block) { long got; /* Seek to the correct loc. */ if (lseek(DEV, current_block * MINIX_BLOCK_SIZE, SEEK_SET) != current_block * MINIX_BLOCK_SIZE ) err(MKFS_ERROR, _("%s: seek failed during testing of blocks"), device_name); /* Try the read */ ...
false
true
false
false
true
1
cm_p7_oprofile_DestroyBlock(CM_P7_OM_BLOCK *block) { int i; if (block == NULL) return; if (block->list != NULL) { for (i = 0; i < block->listSize; ++i) { if (block->list[i] != NULL) p7_oprofile_Destroy(block->list[i]); } free(block->list); } if (block->cm_offsetA != NULL) free(bl...
false
false
false
false
false
0
sorb_decimal_print (char buf[], int n) { int i; for (i = 0; i < n; ++i) { fprintf(stderr,"%4d ",buf[i]); } fprintf(stderr,"\n"); }
false
false
false
false
false
0
wedge_angle(v_id) vertex_id v_id; { int concount; conmap_t *conmap = get_v_constraint_map(v_id); REAL normal[2][MAXCOORD]; REAL c; int j; struct constraint *con; REAL fval; concount = conmap[0]; if ( concount == 0 ) return 2*M_PI; if ( concount == 1 ) return M_PI; /* two constraints, so find angl...
false
false
false
false
true
1
deactivate_object(const PortableServer::ObjectId& oid) { // Once an object is targeted for deactivation, things happen in // this order: // // o wait for requests to complete // -- note that new requests can arrive in the mean time, so the // deactivation may never actually complete! This is ...
false
false
false
false
false
0
mmap_base(unsigned long rnd) { unsigned long gap = rlimit(RLIMIT_STACK); if (gap < MIN_GAP) gap = MIN_GAP; else if (gap > MAX_GAP) gap = MAX_GAP; return PAGE_ALIGN(TASK_SIZE - gap - rnd); }
false
false
false
false
false
0
L13() {register object *base=vs_base; register object *sup=base+VM13; VC13 vs_reserve(VM13); {object V24; object V25; if(vs_top-vs_base>2) too_many_arguments(); if(vs_base>=vs_top){vs_top=sup;goto T57;} V24=(base[0]); vs_base++; if(vs_base>=vs_top){vs_top=sup;goto T58;} V25=(base[1]); vs_top=sup; goto T59; ...
false
false
false
false
false
0
addIndexedNormalRelatedWeight(Function* vsMain, ParameterPtr& pNormalParam, ParameterPtr& pNormalWorldRelatedParam, int index, int& funcCounter) { FunctionInvocation* curFuncInvocation; Operand::OpMask indexMask = ...
false
false
false
false
false
0
bms_overlap(const Bitmapset *a, const Bitmapset *b) { int shortlen; int i; /* Handle cases where either input is NULL */ if (a == NULL || b == NULL) return false; /* Check words in common */ shortlen = Min(a->nwords, b->nwords); for (i = 0; i < shortlen; i++) { if ((a->words[i] & b->words[i]) != 0) ...
false
false
false
false
true
1
readChunk_tRNS(LodePNGColorMode* color, const unsigned char* data, size_t chunkLength) { unsigned i; if(color->colortype == LCT_PALETTE) { /*error: more alpha values given than there are palette entries*/ if(chunkLength > color->palettesize) return 38; for(i = 0; i != chunkLength; ++i) color->palette...
false
false
false
false
false
0
L29() {register object *base=vs_base; register object *sup=base+VM29; VC29 vs_check; {object V58; V58=(base[0]); vs_top=sup; goto TTL; TTL:; base[2]= ((object)VV[25]); base[3]= ((object)VV[12]); vs_top=(vs_base=base+2)+2; (void) (*Lnk80)(); vs_top=sup; base[1]= vs_base[0]; base[2]= (V58); vs_top=(vs_base=...
false
false
false
false
false
0
___finalize(GObject *obj_self) { #define __GOB_FUNCTION__ "Gmpc:MpdData:Model::finalize" GmpcMpdDataModel *self G_GNUC_UNUSED = GMPC_MPDDATA_MODEL (obj_self); gpointer priv G_GNUC_UNUSED = self->_priv; #line 88 "gmpc-mpddata-model.gob" if(self->_priv->req_artist) { g_free ((gpointer) self->_priv->req_artist); self->...
false
false
false
false
false
0
pnpacpi_encode_ext_irq(struct pnp_dev *dev, struct acpi_resource *resource, struct resource *p) { struct acpi_resource_extended_irq *extended_irq = &resource->data.extended_irq; u8 triggering, polarity, shareable; if (!pnp_resource_enabled(p)) { extended_irq->interrupt_count = 0; pnp_dbg(&dev->dev...
false
false
false
false
false
0
pstore_table_import_columns(struct pstore_table *self, const char *filename) { FILE *input; struct fields_reader *reader; struct fields_record *record; unsigned long ndx; input = fopen(filename, "r"); if (input == NULL) die("fopen: %s", strerror(errno)); reader = fields_read_file(input, &dsv_iterator_format,...
false
false
false
false
true
1
pcxhr_update_r_buffer(struct pcxhr_stream *stream) { int err, is_capture, stream_num; struct pcxhr_rmh rmh; struct snd_pcm_substream *subs = stream->substream; struct snd_pcxhr *chip = snd_pcm_substream_chip(subs); is_capture = (subs->stream == SNDRV_PCM_STREAM_CAPTURE); stream_num = is_capture ? 0 : subs->numbe...
false
false
false
false
false
0
stack_init (iksparser *prs) { prs->stack = iks_malloc (128); if (!prs->stack) return 0; prs->stack_max = 128; prs->stack_pos = 0; return 1; }
false
false
false
false
false
0
trace_frame_exc(PyThreadState *tstate, PyFrameObject *f) { PyObject *type, *value, *traceback, *arg; int err; if (tstate->c_tracefunc == NULL) return 0; PyErr_Fetch(&type, &value, &traceback); if (value == NULL) { value = Py_None; Py_INCREF(value); } arg = PyTuple_P...
false
false
false
false
false
0
drawGroupIcon() { if ( type_ == Group ) { if ( childCount() == 0 ) setIcon(IconsetFactory::iconPtr("psi/groupEmpty")); else if ( isOpen() ) setIcon(IconsetFactory::iconPtr("psi/groupOpen")); else setIcon(IconsetFactory::iconPtr("psi/groupClosed")); } else if ( type_ == Profile ) { if ( !d->alerting ...
false
false
false
false
false
0
menu_items_changed_cb(GtkContainer *container, GtkWidget *widget, GeanyMenubuttonAction *action) { GeanyMenubuttonActionPrivate *priv; gboolean enable; GSList *l; g_return_if_fail(action != NULL); priv = GEANY_MENU_BUTTON_ACTION_GET_PRIVATE(action); if (priv->menu != NULL) { GList *children = gtk_container_g...
false
false
false
false
false
0
alloc_real_var(struct net_t *np, int32 insts) { register int32 i; int32 arrw, totchars; double *dp; /* case 1: new real array - must be malloced */ /* must malloc arrays because they can be large */ if (np->n_isarr) { arrw = __get_arrwide(np); totchars = arrw*(2*WRDBYTES*insts*wlen_(REALBITS)); np->nv...
false
false
false
false
false
0
PAINT_end() { GB_PAINT *paint; if (!_current) return; paint = _current; _current = _current->previous; PAINT_close(paint); if (paint->draw) DRAW_open(paint->draw); if (paint->brush) GB.Unref(POINTER(&paint->brush)); GB.Unref(POINTER(&paint->device)); GB.Free(POINTER(&paint)); }
false
false
false
false
false
0
countMembers() { // This bit counter is good for sparse numbers of '1's, which is // very much the case that we will usually have. int32_t count = 0; for (uint32_t i=0; i<sizeof(bits)/sizeof(uint32_t); i++) { uint32_t x = bits[i]; while (x > 0) { count++; x &= (x...
false
false
false
false
false
0
rlm_sql_query(SQLSOCK *sqlsocket, SQL_INST *inst, char *query) { int ret; /* * If there's no query, return an error. */ if (!query || !*query) { return -1; } if (sqlsocket->conn) { ret = (inst->module->sql_query)(sqlsocket, inst->config, query); } else { ret = SQL_DOWN; } if (ret == SQL_DOWN) { s...
false
false
false
false
false
0
alsa_get_unmute_volume( void ) { long val; if (elem == NULL) return -1; if (snd_mixer_selem_is_playback_mono(elem)) { snd_mixer_selem_get_playback_volume(elem, SND_MIXER_SCHN_MONO, &val); return val; } else { int c, n = 0; long sum = 0; for (c = 0; c <= SND_MIXER_SCHN_LAST; c++) { if (snd_mixer_sele...
false
false
false
false
false
0
ResetPetCombat() { Unit* pOwner = m_creature->GetCharmerOrOwner(); if (pOwner && m_creature->GetCharmInfo() && m_creature->GetCharmInfo()->HasCommandState(COMMAND_FOLLOW)) { m_creature->GetMotionMaster()->MoveFollow(pOwner, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); } else { m_creature...
false
false
false
false
false
0
SetSpatialFilter( OGRGeometry * poGeom ) { if (bStreamingDS) bReloadNeeded = TRUE; else if (poFetchedFilterGeom == NULL && poBaseDS != NULL) { /* If there was no filter set, and that we set one */ /* the new result set can only be a subset of the whole */ /* so no need to rel...
false
false
false
false
false
0
assert_reset_soft(bool should_be_detached) { git_oid oid; cl_git_pass(git_reference_name_to_id(&oid, repo, "HEAD")); cl_git_fail(git_oid_streq(&oid, KNOWN_COMMIT_IN_BARE_REPO)); cl_git_pass(git_revparse_single(&target, repo, KNOWN_COMMIT_IN_BARE_REPO)); cl_assert(git_repository_head_detached(repo) == should_be_d...
false
false
false
false
false
0
isASyntaxOrMrPluginOrPss(Slapi_Entry *e) { char *ptype = slapi_entry_attr_get_charptr(e, ATTR_PLUGIN_TYPE); int retval = (ptype && !strcasecmp(ptype, "syntax")); if (!retval) retval = (ptype && !strcasecmp(ptype, "matchingrule")); if (!retval) retval = (ptype && !strcasecmp(ptype, "pwdstoragescheme")); if (!re...
false
false
false
false
false
0
operator()(const SurfacePoint &sp) { if (DistanceSquared(sp.p, p) < maxDist2) { failed = true; return false; } return true; }
false
false
false
false
false
0
toBase(unsigned int value, unsigned int base, char*& ptr){ static const char* hex="0123456789ABCDEF"; int rest = value % base; if(value >= base) toBase( (value-rest)/base, base, ptr); *ptr++=(char)hex[rest]; }
false
false
false
false
false
0
copy_equiv_class (vla_ptr_t *to, const vla_ptr_t *from) { state_t *class_ptr; VLA_PTR_NULLIFY (*to); for (class_ptr = VLA_PTR_BEGIN (*from); class_ptr <= (state_t *) VLA_PTR_LAST (*from); class_ptr++) VLA_PTR_ADD (*to, *class_ptr); }
false
false
false
false
false
0
compute_topo_order (constraint_graph_t graph, struct topo_info *ti) { unsigned int i; unsigned int size = graph->size; for (i = 0; i != size; ++i) if (!TEST_BIT (ti->visited, i) && find (i) == i) topo_visit (graph, ti, i); }
false
false
false
false
false
0
slurm_cred_ctx_set(slurm_cred_ctx_t ctx, slurm_cred_opt_t opt, ...) { int rc = SLURM_SUCCESS; va_list ap; xassert(ctx != NULL); va_start(ap, opt); slurm_mutex_lock(&ctx->mutex); xassert(ctx->magic == CRED_CTX_MAGIC); switch (opt) { case SLURM_CRED_OPT_EXPIRY_WINDOW: ctx->expiry_window = va_arg(ap, in...
false
false
false
false
false
0
removeFromActiveQ(sys_thread_t * t) { sys_thread_t *prev; sys_thread_t *tid; sysAssert(SYS_QUEUE_LOCKED(sysThreadSelf())); ActiveThreadCount--; prev = 0; tid = ThreadQueue; while (tid) { if (tid == t) { if (prev) { prev->next = tid->next; } ...
false
false
false
false
false
0
read_string (const char *text) { char *p; char *s = strdup (text); if (*s == '\"') { s++; } for (p = s; *p; p++) { if (*p == '\"') { *p = '\0'; } } return s; }
false
false
false
false
false
0
bnxt_hwrm_queue_pfc_cfg(struct bnxt *bp, struct ieee_pfc *pfc) { struct hwrm_queue_pfcenable_cfg_input req = {0}; struct ieee_ets *my_ets = bp->ieee_ets; unsigned int tc_mask = 0, pri_mask = 0; u8 i, pri, lltc_count = 0; bool need_q_recfg = false; int rc; if (!my_ets) return -EINVAL; for (i = 0; i < bp->max...
false
false
false
false
false
0
nct6683_fan_is_visible(struct kobject *kobj, struct attribute *attr, int index) { struct device *dev = container_of(kobj, struct device, kobj); struct nct6683_data *data = dev_get_drvdata(dev); int fan = index / 3; /* fan index */ int nr = index % 3; /* attribute index */ if (!(data->have_fan & (1 << fa...
false
false
false
false
false
0
Flush() { if( fStream != NULL) { fStream->flush(); } if( ogzStream != NULL) { ogzStream->flush(); } }
false
false
false
false
false
0
isBinaryOpUsed(BinaryOpcode opcode) const { for (binary_op_node_map_t::const_iterator it = binary_op_node_map.begin(); it != binary_op_node_map.end(); it++) if (it->first.second == opcode) return true; return false; }
false
false
false
false
false
0
c67x00_drv_remove(struct platform_device *pdev) { struct c67x00_device *c67x00 = platform_get_drvdata(pdev); struct resource *res; int i; for (i = 0; i < C67X00_SIES; i++) c67x00_remove_sie(&c67x00->sie[i]); c67x00_ll_release(c67x00); res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); if (res) free_irq...
false
false
false
false
false
0
clampr(float *x, float min, float max) { bool ret = false; if( *x < min ) { *x = min; ret = true; } else if( *x > max ) { *x = max; ret = true; } return ret; }
false
false
false
false
false
0
remove_bus_watch (gpointer user_data) { guint watch_id = GPOINTER_TO_INT(user_data); UNITY_WEBAPPS_NOTE(INTEREST, "REMOVING BUS WATCH FOR %d", watch_id); g_bus_unwatch_name (watch_id); return FALSE; }
false
false
false
false
false
0
spl_display_checklimits(GtkWidget *spl_window) { SPLWizard *spl_wizard; Playlist *spl; GtkWidget *w; spl_wizard = get_spl_wizard(); g_return_if_fail (spl_wizard); spl = g_object_get_data(G_OBJECT (spl_wizard->window), "spl_work"); g_return_if_fail (spl); if ((w = gtkpod_builder_xml_get...
false
false
false
false
false
0
t4vf_get_dev_params(struct adapter *adapter) { struct dev_params *dev_params = &adapter->params.dev; u32 params[7], vals[7]; int v; params[0] = (FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_DEV) | FW_PARAMS_PARAM_X_V(FW_PARAMS_PARAM_DEV_FWREV)); params[1] = (FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_DEV) | FW_PARAMS_PARAM...
false
false
false
false
false
0
count_abook_entries_on_disk(AdrBk *ab, a_c_arg_t *deleted) { FILE *fp_in; char *nickname; adrbk_cntr_t count = 0; adrbk_cntr_t deleted_count = 0; int rew = 1; char nickbuf[50]; if(!ab || !ab->fp) return -1; fp_in = ab->fp; while((nickname ...
false
false
false
false
false
0
e_ews_item_finalize (GObject *object) { EEwsItem *item = (EEwsItem *) object; EEwsItemPrivate *priv; g_return_if_fail (E_IS_EWS_ITEM (item)); priv = item->priv; /* clean up */ g_free (priv); item->priv = NULL; if (parent_class->finalize) (* parent_class->finalize) (object); }
false
false
false
false
false
0
vertice_get_or_build (long id, Vertex ** vertices, int max_size, int * num_vertices) { if (id <= 0 || id >= max_size) return NULL; int index = id - 1; Vertex * vertex = vertices[index]; if (vertex == NULL) { vertex = vertex_new (id); vertices[index] = vertex; *num_vertic...
false
false
false
false
false
0
find_pxe_server_type(EFI_PXE_BASE_CODE *pxe) { INTN i = 0, max; UINT8 tag, length; UINT8 *opts = pxe->Mode->PxeReply.Dhcpv4.DhcpOptions; UINT16 server_type; while(i < 55) { tag = opts[i]; length = opts[i+1]; DBG_PRT((L"Tag #%d Length %d\n",tag, length)); if (tag == 43) goto found; i += 2 + length;...
false
false
false
false
false
0
rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) { struct list_head *plist, *phead; struct sta_info *psta = NULL; u32 index; u8 *addr; u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; if (!hwaddr) return NULL; if (IS_MCAST(hwaddr)) addr = bc_addr; else addr = hwaddr; index = wifi_ma...
false
false
false
false
false
0
gnibbles_load_pixmap_file (const gchar * pixmap, gint xsize, gint ysize) { GdkPixbuf *image; gchar *filename; filename = g_build_filename (DATA_DIRECTORY, "pixmaps", pixmap, NULL); if (!filename) { char *message = g_strdup_printf (_("Nibbles couldn't find pixmap file:\n%s\n\n" ...
false
false
false
false
false
0
copy(FieldInterface * p) { for(int i = 0; i < mHeight; i++) { for(int j = 0; j < mWidth; j++) { maBoard[i][j] = p->getCell(j, i); } } }
false
false
false
false
false
0
sys_task_uniform( long* seed, /*!< Pointer to seed value to use and store new seed in */ long start, /*!< Beginning range */ long end /*!< Ending range */ ) { PROFILE(SYS_TASK_UNIFORM); double d = 0.00000011920928955078125; double a, b, c; unsigned long oldseed, newseed; oldseed =...
false
false
false
false
false
0
e1000e_get_auto_rd_done(struct e1000_hw *hw) { s32 i = 0; s32 ret_val = E1000_SUCCESS; while (i < AUTO_READ_DONE_TIMEOUT) { if (er32(EECD) & E1000_EECD_AUTO_RD) break; msleep(1); i++; } if (i == AUTO_READ_DONE_TIMEOUT) { e_dbg("Auto read by HW from NVM has not completed.\n"); ret_val = -E1000_ERR_RE...
false
false
false
false
false
0
rb_dlcfunc_initialize(int argc, VALUE argv[], VALUE self) { VALUE addr, name, type, calltype, addrnum; struct cfunc_data *data; void *saddr; const char *sname; rb_scan_args(argc, argv, "13", &addr, &type, &name, &calltype); addrnum = rb_Integer(addr); saddr = (void*)(NUM2PTR(addrnum)); ...
false
false
false
false
false
0
jas_iccattrtab_replace(jas_iccattrtab_t *attrtab, int i, jas_iccuint32_t name, jas_iccattrval_t *val) { jas_iccattrval_t *newval; jas_iccattr_t *attr; if (!(newval = jas_iccattrval_clone(val))) goto error; attr = &attrtab->attrs[i]; jas_iccattrval_destroy(attr->val); attr->name = name; attr->val = newval; r...
false
false
false
false
false
0
GKIFree(GKI *hash) { struct gki_elem *ptr; int i; if (hash == NULL) return; /* tolerate a NULL */ for (i = 0; i < hash->nhash; i++) while (hash->table[i] != NULL) { ptr = hash->table[i]->nxt; /* NULL keys can occur after we've gki_upsize'd */ if (hash->table[i]->key != NULL) free(hash->t...
false
false
false
false
false
0
getOpenUrl(QWidget *parent, const QString &caption, const Url &dir, const QString &filter) { const QStringList filterList = filter.split('\n'); QString parsedFilter; for (int i = 0; i < filterList.size(); ++i) { const QStringList filterItems = filterList.at(i).split('|'); if (i > 0) parsedFilter += ";;"; p...
false
false
false
false
false
0
action_examine_all_end (Unit *unit, dpacket packet) { uae_u32 id; uae_u32 doserr = 0; ExAllKey *eak; uaecptr control = GET_PCK_ARG5 (packet); if (kickstart_version < 36) return 0; id = get_long (control + 4); eak = getexall (unit, control, id); #if EXALL_DEBUG > 0 write_log (_T("EXALL_END ID=%d %x\n"), id, e...
false
false
false
false
false
0
sym53c8xx_intr(int irq, void *dev_id) { struct Scsi_Host *shost = dev_id; struct sym_data *sym_data = shost_priv(shost); irqreturn_t result; /* Avoid spinloop trying to handle interrupts on frozen device */ if (pci_channel_offline(sym_data->pdev)) return IRQ_NONE; if (DEBUG_FLAGS & DEBUG_TINY) printf_debug ("...
false
false
false
false
false
0
get_next_tr_id(void) { transfer *tr; while(1) { gdata.next_tr_id++; gdata.next_tr_id %= max2((MAXTRANS * 3) / 2, 1000); gdata.next_tr_id = max2(1,gdata.next_tr_id); tr = does_tr_id_exist(gdata.next_tr_id); if (!tr) { return gdata.next_tr_id; } } }
false
false
false
false
false
0
NormalizePath() const { char *path = new char[fileName.length() + 1]; strcpy(path, AsInternal()); #ifdef WIN32 // Convert unix path separators to Windows for (char *cp = path; *cp; cp++) { if (*cp == '/') *cp = pathSepChar; } #endif char *absPath = new char[fileName.length() + 1]; char *cur = absPath; *cur...
false
false
false
false
false
0
G_CheckSpot ( int playernum, mapthing_t* mthing ) { fixed_t x; fixed_t y; subsector_t* ss; unsigned an; mobj_t* mo; int i; if (!players[playernum].mo) { // first spawn of level, before corpses for (i=0 ; i<playernum ; i++) if (players[i].mo->x == mthing->x << FRAC...
false
false
false
false
false
0
ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional string name = 1; if (has_name()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->name()); } // optional .google.protobuf.ServiceOptio...
false
false
false
false
false
0
readFile(const char* fileName) { int fd = open(fileName, O_RDONLY); if (fd < 0) { fprintf(stderr, "Error opening %s", fileName); return UString(); } struct stat buf; if (fstat(fd, &buf) == -1) { fprintf(stderr, "Error stat'ing %s", fileName); close(fd); return UString(); } int si...
false
false
false
false
false
0
restoringSession() { return d->firstInstance && isSessionRestored(); }
false
false
false
false
false
0
gncVendorCreate (QofBook *book) { GncVendor *vendor; if (!book) return NULL; vendor = g_object_new (GNC_TYPE_VENDOR, NULL); qof_instance_init_data (&vendor->inst, _GNC_MOD_NAME, book); vendor->id = CACHE_INSERT (""); vendor->name = CACHE_INSERT (""); vendor->notes = CACHE_INSERT (""); ...
false
false
false
false
false
0
commit_add_row(struct record_stat* rst, const char* sname, struct trie_node* node) { FILE* fp; int i; fp = fopen(rst->journal_fn, "a"); if (fp == NULL) { return; } write_string(fp, "ADD \""); write_quote_string(fp, sname); write_string(fp, "\" S\""); write_quote_xstr(fp, &node->row.key, ...
false
false
false
false
true
1
DestroyDeletedFileNodes() /* * FUNCTION: Destroys file nodes that are marked for deletion */ { PCFFILE_NODE CurNode; PCFFILE_NODE NextNode; CurNode = FileListHead; while (CurNode != NULL) { NextNode = CurNode->Next; if (CurNode->Delete) { if (CurNode->Prev != ...
false
false
false
false
false
0
argos(block) Block *block; { int width, pos, seq, seq1, seqs, diff[MAXROWS][MAXROWS]; double total; width = block->sequences[0].length; if (width > EXTRA_LARGE_BUFF) { width = EXTRA_LARGE_BUFF; fprintf(stderr, "ERROR: Block %s is too wide (%d), truncated to %d\n", block->number, block->sequen...
false
false
false
false
false
0
gpio_trig_brightness_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t n) { struct led_classdev *led = dev_get_drvdata(dev); struct gpio_trig_data *gpio_data = led->trigger_data; unsigned desired_brightness; int ret; ret = sscanf(buf, "%u", &desired_brightness); if (ret < 1 || de...
false
false
false
false
false
0
vm_delta_from_interp_angle( float current_angle, float desired_angle ) { float delta; if ( desired_angle < 0.0f ) desired_angle += PI2; if ( desired_angle > PI2 ) desired_angle -= PI2; delta = desired_angle - current_angle; if ( fl_abs(delta) > PI ) { if ( delta > 0.0f ) { delta = delta - PI2; } else { ...
false
false
false
false
false
0
SB_Ticker(void) { int delta; int curHealth; curHealth = players[consoleplayer].mo->health; if (curHealth < 0) { curHealth = 0; } if (curHealth < HealthMarker) { delta = (HealthMarker - curHealth) >> 2; if (delta < 1) { delta = 1; } ...
false
false
false
false
false
0
fort_read_line(FILE *fp, gchar **line) { gint ret_val; gchar the_line[LINELEN]; ret_val = fgetline(fp, the_line); if (!ret_val) { *line = g_strndup(the_line, 80); } return(ret_val); }
false
false
false
false
false
0
DateCalc_ISO_UC(N_char c) { N_int i = (N_int) c; if (((i >= 0x61) and (i <= 0x7A)) or ((i >= 0xE0) and (i <= 0xF6)) or ((i >= 0xF8) and (c <= 0xFE))) i -= 0x20; return((N_char) i); }
false
false
false
false
false
0
renderGradient(const FbTk::Texture &texture) { bool inverted = false; using namespace FbTk; interlaced = texture.type() & Texture::INTERLACED; if (texture.type() & Texture::SUNKEN) { from = &(texture.colorTo()); to = &(texture.color()); if (! (texture.type() & Texture::INVER...
false
false
false
false
false
0
vscb_pref_cb( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { FD_browserattrib *ui = ob->form->fdui; int i = fl_get_choice( ob ); fl_set_browser_vscrollbar( ui->vdata, i - 1 ); if ( auto_apply ) redraw_the_form( 0 ); }
false
false
false
false
false
0
gmpc_tools_metadata_appearance_real_preferences_pane_destroy (GmpcPluginPreferencesIface* base, GtkContainer* container) { GmpcToolsMetadataAppearance * self; GtkContainer* _tmp0_; GList* _tmp1_ = NULL; self = (GmpcToolsMetadataAppearance*) base; g_return_if_fail (container != NULL); _tmp0_ = container; _tmp1_ =...
false
false
false
false
false
0
gx_unit_frac(float fvalue) { frac f = frac_0; if (is_fneg(fvalue)) f = frac_0; else if (is_fge1(fvalue)) f = frac_1; else f = float2frac(fvalue); return f; }
false
false
false
false
false
0
sharedlibs_clear (Sharedlibs *sl) { g_return_if_fail (sl->widgets.store != NULL); g_return_if_fail (GTK_IS_LIST_STORE (sl->widgets.store)); gtk_list_store_clear (sl->widgets.store); }
false
false
false
false
false
0
similarity( const QString &s1, const QString &s2 ) { const size_t len1 = s1.length(), len2 = s2.length(); QVector<uint> col( len2 + 1 ), prevCol( len2 + 1 ); for( uint i = 0; i <= len2; i++ ) prevCol[i] = i; for( uint i = 0; i < len1; i++ ) { col[0] = i + 1; for( uint j = 0;...
false
false
false
false
false
0
get_byte(s) gz_stream *s; { if (s->z_eof) return EOF; if (s->stream.avail_in == 0) { errno = 0; s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file); if (s->stream.avail_in == 0) { s->z_eof = 1; /* klibc hack */ if (errno) s->z_err = Z_ERRNO;...
false
false
false
false
false
0
be_isr(int irq, void *dev_id) { struct beiscsi_hba *phba; struct hwi_controller *phwi_ctrlr; struct hwi_context_memory *phwi_context; struct be_eq_entry *eqe = NULL; struct be_queue_info *eq; struct be_queue_info *mcc; unsigned long flags, index; unsigned int num_mcceq_processed, num_ioeq_processed; struct be_...
false
false
false
false
false
0
sse4_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h) { int s, i; uint32_t *sq = ff_squareTbl + 256; s = 0; for (i = 0; i < h; i++) { s += sq[pix1[0] - pix2[0]]; s += sq[pix1[1] - pix2[1]]; s += sq[pix1[2] - pix2[2]]; s += sq[pix1[3] - pix2[3]]; p...
false
false
false
false
false
0
gth_file_store_iter_parent (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreeIter *child) { GthFileStore *file_store; g_return_val_if_fail (child == NULL, FALSE); file_store = (GthFileStore *) tree_model; g_return_val_if_fail (VALID_ITER (child, file_store), FALSE); return FALSE; }
false
false
false
false
false
0
ajTrnSeqC(const AjPTrn trnObj, const char *str, ajint len, AjPStr *pep) { ajint i; ajint lenmod3; const char *cp = str; AjPStr transtr = NULL; char *cq; ajint trnlen; lenmod3 = len - (len % 3); trnlen = lenmod3/3; transtr = ajStrNewRes(trnlen+1); cq = ajStrGetuniquePtr(&transtr...
false
false
false
false
false
0
fill_from_channel (MsgChannel *c) { if (IS_PROTOCOL_29(c)) { Msg::fill_from_channel(c); *c >> filename; uint32_t _lang; *c >> _lang; lang = static_cast<CompileJob::Language>(_lang); } else GetCSMsg::fill_from_channel (c); *c >> job_id; *c >> clientid; }
false
false
false
false
false
0
main(int argc, char **argv) { int i; tabsize = 0; /* default for nt is not to use tabs */ progname = argv[0]; finalstage = 1; #line 46 "mnt.nw" read_defs(stdin); apply_each_module(remove_final_newline); #line 36 "mnt.nw" for (i=1; i<argc; i++) switch (*argv[i]) { case '-': #l...
false
false
false
false
false
0
IPrcWrite(pfPrcHelper* prc) { prc->startTag("SpaceTreeParams"); prc->writeParam("Root", fRoot); prc->writeParam("NumLeaves", fNumLeaves); prc->endTag(true); prc->writeSimpleTag("Tree"); for (size_t i=0; i<fTree.getSize(); i++) fTree[i].prcWrite(prc); prc->closeTag(); }
false
false
false
false
false
0
restore_snapshot(idx, close_curwin) int idx; int close_curwin; /* closing current window */ { win_T *wp; if (curtab->tp_snapshot[idx] != NULL # ifdef FEAT_VERTSPLIT && curtab->tp_snapshot[idx]->fr_width == topframe->fr_width # endif && curtab->tp_snapshot[idx]->fr_height == topframe->fr...
false
false
false
false
false
0