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
runturn(struct CFanimation_struct *animation, long int id, void *parameters) { object *op = animation->victim; int dir = id; /*int face;*/ if (animation->verbose) cf_log(llevDebug, "CFAnim: Turning in direction %ld\n", id); op->facing = dir; /** @todo fix suspicious or missing call */ /...
false
false
false
false
false
0
cmd_global_outline_change (WorkbookControl *wbc, gboolean is_cols, int depth) { CmdColRowHide *me; ColRowVisList *hide, *show; SheetView *sv = wb_control_cur_sheet_view (wbc); colrow_get_global_outline (sv_sheet (sv), is_cols, depth, &show, &hide); if (show == NULL && hide == NULL) return TRUE; me = g_objec...
false
false
false
false
false
0
phone_setup(struct ast_channel *ast) { struct phone_pvt *p; p = ast_channel_tech_pvt(ast); ioctl(p->fd, PHONE_CPT_STOP); /* Nothing to answering really, just start recording */ if (ast_channel_rawreadformat(ast)->id == AST_FORMAT_G729A) { /* Prefer g729 */ ioctl(p->fd, PHONE_REC_STOP); if (p->lastinput.id !=...
false
false
false
false
false
0
arizona_dvfs_down(struct snd_soc_codec *codec, unsigned int flags) { struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec); unsigned int old_reqs; int ret = 0; mutex_lock(&priv->dvfs_lock); old_reqs = priv->dvfs_reqs; priv->dvfs_reqs &= ~flags; if (!priv->dvfs_cached && old_reqs && !priv->dvfs_reqs) ...
false
false
false
false
false
0
setKbdLanguage(const char * pszLang) { if(!pszLang) { m_pKbdLang = NULL; } else { UT_Language Lang; m_pKbdLang = Lang.getLangRecordFromCode(pszLang); // ensure that the change is shown in our status bar bool bChangeLang = false; getPrefsValueBool(XAP_PREF_KEY_ChangeLanguageWithKeyboard, &bChangeLan...
false
false
false
false
false
0
show_happiness_popup(GtkWidget *w, GdkEventButton *ev, gpointer data) { struct happiness_dialog *pdialog = g_object_get_data(G_OBJECT(w), "pdialog"); if (ev->button == 1) { GtkWidge...
true
true
false
false
false
1
xmlRelaxNGIsNullable(xmlRelaxNGDefinePtr define) { int ret; if (define == NULL) return (-1); if (define->dflags & IS_NULLABLE) return (1); if (define->dflags & IS_NOT_NULLABLE) return (0); switch (define->type) { case XML_RELAXNG_EMPTY: case XML_RELAXNG_TEXT...
false
false
false
false
false
0
alltips(node *forknode, node *p) { /* returns true if all descendants of forknode except p are tips; false otherwise. */ node *q, *r; boolean tips; tips = true; r = forknode; q = forknode->next; do { if (q->back && q->back != p && !q->back->tip) tips = false; q = q->next; } while (...
false
false
false
false
false
0
HandlePeriodicLeech(bool apply, bool /*Real*/) { m_isPeriodic = apply; // For prevent double apply bonuses bool loading = (GetTarget()->GetTypeId() == TYPEID_PLAYER && ((Player*)GetTarget())->GetSession()->PlayerLoading()); // Custom damage calculation after if (apply) { if (loading) ...
false
false
false
false
false
0
cd_device_to_string (CdDevice *device) { struct tm *time_tm; time_t t; gchar time_buf[256]; GString *string; g_return_val_if_fail (CD_IS_DEVICE (device), NULL); /* get a human readable time */ t = (time_t) device->priv->created; time_tm = localtime (&t); strftime (time_buf, sizeof time_buf, "%c", time_tm); ...
false
false
false
false
false
0
gnc_employee_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GncEmployee *emp; g_return_if_fail(GNC_IS_EMPLOYEE(object)); emp = GNC_EMPLOYEE(object); ...
false
false
false
false
false
0
fprint (std::ostream& stream, const cl_ring& R, const cl_SV_ringelt& vector) { const cl_print_flags& flags = default_print_flags; std::size_t len = vector.size(); if (flags.vector_syntax == vsyntax_commonlisp) { fprintchar(stream,'#'); fprintchar(stream,'('); } else fprintchar(stream,'['); for (std::size_t i...
false
false
false
false
false
0
read(const unsigned char* buffer, size_t size) { if (size < sizeof(uint64_t)) { plDebug::Error("Invalid node data"); return; } fDirtyMask = 0; fDirtySize = 0; fFieldMask = readU64(buffer, size); fCachedSize = size; for (size_t bit=0; bit<kNumFields; bit++) { if ((fFi...
false
false
false
false
false
0
DebugXmlClassMembers(std::ofstream & strmOut, GdlGlyphClassDefn * /*pglfdParent*/, GrpLineAndFile lnf, int & cwGlyphIDs) { for (unsigned int iw = 0; iw < m_vwGlyphIDs.size(); iw++) { strmOut << " <member glyphid=\"" << m_vwGlyphIDs[iw] << "\" index=\"" << cwGlyphIDs; if (!lnf.NotSet()) strmOut << "\" i...
false
false
false
false
false
0
_xml_endNamespaceDeclHandler(void *userData, const XML_Char *prefix) { xml_parser *parser = (xml_parser *)userData; if (parser && parser->endNamespaceDeclHandler) { zval *retval, *args[2]; args[0] = _xml_resource_zval(parser->index); args[1] = _xml_xmlchar_zval(prefix, 0, parser->target_encoding); if ((retv...
false
false
false
false
false
0
wm8728_set_bias_level(struct snd_soc_codec *codec, enum snd_soc_bias_level level) { struct wm8728_priv *wm8728 = snd_soc_codec_get_drvdata(codec); u16 reg; switch (level) { case SND_SOC_BIAS_ON: case SND_SOC_BIAS_PREPARE: case SND_SOC_BIAS_STANDBY: if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_O...
false
false
false
false
false
0
lekhonee_main_update_bar (LekhoneeMain* self) { gboolean result = FALSE; g_return_val_if_fail (self != NULL, FALSE); gtk_progress_bar_pulse (self->progressbar); result = TRUE; return result; }
false
false
false
false
false
0
nv50_crtc_cursor_move(struct drm_crtc *crtc, int x, int y) { struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); struct nv50_curs *curs = nv50_curs(crtc); struct nv50_chan *chan = nv50_chan(curs); nvif_wr32(&chan->user, 0x0084, (y << 16) | (x & 0xffff)); nvif_wr32(&chan->user, 0x0080, 0x00000000); nv_crtc->cursor...
false
false
false
false
false
0
relation_has_policies(Relation rel) { Relation catalog; ScanKeyData skey; SysScanDesc sscan; HeapTuple policy_tuple; bool ret = false; catalog = heap_open(PolicyRelationId, AccessShareLock); ScanKeyInit(&skey, Anum_pg_policy_polrelid, BTEqualStrategyNumber, F_OIDEQ, ObjectIdGetDatum(RelationGetReli...
false
false
false
false
false
0
mono_metadata_inflate_generic_inst (MonoGenericInst *ginst, MonoGenericContext *context, MonoError *error) { MonoType **type_argv; MonoGenericInst *nginst = NULL; int i, count = 0; mono_error_init (error); if (!ginst->is_open) return ginst; type_argv = g_new0 (MonoType*, ginst->type_argc); for (i = 0; i < ...
false
false
false
false
false
0
_unpack_task_exit_msg(task_exit_msg_t ** msg_ptr, Buf buffer, uint16_t protocol_version) { task_exit_msg_t *msg; uint32_t uint32_tmp; xassert(msg_ptr != NULL); msg = xmalloc(sizeof(task_exit_msg_t)); *msg_ptr = msg; safe_unpack32(&msg->return_code, buffer); safe_unpack32(&msg->num_tasks, buffer); safe...
false
false
false
false
false
0
consistencyCheck(struct partition *partTable, int doprint, int verbose, int *has_activated, unsigned int *last_end, unsigned int *j, struct device *used_dev, int target_partition) { unsigned int i; unsigned int inconsistency; *j = 0; *last_end = 1; /* quick consistency check */ inconsiste...
false
false
false
false
false
0
add_to_ae(ir_rvalue **rvalue) { if (debug) { printf("CSE: Add to AE: "); (*rvalue)->print(); printf("\n"); } ae->push_tail(new(mem_ctx) ae_entry(base_ir, rvalue)); if (debug) dump_ae(ae); }
false
false
false
false
false
0
mac_addr_n2a(char *mac_addr, unsigned char *arg) { int i, l; l = 0; for (i = 0; i < ETH_ALEN ; i++) { if (i == 0) { sprintf(mac_addr+l, "%02x", arg[i]); l += 2; } else { sprintf(mac_addr+l, ":%02x", arg[i]); l += 3; } } }
false
false
false
false
false
0
fso_gsm_htc_at_parser_echo_a (FsoGsmHtcAtParser* self, gchar c) { FsoGsmHtcAtParserState result = 0; gchar _tmp0_ = '\0'; g_return_val_if_fail (self != NULL, 0); _tmp0_ = c; switch (_tmp0_) { case 'T': case 't': { result = FSO_GSM_HTC_AT_PARSER_STATE_ECHO_INLINE; return result; } default: break; ...
false
false
false
false
false
0
opj_event_msg(opj_common_ptr cinfo, int event_type, const char *fmt, ...) { #define MSG_SIZE 512 /* 512 bytes should be more than enough for a short message */ opj_msg_callback msg_handler = NULL; opj_event_mgr_t *event_mgr = cinfo->event_mgr; if(event_mgr != NULL) { switch(event_type) { case EVT_ERROR: ms...
true
true
false
false
true
1
__asinl (long double x) { if (__builtin_expect (isgreater (fabsl (x), 1.0L), 0) && _LIB_VERSION != _IEEE_) { /* asin(|x|>1) */ feraiseexcept (FE_INVALID); return __kernel_standard_l (x, x, 202); } return __ieee754_asinl (x); }
false
false
false
false
false
0
pdc2027x_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) { static const unsigned long cmd_offset[] = { 0x17c0, 0x15c0 }; static const unsigned long bmdma_offset[] = { 0x1000, 0x1008 }; unsigned int board_idx = (unsigned int) ent->driver_data; const struct ata_port_info *ppi[] = { &pdc2027x...
false
false
false
false
false
0
os_mkdir_between(const nstring &top, const nstring &extn, int mode) { trace(("os_mkdir_between(top = %08lX, extn = %08lX, mode = 0%o)\n{\n", (long)&top, (long)&extn, mode)); trace_string(top.c_str()); trace_string(extn.c_str()); assert(top[0] == '/'); assert(extn[0] != '/'); assert(extn[extn.si...
false
false
false
false
true
1
update_create_info_from_table(HA_CREATE_INFO *create_info, TABLE *table) { TABLE_SHARE *share= table->s; DBUG_ENTER("update_create_info_from_table"); create_info->max_rows= share->max_rows; create_info->min_rows= share->min_rows; create_info->table_options= share->db_create_options; create_info->avg_row_le...
false
false
false
false
false
0
AlphaClear() { if (pAlpha) memset(pAlpha,0,head.biWidth * head.biHeight); }
false
false
false
false
false
0
registerAnonymousObject(const ObjectSignature &sig, FWObject* obj) { ObjectSignature anon_sig = sig; anon_sig.object_name = ""; anon_object_registry[anon_sig.toString()] = (obj!=NULL) ? obj->getId() : -1; }
false
false
false
false
false
0
C_i_fifo_p(C_word name) { struct stat buf; int res; res = stat(C_c_string(name), &buf); if(res != 0) { #ifdef __CYGWIN__ return C_SCHEME_FALSE; #else if(errno == ENOENT) return C_fix(0); else return C_fix(res); #endif } if((buf.st_mode & S_IFMT) == S_IFIFO) return C_SCHEME_TRUE; else retur...
false
false
false
false
false
0
StringifyImpl(size_t const indentDepth) const { std::wstring ret_string; size_t const indentDepth1 = indentDepth ? indentDepth + 1 : 0; std::wstring const indentStr = Indent(indentDepth); std::wstring const indentStr1 = Indent(indentDepth1); switch (type) { case JSONType_Null: ret_string = L"null"; break...
false
false
false
false
false
0
draw_hat(GooCanvasItem *item, int type) { GdkPixbuf *image; if (type == STARS) image = gc_pixmap_load("magic_hat/hat.svg"); else image = gc_pixmap_load("magic_hat/hat-point.svg"); g_object_set(item, "pixbuf", image, NULL); #if GDK_PIXBUF_MAJOR <= 2 && GDK_PIXBUF_MINOR <= 24 g...
false
false
false
false
false
0
operator!=(const char *s) const { if (s==NULL) return !is_empty(); return (strcmp(chars(), s) != 0); }
false
false
false
false
false
0
sys_setpgid(tcp) struct tcb *tcp; { if (entering(tcp)) { tprintf("%lu, %lu", tcp->u_arg[0], tcp->u_arg[1]); } return 0; }
false
false
false
false
false
0
reply_ptradd(const int sock, const struct spdet *priv) { struct spptr inptr, rptr; pullin(sock, (char *) &inptr, sizeof(inptr)); swapinp(&rptr, &inptr); if (!(priv->spu_flgs & PV_ADDDEL)) { if (tracing & TRACE_APIOPEND) trace_op_res(Realuid, "ptradd", "noperm"); return XT_NOPERM; } if (rptr.spp_dev[0...
false
false
false
false
false
0
saa7134_hwinit1(struct saa7134_dev *dev) { core_dbg("hwinit1\n"); saa_writel(SAA7134_IRQ1, 0); saa_writel(SAA7134_IRQ2, 0); /* Clear any stale IRQ reports */ saa_writel(SAA7134_IRQ_REPORT, saa_readl(SAA7134_IRQ_REPORT)); mutex_init(&dev->lock); spin_lock_init(&dev->slock); saa7134_track_gpio(dev,"pre-init")...
false
false
false
false
false
0
LodePNG_InfoRaw_copy(LodePNG_InfoRaw* dest, const LodePNG_InfoRaw* source) { unsigned error = 0; LodePNG_InfoRaw_cleanup(dest); *dest = *source; LodePNG_InfoColor_init(&dest->color); error = LodePNG_InfoColor_copy(&dest->color, &source->color); if(error) return error; return error; }
false
false
false
false
false
0
isexten_function_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) { char *parse; AST_DECLARE_APP_ARGS(args, AST_APP_ARG(context); AST_APP_ARG(exten); AST_APP_ARG(priority); ); strcpy(buf, "0"); if (ast_strlen_zero(data)) { ast_log(LOG_ERROR, "DIALPLAN_EXISTS() requires ...
false
false
false
false
false
0
check_reqs(stringlist_t *sl) { stringlist_t *s; char *err = NULL, *p, sep = ':'; size_t alloc = 0; while (sl != NULL) { s = sl; sl = sl->next; if (!script_require(parse_script, s->s)) { if (!err) { alloc = 100; p = err = xmalloc(alloc); p += sprintf(p, "Unsupported feature(s) in \"re...
false
false
false
false
false
0
PrintInfo(std::ostream& os) const { if(this->Valid()) { this->Internal->PrintInfo(os); } else { os << "Not a valid ELF file.\n"; } }
false
false
false
false
false
0
wmi_event(wmi_handle_t handle, WMI_EVENT_ID evt_id, void *buffer, a_int32_t Length) { adf_nbuf_t netbuf = ADF_NBUF_NULL; a_uint8_t *pData; netbuf = WMI_AllocEvent(handle, WMI_EVT_CLASS_CMD_EVENT, sizeof(WMI_CMD_HDR) + Length); if (netbuf == ADF_NBUF_NULL) { adf_os_print("Buf null\n"); return; } ...
false
false
false
false
false
0
AcquireDeletionLock(const ObjectAddress *object, int flags) { if (object->classId == RelationRelationId) { /* * In DROP INDEX CONCURRENTLY, take only ShareUpdateExclusiveLock on * the index for the moment. index_drop() will promote the lock once * it's safe to do so. In all other cases we need full exclu...
false
false
false
false
false
0
wm_set_vol(struct snd_ice1712 *ice, unsigned int index, unsigned short vol, unsigned short master) { unsigned char nvol; if ((master & WM_VOL_MUTE) || (vol & WM_VOL_MUTE)) nvol = 0; else nvol = 127 - wm_vol[(((vol & ~WM_VOL_MUTE) * (master & ~WM_VOL_MUTE)) / 127) & WM_VOL_MAX]; wm_put(ice, index, nvol);...
false
false
false
false
false
0
deviceNonlinearCalculate(devicePrivate_ *p) { p->Vn = rowGetSolution(p->rowK) - rowGetSolution(p->rowJ); ReturnErrIf(isnan(p->Vn)); ReturnErrIf(calcSolve(p->calc, &p->Vc)); return 0; }
false
false
false
false
false
0
strmap_iter_next(strmap_t *map, strmap_iter_t *iter) { tor_assert(map); tor_assert(iter); return HT_NEXT(strmap_impl, &map->head, iter); }
false
false
false
false
false
0
SwitchToFrame(size_t number) { ResetCursor(); QueueCommand(new CdbCmd_SwitchFrame(this, number)); }
false
false
false
false
false
0
ComputeCallGlobal(int argc, Code::Kind kind, Code::ExtraICState extra_ic_state, String* name, JSObject* receiver, ...
false
false
false
false
false
0
vb2_fop_poll(struct file *file, poll_table *wait) { struct video_device *vdev = video_devdata(file); struct vb2_queue *q = vdev->queue; struct mutex *lock = q->lock ? q->lock : vdev->lock; unsigned res; void *fileio; /* * If this helper doesn't know how to lock, then you shouldn't be using * it but you shoul...
false
false
false
false
false
0
atcommand_doom(const int fd, struct map_session_data* sd, AtCommandType command, const char* message) { struct map_session_data *pl_sd; int i; nullpo_retr(-1, sd); for (i = 0; i < fd_max; i++) { if (session[i] && (pl_sd = (struct map_session_data *)session[i]->session_data) && pl_sd->state.auth && pc_isGM...
false
false
false
false
false
0
partial_buf_size(long long nbytes) { int ibytes = (int)nbytes; /* never more than 10 MB, anyway */ if( ibytes <= GXML_MIN_BSIZE ) return GXML_MIN_BSIZE; if( ibytes <= 64*1024 ) return ibytes; if( ibytes <= 10*1024*1024 ) /* divide by 10, but round up to a block */ return (ibytes/10 ...
false
false
false
false
false
0
createMipsAsmBackendEL32(const Target &T, const MCRegisterInfo &MRI, const Triple &TT, StringRef CPU) { return new MipsAsmBackend(T, TT.getOS(), /*IsLittle*/ true, /*Is64Bit*/ false); }
false
false
false
false
false
0
pnfs_generic_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, struct nfs_page *req) { unsigned int size; u64 seg_end, req_start, seg_left; size = nfs_generic_pg_test(pgio, prev, req); if (!size) return 0; /* * 'size' contains the number of bytes left in the current page (up * to th...
false
false
false
false
false
0
syntax_clear(buf) buf_T *buf; { int i; buf->b_syn_error = FALSE; /* clear previous error */ buf->b_syn_ic = FALSE; /* Use case, by default */ buf->b_syn_spell = SYNSPL_DEFAULT; /* default spell checking */ buf->b_syn_containedin = FALSE; /* free the keywords */ clear_keywtab(&b...
false
false
false
false
false
0
get_loop_count_profile(Block *block_head) { int loop_count = 0; Block *bpt; if (block_head->inner == NULL || !block_head->is_profiled_count) return 0; for (bpt = block_head->inner; bpt != NULL; bpt = bpt->next) { if (bpt->is_profiled_count && block_head->count != 0 ...
false
false
false
false
false
0
set_task_end_flag(Task *task) { int i; for (i = 1; i <= task->TaskNum; i++) { if (in_IntSet(task->TaskF, i) && !in_IntSet(task->TaskEndF, i) && task->TaskEndTime[i] <= task->clock) { add1_IntSet(task->TaskEndF, i); } } }
false
false
false
false
false
0
unpack_non_delta_entry(enum object_type type, unsigned long size, unsigned nr) { void *buf = get_data(size); if (!dry_run && buf) write_object(nr, type, buf, size); free(buf); }
false
false
false
false
false
0
GTextInfoGetWidth(GWindow base,GTextInfo *ti,FontInstance *font) { int width=0; int iwidth=0; int skip = 0; if ( ti->text!=NULL ) { if ( ti->font!=NULL ) font = ti->font; if ( font!=NULL ) GDrawSetFont(base,font); width = GDrawGetBiTextWidth(base,ti->text, -1, -1, NULL); } if ( ti...
false
false
false
false
false
0
pack_reverse_comm(int n, int first, double *buf) { int i,m,last; m = 0; last = first + n; for (i = first; i < last; i++) { buf[m++] = rho[i]; buf[m++] = mu[i][0]; buf[m++] = mu[i][1]; buf[m++] = mu[i][2]; buf[m++] = lambda[i][0]; buf[m++] = lambda[i][1]; buf[m++] = lambda[i][2]; buf[m++] = lamb...
false
false
false
false
false
0
gst_value_subtract_double_range_double (GValue * dest, const GValue * minuend, const GValue * subtrahend) { /* since we don't have open ranges, we cannot create a hole in * a double range. We return the original range */ if (dest) gst_value_init_and_copy (dest, minuend); return TRUE; }
false
false
false
false
false
0
DefineView(ViewStmt *stmt, const char *queryString) { Query *viewParse; Oid viewOid; RangeVar *view; /* * Run parse analysis to convert the raw parse tree to a Query. Note this * also acquires sufficient locks on the source table(s). * * Since parse analysis scribbles on its input, copy the raw par...
false
false
false
false
false
0
copyJPEGStream(char*& pixelData, Uint32& pixLength) { DCMDATA_LIBI2D_DEBUG("I2DJpegSource: Copying JPEG data from JPEG file"); /* Calculate length of total stream as found in the file * Therefore, look at byte positions from SOI and EOI marker */ offile_off_t bytePosJ...
false
false
false
false
false
0
__connman_service_counter_unregister(const char *counter) { struct connman_service *service; GSequenceIter *iter; DBG("counter %s", counter); iter = g_sequence_get_begin_iter(service_list); while (g_sequence_iter_is_end(iter) == FALSE) { service = g_sequence_get(iter); g_hash_table_remove(service->counter_...
false
false
false
false
false
0
fswc_add_image_jpeg(src_t *src, avgbmp_t *abitmap) { uint32_t x, y, hlength; uint8_t *himg = NULL; gdImage *im; int i; /* MJPEG data may lack the DHT segment required for decoding... */ i = verify_jpeg_dht(src->img, src->length, &himg, &hlength); im = gdImageCreateFromJpegPtr(hlength, himg); if(i == 1) free...
false
false
false
false
false
0
write_pipe_chunks(char *data, int len, int dest) { PipeProtoChunk p; int fd = fileno(stderr); int rc; Assert(len > 0); p.proto.nuls[0] = p.proto.nuls[1] = '\0'; p.proto.pid = MyProcPid; /* write all but the last chunk */ while (len > PIPE_MAX_PAYLOAD) { p.proto.is_last = (dest == LOG_DESTINATION_CSVLO...
false
true
false
false
false
1
setLabel(const QString & label, Qt::Alignment a) { if (label.isEmpty()) { delete d->label; d->label = 0; d->labelAlignment = 0; } else { if (!d->label) { d->label = new QLabel(this); } d->label->setText(label); d->label->setObjectName("KNumInpu...
false
false
false
false
false
0
arrow_bb(pointf p, pointf u, double arrowsize, int flag) { double s; boxf bb; double ax,ay,bx,by,cx,cy,dx,dy; double ux2, uy2; /* generate arrowhead vector */ u.x -= p.x; u.y -= p.y; /* the EPSILONs are to keep this stable as length of u approaches 0.0 */ s = ARROW_LENGTH * arrowsiz...
false
false
false
false
false
0
local_lseek(vfile *vf, avoff_t offset, int whence) { avoff_t res; struct localfile *fi = local_vfile_file(vf); res = lseek(fi->fd, offset, whence); if(res == -1) return -errno; vf->ptr = res; return res; }
false
false
false
false
false
0
DAsize_array(dynarr_p arr /* IN: Array to get size of */ ) { CONSTR(FUNC, "DAsize_array"); /* for HERROR */ dynarr_t *arr_ptr; /* ptr to the dynarray destroy*/ intn ret_value=SUCCEED; HEclear(); arr_ptr=(dynarr_t *)arr; if(arr_ptr==NULL) HGOTO_ERROR(DFE_ARGS, FAIL); ...
false
false
false
false
false
0
FDKaacEnc_QuantizeSpectrum(INT sfbCnt, INT maxSfbPerGroup, INT sfbPerGroup, INT *sfbOffset, FIXP_DBL *mdctSpectrum, INT globalGain, INT *scalefactors, SHORT *quantize...
false
false
false
false
false
0
buf_append(char *p, const char *q, char *end) { int m; for (m = 0; p < end; p++, q++, m++) { *p = *q; if (*q == '\0') { break; } } return m; }
false
false
false
false
false
0
gethinfo(int fd) { int socksz; struct hostent *hent; char *iaddr; static char host[MAXHOSTNAMELEN]; /* find out hostname of client */ strcpy(host, "unknown-host"); socksz = sizeof (struct sockaddr_in); if (getpeername(fd, (struct sockaddr *) &imspd_remoteaddr, &socksz) < 0) { return (N...
false
false
false
false
false
0
system_databases_handlerton(THD *unused, plugin_ref plugin, void *arg) { I_List<i_string> *found_databases= (I_List<i_string> *) arg; const char *db; handlerton *hton= plugin_data(plugin, handlerton *); if (hton->system_database) { db= hton->system_database(); ...
false
false
false
false
false
0
reset_layout_attrs (EText *text) { PangoAttrList *attrs = NULL; gint object_count; if (text->layout == NULL) return; object_count = e_text_model_object_count (text->model); if (text->bold || text->strikeout || object_count > 0) { gint length = 0; gint i; attrs = pango_attr_list_new (); for (i = 0; i...
false
false
false
false
false
0
gst_asm_rule_evaluate (GstASMRule * rule, GHashTable * vars) { gboolean res; if (rule->root) { res = (gboolean) gst_asm_node_evaluate (rule->root, vars); } else res = TRUE; return res; }
false
false
false
false
false
0
lookup_iterate_if_possible(nlookup_t *nl) { lookup_check(nl); /* * Loose parallelism: iterate as soon as one of the "alpha" RPCs from * the previous hop has returned. * * Strict parallelism: iterate when all RPCs have come back. * * Bounded parallelism: make sure we have only "alpha" RPCs pending. * ...
false
false
false
false
false
0
StartOptimization( bool doOnlyInitialization ) { itkDebugMacro("StartOptimization"); SizeValueType maxOpt=this->m_OptimizersList.size(); if ( maxOpt == NumericTraits<SizeValueType>::Zero ) { itkExceptionMacro(" No optimizers are set."); } if ( ! this->m_Metric ) { this->m_Metric = this->m_Op...
false
false
false
false
false
0
display_clocks(unsigned int index) { u8 active_count, recovery_count; active_count = active_counts[index]; if (active_count == 1) ++active_count; recovery_count = recovery_counts[index]; if (active_count > 3 && recovery_count == 1) ++recovery_count; if (cmd640_chip_version > 1) recovery_count += 1; /* cmd...
false
false
false
false
false
0
_ml_NetDB_gethostname (ml_state_t *msp, ml_val_t arg) { char hostname[MAXHOSTNAMELEN]; if (gethostname (hostname, MAXHOSTNAMELEN) == -1) return RAISE_SYSERR(msp, sts); else return ML_CString(msp, hostname); }
true
true
false
false
false
1
shpchp_disable_slot (struct slot *p_slot) { u8 getstatus = 0; int rc, retval = -ENODEV; struct controller *ctrl = p_slot->ctrl; if (!p_slot->ctrl) return -ENODEV; /* Check to see if (latch closed, card present, power on) */ mutex_lock(&p_slot->ctrl->crit_sect); rc = p_slot->hpc_ops->get_adapter_status(p_slo...
false
false
false
false
false
0
qmonManopAdd(Widget w, XtPointer cld, XtPointer cad) { int type = dialog_mode; lList *lp = NULL; lList *alp = NULL; lEnumeration *what = NULL; String user = NULL; Widget username; int nm; lDescr *dp; DENTER(GUI_LAYER, "qmonManopAdd"); switch (type) { case SGE_UM_LIST: dp =...
false
false
false
false
false
0
demangle_integral_value (struct work_stuff *work, const char **mangled, string *s) { int success; if (**mangled == 'E') success = demangle_expression (work, mangled, s, tk_integral); else if (**mangled == 'Q' || **mangled == 'K') success = demangle_qualified (work, mangled, s, 0,...
true
true
false
false
false
1
sprow_ip(row1, row2, lim) SPROW *row1, *row2; int lim; { int idx1, idx2, len1, len2, tmp; int sprow_idx(); register row_elt *elts1, *elts2; register Real sum; elts1 = row1->elt; elts2 = row2->elt; len1 = row1->len; len2 = row2->len; sum = 0.0; if ( len1 <= 0 || len2 <= 0 ) return 0.0; if ( elts1->col...
false
false
false
false
false
0
pca953x_gpio_direction_output(struct gpio_chip *gc, unsigned off, int val) { struct pca953x_chip *chip = to_pca(gc); u8 reg_val; int ret, offset = 0; mutex_lock(&chip->i2c_lock); /* set output level */ if (val) reg_val = chip->reg_output[off / BANK_SZ] | (1u << (off % BANK_SZ)); else reg_val = chip->re...
false
false
false
false
false
0
quote_identifier(const char *s) { char *result = pg_malloc(strlen(s) * 2 + 3); char *r = result; *r++ = '"'; while (*s) { if (*s == '"') *r++ = *s; *r++ = *s; s++; } *r++ = '"'; *r++ = '\0'; return result; }
false
false
false
false
false
0
parse_X(char *s, char *dat) { char *c; s+=2; while(isblank(*s)) s++; while(1) { if (*(c=strip(str2list(&s)))) { char *n = c; int p,z; while (*n && *n != '=') /* get number-re */ n++; if(!*n) { warning (dat, "Ignoring invalid exception"); break; ...
false
false
false
false
false
0
record_one_stack_ref (rtx insn, rtx *ref, struct csa_reflist *next_reflist) { struct csa_reflist *ml; ml = XNEW (struct csa_reflist); if (REG_P (*ref) || XEXP (*ref, 0) == stack_pointer_rtx) ml->sp_offset = 0; else ml->sp_offset = INTVAL (XEXP (XEXP (*ref, 0), 1)); ml->insn = insn; ml->ref = ref;...
false
false
false
false
false
0
notify_keystroke_listener (DeviceListenerEntry *e) { gchar *path = _atspi_device_listener_get_path (e->listener); dbus_uint32_t d_modmask = e->modmask; dbus_uint32_t d_event_types = e->event_types; AtspiEventListenerMode listener_mode; gboolean retval = FALSE; DBusError d_error;...
false
false
false
false
false
0
timestamptz_date(PG_FUNCTION_ARGS) { TimestampTz timestamp = PG_GETARG_TIMESTAMP(0); DateADT result; struct pg_tm tt, *tm = &tt; fsec_t fsec; int tz; char *tzn; if (TIMESTAMP_IS_NOBEGIN(timestamp)) DATE_NOBEGIN(result); else if (TIMESTAMP_IS_NOEND(timestamp)) DATE_NOEND(result); else { if ...
false
false
false
false
false
0
init_progressive() { int i; if (m_comps_in_frame == 4) stop_decoding(JPGD_UNSUPPORTED_COLORSPACE); // Allocate the coefficient buffers. for (i = 0; i < m_comps_in_frame; i++) { m_dc_coeffs[i] = coeff_buf_open(m_max_mcus_per_row * m_comp_h_samp[i], m_max_mcus_per_col * m_comp_v_samp[i],...
false
false
false
false
false
0
cond_check_access(char *file, int type, Bool im) { char *full_file; char *path = NULL; if (!file || *file == 0) { return False; } if (file[0] == '/') { if (access(file, type) == 0) { return True; } else { return False; } } if (type != X_OK && im == False) { return False; } if (im == F...
false
true
false
false
true
1
tunnel_tun(int tun_fd, int dns_fd) { unsigned long outlen; struct ip *header; char out[64*1024]; char in[64*1024]; int userid; int read; if ((read = read_tun(tun_fd, in, sizeof(in))) <= 0) return 0; /* find target ip in packet, in is padded with 4 bytes TUN header */ header = (struct ip*) (in + 4); useri...
true
true
false
false
true
1
sas_domain_attach_transport(struct sas_domain_function_template *dft) { struct scsi_transport_template *stt = sas_attach_transport(&sft); struct sas_internal *i; if (!stt) return stt; i = to_sas_internal(stt); i->dft = dft; stt->create_work_queue = 1; stt->eh_timed_out = sas_scsi_timed_out; stt->eh_strategy...
false
false
false
false
false
0
isIllustratorFile(const QByteArray & fileContent) { return fileContent.contains(AdobeIllustratorIdentifier.toUtf8()); }
false
false
false
false
false
0
mono_vcall_trampoline (mgreg_t *regs, guint8 *code, int slot, guint8 *tramp) { MonoObject *this_arg; MonoVTable *vt; gpointer *vtable_slot; MonoMethod *m; gpointer addr; trampoline_calls ++; /* * We need to obtain the following pieces of information: * - the method which needs to be compiled. * - the vta...
false
false
false
false
false
0
entityXML (char *s) { static char *malbuf; int nmalbuf = 0; char *sret; char *ep; /* scan for each entity, if any */ for (sret = s; (ep = strpbrk (s, entities)) != NULL; s = ep+1) { /* found another entity, copy preceding to malloced buffer */ int nnew = ep - s; /* all but entity itself *...
false
false
false
false
true
1
gdata_calendar_event_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { GDataCalendarEventPrivate *priv = GDATA_CALENDAR_EVENT (object)->priv; switch (property_id) { case PROP_EDITED: g_value_set_int64 (value, priv->edited); break; case PROP_STATUS: g_value_set_string ...
false
false
false
false
false
0
EmptyDrive( void *theEnv, struct joinNode *join, struct partialMatch *rhsBinds) { struct partialMatch *linker; struct joinNode *listOfJoins; int joinExpr; /*======================================================*/ /* Determine if the alpha memory partial match satifies */ /* the join expressi...
false
false
false
false
false
0