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
visitItem(void* item) { LineSegment* seg = (LineSegment*) item; if ( Envelope::intersects(seg->p0, seg->p1, querySeg->p0, querySeg->p1) ) { items->push_back(seg); } }
false
false
false
false
false
0
gsb_data_account_set_mini_balance_wanted ( gint account_number, gsb_real balance ) { struct_account *account; account = gsb_data_account_get_structure ( account_number ); if (!account ) return FALSE; account -> mini_balance_wanted = balance; return TRUE; }
false
false
false
false
false
0
show_stats(struct device *device, struct device_attribute *attr, char *buf) { struct ipath_ibdev *dev = container_of(device, struct ipath_ibdev, ibdev.dev); int i; int len; len = sprintf(buf, "RC resends %d\n" "RC no QACK %d\n" "RC ACKs %d\n" "RC SEQ NAKs %d\n" ...
false
false
false
false
false
0
SetList(const char *listText, char separator, char typesep) { Clear(); int count = strlen(listText) + 1; std::vector<char> words(listText, listText+count); char *startword = &words[0]; char *numword = NULL; int i = 0; for (; words[i]; i++) { if (words[i] == separator) { words[i] = '\0'; if (numword) ...
false
false
false
false
false
0
dri2_query_buffer_age(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surface) { struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surface); if (get_back_bo(dri2_surf) < 0) { _eglError(EGL_BAD_ALLOC, "dri2_query_buffer_age"); return 0; } return dri2_surf->back->age; ...
false
false
false
false
false
0
MdfLoadFile(char *c, Object *in) { char *str; if (!in[0] || ! DXExtractString (in[0], &str)) { DXSetError (ERROR_BAD_PARAMETER, "#10200", "mdf filename"); return (ERROR); } return DXLoadMDFFile(str); }
false
false
false
false
false
0
DGG_generateFormulationCutsFromBase( DGG_constraint_t *base, double slack, DGG_list_t *cut_list, DGG_data_t *data, const void *solver_ptr, CoinThreadRandom & generator) { int i, p, rval; int int_skala; double skala; int num_inlist = 0; int* skala_list = reinterpret_cast<int*> (ma...
false
true
false
false
false
1
clear_IO_APIC (void) { int apic, pin; for_each_ioapic_pin(apic, pin) clear_IO_APIC_pin(apic, pin); }
false
false
false
false
false
0
kurtosis() { double the_mean = mean(); double sum = 0.0; long good = 0; for (unsigned int i = 0; i < the_depth; i++) if (!gr_missing(contents[i])) { double tmp = (contents[i] - the_mean); sum += tmp * tmp * tmp * tmp; good++; } double s = stddev(); // BUG: which kurtosis definition to use??? // some...
false
false
false
false
false
0
swan_vk_send_line(struct swan_vk_command_option *opt, int x0, int y0, int x1, int y1) { int ret; int fd; fd = swan_vk_link_server(opt); if (fd < 0) { return fd; } ret = swan_vk_send_line_base(fd, x0, y0, x1, y1); if (ret < 0) { pr_red_info("swan_vk_send_line"); } close(fd); return ret; }
false
false
false
false
false
0
artec48u_download_firmware (Artec48U_Device * dev, SANE_Byte * data, SANE_Word size) { SANE_Status status; SANE_Byte download_buf[MAX_DOWNLOAD_BLOCK_SIZE]; SANE_Byte check_buf[MAX_DOWNLOAD_BLOCK_SIZE]; SANE_Byte *block; SANE_Word addr, bytes_left; Artec48U_Packet boot_req; SANE_Word block_size = MA...
false
false
false
false
false
0
btn_buttonrow_set_width(ButtonRow *brw, guint width) { guint i, j; if((brw != NULL) && (width > 0)) { if(width == brw->width) /* No change? */ return; if(width < brw->width) /* Shrinking? */ { for(i = width; i < brw->width; i++) btn_button_destroy(brw->button + i); } brw->button = g_realloc(b...
false
false
false
false
false
0
clock(cycle_count delta_t) { int i; if (delta_t <= 0) { return; } // Age bus value. bus_value_ttl -= delta_t; if (bus_value_ttl <= 0) { bus_value = 0; bus_value_ttl = 0; } // Clock amplitude modulators. for (i = 0; i < 3; i++) { voice[i].envelope.clock(delta_t); ...
false
false
false
false
false
0
posix_setgroups(PyObject *self, PyObject *groups) { int i, len; gid_t grouplist[MAX_GROUPS]; if (!PySequence_Check(groups)) { PyErr_SetString(PyExc_TypeError, "setgroups argument must be a sequence"); return NULL; } len = PySequence_Size(groups); if (len > MAX_GROUPS) { ...
false
false
false
false
false
0
ExecReScanGroup(GroupState *node) { node->grp_done = FALSE; node->ss.ps.ps_TupFromTlist = false; /* must clear first tuple */ ExecClearTuple(node->ss.ss_ScanTupleSlot); /* * if chgParam of subnode is not null then plan will be re-scanned by * first ExecProcNode. */ if (node->ss.ps.lefttree && node->ss.ps...
false
false
false
false
false
0
dch_global(int arg, char *inout, int suf, bool is_to_char, bool is_interval, FormatNode *node, void *data) { if (arg == DCH_FX) DCH_global_fx = true; return -1; }
false
false
false
false
false
0
c_parser_omp_all_clauses (c_parser *parser, unsigned int mask, const char *where) { tree clauses = NULL; bool first = true; while (c_parser_next_token_is_not (parser, CPP_PRAGMA_EOL)) { location_t here; pragma_omp_clause c_kind; const char *c_name; tree prev = clauses; if ...
false
false
false
false
false
0
accur_correct (gunichar uchr, double touch_time) { gint i, j; if (uchr == L' ' || uchr == UPSYM || uchr == L'\t' || uchr == L'\b') return; if (!keyb_is_inset (uchr)) return; /* * First, accuracy */ for (i = 0; i < terror_n; i++) { if (uchr == terror[i].uchr) { if (terror[i].correct > ERROR_INERTI...
false
false
false
false
false
0
set_breakpoint(TriggerObject *bpo, Processor *pCpu, Expression *pExpr) { int bpn = find_free(); if(bpn >= MAX_BREAKPOINTS || !bpo->set_break()) { delete bpo; return MAX_BREAKPOINTS; } BreakStatus &bs = break_status[bpn]; bs.bpo = bpo; bs.type = BREAK_MASK; // place holder for now... bs.cpu = p...
false
false
false
false
false
0
explain_buffer_mount_point_fd(explain_string_buffer_t *sb, int fildes) { struct stat st; if (fstat(fildes, &st) < 0) return -1; return explain_buffer_mount_point_stat(sb, &st); }
false
false
false
false
false
0
prune_matches( const vector< Match > &match, int best_cost ) { //cerr << "\tpruning"; vector< Match > pruned; for(int i=match.size()-1; i>=0; i--) { //cerr << " (" << match[i].input_start << "," << match[i].input_end // << " ; " << match[i].tm_start << "," << match[i].tm_end // << " * " << match[i].min_...
false
false
false
false
false
0
init_global_block_rsv(struct btrfs_fs_info *fs_info) { struct btrfs_space_info *space_info; space_info = __find_space_info(fs_info, BTRFS_BLOCK_GROUP_SYSTEM); fs_info->chunk_block_rsv.space_info = space_info; space_info = __find_space_info(fs_info, BTRFS_BLOCK_GROUP_METADATA); fs_info->global_block_rsv.space_inf...
false
false
false
false
false
0
initPDFSet(const string& name, SetType type, int member) { initPDFSet(name + "." + _getFileExtension(type), member); }
false
false
false
false
false
0
mt76_init_beacon_offsets(struct mt7601u_dev *dev) { u16 base = MT_BEACON_BASE; u32 regs[4] = {}; int i; for (i = 0; i < 16; i++) { u16 addr = dev->beacon_offsets[i]; regs[i / 4] |= ((addr - base) / 64) << (8 * (i % 4)); } for (i = 0; i < 4; i++) mt7601u_wr(dev, MT_BCN_OFFSET(i), regs[i]); }
false
false
false
false
false
0
generatePtaWideLine(l_int32 x1, l_int32 y1, l_int32 x2, l_int32 y2, l_int32 width) { l_int32 i, x1a, x2a, y1a, y2a; PTA *pta, *ptaj; PROCNAME("generatePtaWideLine"); if (width < 1) { L_WARNING("width < 1; setting...
false
false
false
false
false
0
write_string (ACE_CDR::ULong len, const ACE_CDR::Char *x) { // @@ This is a slight violation of "Optimize for the common case", // i.e. normally the translator will be 0, but OTOH the code is // smaller and should be better for the cache ;-) ;-) if (this->char_translator_ != 0) ...
false
false
false
false
false
0
get_local_array_du_block(Block *bpt, IntSet local_array) { Array_def_use_table_semnode *local_du = NULL, *mod; Module_table *module = bpt->module; local_du = copy_array_def_use_table_semnode(get_array_mayuse(bpt)); replace_unknown_to_defined_du_semnode_list(module, ...
false
false
false
false
false
0
ajCathDel(AjPCath *Pcath) { ajuint i = 0U; AjPCath cath = NULL; if(!Pcath || !*Pcath) return; cath = *Pcath; ajStrDel(&cath->DomainID); ajStrDel(&cath->Pdb); ajStrDel(&cath->Class); ajStrDel(&cath->Architecture); ajStrDel(&cath->Topology); ajStrDel(&cath->Superfamily)...
false
false
false
false
false
0
opengl_tcache_shutdown() { opengl_kill_all_render_targets(); opengl_tcache_flush(); GL_textures_in = 0; GL_textures_in_frame = 0; if (Textures != NULL) { vm_free(Textures); Textures = NULL; } if (Tex_used_this_frame != NULL) { vm_free(Tex_used_this_frame); Tex_used_this_frame = NULL; } }
false
false
false
false
false
0
radeonfb_imageblit(struct fb_info *info, const struct fb_image *image) { struct radeonfb_info *rinfo = info->par; if (info->state != FBINFO_STATE_RUNNING) return; radeon_engine_idle(); cfb_imageblit(info, image); }
false
false
false
false
false
0
gst_byte_reader_get_asf_var_size_field (GstByteReader * reader, guint8 field_type, guint32 * var) { guint8 aux8 = 0; guint16 aux16 = 0; guint32 aux32 = 0; gboolean ret; switch (field_type) { case ASF_FIELD_TYPE_DWORD: ret = gst_byte_reader_get_uint32_le (reader, &aux32); *var = aux32; ...
false
false
false
false
false
0
AnySelectedHints(FontViewBase *fv) { SplineFont *sf = fv->sf; int gid, enc; SplineChar *sc; for ( enc=0; enc<fv->map->enccount; ++enc ) { if ( fv->selected[enc] && (gid=fv->map->map[enc])!=-1 && (sc = sf->glyphs[gid])!=NULL && (sc->hstem!=NULL || sc->vstem!=NULL || sc->dstem!=NULL )) return( true ...
false
false
false
false
false
0
RGBE_WritePixels(float *data, int numpixels) { unsigned char rgbe[4]; while (numpixels-- > 0) { float2rgbe(rgbe,data[RGBE_DATA_RED],data[RGBE_DATA_GREEN],data[RGBE_DATA_BLUE]); data += RGBE_DATA_SIZE; if (iwrite(rgbe, sizeof(rgbe), 1) < 1) return IL_FALSE; } return IL_TRUE; }
true
true
false
false
false
1
GetParentDirectory(const char* fileOrDir) { if ( !fileOrDir || !*fileOrDir ) { return ""; } kwsys_stl::string res = fileOrDir; SystemTools::ConvertToUnixSlashes(res); kwsys_stl::string::size_type cc = res.size()-1; if ( res[cc] == '/' ) { cc --; } for ( ; cc > 0; cc -- ) { if...
false
false
false
false
false
0
HandlersToCode( void *theEnv, FILE **handlerFile, char *fileName, int fileID, int imageID, FILE *headerFP, int *fileCount, int maxIndices, DEFCLASS *theDefclass, int *handlerArrayVersion, int *handlerArrayCount, int *reopenHandlerFile, struct CodeGeneratorFile *handlerCodeFile) { register...
false
false
false
false
true
1
SubsurfaceFromDiffuse(const Spectrum &Kd, float meanPathLength, float eta, Spectrum *sigma_a, Spectrum *sigma_prime_s) { float A = (1.f + Fdr(eta)) / (1.f - Fdr(eta)); float rgb[3]; Kd.ToRGB(rgb); float sigma_prime_s_rgb[3], sigma_a_rgb[3]; for (int i = 0; i < 3; ++i) { // Compute $\a...
false
false
false
false
false
0
LoadLVars( Obj lvars ) { UInt len,i; Obj *ptr; ADDR_OBJ(lvars)[0] = LoadSubObj(); ((UInt *)ADDR_OBJ(lvars))[1] = LoadUInt(); ADDR_OBJ(lvars)[2] = LoadSubObj(); len = (SIZE_OBJ(lvars) - (2*sizeof(Obj)+sizeof(UInt)))/sizeof(Obj); ptr = ADDR_OBJ(lvars)+3; for (i = 0; i < len; i++) *ptr++ = LoadSubObj()...
false
false
false
false
false
0
dokey_dfi(Key *k, uchar *lp, uchar *lpe, Field *f) { uchar *kp; Rune r; int c, cl, n, rflag; cl = k->klen; kp = k->key + cl; rflag = f->flags & Rflag; for(;;) { /* * get the character */ if(lp >= lpe) break; c = *lp; if(c >= Runeself) { lp += chartorune(&r, (char*)lp); c = r; } else ...
false
false
false
false
true
1
__ecereMethod___ecereNameSpace__ecere__gui__Key_OnGetDataFromString(struct __ecereNameSpace__ecere__com__Class * class, unsigned int * this, char * string) { if(((unsigned int (*)(struct __ecereNameSpace__ecere__com__Class *, void *, char * string))__ecereClass_class->_vTbl[__ecereVMethodID_class_OnGetDataFromString])...
false
false
false
false
false
0
array_grow(array_header *arr, int n) { if (n <= 0) return; if (arr->nelts + n > arr->nalloc) { char *new_elts; int new_nalloc = (arr->nalloc <= 0) ? n : arr->nelts + n; new_elts = ap_pcalloc(arr->pool, arr->elt_size * new_nalloc); memcpy(new_elts, arr->elts, arr->nelts ...
false
false
false
false
false
0
ReconstructIntra4(VP8EncIterator* const it, int16_t levels[16], const uint8_t* const src, uint8_t* const yuv_out, int mode) { const VP8Encoder* const enc = it->enc_; const uint8_t* const ref = it->yuv...
false
false
false
false
false
0
addRecord( F_Session * pFlmSession, HFDB hDb, const char * pszDbKey, FLMUINT uiDrn, FLMUINT uiContainer, FLMBOOL bReadOnly) { RCODE rc = FERR_OK; FlmRecord * pRec = NULL; FLMUINT uiAutoTrans; // We first need to reconsitute the record. if (RC_BAD( rc = constructRecord( uiDrn, uiContaine...
false
false
false
false
false
0
Tspi_Context_GetCapability(TSS_HCONTEXT tspContext, /* in */ TSS_FLAG capArea, /* in */ UINT32 ulSubCapLength, /* in */ BYTE * rgbSubCap, /* in */ UINT32 * pulRespDataLength, /* out */ BYTE ** prgbRespData) /* out */ { TSS_RESULT result; if (prgbRespData == NULL || pulRespDataLength =...
false
false
false
false
false
0
requeue_pi_wake_futex(struct futex_q *q, union futex_key *key, struct futex_hash_bucket *hb) { get_futex_key_refs(key); q->key = *key; __unqueue_futex(q); WARN_ON(!q->rt_waiter); q->rt_waiter = NULL; q->lock_ptr = &hb->lock; wake_up_state(q->task, TASK_NORMAL); }
false
false
false
false
false
0
processYUVMMX(imageStruct &image){ int i = image.xsize * image.ysize/4; const __m64 mask = _mm_set_pi8(m_mask[chRed], m_mask[chBlue], m_mask[chRed], m_mask[chGreen], m_mask[chRed], m_mask[chBlue], m_mask[chRed], m_mask[chGreen]); __m64 *input = (__m64*)image.data; while(i--)...
false
false
false
false
false
0
cfg_get_section(char *section, char *subsection) { struct cfg_section *current; char *p1, *p2; if ((current = cfg_database)) do { p1 = current->name; p2 = section; while (*p1 && *p1 == tolower((int)(unsigned char)*p2)) { p1++; p2++; } if (*p2) continue; if ((p2 = subsection)) while (*p1 && *p1 == t...
false
false
false
false
false
0
Csched_Get_priority_max(file,line,policy) char *file; int line; int policy; { #ifdef CTHREAD_DEBUG if (file != NULL) { if (Cthread_debug != 0) log(LOG_INFO,"[Cthread [%2d]] In _Cthread_Get_priority_max(%d) called at/behind %s:%d\n", _Cthread_self(),policy,file,line); } #endif ...
false
false
false
false
false
0
establish(void) { switch(inp_parse(serviceName())) { case MSIPService::CN_TYPE_ERR: /* Shouldn't get here */ MSMessageLog::warningMessage("MSIPService: Invalid service type: (%s)\n", serviceName().string()); break; case MSIPService::CN_TYPE_REMPROGS: if (lookupRemprogService()==0) ...
false
false
false
false
false
0
UpdateControlStates() { m_WorkBetweenBeginCtrl->Enable(); m_WorkBetweenEndCtrl->Enable(); m_ConnectBetweenBeginCtrl->Enable(); m_ConnectBetweenEndCtrl->Enable(); m_MaxDiskUsageCtrl->Enable(); m_MaxCPUUsageCtrl->Enable(); m_WorkWhileOnBatteryCtrl->Enable(); ...
false
false
false
false
false
0
PKCS12_MAKE_SHKEYBAG(int pbe_nid, const char *pass, int passlen, unsigned char *salt, int saltlen, int iter, PKCS8_PRIV_KEY_INFO *p8) { PKCS12_SAFEBAG *bag; const EVP_CIPHER *pbe_ciph; /* Set up the safe bag */ if (!(bag = PKCS12_SAFEBAG_new())) { PKCS12err(PKCS12_F_PKCS12_MAKE_SHKEYBAG, ERR_R_MALLOC...
false
false
false
false
false
0
ethoc_open(struct net_device *dev) { struct ethoc *priv = netdev_priv(dev); int ret; ret = request_irq(dev->irq, ethoc_interrupt, IRQF_SHARED, dev->name, dev); if (ret) return ret; napi_enable(&priv->napi); ethoc_init_ring(priv, dev->mem_start); ethoc_reset(priv); if (netif_queue_stopped(dev)) { dev_...
false
false
false
false
false
0
xattr_entry_alloc(const char *attrname) { struct xattr_entry *entry; static const char diag[] = "xattr_entry_alloc"; GFARM_CALLOC_ARRAY(entry, 1); if (entry == NULL) { gflog_debug(GFARM_MSG_1001777, "allocation of 'xattr_entry' failed"); return NULL; } if ((entry->name = strdup_log(attrname, diag)) == NUL...
false
false
false
false
false
0
connection_detach(struct connection *pconn, bool remove_unused_player) { struct player *pplayer; fc_assert_ret(pconn != NULL); if (NULL != (pplayer = pconn->playing)) { bool was_connected = pplayer->is_connected; send_remove_team_votes(pconn); conn_list_remove(pplayer->connections, pconn); pcon...
false
true
false
false
false
1
makecontrasts(node *p) { /* compute the contrasts, recursively */ if (p->tip) return; makecontrasts(p->next->back); makecontrasts(p->next->next->back); nuview(p); contbetween(p->next->back, p->next->next->back); }
false
false
false
false
false
0
PrintUnbLVar ( Stat stat ) { Pr( "Unbind( ", 0L, 0L ); Pr( "%I", (Int)NAME_LVAR( (UInt)(ADDR_STAT(stat)[0]) ), 0L ); Pr( " );", 0L, 0L ); }
false
false
false
false
false
0
f_indent_print(FILE *f, int indent, char *str) { char *P; int i, col; col=indent; for (P=str; *P; P++) { col++; if ((*P==10) || (*P==13)) { fprintf(f, "%c", *P); for (i=indent; i; i--) { fprintf(f, " "); } col=indent; continue; } ...
false
false
false
false
false
0
vrrp_state_backup(vrrp_t * vrrp, char *buf, int buflen) { vrrphdr_t *hd; uint32_t saddr; int ret = 0, proto; /* Process the incoming packet */ hd = vrrp_get_header(vrrp->family, buf, &proto, &saddr); ret = vrrp_check_packet(vrrp, buf, buflen); if (ret == VRRP_PACKET_KO || ret == VRRP_PACKET_NULL) { log_messa...
false
false
false
false
false
0
hdhomerun_device_get_tuner_plotsample(struct hdhomerun_device_t *hd, struct hdhomerun_plotsample_t **psamples, size_t *pcount) { if (!hd->cs) { hdhomerun_debug_printf(hd->dbg, "hdhomerun_device_get_tuner_plotsample: device not set\n"); return -1; } char name[32]; hdhomerun_sprintf(name, name + sizeof(name), "/...
true
true
false
false
false
1
SemText(Position* &pos) { Expect(39 /* "(." */); int beg = la->pos; int col = la->col; int line = t->line; while (StartOf(13)) { if (StartOf(14)) { Get(); } else if (la->kind == _badString) { Get(); SemErr(L"bad string in semantic action"); } else { Get(); SemErr(L"missin...
false
false
false
false
false
0
set_fan_target(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { int nr = to_sensor_dev_attr(attr)->index; struct i2c_client *client = to_i2c_client(dev); struct f75375_data *data = i2c_get_clientdata(client); unsigned long val; int err; err = kstrtoul(buf, 10, &val); if (err...
false
false
false
false
false
0
cd_profile_get_age (CdProfile *profile) { g_return_val_if_fail (CD_IS_PROFILE (profile), 0); g_return_val_if_fail (profile->priv->proxy != NULL, 0); if (profile->priv->created == 0) return 0; return (g_get_real_time () / G_USEC_PER_SEC) - profile->priv->created; }
false
false
false
false
false
0
blinkm_led_common_set(struct led_classdev *led_cdev, enum led_brightness value, int color) { /* led_brightness is 0, 127 or 255 - we just use it here as-is */ struct blinkm_led *led = cdev_to_blmled(led_cdev); struct blinkm_data *data = i2c_get_clientdata(led->i2c_client); struct blinkm_work *bl_work; switch...
false
false
false
false
false
0
zend_set_memory_limit(size_t memory_limit) { TSRMLS_FETCH(); AG(mm_heap)->limit = (memory_limit >= AG(mm_heap)->block_size) ? memory_limit : AG(mm_heap)->block_size; return SUCCESS; }
false
false
false
false
false
0
shinkos2145_query_serno(struct libusb_device_handle *dev, uint8_t endp_up, uint8_t endp_down, char *buf, int buf_len) { struct s2145_cmd_hdr cmd; struct s2145_getunique_resp *resp = (struct s2145_getunique_resp*) rdbuf; int ret, num = 0; struct shinkos2145_ctx ctx = { .dev = dev, .endp_up = endp_up, .endp_do...
false
true
false
false
false
1
parse_oid(const char *str, const heim_oid *def, heim_oid *oid) { int ret; if (str) ret = der_parse_heim_oid (str, " .", oid); else ret = der_copy_oid(def, oid); if (ret) errx(1, "parse_oid failed for: %s", str ? str : "default oid"); }
false
false
false
false
false
0
append_row_to_cfg(void *arg, int num_columns, char **values, char **columns) { struct ast_config *cfg = arg; struct ast_category *cat; int i; if (!(cat = ast_category_new("", "", 99999))) { return SQLITE_ABORT; } for (i = 0; i < num_columns; i++) { struct ast_variable *var; if (!(var = ast_variable_new(co...
false
false
false
false
false
0
term_patch_fill_state(patch_fill_state_t *pfs) { bool b = (pfs->color_stack_ptr != pfs->color_stack); # if LAZY_WEDGES wedge_vertex_list_elem_buffer_free(pfs); # endif if (pfs->color_stack) gs_free_object(pfs->memory, pfs->color_stack, "term_patch_fill_state"); if (pfs->pcic != NULL) ...
false
false
false
false
false
0
alDeleteAuxiliaryEffectSlots(ALsizei n, const ALuint *effectslots) { ALCcontext *Context; ALeffectslot *EffectSlot; ALsizei i; Context = GetContextRef(); if(!Context) return; if(n < 0) alSetError(Context, AL_INVALID_VALUE); else { // Check that all effectslots are valid...
false
false
false
false
false
0
name_selector_dispose (GObject *object) { ENameSelectorPrivate *priv; guint ii; priv = E_NAME_SELECTOR_GET_PRIVATE (object); if (priv->cancellable) { g_cancellable_cancel (priv->cancellable); g_object_unref (priv->cancellable); priv->cancellable = NULL; } for (ii = 0; ii < priv->source_books->len; ii++) ...
false
false
false
false
false
0
window_refnum_next(int refnum, int wrap) { GSList *tmp; int min, next; min = next = -1; for (tmp = windows; tmp != NULL; tmp = tmp->next) { WINDOW_REC *rec = tmp->data; if (rec->refnum > refnum && (next == -1 || rec->refnum < next)) next = rec->refnum; if (wrap && (min == -1 || rec->refnum < min)) min...
false
false
false
false
false
0
aryset_gen(struct parser_params *parser, NODE *recv, NODE *idx) { if (recv && nd_type(recv) == NODE_SELF) recv = (NODE *)1; return NEW_ATTRASGN(recv, tASET, idx); }
false
false
false
false
false
0
mtip_standby_immediate(struct mtip_port *port) { int rv; struct host_to_dev_fis fis; unsigned long start; unsigned int timeout; /* Build the FIS. */ memset(&fis, 0, sizeof(struct host_to_dev_fis)); fis.type = 0x27; fis.opts = 1 << 7; fis.command = ATA_CMD_STANDBYNOW1; mtip_set_timeout(port->dd, &fis, &timeo...
false
false
false
false
false
0
gdch(vm * vm) { std::string x, y; vm->stackdecrement(); std::getline(std::cin, y); x = " "; x[0] = y[0]; x[1] = y[1]; x[2] = y[2]; x[3] = y[3]; word a("ch", x); memory[realadr(vm, vm->ST)] = a.value; }
false
false
false
false
false
0
parseInt(const UString &s, int radix) { int length = s.size(); int p = 0; while (p < length && CommonUnicode::isStrWhiteSpace(s[p].uc)) { ++p; } double sign = 1; if (p < length) { if (s[p] == '+') { ++p; } else if (s[p] == '-') { sign = -1; ...
false
false
false
false
false
0
mark_reverse(arg) CONST char *arg; { int i; mark = 0; marksize = (off_t)0; for (i = 0; i < maxfile; i++) if (!isdir(&(filelist[i]))) if ((filelist[i].tmpflags ^= F_ISMRK) & F_ISMRK) { mark++; if (isfile(&(filelist[i]))) marksize += getblock(filelist[i].st_size); } markcount(); return(FNC_UPDATE); ...
false
false
false
false
false
0
warningYesNoList(QWidget *parent, const QString &text, const QStringList &strlist, const QString &caption, const KGuiItem &buttonYes, const KGuiItem &buttonNo, const QStr...
false
false
false
false
false
0
process_ai() { //----- when it is idle -------// if( !is_visible() || !is_ai_all_stop() ) return; if( info.game_date%15 == sprite_recno%15 ) { random_attack(); // randomly attacking targets /* switch(misc.random(2)) { case 0: random_attack(); // randomly attacking targets break; case 1: ...
false
false
false
false
false
0
port_is_input(uint32_t flags) { bool playback; playback = JACKDBUS_PORT_IS_INPUT(flags); ASSERT(playback || JACKDBUS_PORT_IS_OUTPUT(flags)); /* playback or capture */ ASSERT(!(playback && JACKDBUS_PORT_IS_OUTPUT(flags))); /* but not both */ return playback; }
false
false
false
false
false
0
handleIncreaseClicked(const EventArgs& e) { if (((const MouseEventArgs&)e).button == LeftButton) { // adjust scroll bar position as required. setScrollPosition(d_position + d_stepSize); return true; } return false; }
false
false
false
false
false
0
srealloc(void *ptr, int n, const char *name) { if (n == 0) return NULL; ptr = realloc(ptr,n); if (ptr == NULL) { char str[128]; sprintf(str,"Failed to reallocate %d bytes for array %s",n,name); error->one(str); } return ptr; }
false
false
false
false
false
0
clientWidth() const { return width() - borderLeft() - borderRight() - (layer() ? layer()->verticalScrollbarWidth() : 0); }
false
false
false
false
false
0
yajl_lex_comment(yajl_lexer lexer, const unsigned char * jsonText, unsigned int jsonTextLen, unsigned int * offset) { unsigned char c; yajl_tok tok = yajl_tok_comment; RETURN_IF_EOF; c = readChar(lexer, jsonText, offset); /* either slash or star expected */ if (c == '/') ...
false
false
false
false
false
0
dupe_match_rank_sort(GList *source_list) { GList *list = NULL; GList *work; work = source_list; while (work) { DupeItem *di = work->data; if (di->group) { dupe_match_rank_update(di); list = g_list_prepend(list, di); } work = work->next; } return g_list_sort(list, dupe_match_rank_sort_cb);...
false
false
false
false
false
0
__pyx_pf_13pybloomfilter_11BloomFilter_30intersection(struct __pyx_obj_13pybloomfilter_BloomFilter *__pyx_v_self, struct __pyx_obj_13pybloomfilter_BloomFilter *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NU...
false
false
false
false
false
0
tst_collect_build(void *value, tst_collect_t *results) { if(!results->tester || results->tester(value, results->key, results->len)) { lnode_t *node = lnode_create(value); list_append(results->values, node); } }
false
false
false
false
false
0
bson_append_binary( bson_buffer * b, const char * name, char type, const char * str, int len ){ if ( ! bson_append_estart( b , bson_bindata , name , 4+1+len ) ) return 0; bson_append32(b, &len); bson_append_byte(b, type); bson_append(b, str, len); return b; }
false
false
false
false
false
0
png_handle_tEXt(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) { png_text text_info; png_bytep buffer; png_charp key; png_charp text; png_uint_32 skip = 0; png_debug(1, "in png_handle_tEXt"); #ifdef PNG_USER_LIMITS_SUPPORTED if (png_ptr->user_chunk_cache_max != 0) { if (...
false
false
false
false
false
0
PlayerPicDrawFunc (void *_self, FNT_font_t font) { int x, y; char scratch[MAX_QPATH]; menuitem_s *self = (menuitem_s *)_self; x = Item_GetX (*self); y = Item_GetY (*self); Com_sprintf( scratch, sizeof( scratch ), "/players/%s_i.tga", Cvar_VariableString ("skin") ); Draw_StretchPic (x, y, font->...
true
true
false
false
false
1
__perf_event_overflow(struct perf_event *event, int throttle, struct perf_sample_data *data, struct pt_regs *regs) { int events = atomic_read(&event->event_limit); struct hw_perf_event *hwc = &event->hw; u64 seq; int ret = 0; /* * Non-sampling counters might still use the PMI to fold short * har...
false
false
false
false
false
0
eql_g_slave_cfg(struct net_device *dev, slave_config_t __user *scp) { equalizer_t *eql = netdev_priv(dev); slave_t *slave; struct net_device *slave_dev; slave_config_t sc; int ret; if (copy_from_user(&sc, scp, sizeof (slave_config_t))) return -EFAULT; slave_dev = __dev_get_by_name(&init_net, sc.slave_name); ...
false
false
false
false
false
0
garbage_collect() { bool action; static double last_time=0; if (!clock_change && now - last_time < GARBAGE_COLLECT_PERIOD) return false; last_time = gstate.now; action = abort_unstarted_late_jobs(); if (action) return true; action = garbage_collect_always(); if (action) return true; #i...
false
false
false
false
false
0
get_default_style_scheme (GSettings *editor_settings) { GtkSourceStyleSchemeManager *manager; gchar *scheme_id; GtkSourceStyleScheme *def_style; manager = gtk_source_style_scheme_manager_get_default (); scheme_id = g_settings_get_string (editor_settings, GEDIT_SETTINGS_SCHEME); def_style = gtk_source_style_schem...
false
false
false
false
false
0
test_composePointJacob(double x1,double y1,double z1, double yaw1,double pitch1,double roll1, double x,double y,double z) { const CPose3DQuat q1( CPose3D(x1,y1,z1,yaw1,pitch1,roll1) ); const CPoint3D p(x,y,z); CMatrixFixedNumeric<double,3,3> df_dpoint(UNINITIALIZED_MATRIX); CMatrixFixedN...
false
false
false
false
false
0
isEmptyOrComment(const char *s) { if (s[0] == '#') return true; for (int off = 0; ; ++off) { if (s[off] == 0) return true; if (!isWhite(s[off])) break; } return false; }
false
false
false
false
false
0
stem_soundex ( BYTE * pWord ) { static BYTE dLetter2Code [ 27 ] = "01230120022455012623010202"; // check if the word only contains lowercase English letters BYTE * p = pWord; while ( *p>='a' && *p<='z' ) p++; if ( *p ) return; // do soundex p = pWord+1; BYTE * pOut = pWord+1; while ( *p ) { BYTE c = d...
false
false
false
false
false
0
sinfo_update_ims_fits_card_string(cpl_imagelist* iml, const char* file, const char* card, const char* value) { cpl_propertylist * plist =NULL; if ((plist = cpl_propertylist_load(file, 0)) == NULL) { sinfo_m...
false
false
false
false
false
0
tr_ilg(int n) { return (n & 0xffff0000) ? ((n & 0xff000000) ? 24 + lg_table[(n >> 24) & 0xff] : 16 + lg_table[(n >> 16) & 0xff]) : ((n & 0x0000ff00) ? 8 + lg_table[(n >> 8) & 0xff] : 0 + lg_table[(n >> 0) & 0xff]); }
false
false
false
false
false
0
checkInput(double coeff, int expo, int ind1, int ind2, int index, int i){ if ((coeff == 0) || (expo < 0) || (expo > 2) || (ind1 < -1) || (ind1 >= i) || (ind2 < -1) || (ind2 >= i)){ cout << "Error in input file: equation n. " << index; perror("Please correct your input file "); exit(3); } }
false
false
false
false
false
0
get24(const unsigned char* pSrc) { const int x = pSrc[0] | pSrc[1] << 8 | pSrc[2] << 16; return x & 0x800000 ? x - 0x1000000 : x; }
false
false
false
false
false
0
RecordHistory() { // First we query and compute some values, then we store them in the history list // A few comments about the use of double and float in computations: // Even on a hi-res screen our graphs will have 10 bits of resolution at most, // so the 24 bits resolution of a float on 32 bit Intel processors i...
false
false
false
false
false
0