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
mpw_div_ui(mpw_ptr rop,mpw_ptr op, unsigned int i) { if G_UNLIKELY (i==0) { gel_errorout (_("Division by zero!")); gel_error_num=GEL_NUMERICAL_MPW_ERROR; return; } if (rop != op) { MAKE_EMPTY(rop->r, op->r->type); } else { MAKE_COPY (rop->r); } mpwl_div_ui(rop->r,op->r,i); if (MPW_IS_REAL (op)) { MAK...
false
false
false
false
false
0
vhost_disable_notify(struct vhost_dev *dev, struct vhost_virtqueue *vq) { int r; if (vq->used_flags & VRING_USED_F_NO_NOTIFY) return; vq->used_flags |= VRING_USED_F_NO_NOTIFY; if (!vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX)) { r = vhost_update_used_flags(vq); if (r) vq_err(vq, "Failed to enable notifi...
false
false
false
false
false
0
remLaser(ArLaser *laser, bool removeAsRangeDevice) { if (laser == NULL) { ArLog::log(ArLog::Normal, "ArRobot::remLaser: Passed NULL laser to remove"); return false; } std::map<int, ArLaser *>::iterator it; for (it = myLaserMap.begin(); it != myLaserMap.end(); ++it) { if ((*it).second ...
false
false
false
false
false
0
hfs_remount(struct super_block *sb, int *flags, char *data) { sync_filesystem(sb); *flags |= MS_NODIRATIME; if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) return 0; if (!(*flags & MS_RDONLY)) { if (!(HFS_SB(sb)->mdb->drAtrb & cpu_to_be16(HFS_SB_ATTRIB_UNMNT))) { pr_warn("filesystem was not cleanly un...
false
false
false
false
false
0
_shmem_clear_lock(void *lock, int lock_size) { int current_lock_counter = shmem_lock_decrement_counter(lock, lock_size); if (0 == current_lock_counter) { int next_informed = 0; int pe_next = 0; while (!next_informed) { shmem_lock_extract_pe_next(lock, lock_size, &pe_next); ...
false
false
false
false
false
0
freewinznc(winfo) WinZnc *winfo; { long i,j; j=winfo->nx*winfo->ny; for(i=0;i<j;i++) if(winfo->ChZnc[i]!=NULL) freechain(winfo->ChZnc[i]); mbkfree(winfo->ChZnc); mbkfree(winfo); }
false
false
false
false
false
0
wcn36xx_smd_remove_stakey(struct wcn36xx *wcn, enum ani_ed_type enc_type, u8 keyidx, u8 sta_index) { struct wcn36xx_hal_remove_sta_key_req_msg msg_body; int ret = 0; mutex_lock(&wcn->hal_mutex); INIT_HAL_MSG(msg_body, WCN36XX_HAL_RMV_STAKEY_REQ); msg_body.sta_idx = sta_index; msg_body...
false
false
false
false
false
0
LL_extract( LinkedList list, int item ) { Link *pLink; if( list == NULL || list->size == 0 ) return NULL; AssertValidPtr( list ); CHANGE_STATE(list); pLink = GetLink( list, item ); if( pLink == NULL ) return NULL; return Extract( list, pLink ); }
false
false
false
false
false
0
gtkaccellabel_gtk_accel_label_set_accel_closure(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_) { ScmObj accel_label_scm; GtkAccelLabel* accel_label; ScmObj accel_closure_scm; ScmProcedure* accel_closure; ScmObj SCM_SUBRARGS[2]; int SCM_i; SCM_ENTER_SUBR("gtk-accel-label-set-accel-closure"); for (SCM_i=0; ...
false
false
false
false
false
0
change_mode(int newmode) { mode = newmode; switch(mode) { case MODE_NORMAL: curs_set(0); if (search_filter_len == 0) { app.screen.status_line_printer = NULL; } break; case MODE_SEARCH: curs_set(1); break; } }
false
false
false
false
false
0
i830_chipset_flush(void) { unsigned long timeout = jiffies + msecs_to_jiffies(1000); /* Forcibly evict everything from the CPU write buffers. * clflush appears to be insufficient. */ wbinvd_on_all_cpus(); /* Now we've only seen documents for this magic bit on 855GM, * we hope it exists for the other gen2 ch...
false
false
false
false
false
0
getGrayLine(Guchar *in, Guchar *out, int length) { int i; for (i = 0; i < length; i++) { out[i] = (in[i * 3 + 0] * 19595 + in[i * 3 + 1] * 38469 + in[i * 3 + 2] * 7472) / 65536; } }
false
false
false
false
false
0
slurm_xmalloc(size_t size, const char *file, int line, const char *func) { void *new; int *p; xmalloc_assert(size >= 0 && size <= INT_MAX); MALLOC_LOCK(); p = (int *)malloc(size + 2*sizeof(int)); MALLOC_UNLOCK(); if (!p) { /* out of memory */ log_oom(file, line, func); abort(); } p[0] = XMALLOC_MAGIC; ...
false
false
false
false
false
0
clutter_shader_effect_set_uniform_valist (ClutterShaderEffect *effect, const gchar *name, GType value_type, gsize n_values, ...
false
false
false
false
false
0
AddRule(ASTrule* rule) { bool isShapeItem = rule->mNameIndex == -1; if (isShapeItem) rule->mNameIndex = mCurrentShape; else mCurrentShape = -1; if (rule->mNameIndex == -1) { CfdgError::Error(rule->mLocation, "Shape rules/paths must follow a shape declaration"); ...
false
false
false
false
false
0
ffcpdt(fitsfile *infptr, /* I - FITS file pointer to input file */ fitsfile *outfptr, /* I - FITS file pointer to output file */ int *status) /* IO - error status */ { /* copy the data unit from the CHDU of infptr to the CHDU of outfptr. This will overwrite any data already ...
false
false
false
false
false
0
on_insert(const Gtk::TextBuffer::iterator& pos, const Glib::ustring& text, int bytes) { move_mark(_insert, pos); Glib::ustring utf8; // Here we will handle the lam-alef inserts. // According to the xfree86 guys, It's not possible to map 1 key to 2 letter. // I'm not sure whether it's not possible or it's that...
false
false
false
false
false
0
fb_seq_show(struct seq_file *m, void *v) { int i = *(loff_t *)v; struct fb_info *fi = registered_fb[i]; if (fi) seq_printf(m, "%d %s\n", fi->node, fi->fix.id); return 0; }
false
false
false
false
false
0
release_one_tty(struct work_struct *work) { struct tty_struct *tty = container_of(work, struct tty_struct, hangup_work); struct tty_driver *driver = tty->driver; struct module *owner = driver->owner; if (tty->ops->cleanup) tty->ops->cleanup(tty); tty->magic = 0; tty_driver_kref_put(driver); module_put(owne...
false
false
false
false
false
0
FuncPRINT_CPROMPT( Obj self, Obj prompt ) { if (IS_STRING_REP(prompt)) { /* by assigning to Prompt we also tell readline (if used) what the current prompt is */ strlcpy(promptBuf, CSTR_STRING(prompt), sizeof(promptBuf)); Prompt = promptBuf; } Pr("%s%c", (Int)Prompt, (Int)'\03' ); return (Obj...
false
false
false
false
false
0
xmms_ipc_broadcast_cb (xmms_object_t *object, xmmsv_t *arg, gpointer userdata) { GList *c, *s; guint broadcastid = GPOINTER_TO_UINT (userdata); xmms_ipc_t *ipc; xmms_ipc_msg_t *msg = NULL; GList *l; g_mutex_lock (ipc_servers_lock); for (s = ipc_servers; s && s->data; s = g_list_next (s)) { ipc = s->data; g...
false
false
false
false
false
0
Cddb_Track_List_Button_Press (GtkTreeView *treeView, GdkEventButton *event) { g_return_val_if_fail (event != NULL, FALSE); if (event->type==GDK_2BUTTON_PRESS && event->button==1) { /* Double left mouse click */ Cddb_Track_List_Select_All(); } return FALSE; }
false
false
false
false
false
0
cc_interfaces_datastore_init(struct ast_channel *chan) { struct dialed_cc_interfaces *interfaces; struct ast_cc_monitor *monitor; struct ast_datastore *dial_cc_datastore; /*XXX This may be a bit controversial. In an attempt to not allocate * extra resources, I make sure that a future request will be within * l...
false
false
false
false
false
0
connman_service_get_domainname(struct connman_service *service) { if (service == NULL) return NULL; if (service->domains != NULL) return service->domains[0]; else return service->domainname; }
false
false
false
false
false
0
create_adsp_page_table(struct snd_pcm_substream *substream, struct hsw_priv_data *pdata, struct snd_soc_pcm_runtime *rtd, unsigned char *dma_area, size_t size, int pcm) { struct snd_dma_buffer *dmab = snd_pcm_get_dma_buf(substream); int i, pages, stream = substream->stream; pages = snd_sgbuf_aligned_pages(size); ...
false
false
false
false
false
0
cli_complete (const char *commandline) { int matches = 0; char str_matches[4096]=""; strncpy (newcommand, commandline, 99); newcommand[99] = 0; if (commandline[0]) { matches = item_matches (newcommand); if (matches == 1) { ItemT *titem = items; while (titem) { if (!strncmp (newcommand, titem->nam...
false
false
false
false
false
0
ch_ccmx_got_file_cb (SoupSession *session, SoupMessage *msg, gpointer user_data) { ChCcmxPrivate *priv = (ChCcmxPrivate *) user_data; gboolean ret; gchar *basename = NULL; gchar *location = NULL; GError *error = NULL; GtkWidget *widget; SoupURI *uri; /* we failed */ if (!SOUP_STATUS_IS_SUCCESSFU...
false
false
false
false
false
0
set_downmix_coeffs(AC3DecodeContext *s) { int i; float cmix = gain_levels[center_levels[s->center_mix_level]]; float smix = gain_levels[surround_levels[s->surround_mix_level]]; float norm0, norm1; for(i=0; i<s->fbw_channels; i++) { s->downmix_coeffs[i][0] = gain_levels[ac3_default_coeffs[s-...
false
false
false
false
false
0
init_exec_env(void) { if (pthread_key_create(&current_exec_env_key, NULL) != 0) error("pthread_key_create"); struct vm_exec_env *vm_exec_env = alloc_exec_env(); if (!vm_exec_env) error("out of memory"); pthread_setspecific(current_exec_env_key, vm_exec_env); }
false
false
false
false
false
0
get_date_from_str(THD *thd, String *str, timestamp_type warn_type, const char *warn_name, bool *error_arg) { MYSQL_TIME l_time; *error_arg= get_mysql_time_from_str(thd, str, warn_type, warn_name, &l_time); if (*error_arg) return 0; ret...
false
false
false
false
false
0
erl_mk_list (ETERM **arr, int size) { ETERM *ep; int i; if ((!arr) || (size < 0)) return NULL; for (i=0; i<size; i++) if (!arr[i]) return NULL; /* ASSERT(arr != NULL); */ ep = erl_mk_empty_list(); if (size > 0) { ERL_COUNT(ep)--; } for (i = size-1; i >= 0; i--) { /* ASS...
false
false
false
false
false
0
DoFillFromMessage( nMessage& m ) { // read player ID unsigned short id; m.Read(id); tJUST_CONTROLLED_PTR< ePlayerNetID > p=dynamic_cast<ePlayerNetID *>(nNetObject::ObjectDangerous(id)); player_ = p; return eVoteItem::DoFillFromMessage( m ); }
false
false
false
false
false
0
INI_Find(FILE *fh, const char *section, const char *key) { long fsize; char _ini_file[MAX_INI_SIZE]; static char _ini_ret[MAX_INI_STR_LEN]; char *line, *value; char cur_section[MAX_INI_STR_LEN]; memset(&_ini_ret, 0, MAX_INI_STR_LEN); memset(&cur_section, 0, MAX_INI_STR_LEN); memset(&_ini_file, 0, MAX_INI_SIZE)...
false
false
false
false
false
0
handshake_upenc_autodetect(int dns_fd) /* Returns: 0: keep Base32 1: Base64 is okay 2: Base64u is okay 3: Base128 is okay */ { /* Note: max 59 chars, must start with "aA". pat64: If 0129 work, assume 3-8 are okay too. RFC1035 par 2.3.1 states that [A-Z0-9-] allowed, but only [A-Z] as first, an...
false
false
false
false
false
0
is_square_threatened(const struct player *pplayer, const struct tile *ptile) { square_iterate(ptile, 2, ptile1) { unit_list_iterate(ptile1->units, punit) { if (((pplayer->ai_controlled && !ai_handicap(pplayer, H_MAP)) || can_player_see_unit_at(pplayer, punit, ptile1)) &...
false
false
false
false
false
0
allocate_compress_buf(int fd) { struct fileinfo *fcb = &G__.fileinfo[fd]; int n; n = fcb->cellhd.cols * (sizeof(CELL) + 1) + 1; if (fcb->cellhd.compressed && fcb->map_type == CELL_TYPE && (n > G__.compressed_buf_size)) { if (G__.compressed_buf_size <= 0) G__.compressed_buf = (unsigned char *)G_m...
false
false
false
false
false
0
ion_system_contig_heap_create(struct ion_platform_heap *unused) { struct ion_heap *heap; heap = kzalloc(sizeof(struct ion_heap), GFP_KERNEL); if (!heap) return ERR_PTR(-ENOMEM); heap->ops = &kmalloc_ops; heap->type = ION_HEAP_TYPE_SYSTEM_CONTIG; return heap; }
false
false
false
false
false
0
button_press_func(GtkWidget *tree, GdkEventButton *event, gpointer user_data) { GtkTreePath *path = NULL; if (event->type == GDK_BUTTON_PRESS && event->button == 1) { gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(tree), (gint)event->x, (gint)event->y, &path, NULL, NULL, NULL); ro...
false
false
false
false
false
0
icalcomponent_count_errors(icalcomponent* component) { int errors = 0; icalproperty *p; icalcomponent *c; pvl_elem itr; for( itr = pvl_head(component->properties); itr != 0; itr = pvl_next(itr)) { p = (icalproperty*)pvl_data(itr); if(icalproperty_isa(p) == ICAL_XLICERROR_PROPERTY) { ...
false
false
false
false
false
0
answerQuery(Query *query, LogCache *logcache, time_t since, time_t until, unsigned logclasses) { load(logcache, since, until, logclasses); // make sure all messages are present uint64_t sincekey = makeKey(since, 0); logfile_entries_t::iterator it = _entries.lower_bound(sincekey); while (it != _entries.e...
false
false
false
false
false
0
gt_pch_nx_VEC_inline_summary_t_gc (void *x_p) { struct VEC_inline_summary_t_gc * const x = (struct VEC_inline_summary_t_gc *)x_p; if (gt_pch_note_object (x, x, gt_pch_p_23VEC_inline_summary_t_gc, gt_ggc_e_23VEC_inline_summary_t_gc)) { { size_t i0; size_t l0 = (size_t)(((*x).base).prefix.nu...
false
false
false
false
false
0
_scroll_cb(Evas_Object *obj, void *data __UNUSED__) { Evas_Coord x, y, w, h, bw, x_boundary; unsigned int adjust_pixels; Eina_Bool h_bounce; ELM_DISKSELECTOR_DATA_GET(obj, sd); _string_check(sd); sd->s_iface->content_pos_get(obj, &x, &y); sd->s_iface->content_viewport_size_get(obj, &w,...
false
false
false
false
false
0
cuddHashTableInsert1( DdHashTable * hash, DdNode * f, DdNode * value, ptrint count) { int result; unsigned int posn; DdHashItem *item; #ifdef DD_DEBUG assert(hash->keysize == 1); #endif if (hash->size > hash->maxsize) { result = cuddHashTableResize(hash); if (result == 0) return(0); ...
false
false
false
false
false
0
asocket_abort(struct asocket *s) { int ret; char buf = 0; /* Prevent further use of fd, without yet releasing the fd */ shutdown(s->fd, SHUT_RDWR); /* wake up calls blocked at poll() */ do { ret = write(s->abort_fd[1], &buf, 1); } while (ret < 0 && errno == EINTR); }
false
false
false
false
false
0
neos_url_validate (const char *in, char **esc) { NEOERR *err = STATUS_OK; STRING out_s; int valid = 0; size_t i; size_t inlen; int num_protocols = sizeof(URL_PROTOCOLS) / sizeof(char*); void* slashpos; void* colonpos; inlen = strlen(in); /* * <a href="//b:80"> or <a href="a/b:80"> are allowed b...
false
false
false
false
false
0
rtw_init_hwxmits23a(struct hw_xmit *phwxmit, int entry) { int i; for (i = 0; i < entry; i++, phwxmit++) phwxmit->accnt = 0; }
false
false
false
false
false
0
GetNoDataValue( int *pbSuccess ) { if( pbSuccess != NULL ) *pbSuccess = TRUE; return ((IDADataset *) poDS)->nMissing; }
false
false
false
false
false
0
mwl8k_cmd_set_rf_channel(struct ieee80211_hw *hw, struct ieee80211_conf *conf) { struct ieee80211_channel *channel = conf->chandef.chan; enum nl80211_channel_type channel_type = cfg80211_get_chandef_type(&conf->chandef); struct mwl8k_cmd_set_rf_channel *cmd; struct mwl8k_priv *priv = hw->priv; int rc; ...
false
false
false
false
false
0
InternPointer(table, ptr) PointerTable *table; void *ptr; { I i; if (table == NULL) i = (-1); else { /* If pointer is already installed just return it */ for (i = 0; i < table->length; i++) if (table->ptr[i] == ptr) return i; for (i = 0; i < table->length; i++) if (table->ptr[i]...
false
false
false
false
false
0
ls_print (Node *p, void *closure) { if (long_format) { struct long_format_data *data = p->data; cvs_output_tagged ("text", data->header); if (data->time) cvs_output_tagged ("date", data->time); if (data->footer) cvs_output_tagged ("text", data->footer); cvs_output_tagged ("newline", NULL); } ...
false
false
false
false
false
0
mptscsih_bus_reset(struct scsi_cmnd * SCpnt) { MPT_SCSI_HOST *hd; int retval; VirtDevice *vdevice; MPT_ADAPTER *ioc; /* If we can't locate our host adapter structure, return FAILED status. */ if ((hd = shost_priv(SCpnt->device->host)) == NULL){ printk(KERN_ERR MYNAM ": bus reset: " "Can't locate host...
false
false
false
false
false
0
set_format(int dev, int fmt) { if (fmt != AFMT_QUERY) { audio_devs[dev]->local_conversion = 0; if (!(audio_devs[dev]->format_mask & fmt)) /* Not supported */ { if (fmt == AFMT_MU_LAW) { fmt = AFMT_U8; audio_devs[dev]->local_conversion = CNV_MU_LAW; } else fmt = AFMT_U8; /* This is alway...
false
false
false
false
false
0
setHue(FXfloat h){ h=FXCLAMP(0.0f,h,360.0f); if(h!=hsv[0]){ hsv[0]=h; updatebar(); bar->render(); update(padleft+border+2,padtop+border+2,width-padleft-padright-(border<<1)-4,height-padtop-padbottom-(border<<1)-4); } }
false
false
false
false
false
0
_Py_DumpTracebackThreads(int fd, PyInterpreterState *interp, PyThreadState *current_thread) { PyThreadState *tstate; unsigned int nthreads; /* Get the current interpreter from the current thread */ tstate = PyInterpreterState_ThreadHead(interp); if (tstate == NULL) ...
false
false
false
false
false
0
getStringVersioned(const fn_call& fn, const as_value& val, std::string& str) { /// version to use is the one of the SWF containing caller code. /// If callerDef is null, this calls is spontaneous (system-event?) /// in which case we should research on which version should drive /// behaviour. /// N...
false
false
false
false
false
0
install_htb(struct rtnl_handle *rth, int ifindex, int rate, int burst) { struct qdisc_opt opt1 = { .kind = "htb", .handle = 0x00010000, .parent = TC_H_ROOT, .quantum = conf_r2q, .defcls = 1, .qdisc = qdisc_htb_root, }; struct qdisc_opt opt2 = { .kind = "htb", .handle = 0x00010001, .parent = 0x000...
false
false
false
false
false
0
_mdfd_getseg(SMgrRelation reln, ForkNumber forknum, BlockNumber blkno, bool isTemp, ExtensionBehavior behavior) { MdfdVec *v = mdopen(reln, forknum, behavior); BlockNumber targetseg; BlockNumber nextsegno; if (!v) return NULL; /* only possible if EXTENSION_RETURN_NULL */ targetseg = blkno / ((BlockNum...
false
false
false
false
false
0
show_label(struct device *dev, struct device_attribute *attr, char *buf) { static const char * const labels[] = { "+5V", "5VSB", "Vbat", }; static const char * const labels_it8721[] = { "+3.3V", "3VSB", "Vbat", }; struct it87_data *data = dev_get_drvdata(dev); int nr = to_sensor_dev_attr(attr)->inde...
false
false
false
false
false
0
open_input_files (struct sortfile *files, size_t nfiles, FILE ***pfps) { FILE **fps = *pfps = xnmalloc (nfiles, sizeof *fps); int i; /* Open as many input files as we can. */ for (i = 0; i < nfiles; i++) { fps[i] = (files[i].temp && files[i].temp->state != UNCOMPRESSED ? open_temp (f...
false
false
false
false
false
0
really_do_trymove(int pos, int color) { BEGIN_CHANGE_RECORD(); PUSH_VALUE(board_ko_pos); /* * FIXME: Do we really have to store board_hash in a stack? * * Answer: No, we don't. But for every stone that we add * or remove, we must call hashdata_invert_stone(). This is * not difficu...
false
true
false
false
false
1
isLayoutIdentical(StructType *Other) const { if (this == Other) return true; if (isPacked() != Other->isPacked()) return false; return elements() == Other->elements(); }
false
false
false
false
false
0
time_token(time_t time, int type, char *timebuf) { struct tm *btime; btime=localtime(&time); strcpy(timebuf,""); switch(type) { case (1): sprintf(timebuf,"%d",btime->tm_hour); break; case (2): sprintf(timebuf,"%d",btime->tm_min); break; case (3): sprintf(timebuf,"%d",btime->tm_sec); break; case (4): sprin...
false
true
false
false
false
1
gtk_source_buffer_move_cursor (GtkTextBuffer *buffer, const GtkTextIter *iter, GtkTextMark *mark) { GtkSourceBuffer *source_buffer; GtkTextIter start, end; gunichar cursor_char; GtkSourceBracketMatchType previous_state; g_return_if_fail (GTK_SOURCE_IS_BUFFER (buffer)); g_return_if_f...
false
false
false
false
false
0
accept() { bool ok; int num; QString randomNumSeed = randomNumberGenSeed->text(); num = randomNumSeed.toInt(&ok); if(ok) { if(num >= 1 && num <= 1000) { clustalw::userParameters->setBootRanSeed(num); } } QString numTrials = numBootstrapTrials->tex...
false
false
false
false
false
0
mov_padd_callback (GtkWidget *widget, gpointer data) { t_mov_gui_stuff *mgp = data; gint l_idx; if(gap_debug) printf("mov_padd_callback\n"); l_idx = pvals->point_idx_max; if (l_idx < GAP_MOV_MAX_POINT -2) { /* advance to next point */ p_points_to_tab(mgp); pvals->point_i...
false
false
false
false
false
0
adjustMPres(MPreFixups *mpreFixups, LEGlyphStorage &glyphStorage, LEErrorCode& success) { if (mpreFixups != NULL) { mpreFixups->apply(glyphStorage, success); delete mpreFixups; } }
false
false
false
false
false
0
OnSignalChildHandler(int /*signal*/, siginfo_t *siginfo, void * /*ucontext*/) { // Build the log message wxString msg; msg << wxT("OnSignalChildHandler() has been called for child process with pid `") << siginfo->si_pid << wxT("'. "); // Make sure we leave no zombies by calling waitpid() int status = 0; pid_t...
false
false
false
false
false
0
clocks_world_item_real_get_name (ClocksContentItem* base) { const gchar* result; ClocksWorldItem* self; gchar* _tmp0_ = NULL; gchar* _tmp1_ = NULL; gchar* _tmp2_ = NULL; gboolean _tmp3_ = FALSE; const gchar* _tmp13_ = NULL; self = (ClocksWorldItem*) base; _tmp0_ = clocks_world_item_get_nation_name (self); _tm...
false
false
false
false
false
0
SetName(uint32_t partNum) { UnicodeString theName = ""; int retval = 1; if (IsUsedPartNum(partNum)) { cout << "Enter name: "; theName = ReadUString(); partitions[partNum].SetName(theName); } else { cerr << "Invalid partition number (" << partNum << ")\n"; retval = 0; } // i...
false
false
false
false
false
0
gl843_cold_boot (Genesys_Device * dev) { SANE_Status status; uint8_t val; DBGSTART; RIE (sanei_genesys_write_register (dev, 0x0e, 0x01)); RIE (sanei_genesys_write_register (dev, 0x0e, 0x00)); /* test CHKVER */ RIE (sanei_genesys_read_register (dev, REG40, &val)); if (val & REG40_CHKVER) { R...
false
false
false
false
false
0
sparse_file_write_block(struct output_file *out, struct backed_block *bb) { switch (backed_block_type(bb)) { case BACKED_BLOCK_DATA: write_data_chunk(out, backed_block_len(bb), backed_block_data(bb)); break; case BACKED_BLOCK_FILE: write_file_chunk(out, backed_block_len(bb), backed_block_filename(bb), ba...
false
false
false
false
false
0
SHA1Update(SHA1Context* context, const unsigned char* data, size_t len) /* JHB */ { u32 i, j; /* JHB */ j = (context->count[0] >> 3) & 63; if ((context->count[0] += len << 3) < (len << 3)) context->count[1]++; context->count[1] += (len >> 29); if ((j + len) > 63) { memcpy(&context->buffer[j], data, ...
false
false
false
false
false
0
show_entry(struct diff_options *opt, const char *prefix, struct tree_desc *desc, struct strbuf *base) { unsigned mode; const char *path; const unsigned char *sha1 = tree_entry_extract(desc, &path, &mode); int pathlen = tree_entry_len(path, sha1); int old_baselen = base->len; strbuf_add(base, path, pathl...
false
false
false
false
false
0
asStc() const // returns "flags" converted to wxSTC search flags { int retval = 0; if (has(se::WHOLE_WORD)) retval |= wxSTC_FIND_WHOLEWORD; if (has(se::MATCH_CASE)) retval |= wxSTC_FIND_MATCHCASE; if (has(se::REGULAR_EXPRESSION)) retval |= wxSTC_FIND_REGEXP; return...
false
false
false
false
false
0
client3_3_releasedir (call_frame_t *frame, xlator_t *this, void *data) { clnt_conf_t *conf = NULL; clnt_fd_ctx_t *fdctx = NULL; clnt_args_t *args = NULL; int64_t remote_fd = -1; if (!this || !data) ...
false
false
false
false
false
0
check_data_dir(const char* data_dir) { gboolean ret = FALSE; char* dir_path = g_build_filename(data_dir, "thumbnailers", NULL); struct stat statbuf; if(stat(dir_path, &statbuf) == 0) { if(statbuf.st_mtime > last_loaded_time) ret = TRUE; } g_free(dir_path); return ret;...
false
false
false
false
false
0
sony_nc_lid_resume_store(struct device *dev, struct device_attribute *attr, const char *buffer, size_t count) { unsigned int result; unsigned long value; unsigned int pos = LID_RESUME_S5; if (count > 31) return -EINVAL; if (kstrtoul(buffer, 10, &value) || value > 1) return -EINVAL; /* the value we...
false
false
false
false
false
0
callback (SoupSession * session, SoupMessage * msg, gpointer user_data) { GstSoupHttpClientSink *souphttpsink = GST_SOUP_HTTP_CLIENT_SINK (user_data); GST_DEBUG_OBJECT (souphttpsink, "callback status=%d %s", msg->status_code, msg->reason_phrase); g_mutex_lock (&souphttpsink->mutex); g_cond_signal (&soup...
false
false
false
false
false
0
wfree(void *ptr, size_t size) { zone_t *zone; size_t rounded = zalloc_round(size); g_assert(ptr != NULL); g_assert(size_is_positive(size)); if G_UNLIKELY(walloc_stopped) return; if (rounded > WALLOC_MAX) { xfree(ptr); return; } zone = walloc_get_zone(rounded, FALSE); zfree(zone, ptr); }
false
false
false
false
false
0
onSelectionLost(FXObject* sender,FXSelector sel,void* ptr){ FXbool hadselection=hasSelection(); FXScrollArea::onSelectionLost(sender,sel,ptr); if (hadselection) { _scint->UnclaimSelection(); } return 1; }
false
false
false
false
false
0
click(int button, int time, unsigned int mods) { if (button == 4 || button == 2) { // wheel up m_slit.clientUp(&m_client); } else if (button == 5 || button == 3) { // wheel down m_slit.clientDown(&m_client); } else { m_client.setVisible(!m_client.visible()); ...
false
false
false
false
false
0
addr_expr_of_non_mem_decl_p_1 (tree addr, bool nortl) { if (TREE_CODE (addr) != ADDR_EXPR) return false; tree base = TREE_OPERAND (addr, 0); if (!DECL_P (base) || TREE_ADDRESSABLE (base) || DECL_MODE (base) == BLKmode) return false; if (!DECL_RTL_SET_P (base)) return nortl; return ...
false
false
false
false
false
0
cpu_check_up_prepare(int cpu) { if (!IS_ENABLED(CONFIG_HOTPLUG_CPU)) { atomic_set(&per_cpu(cpu_hotplug_state, cpu), CPU_UP_PREPARE); return 0; } switch (atomic_read(&per_cpu(cpu_hotplug_state, cpu))) { case CPU_POST_DEAD: /* The CPU died properly, so just start it up again. */ atomic_set(&per_cpu(cpu_hot...
false
false
false
false
false
0
getReferences() { IVector ret = HwMEBase::getReferences(); ret.push_back(_ggggvertex); ret.push_back(_gggvertex); ret.push_back(_qqgvertex); ret.push_back(_gluon); for(unsigned int ix=0;ix<_quark.size();++ix) {ret.push_back(_quark[ix]);} for(unsigned int ix=0;ix<_antiquark.size();++ix) {ret.push_b...
false
false
false
false
false
0
job_copy(job j) { job n; if (!j) return NULL; n = malloc(sizeof(struct job) + j->r.body_size); if (!n) return twarnx("OOM"), (job) 0; memcpy(n, j, sizeof(struct job) + j->r.body_size); n->next = n->prev = n; /* not in a linked list */ n->file = NULL; /* copies do not have refcnt on the w...
false
false
false
false
false
0
simple_object_fetch_attributes (simple_object_read *sobj, const char **errmsg, int *err) { void *data; simple_object_attributes *ret; data = sobj->functions->fetch_attributes (sobj, errmsg, err); if (data == NULL) return NULL; ret = XNEW (simple_object_attributes); ret->functions = sobj->functions;...
false
false
false
false
false
0
refresh() const { LYXERR(Debug::GUI, "Calling BC refresh()"); bool const all_valid = d->checkWidgets(); if (d->okay_) { bool const enabled = all_valid && policy().buttonStatus(ButtonPolicy::OKAY); d->okay_->setEnabled(enabled); } if (d->apply_) { bool const enabled = all_valid && policy().buttonStatu...
false
false
false
false
false
0
fill_entry(const dbmw_t *dw, struct cached *entry, void *value, size_t length) { /* * Try to reuse old entry arena if same size. * * Also handle case where value points to the cached entry data, since * that is likely to be the case when invoked from dbmw_write() (they * issued a dbmw_read() before and chan...
false
false
false
false
false
0
on_thread_exited(GArray *nodes) { const char *tid = parse_find_value(nodes, "id"); iff (tid, "no tid") { GtkTreeIter iter; if (!g_strcmp0(tid, gdb_thread)) set_gdb_thread(NULL, FALSE); if (find_thread(tid, &iter)) { gboolean was_selected = !g_strcmp0(tid, thread_id); thread_iter_unmark(&iter, GI...
false
false
false
false
false
0
slotAddPlayer(int selectedPlayerType) { PlayerGui *selectablePlayer = m_selectablePlayer[selectedPlayerType]; playersListModel *model = static_cast<playersListModel*>(m_w->playerList->model()); Player *player = model->addPlayer(selectablePlayer); if (player) { m_game->map()->addPlayerPlanetSom...
false
false
false
false
false
0
of_dma_request_slave_channel(struct device_node *np, const char *name) { struct of_phandle_args dma_spec; struct of_dma *ofdma; struct dma_chan *chan; int count, i; int ret_no_channel = -ENODEV; if (!np || !name) { pr_err("%s: not enough information provided\n", __func__); return ERR_PTR(-EN...
false
false
false
false
false
0
param_value(int i)const { switch (COMMON_BUILT_IN_BJT::param_count() - 1 - i) { case 0: return area.string(); case 1: return off.string(); case 2: return icvbe.string(); case 3: return icvce.string(); case 4: return temp_c.string(); default: return COMMON_COMPONENT::param_value(i); } }
false
false
false
false
false
0
kgd2kfd_interrupt(struct kfd_dev *kfd, const void *ih_ring_entry) { if (!kfd->init_complete) return; spin_lock(&kfd->interrupt_lock); if (kfd->interrupts_active && interrupt_is_wanted(kfd, ih_ring_entry) && enqueue_ih_ring_entry(kfd, ih_ring_entry)) schedule_work(&kfd->interrupt_work); spin_unlock(...
false
false
false
false
false
0
git_pqueue_pop(git_pqueue *pq) { void *rval = git_pqueue_get(pq, 0); if (git_pqueue_size(pq) > 1) { /* move last item to top of heap, shrink, and push item down */ pq->contents[0] = git_vector_last(pq); git_vector_pop(pq); pqueue_down(pq, 0); } else { /* all we need to do is shrink the heap in this case *...
false
false
false
false
false
0
parse_fstype (const struct parser_table* entry, char **argv, int *arg_ptr) { const char *typename; if (collect_arg(argv, arg_ptr, &typename)) { struct predicate *our_pred = insert_primary (entry); our_pred->args.str = typename; /* This is an expensive operation, so although there are *...
false
false
false
false
false
0
dump_ascii(int fd, PyObject *text) { PyASCIIObject *ascii = (PyASCIIObject *)text; Py_ssize_t i, size; int truncated; int kind; void *data = NULL; wchar_t *wstr = NULL; Py_UCS4 ch; size = ascii->length; kind = ascii->state.kind; if (ascii->state.compact) { if (ascii->sta...
false
false
false
true
false
1
eti_cancel_drag_due_to_model_change (ETableItem *eti) { if (eti->maybe_in_drag) { eti->maybe_in_drag = FALSE; if (!eti->maybe_did_something) e_selection_model_do_something (E_SELECTION_MODEL (eti->selection), eti->drag_row, eti->drag_col, eti->drag_state); } if (eti->in_drag) { eti->in_drag = FALSE; } }
false
false
false
false
false
0
assuan_register_command (assuan_context_t ctx, const char *cmd_name, assuan_handler_t handler, const char *help_string) { int i, cmd_index = -1; const char *s; if (cmd_name && !*cmd_name) cmd_name = NULL; if (!cmd_name) return _assuan_error (ctx, GPG_ERR_ASS_INV_VALUE); if ...
false
false
false
false
false
0
s_net_find(NET * net_head, NET * node) { NET *n_current; n_current = net_head; while (n_current != NULL) { if (n_current->nid == node->nid) { return (TRUE); } n_current = n_current->next; } return (FALSE); }
false
false
false
false
false
0
get_new_connections() { if (fds[0].revents & POLLRDNORM) { int newfd = accept_connection(listener); int i; for (i = 1; (i < NUM_FDS) && (fds[i].fd != -1); ++i) ; if (i == NUM_FDS) { logprintf(WarnMsg, "too many open connections; dropping a new one"); return; } fds[i].fd = newfd; /* now listenin...
false
false
false
false
false
0