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
lm95245_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct device *dev = &client->dev; struct lm95245_data *data; struct device *hwmon_dev; data = devm_kzalloc(dev, sizeof(struct lm95245_data), GFP_KERNEL); if (!data) return -ENOMEM; data->client = client; mutex_init(&data->update_...
false
false
false
false
false
0
mspro_block_data_clear(struct mspro_block_data *msb) { int cnt; struct mspro_sys_attr *s_attr; if (msb->attr_group.attrs) { for (cnt = 0; msb->attr_group.attrs[cnt]; ++cnt) { s_attr = mspro_from_sysfs_attr(msb->attr_group .attrs[cnt]); kfree(s_attr->data); kfree(s_attr); } kfree(msb->attr_g...
false
false
false
false
false
0
EscapeQuotes(char *s, char *out, int outSz) { char *spt,*spf; int i = 0; memset(out,0,outSz); for (spf = s, spt = out; (i < outSz - 2) && (*spf != '\0'); spf++,spt++,i++) { switch (*spf) { case '\'': case '\"': *spt++ = '\\'; *spt = *spf; i+=3; break; ...
false
false
false
false
false
0
nonlocal_set_p_1 (rtx *loc, void *data ATTRIBUTE_UNUSED) { rtx x = *loc; if (! x) return 0; switch (GET_CODE (x)) { case CALL: /* Non-constant calls and recursion are not local. */ return 1; case PRE_INC: case PRE_DEC: case POST_INC: case POST_DEC: case PRE_MODIFY: ...
false
false
false
false
false
0
scan_reads_nospill (insn_info_t insn_info, bitmap gen, bitmap kill) { read_info_t read_info = insn_info->read_rec; int i; group_info_t group; /* If this insn reads the frame, kill all the frame related stores. */ if (insn_info->frame_read) { FOR_EACH_VEC_ELT (group_info_t, rtx_group_vec, i, group)...
false
false
false
false
false
0
ptrace_has_cap(struct user_namespace *ns, unsigned int mode) { if (mode & PTRACE_MODE_NOAUDIT) return has_ns_capability_noaudit(current, ns, CAP_SYS_PTRACE); else return has_ns_capability(current, ns, CAP_SYS_PTRACE); }
false
false
false
false
false
0
__nfs3_get_volume_id (struct nfs3_state *nfs3, xlator_t *xl, uuid_t volumeid) { int ret = -1; struct nfs3_export *exp = NULL; GF_VALIDATE_OR_GOTO (GF_NFS3, nfs3, out); GF_VALIDATE_OR_GOTO (GF_NFS3, xl, out); list_for_each_entry (ex...
false
false
false
false
false
0
RleFlush( byte *first, byte *reps, byte *now, byte *out ) { int count; int l; if ( ! first ) return( 0 ); if ( ! reps ) reps = now; count = 0; /* Write the nonrepetitve pattern first */ while ( ( l = reps - first ) ) { if ( l > 128 ) { ...
false
false
false
false
false
0
H5VM_array_fill(void *_dst, const void *src, size_t size, size_t count) { size_t copy_size; /* size of the buffer to copy */ size_t copy_items; /* number of items currently copying*/ size_t items_left; /* number of items left to copy */ uint8_t *dst=(uint8_t*...
false
false
false
false
false
0
edge_energy_q_metric(e_id) edge_id e_id; { REAL *pt[EDGE_CTRL]; REAL tang[MAXCOORD]; vertex_id v[EDGE_CTRL]; int i,j,k; REAL gpt[MAXCOORD]; REAL len; REAL euclidean; v[0] = get_edge_tailv(e_id); v[1] = get_edge_midv(e_id); v[2] = get_edge_headv(e_id); for ( i = 0 ; i < EDGE_CTRL ; i++ ) pt[i]...
false
false
false
false
false
0
NNevalAction(NNState * pnState) { if (!pnState) return NNEVAL_NONE; switch (pnState->state) { case NNSTATE_NONE: { /* incremental evaluation not useful */ return NNEVAL_NONE; } case NNSTATE_INCREMENTAL: { /* next call should return FRO...
false
false
false
false
false
0
read_header_version(user_interaction & dialog, bool lax, generic_file & where, header_version & ver) { try { ver.read(where); } catch(Ebug & e) { throw; } catch(Ethread_cancel & e) { throw; } catch(Egeneric & e) { if(!lax) throw; else { dialog.warning(gettext("LAX MODE:...
false
false
false
false
false
0
handleShift(BinaryOperator &I) { IRBuilder<> IRB(&I); // If any of the S2 bits are poisoned, the whole thing is poisoned. // Otherwise perform the same shift on S1. Value *S1 = getShadow(&I, 0); Value *S2 = getShadow(&I, 1); Value *S2Conv = IRB.CreateSExt(IRB.CreateICmpNE(S2, getCleanShadow(S2))...
false
false
false
false
false
0
gx_rack_tuner_init (GxRackTuner *tuner) { g_assert(GX_IS_RACK_TUNER(tuner)); tuner->scale_lim = 0.03; tuner->speed = 0.15; tuner->display_flat = FALSE; tuner->streaming = FALSE; tuner->timestep = 50; tuner->in_limit_timestep = 8; tuner->n_targets = 0; // state tuner->pos = 0.0; tuner->in_limit = FALSE; tune...
false
false
false
false
false
0
buildCanvasMaps( const QwtPlot *plot, const QRectF &canvasRect, QwtScaleMap maps[] ) const { for ( int axisId = 0; axisId < QwtPlot::axisCnt; axisId++ ) { maps[axisId].setTransformation( plot->axisScaleEngine( axisId )->transformation() ); const QwtScaleDiv &scaleDiv = *plot->ax...
false
false
false
false
false
0
ValidForRubberSheet(Object object) { Category cat; int rank, shape[32]; if (! DXGetType(object, NULL, &cat, &rank, shape) || (cat != CATEGORY_REAL) || (! (rank == 0 || (rank == 1 && shape[0] == 1)))) { DXSetError(ERROR_DATA_INVALID, "invalid data: scalar or 1-vector real data required"); re...
false
false
false
false
false
0
of_path_to_platform_device(const char *path) { struct device_node *np; struct platform_device *pdev; np = of_find_node_by_path(path); if (np == NULL) return NULL; pdev = of_find_device_by_node(np); of_node_put(np); return pdev; }
false
false
false
false
false
0
value_to_integer(char * money, char * integer, int decimal_places) { int i,ctr=0; char intval[STRING_BLOCK]; char decval[STRING_BLOCK]; for (i=0;i<strlen(money);i++) { if (money[i]=='.') { break; } if ((money[i]>='0') && (money[i]<='9')) { intval[ctr++]=mone...
true
true
false
false
true
1
git_attr_cache__lookup_macro( git_repository *repo, const char *name) { git_strmap *macros = git_repository_attr_cache(repo)->macros; khiter_t pos; pos = git_strmap_lookup_index(macros, name); if (!git_strmap_valid_index(macros, pos)) return NULL; return (git_attr_rule *)git_strmap_value_at(macros, pos); }
false
false
false
false
false
0
parse_treeish_arg(const char **argv, struct archiver_args *ar_args, const char *prefix) { const char *name = argv[0]; const unsigned char *commit_sha1; time_t archive_time; struct tree *tree; const struct commit *commit; unsigned char sha1[20]; if (get_sha1(name, sha1)) die("Not a valid object name"); com...
true
true
false
false
false
1
sdataEntity(SdataEntityEvent *event) { if (gatheringContent_) { content_.addSdata(event->entity()->asInternalEntity()->string(), event->location().origin()); return; } else { currentLocation_ = event->location(); for (size_t i = 0; i < arcProcessors_.size(); i++) { if (arcProcessors_...
false
false
false
false
false
0
er_strutils_indent (const char * str, int indent) { static char output[MAX_MSG_LENGTH]; const char *warning = "\n ... [ TEXT TRUNCATED - MAXIMUM STRING LENGTH EXCEEDED ]\n"; int c, i, s; memset (output, 0, MAX_MSG_LENGTH); c = 0; for (s=0; s<(int)strlen(str); s++) { if (c >= (MAX_MSG_LENGTH - 2 - indent)) ...
false
false
false
false
false
0
NCDFAddHistory(int fpImage, const char *pszAddHist, const char *pszOldHist) { char strtime[32]; time_t tp; struct tm *ltime; char *pszNewHist = NULL; size_t nNewHistSize = 0; int disableHistory = FALSE; int status; /* Check pszOldHist - as if there was no previous history, it will be ...
false
false
false
false
true
1
SetRestOfGroupToState(Enemy ThisRobot, short NewState) { int MarkerCode; MarkerCode = ThisRobot->marker; if ((MarkerCode == 0) || (MarkerCode == 101)) return; enemy *erot; BROWSE_ALIVE_BOTS(erot) { if (erot->marker == MarkerCode) erot->combat_state = NewState; } }
false
false
false
false
false
0
pd_popsym(t_pd *x) { if (!gstack_head || s__X.s_thing != x) bug("gstack_pop"); else { t_gstack *headwas = gstack_head; s__X.s_thing = headwas->g_what; gstack_head = headwas->g_next; t_freebytes(headwas, sizeof(*headwas)); lastpopped = x; } }
false
false
false
false
false
0
sanei_genesys_buffer_get_write_pos (Genesys_Buffer * buf, size_t size) { if (buf->avail + size > buf->size) return NULL; if (buf->pos + buf->avail + size > buf->size) { memmove (buf->buffer, buf->buffer + buf->pos, buf->avail); buf->pos = 0; } return buf->buffer + buf->pos + buf->avail; }
false
false
false
false
false
0
isoconv_node (NODE *t, parser *p) { NODE *e, *n = t->v.b1.b; NODE *ret = NULL; const double *x = NULL; double *ymd[3] = {NULL, NULL, NULL}; int i, k = n->v.bn.n_nodes; if (p->dset == NULL) { p->err = E_NODATA; return NULL; } if (k < 3 || k > 4) { n_args_error(k, 4, t->t, p); } e...
false
false
false
false
false
0
working_days(time_t start, time_t finish) { // // Flip it end-for-end if they gave it the wrong way round. // trace(("working_days(start = %ld, finish = %ld)\n{\n", (long)start, (long)finish)); trace(("start = %s", ctime(&start))); trace(("finish = %s", ctime(&finish))); if (start > fini...
false
false
false
false
false
0
mRNAs_are_equal(GtGenomeNode *gn_1, GtGenomeNode *gn_2, const char *feature_type) { GtArray *exons_1, *exons_2; StoreExonFeatureInfo info; bool equal; GT_UNUSED int had_err; gt_assert(gn_1 && gn_2 && feature_type); /* init */ exons_1 = gt_array_new(sizeof (GtRange)); exons_...
false
false
false
false
false
0
directory_monitor_cancel (GFileMonitor *monitor) { if (monitor) { g_file_monitor_cancel (G_FILE_MONITOR (monitor)); g_object_unref (monitor); } }
false
false
false
false
false
0
MultiplayerConfig(void) { txt_window_t *window; txt_label_t *label; txt_table_t *table; char buf[10]; int i; window = TXT_NewWindow("Multiplayer Configuration"); TXT_AddWidgets(window, TXT_NewStrut(0, 1), TXT_NewHorizBox(TXT_NewLabel("Player name: ")...
false
false
false
false
false
0
estPairFree(void) { if(debug) ajDebug("estPairFree: rpairs: %d rpair: %x\n", rpairs, rpair); if(rpair) AJFREE(rpair); rpair = NULL; rpair_size = 0; rpairs = 0; rpairs_sorted = 0; return; }
false
false
false
false
false
0
cb_build_expr (cb_tree list) { cb_tree l; /* RXW cb_tree x; */ int op; cb_expr_init (); for (l = list; l; l = CB_CHAIN (l)) { op = CB_PURPOSE_INT (l); switch (op) { case '9': /* NUMERIC */ cb_expr_shift_class ("cob_is_numeric"); break; case 'A': /* ALPHABETIC */ cb_expr_shift_class ("cob_is_alph...
false
false
false
true
false
1
cmd_cat(Volume* volume, int argc, const char *argv[]) { HFSPlusCatalogRecord* record; AbstractFile* stdoutFile; record = getRecordFromPath(argv[1], volume, NULL, NULL); stdoutFile = createAbstractFileFromFile(stdout); if(record != NULL) { if(record->recordType == kHFSPlusFileRecord) writeToFile((HFSPlusCa...
false
false
false
false
false
0
amitk_data_set_get_min_frame_duration(const AmitkDataSet * ds) { amide_time_t min_frame_duration; guint i_frame; g_return_val_if_fail(AMITK_IS_DATA_SET(ds), 1.0); min_frame_duration = amitk_data_set_get_frame_duration(ds,0); for(i_frame=1;i_frame<AMITK_DATA_SET_NUM_FRAMES(ds);i_frame++) if (amitk_da...
false
false
false
false
false
0
setTemplateIdentification(const OFString &templateIdentifier, const OFString &mappingResource) { OFCondition result = EC_IllegalParameter; /* check for valid value pair */ if ((templateIdentifier.empty() && mappingResource.empty()) || (!temp...
false
false
false
false
false
0
isns_getnext_get_object(isns_simple_t *qry, isns_db_t *db, isns_object_t **result) { isns_scope_t *scope; isns_attr_list_t *keys = &qry->is_message_attrs, match; isns_object_template_t *tmpl; unsigned int i; /* * 5.6.5.3. * The Message Key Attribute may be an Entity Identifier (EID), * iSCSI Name, iSCSI...
false
false
false
false
false
0
vwp_unpoll(struct vwp *vwp, int fd) { assert(fd >= 0); assert(fd < vwp->npoll); vwp_pollspace(vwp, (unsigned)fd); assert(vwp->pollfd[fd].fd == fd); assert(vwp->pollfd[fd].events == POLLIN); assert(vwp->pollfd[fd].revents == 0); vwp->pollfd[fd].fd = -1; vwp->pollfd[fd].events = 0; }
false
false
false
false
false
0
OGR_F_SetFrom( OGRFeatureH hFeat, OGRFeatureH hOtherFeat, int bForgiving ) { VALIDATE_POINTER1( hFeat, "OGR_F_SetFrom", CE_Failure ); VALIDATE_POINTER1( hOtherFeat, "OGR_F_SetFrom", CE_Failure ); return ((OGRFeature *) hFeat)->SetFrom( (OGRFeature *) hOtherFeat, ...
false
false
false
false
false
0
_dvb_sub_read_8bit_string (guint8 * destbuf, gint dbuf_len, const guint8 ** srcbuf, gint buf_size, guint8 non_mod, guint8 * map_table) { GstBitReader gb = GST_BIT_READER_INIT (*srcbuf, buf_size); /* FIXME: Handle FALSE returns from gst_bit_reader_get_* calls? */ gboolean stop_parsing = FALSE; guint32 bits ...
false
false
false
false
false
0
reservation_object_test_signaled_rcu(struct reservation_object *obj, bool test_all) { unsigned seq, shared_count; int ret = true; retry: shared_count = 0; seq = read_seqcount_begin(&obj->seq); rcu_read_lock(); if (test_all) { unsigned i; struct reservation_object_list *fobj = rcu_dereference(o...
false
false
false
false
false
0
_checkMetaFile(const std::string& filename, const std::string& url, bool& is_locked) { std::string meta_file(filename + CACHE_META_SUFFIX); struct stat fileStat; if (FileStat(meta_file, &fileStat, true)) { // check URL inside file for possible hash collisions std::list<std::string> lines; ...
false
false
false
false
false
0
check_for_changed_options (SolverState *state) { Sheet *sheet = state->sheet; if (!gnm_solver_param_equal (sheet->solver_parameters, state->orig_params)) { GOUndo *undo = set_params (sheet, state->orig_params); GOUndo *redo = set_params (sheet, sheet->solver_parameters); cmd_generic (WORKBOOK_CONTROL ...
false
false
false
false
false
0
jclass_get_class_from_method_signature(const char* method) { char* class_name; int start_index; int finish_index; if(method == NULL) return NULL; finish_index = strlen(method) - 1; while(method[finish_index] != '(' && finish_index > 0) finish_index--; while(method[finish_index] != '.' && finish_index >...
false
false
false
false
false
0
sbp2_unmap_scatterlist(struct device *card_device, struct sbp2_command_orb *orb) { scsi_dma_unmap(orb->cmd); if (orb->request.misc & cpu_to_be32(COMMAND_ORB_PAGE_TABLE_PRESENT)) dma_unmap_single(card_device, orb->page_table_bus, sizeof(orb->page_table), DMA_TO_DEVICE); }
false
false
false
false
false
0
bind_interface(SOCKET fd, unsigned int ip, unsigned short port) { struct sockaddr_in sin; memset(&sin, 0, sizeof(sin)); sin.sin_family = AF_INET; sin.sin_addr.s_addr = ip; sin.sin_port = htons(port); if(bind(fd, (struct sockaddr *) &sin, sizeof(sin)) < 0) { nlogerr("bind_interface",...
false
false
false
false
false
0
GetFilteredMessageIndex( wxInt32 iRow) const { if (s_bIsFiltered) return m_iFilteredIndexes[iRow]; return iRow; }
false
false
false
false
false
0
net_store_fill_any (netstore *ns) { struct addrinfo *ai; struct sockaddr_in *sin; ai = ns->ip6_hostent; if (!ai) { ai = malloc (sizeof (struct addrinfo)); memset (ai, 0, sizeof (struct addrinfo)); ns->ip6_hostent = ai; } sin = (struct sockaddr_in *)ai->ai_addr; if (!sin) { sin = malloc (sizeof (struct s...
false
false
false
false
false
0
print_variant_names (destination) FILE * destination; { /* * print a list with the names of all known variants to the * file pointed to by "destination". */ register int vd_count = 0; register char * varname_p; (void) fputs ("#\n#\tVariant Definitions\n#\n\n", destination); if ((varname_p = varian...
false
false
false
false
false
0
summaryview_search_root_progress(gpointer data, guint at, guint matched, guint total) { SummaryView *summaryview = (SummaryView*) data; gint interval = quicksearch_is_fast(summaryview->quicksearch) ? 5000 : 100; statusbar_progress_all(at, total, interval); if (at % interval == 0) GTK_EVENTS_FLUSH(); return ...
false
false
false
false
false
0
choose_daemon(void) { char *daemon_menu = "r) reset daemon\n" "a) arp spoof + arp relayer daemon\n" "s) sniff daemon\n" "m) mac discovery daemon\n" "x) return\n"; char *daemon_chars = "rasmx"; int run_it = 1; while (run_it) { switch (menu("daemons", daemon_menu, "dm", daemon_chars, 0...
false
false
false
false
false
0
exists_acl_index(Vfs_handle *h) { int st; st = vfs_exists(h, ACL_INDEX_FILENAME); if (st == -1) { log_msg((LOG_ERROR_LEVEL, "Error testing ACL index")); return(-1); } return(st); }
false
false
false
false
false
0
fetch_pointer(const opal_identifier_t *uid, const char *key, void **data, opal_data_type_t type) { proc_data_t *proc_data; opal_value_t *kv; opal_identifier_t id; /* to protect alignment, copy the data across */ memcpy(&id, uid, sizeof(opal_identifi...
false
false
false
false
false
0
math_2(PyObject *args, double (*func) (double, double), char *funcname) { PyObject *ox, *oy; double x, y, r; if (! PyArg_UnpackTuple(args, funcname, 2, 2, &ox, &oy)) return NULL; x = PyFloat_AsDouble(ox); y = PyFloat_AsDouble(oy); if ((x == -1.0 || y == -1.0) && PyErr_Occurred()) ...
false
false
false
false
false
0
cl_com_handle_service_thread(void *t_conf) { int ret_val = CL_RETVAL_OK; int do_exit = 0; cl_com_handle_t* handle = NULL; /* get pointer to cl_thread_settings_t struct */ cl_thread_settings_t *thread_config = (cl_thread_settings_t*)t_conf; /* set thread config data */ if (cl_thread_set_thread_c...
false
false
false
false
false
0
mp_init_size(mp_int *mp, mp_size prec) { ARGCHK(mp != NULL && prec > 0, MP_BADARG); prec = MP_ROUNDUP(prec, s_mp_defprec); if((DIGITS(mp) = s_mp_alloc(prec, sizeof(mp_digit))) == NULL) return MP_MEM; SIGN(mp) = ZPOS; USED(mp) = 1; ALLOC(mp) = prec; return MP_OKAY; }
false
false
false
false
false
0
printstatus(struct gspca_dev *gspca_dev, struct cam_params *params) { PDEBUG(D_PROBE, "status: %02x %02x %02x %02x %02x %02x %02x %02x", params->status.systemState, params->status.grabState, params->status.streamState, params->status.fatalError, params->status.cmdError, params->status.debugFlag...
false
false
false
false
false
0
test1() { static const char teststr[]= { 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x04, 0x14, 0x00, 0x00, 0x04, 0x30, 0x00, 0x00, 0x00, 0x42}; char outputbuf[12]; struct collect_buf cb; libmail_u_convert_handle_t h; int checkflag; cb.ptr=outputbuf; cb.cnt=0; cb.size=sizeof(outputbuf); if ((h=libmail_u_con...
true
true
false
false
false
1
mb_free_blocks(struct inode *inode, struct ext4_buddy *e4b, int first, int count) { int left_is_free = 0; int right_is_free = 0; int block; int last = first + count - 1; struct super_block *sb = e4b->bd_sb; if (WARN_ON(count == 0)) return; BUG_ON(last >= (sb->s_blocksize << 3)); assert_spin_locked(ext4...
false
false
false
false
false
0
hoverEnterEvent ( QGraphicsSceneHoverEvent * event ) { // debugInfo("hover enter paletteitembase"); ItemBase::hoverEnterEvent(event); if (event->isAccepted()) { if (hasRubberBandLeg()) { //DebugDialog::debug("---pab set override cursor"); CursorMaster::instance()->addCursor(this, cursor()); bool connecte...
false
false
false
false
false
0
cmd_send_con_msg(hypervisor_conn_t *conn,int argc,char *argv[]) { vm_instance_t *vm; if (!(vm = hypervisor_find_object(conn,argv[0],OBJ_TYPE_VM))) return(-1); vtty_store_str(vm->vtty_con,argv[1]); vm_release(vm); hypervisor_send_reply(conn,HSC_INFO_OK,1,"OK"); return(0); }
false
false
false
false
false
0
add_empty_field(HTable table, const char *field) { SField *f, *nf; if ((! table) || (! field)) return NULL; f = find_field(table, field); if (f) table_remove_field(table, f->name); nf = (SField*)calloc(1, sizeof(SField)); if (! nf) return NULL; nf->name = strdup(field); ...
false
false
false
false
false
0
Aggro(Unit* pWho) override { if (urand(0, 1)) { DoScriptText(SAY_REM_AGGRO, m_creature, pWho); } }
false
false
false
false
false
0
load_module(void) { int res; int x; ast_format_set(&alawtoulaw.src_format, AST_FORMAT_ALAW, 0); ast_format_set(&alawtoulaw.dst_format, AST_FORMAT_ULAW, 0); ast_format_set(&ulawtoalaw.src_format, AST_FORMAT_ULAW, 0); ast_format_set(&ulawtoalaw.dst_format, AST_FORMAT_ALAW, 0); for (x=0;x<256;x++) { mu2a[x] = ...
false
false
false
false
false
0
__compact_finished(struct zone *zone, struct compact_control *cc, const int migratetype) { unsigned int order; unsigned long watermark; if (cc->contended || fatal_signal_pending(current)) return COMPACT_CONTENDED; /* Compaction run completes if the migrate and free scanner meet */ if (compact_scanners_m...
false
false
false
false
false
0
mono_thread_state_init_from_monoctx (MonoThreadUnwindState *ctx, MonoContext *mctx) { MonoInternalThread *thread = mono_thread_internal_current (); if (!thread || !thread->jit_data) { ctx->valid = FALSE; return FALSE; } ctx->ctx = *mctx; ctx->unwind_data [MONO_UNWIND_DATA_DOMAIN] = mono_domain_get (); ctx->u...
false
false
false
false
false
0
max98925_dai_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) { struct snd_soc_codec *codec = dai->codec; struct max98925_priv *max98925 = snd_soc_codec_get_drvdata(codec); switch (params_width(params)) { case 16: regmap_update_bits(max98925-...
false
false
false
false
false
0
OJPEGReadByte(OJPEGState* sp, uint8* byte) { if (sp->in_buffer_togo==0) { if (OJPEGReadBufferFill(sp)==0) return(0); assert(sp->in_buffer_togo>0); } *byte=*(sp->in_buffer_cur); sp->in_buffer_cur++; sp->in_buffer_togo--; return(1); }
false
false
false
false
false
0
gst_adder_change_state (GstElement * element, GstStateChange transition) { GstAdder *adder; GstStateChangeReturn ret; adder = GST_ADDER (element); switch (transition) { case GST_STATE_CHANGE_NULL_TO_READY: break; case GST_STATE_CHANGE_READY_TO_PAUSED: adder->timestamp = 0; adder->off...
false
false
false
false
false
0
ss_filter_match (or_filter_t* or, struct berval** vals) /* returns: 0 filter matched * -1 filter did not match * >0 an LDAP error code */ { auto int rc = -1; /* no match */ auto indexer_t* ix = or->or_indexer; if (vals != NULL) for (; *vals; ++vals) { auto struct berval v; auto st...
false
false
false
false
false
0
routine_error(OM_uint32 v) { static const char *msgs[] = { NULL, /* 0 */ "An unsupported mechanism was requested", "An invalid name was supplied", "A supplied name was of an unsupported type", "Incorrect channel bindings were supplied", "An invalid status code was supplied", "A token had an invalid MIC", ...
false
false
false
false
false
0
report_fuse_errors(struct fuse_client * c) { char buf[1024]; int fd; int len; fflush(stderr); dup2(captured_fd, fileno(stderr)); close(captured_fd); clearerr(stderr); fsetpos(stderr, &pos); /* for C9X */ if ((fd=open(TMP_FILE,O_RDONLY))<0) return;; memset(buf,0,1024); len...
true
true
false
false
true
1
actively_uploading(PROJECT* p) { for (unsigned int i=0; i<gstate.file_xfers->file_xfers.size(); i++) { FILE_XFER* fxp = gstate.file_xfers->file_xfers[i]; if (fxp->fip->project != p) continue; if (!fxp->is_upload) continue; if (gstate.now - fxp->start_time > WF_DEFER_INTERVAL) continu...
false
false
false
false
false
0
intel_ntb_mw_set_trans(struct ntb_dev *ntb, int idx, dma_addr_t addr, resource_size_t size) { struct intel_ntb_dev *ndev = ntb_ndev(ntb); unsigned long base_reg, xlat_reg, limit_reg; resource_size_t bar_size, mw_size; void __iomem *mmio; u64 base, limit, reg_val; int bar; if (idx >= ndev->b2b_idx && !ndev...
false
false
false
false
false
0
_echoRayIntx_Cube(RAYINTX_ARGS(Cube)) { echoPos_t t; int ax, dir; AIR_UNUSED(parm); if (!_echoRayIntx_CubeSurf(&t, &ax, &dir, -1, 1, -1, 1, -1, 1, ray)) return AIR_FALSE; intx->obj = (echoObject *)obj; intx->t = t; ...
false
false
false
false
false
0
isEqual(ELObj &obj) { PairObj *p = obj.asPair(); // FIXME need non-recursive implementation return p && equal(*p->car(), *car()) && equal(*p->cdr(), *cdr()); }
false
false
false
false
false
0
sysfs_delete_link(struct kobject *kobj, struct kobject *targ, const char *name) { const void *ns = NULL; /* * We don't own @target and it may be removed at any time. * Synchronize using sysfs_symlink_target_lock. See * sysfs_remove_dir() for details. */ spin_lock(&sysfs_symlink_target_lock); if (targ->...
false
false
false
false
false
0
globalize_local(astnode *n, void *arg, astnode **next) { char str[32]; /* Make it global by appending namespace counter to the id */ snprintf(str, sizeof (str), "#%d", label_count); if (astnode_is_type(n, LOCAL_LABEL_NODE)) { /* Local label definition, use label field */ n->label = reall...
false
false
false
false
false
0
unity_scope_dbus_connector_run (void) { Block9Data* _data9_; GMainLoop* _tmp0_ = NULL; UnityInternalScopeDBusNameManager* _tmp2_ = NULL; GMainLoop* _tmp3_ = NULL; _data9_ = g_slice_new0 (Block9Data); _data9_->_ref_count_ = 1; _tmp0_ = unity_scope_dbus_connector_primary_loop; if (_tmp0_ == NULL) { GMainLoop* _...
false
false
false
false
false
0
tick_nohz_tick_stopped(void) { return __this_cpu_read(tick_cpu_sched.tick_stopped); }
false
false
false
false
false
0
WriteFrameComponent( const PicArray& pic_data , const CompSort& cs) { if (!m_op_pic_ptr) { std::cerr<<std::endl<<"Can't open picture data file for writing"; return false; } //initially set up for 10-bit data input, rounded to 8 bits on file output //This will throw out any padding t...
false
false
false
true
false
1
load_nation_names(struct section_file *file) { struct section_list *sec; int j; (void) secfile_entry_by_path(file, "datafile.description"); /* unused */ sec = secfile_sections_by_name_prefix(file, NATION_SECTION_PREFIX); if (NULL == sec) { ruleset_error(LOG_FATAL, "No available nations in this ruleset...
false
false
false
false
false
0
A_FirePhoenixPL2(player_t * player, pspdef_t * psp) { mobj_t *mo; mobj_t *pmo; angle_t angle; fixed_t x, y, z; fixed_t slope; if (--player->flamecount == 0) { // Out of flame P_SetPsprite(player, ps_weapon, S_PHOENIXATK2_4); player->refire = 0; ...
false
false
false
false
false
0
bg_sched_sleep(struct bgtask *bt) { bg_task_check(bt); g_assert(!(bt->flags & TASK_F_SLEEPING)); g_assert(!(bt->flags & TASK_F_RUNNING)); g_assert(bg_runcount > 0); bg_sched_remove(bt); /* Can no longer be scheduled */ bg_runcount--; bt->flags |= TASK_F_SLEEPING; sleepq = g_slist_prepend(sleepq, bt); }
false
false
false
false
false
0
safe_read_partial(const int fd, void * const buf_, const size_t max_count) { unsigned char * const buf = (unsigned char *) buf_; ssize_t readnb; while ((readnb = read(fd, buf, max_count)) < (ssize_t) 0 && errno == EINTR); return readnb; }
false
true
false
false
true
1
do_xor(SList,Layer) struct ks *SList; int Layer; { struct g *GenDesc; struct o *Pointer; struct ka BB, AOI; struct ks *SQDesc; (void)CDBB(Parameters.kpCellDesc,SList->ksPointer,&AOI.kaLeft, &AOI.kaBottom,&AOI.kaRight,&AOI.kaTop); /* conditionally delete overlapping boxes, store list i...
false
false
false
false
false
0
mtk_spi_interrupt(int irq, void *dev_id) { u32 cmd, reg_val, cnt; struct spi_master *master = dev_id; struct mtk_spi *mdata = spi_master_get_devdata(master); struct spi_transfer *trans = mdata->cur_transfer; reg_val = readl(mdata->base + SPI_STATUS0_REG); if (reg_val & MTK_SPI_PAUSE_INT_STATUS) mdata->state = ...
false
false
false
false
false
0
reset_crypto_state(struct session_state *state) { state->sign_object = -1; if (state->sign_mechanism) free(state->sign_mechanism); state->sign_mechanism = NULL_PTR; state->verify_object = -1; if (state->verify_mechanism) free(state->verify_mechanism); state->verify_mechanism = NULL_PTR; }
false
false
false
false
false
0
endEncoding() { size_t min_size = s_stacksize_stack.back(); if (s_encoding_stack.size() <= min_size) { _FB_USES_NLS; cerr<<_FB_CONSOLETEXT(Menu, ErrorEndEncoding, "Warning: unbalanced [encoding] tags", "User menu file had unbalanced [encoding] tags")<<endl; return; } s_encoding_...
false
false
false
false
false
0
iter_gen_sym(int n, int nrow) #endif { SPMAT *A; VEC *u; Real s1; int i, j, k, k_max; if (nrow <= 1) nrow = 2; /* nrow should be even */ if ((nrow & 1)) nrow -= 1; A = sp_get(n,n,nrow); u = v_get(A->m); v_zero(u); for ( i = 0; i < A->m; i++ ) { k_max = ((rand...
false
false
false
false
false
0
depRecComp(l,e,qs) /* find dependents of a recursive */ Int l; /* comprehension */ Cell e; List qs; { List mdoBounds; List obvs; withinScope(NIL); mdoBounds = mdoBVars(l, qs); enterBtyvs(); obvs = saveBvars(); hd(bounds) = mdoBounds; mdoExpandQualifiers(l,e,qs,mdoBounds); resto...
false
false
false
false
false
0
__del_reloc_root(struct btrfs_root *root) { struct rb_node *rb_node; struct mapping_node *node = NULL; struct reloc_control *rc = root->fs_info->reloc_ctl; spin_lock(&rc->reloc_root_tree.lock); rb_node = tree_search(&rc->reloc_root_tree.rb_root, root->node->start); if (rb_node) { node = rb_entry(rb_no...
false
false
false
false
false
0
panel_util_get_icon_for_uri_known_folders (const char *uri) { const char *icon; char *path; int len; icon = NULL; if (!g_str_has_prefix (uri, "file:")) return NULL; path = g_filename_from_uri (uri, NULL, NULL); /* Sanity check. We may be given a broken URI. */ if (path == NULL) return NUL...
false
false
false
false
false
0
handle_spy(struct linked_server *ls, const void *data, size_t length) { (void)data; (void)length; if (ls->connection->instance->config->antispy) return PA_DROP; return PA_ACCEPT; }
false
false
false
false
false
0
floatformat_from_double (fmt, from, to) const struct floatformat *fmt; double *from; char *to; { double dfrom; int exponent; double mant; unsigned int mant_bits, mant_off; int mant_bits_left; unsigned char *uto = (unsigned char *)to; memcpy (&dfrom, from, sizeof (dfrom)); memset (uto, 0,...
false
false
false
false
false
0
e_modapi_shutdown(E_Module *m) { E_Mixer_Module_Context *ctxt; ctxt = m->data; if (!ctxt) return 0; _mixer_instances_free(ctxt); if (ctxt->conf_dialog) e_object_del(E_OBJECT(ctxt->conf_dialog)); if (ctxt->mixer_dialog) e_object_del(E_OBJECT(ctxt->mixer_dialog)); _mixer_configure...
false
false
false
false
false
0
putback(start, newend) int start, *newend; { int siz, st; HANDLE f; if (yank.size+bufmax < SIZE && yank.size > 0) { *newend = start + yank.size; if (start < bufmax) moveright(&core[start], &core[start+yank.size], bufmax-start); moveleft(yank.stuff, &core[start], min(SBUFSIZE, yank.size)); if (...
false
false
false
false
false
0
addModule(const std::string& name, Module* module) { if (m_mods.find(name) != m_mods.end()) { return; } m_mods.insert(ModuleMap::value_type(name, module)); module->init(); module->setLoaded(); if (module->hasModules()) { ModuleMap& mods = module->getModules(); ModuleMap::const_iterator it(mods.begin()), e...
false
false
false
false
false
0
stk_free_sio_buffers(struct stk_camera *dev) { int i; int nbufs; unsigned long flags; if (dev->n_sbufs == 0 || dev->sio_bufs == NULL) return 0; /* * If any buffers are mapped, we cannot free them at all. */ for (i = 0; i < dev->n_sbufs; i++) { if (dev->sio_bufs[i].mapcount > 0) return -EBUSY; } /* * O...
false
false
false
false
false
0
StructUnionType_new(PyTypeObject *type, PyObject *args, PyObject *kwds, int isStruct) { PyTypeObject *result; PyObject *fields; StgDictObject *dict; /* create the new instance (which is a class, since we are a metatype!) */ result = (PyTypeObject *)PyType_Type.tp_new(type, args, kwds); i...
false
false
false
false
false
0