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
query_stream_param(struct hdac_device *codec, hda_nid_t nid) { unsigned int streams = snd_hdac_read_parm(codec, nid, AC_PAR_STREAM); if (!streams || streams == -1) streams = snd_hdac_read_parm(codec, codec->afg, AC_PAR_STREAM); if (!streams || streams == -1) return 0; return streams; }
false
false
false
false
false
0
GC_reclaim1(hbp, hhdr, list COUNT_PARAM) register struct hblk *hbp; /* ptr to current heap block */ hdr * hhdr; register ptr_t list; COUNT_DECL { register word * mark_word_addr = &(hhdr->hb_marks[0]); register word *p, *plim; register word mark_word; register int i; NWORDS_DECL # define DO_OBJ(st...
false
false
false
false
false
0
register_mem_sect_under_node(struct memory_block *mem_blk, int nid) { int ret; unsigned long pfn, sect_start_pfn, sect_end_pfn; if (!mem_blk) return -EFAULT; if (!node_online(nid)) return 0; sect_start_pfn = section_nr_to_pfn(mem_blk->start_section_nr); sect_end_pfn = section_nr_to_pfn(mem_blk->end_section_...
false
false
false
false
false
0
ds2404_write_byte(struct device *dev, u8 byte) { int i; gpio_direction_output(ds2404_gpio[DS2404_DQ].gpio, 1); for (i = 0; i < 8; i++) { gpio_set_value(ds2404_gpio[DS2404_DQ].gpio, byte & (1 << i)); udelay(10); gpio_set_value(ds2404_gpio[DS2404_CLK].gpio, 1); udelay(10); gpio_set_value(ds2404_gpio[DS2404_...
false
false
false
false
false
0
png_set_PLTE(png_structp png_ptr, png_infop info_ptr, png_const_colorp palette, int num_palette) { png_debug1(1, "in %s storage function", "PLTE"); if (png_ptr == NULL || info_ptr == NULL) return; if (num_palette < 0 || num_palette > PNG_MAX_PALETTE_LENGTH) { if (info_ptr->color_type == P...
false
false
false
false
false
0
e_util_win_auto_resize_fill(E_Win *win) { E_Zone *zone = NULL; if (win->border) zone = win->border->zone; if ((!zone) && (win->container)) zone = e_util_zone_current_get(win->container->manager); if (zone) { int w, h; e_zone_useful_geometry_get(zone, NULL, NULL, &w, &h); ...
false
false
false
false
false
0
ao_null_close(ao_device *device) { ao_null_internal *internal = (ao_null_internal *) device->internal; adebug("%ld bytes sent to null device.\n", internal->byte_counter); return 1; }
false
false
false
false
false
0
local_setattr(vfile *vf, struct avstat *buf, int attrmask) { int res = 0; struct localfile *fi = local_vfile_file(vf); if((attrmask & (AVA_ATIME | AVA_MTIME)) != 0) res = local_set_time(fi, buf, attrmask); if((attrmask & AVA_MODE) != 0) res = local_set_mode(fi, buf->mode); if((attr...
false
false
false
false
false
0
_dxfClipped_Copy(Clipped old, enum _dxd_copy copy) { Clipped new; Object render, clipping; /* * Do recursive copy? * NB - no difference between COPY_HEADER and COPY_ATTRIBUTES * here, because we can't create a clipped object w/o subparts */ if (copy==COPY_HEADER || copy==COPY_ATTRIB...
false
false
false
false
false
0
kexec_calculate_store_digests(struct kimage *image) { struct crypto_shash *tfm; struct shash_desc *desc; int ret = 0, i, j, zero_buf_sz, sha_region_sz; size_t desc_size, nullsz; char *digest; void *zero_buf; struct kexec_sha_region *sha_regions; struct purgatory_info *pi = &image->purgatory_info; zero_buf = _...
false
false
false
false
false
0
syn_process_ps2_data (Gpm_Event *state, unsigned char *data) { /* gpm_report(GPM_PR_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); */ /* initialize the state */ state->buttons = 0; state->dx = 0; state->dy = 0; if (wmode_enabled) { syn_...
false
false
false
false
false
0
update() { for (unsigned int line=0; line != height; line+=4) { std::copy(in+line*width,in+(line+1)*width,out+(line*width)); std::fill(out+(line+1)*width,out+(line+5)*width,0x00000000); } }
false
false
false
false
false
0
ext2fs_allocate_block_bitmap(ext2_filsys fs, const char *descr, ext2fs_block_bitmap *ret) { __u64 start, end, real_end; EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS); fs->write_bitmaps = ext2fs_write_bitmaps; start = EXT2FS_B2C(fs, fs->super->s_first_data_block); end = EXT2FS_B2C(fs, ...
false
false
false
false
false
0
method_repr(PyMethodObject *a) { PyObject *self = a->im_self; PyObject *func = a->im_func; PyObject *klass; PyObject *funcname = NULL ,*klassname = NULL, *result = NULL; char *defname = "?"; if (self == NULL) { PyErr_BadInternalCall(); return NULL; } klass = (PyObject*)P...
false
false
false
false
false
0
alternatives_smp_module_add(struct module *mod, char *name, void *locks, void *locks_end, void *text, void *text_end) { struct smp_alt_module *smp; mutex_lock(&smp_alt); if (!uniproc_patched) goto unlock; if (num_possible_cpus() == 1) /* Don't bother remembering, we'll never have to u...
false
false
false
false
false
0
dso_open(const char *path) { struct dso_handle *h; h = calloc(1, sizeof(*h)); if (!h) return NULL; if (path) { h->handle = dlopen(path, RTLD_LAZY|RTLD_LOCAL); if (!h->handle) goto error; } else h->handle = RTLD_DEFAULT; return h; error: dso_...
false
false
false
false
false
0
gen_v8_14(struct ftio *ftio, int count) { struct fts3rec_v8_14 rec_v8_14; int i; bzero(&rec_v8_14, sizeof rec_v8_14); rec_v8_14.Last = 0xFFFF0000; rec_v8_14.dstaddr = 0xFFFF0000; rec_v8_14.output = 0xFF00; rec_v8_14.dstport = 0xFF00; for (i = 0; i < count; ++i) { rec_v8_14.dPkts ++; rec_v8_1...
false
false
false
false
false
0
ajRangeStrStuff(const AjPRange thys, const AjPStr instr, AjPStr *outstr) { ajuint nr; ajuint i; ajuint j; ajuint lasten = 0; ajuint lastst = 0; ajuint len; ajuint st; ajuint en; AjBool result = ajFalse; nr = thys->n; for(i = 0; i < nr; i++) { result = ajTrue; ...
false
false
false
false
false
0
Score(OBMol &mol, unsigned int index, const RotorKeys &keys, const std::vector<double*> &conformers) { energy_nrequest++; RotorKey cur_key = keys[index]; if (energy_map.size () > 0) { // Check that we haven't already computed this energy); mapRotorE...
false
false
false
false
false
0
Draw( void ) { mv.Draw(); DrawBack( panel ); DrawBox( panel, BOX_RAISED ); Widget *wd = widgets; while ( wd ) { if ( !wd->Hidden() ) wd->Draw(); wd = wd->next; } PrintCursorPos(); }
false
false
false
false
false
0
replaceRecordType(RecordTypeLoc &RTLoc, const std::string &Name) { const IdentifierInfo *TypeId = RTLoc.getType().getBaseTypeIdentifier(); SourceLocation LocStart = RTLoc.getLocStart(); // Loc could be invalid, for example: // class AAA { }; // class BBB:AAA { // public...
false
false
false
false
false
0
mpn_fft_fft (mp_ptr *Ap, mp_size_t K, int **ll, mp_size_t omega, mp_size_t n, mp_size_t inc, mp_ptr tp) { if (K == 2) { mp_limb_t cy; #if HAVE_NATIVE_mpn_add_n_sub_n cy = mpn_add_n_sub_n (Ap[0], Ap[inc], Ap[0], Ap[inc], n + 1) & 1; #else MPN_COPY (tp, Ap[0], n + 1); mpn_add_n (Ap[0],...
false
false
false
false
false
0
RawSend(Data &send, int timeout) { bool ret = m_jdwp.Write(m_socket, send, timeout); if (ret) barryverbose("JDWMessage::RawSend: Socket ID " << m_socket << "\nSent:\n" << send); }
false
false
false
false
false
0
GetSymbolStyleString(double dfAngle) { const char *pszStyle = NULL; int nOGRStyle = 1; char szPattern[20]; int nAngle = 0; szPattern[0] = '\0'; if (m_sSymbolDef.nSymbolNo == 31) nOGRStyle = 0; else if (m_sSymbolDef.nSymbolNo == 32) nOGRStyle = 6; else if (m_sSym...
false
false
false
false
false
0
EqSet ( Obj listL, Obj listR ) { Int lenL; /* length of the left operand */ Int lenR; /* length of the right operand */ Obj elmL; /* element of the left operand */ Obj ...
false
false
false
false
false
0
addEmptyPage(const QString &title) { if (!mPageTab) { kDebug(291) << "addPage: " << "Invalid layout"; return 0; } QFrame *const page = new QFrame(); page->setObjectName(title.toLatin1()); page->setFrameStyle(QFrame::NoFrame); mPageTab->addTab(page, title); return page; }
false
false
false
false
false
0
val_int() { DBUG_ASSERT(fixed == 1); uint year; MYSQL_TIME ltime; if (get_arg0_date(&ltime, TIME_NO_ZERO_DATE)) return 0; return (longlong) calc_week(&ltime, week_mode((uint) args[1]->val_int()), &year); }
false
false
false
false
false
0
init_simple(ndbuf_t *ndbuf, PyObject *items, PyObject *format, Py_ssize_t itemsize) { PyObject *mview; Py_buffer *base = &ndbuf->base; int ret; mview = PyMemoryView_FromBuffer(base); if (mview == NULL) return -1; ret = pack_from_list(mview, items, format, itemsize); Py_...
false
false
false
false
false
0
goo_canvas_points_unref (GooCanvasPoints *points) { if (--points->ref_count == 0) { g_slice_free1 (points->num_points * 2 * sizeof (double), points->coords); g_slice_free (GooCanvasPoints, points); } }
false
false
false
false
false
0
ms_transfer_data(struct realtek_pci_ms *host, unsigned char data_dir, u8 tpc, u8 cfg, struct scatterlist *sg) { struct rtsx_pcr *pcr = host->pcr; int err; unsigned int length = sg->length; u16 sec_cnt = (u16)(length / 512); u8 val, trans_mode, dma_dir; struct memstick_dev *card = host->msh->card; bool pro_card...
false
false
false
false
false
0
FB(const bool *whatd,const Mesh & Th,const Triangle & K,const R2 & PHat,RNMK_ & val) const { // // const Triangle & K(FE.T); R2 P(K(PHat)); R2 A(K[0]), B(K[1]),C(K[2]); // R l0=1-P.x-P.y,l1=P.x,l2=P.y; // R2 Dl0(K.H(0)), Dl1(K.H(1)), Dl2(K.H(2)); if (val.N() <3) throwassert(val.N() >=3); throwassert(...
false
false
false
false
false
0
cl_log_do_fflush(int do_fsync) { if (log_file.fp) { fflush(log_file.fp); if (do_fsync) fsync(fileno(log_file.fp)); } if (debug_file.fp) { fflush(debug_file.fp); if (do_fsync) fsync(fileno(debug_file.fp)); } }
false
false
false
false
false
0
sh_mmcif_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) { struct sh_mmcif_host *host = mmc_priv(mmc); struct device *dev = sh_mmcif_host_to_dev(host); unsigned long flags; spin_lock_irqsave(&host->lock, flags); if (host->state != STATE_IDLE) { dev_dbg(dev, "%s() rejected, state %u\n", __func__, host->sta...
false
false
false
false
false
0
gst_ogg_demux_sink_event (GstPad * pad, GstObject * parent, GstEvent * event) { gboolean res; GstOggDemux *ogg; ogg = GST_OGG_DEMUX (parent); switch (GST_EVENT_TYPE (event)) { case GST_EVENT_FLUSH_START: res = gst_ogg_demux_send_event (ogg, event); break; case GST_EVENT_FLUSH_STOP: G...
false
false
false
false
false
0
get_body(void) { if(fetched_) return true; // Already fetched body fetched_=true; // Even attempt counts valid_=false; // But object is invalid till whole body is available if(body_) free(body_); body_ = NULL; body_size_ = 0; // TODO: Check for methods and responses which can't have body char* result = NU...
false
false
false
false
false
0
_rocker_neigh_add(struct rocker *rocker, struct switchdev_trans *trans, struct rocker_neigh_tbl_entry *entry) { if (!switchdev_trans_ph_commit(trans)) entry->index = rocker->neigh_tbl_next_index++; if (switchdev_trans_ph_prepare(trans)) return; entry->ref_count++; hash_add(rocker->neigh_tbl, &...
false
false
false
false
false
0
cvthname(f) struct sockaddr_in *f; { struct hostent *hp; register char *p; int count; if (f->sin_family != AF_INET) { dprintf("Malformed from address.\n"); return ("???"); } hp = gethostbyaddr((char *) &f->sin_addr, sizeof(struct in_addr), \ f->sin_family); if (hp == 0) { dprintf("Host name for you...
false
false
false
false
false
0
do_update (int argc, char **argv, char *xoptions, char *xtag, char *xdate, int xforce, int local, int xbuild, int xaflag, int xprune, int xpipeout, int which, char *xjoin_rev1, char *xjoin_date1, char *xjoin_rev2, char *xjoin_date2, char *preload_update_dir, int xdotemplate, char *r...
false
false
false
false
false
0
ReInitDialog() { // Clear text fields and combobox wxTextCtrl* txt_FileTypes = XRCCTRL(*this, "txt_FileTypes", wxTextCtrl); txt_FileTypes->SetValue(_T("")); wxTextCtrl* txt_SingleComment = XRCCTRL(*this, "txt_SingleComment", wxTextCtrl); txt_SingleComment->SetValue(_T("")); wxTextCtrl* txt_Multi...
false
false
false
false
false
0
verify() { int size = sizeof(SCHED_SHMEM) + max_wu_results*sizeof(WU_RESULT); if (ss_size != size) return error_return("shmem"); if (platform_size != sizeof(PLATFORM)) return error_return("platform"); if (app_size != sizeof(APP)) return error_return("app"); if (app_version_size != sizeof(APP_VERSION...
false
false
false
false
false
0
qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { Q_ASSERT(staticMetaObject.cast(_o)); Scanner *_t = static_cast<Scanner *>(_o); switch (_id) { case 0: _t->windowFound((*reinterpret_cast< Window(*)>(_a[1])),(*reinte...
false
false
false
false
false
0
set_settings(struct net_device *dev, struct ethtool_cmd *cmd) { struct adapter *adapter = dev->ml_priv; struct port_info *p = &adapter->port[dev->if_port]; struct link_config *lc = &p->link_config; if (!(lc->supported & SUPPORTED_Autoneg)) return -EOPNOTSUPP; /* can't change speed/duplex */ if (cmd...
false
false
false
false
false
0
property_iter_free (gpointer key) { if (key != NULL) { PropertyIter *property_iter = key; g_object_unref (property_iter->interval); g_object_unref (property_iter->alpha); g_slice_free (PropertyIter, property_iter); } }
false
false
false
false
false
0
atp_open(struct input_dev *input) { struct atp *dev = input_get_drvdata(input); if (usb_submit_urb(dev->urb, GFP_ATOMIC)) return -EIO; dev->open = 1; return 0; }
false
false
false
false
false
0
wr_header(void) { const route_head* pres_track; const route_head* track; struct tm* tm; time_t date; static const char dflt_str[] = "Unknown"; const char* str; waypoint* wpt; get_tracks(&pres_track, &track); if (!track && pres_track) { track = pres_track; } // Date in header record is that of...
false
false
false
false
false
0
PrintSelf(ostream& os, vtkIndent indent) { this->Superclass::PrintSelf(os,indent); if ( this->Loop ) { os << indent << "Loop of " << this->Loop->GetNumberOfPoints() << " points defined\n"; } else { os << indent << "Loop not defined\n"; } os << indent << "Automatic Normal Generat...
false
false
false
false
false
0
sparsematrix_new(int R, int C) { int i; sparsematrix_t* sp = calloc(1, sizeof(sparsematrix_t)); sp->R = R; sp->C = C; sp->rows = calloc(R, sizeof(bl)); for (i=0; i<R; i++) bl_init(sp->rows + i, 16, sizeof(entry_t)); return sp; }
false
false
false
false
false
0
_secret_gen_collection_call_create_item_sync ( SecretGenCollection *proxy, GVariant *arg_properties, GVariant *arg_secret, gboolean arg_replace, gchar **out_item, gchar **out_prompt, GCancellable *cancellable, GError **error) { GVariant *_ret; _ret = g_dbus_proxy_call_sync (G_DBUS_PR...
false
false
false
false
false
0
ark_pci_remove(struct pci_dev *dev) { struct fb_info *info = pci_get_drvdata(dev); if (info) { struct arkfb_info *par = info->par; arch_phys_wc_del(par->wc_cookie); dac_release(par->dac); unregister_framebuffer(info); fb_dealloc_cmap(&info->cmap); pci_iounmap(dev, info->screen_base); pci_release_regio...
false
false
false
false
false
0
print_containing_files () { FILE_BUF *ip = NULL; int i; int first = 1; /* If stack of files hasn't changed since we last printed this info, don't repeat it. */ if (last_error_tick == input_file_stack_tick) return; for (i = indepth; i >= 0; i--) if (instack[i].fname != NULL) { ip = &ins...
false
false
false
false
false
0
nxt6000_setup(struct dvb_frontend* fe) { struct nxt6000_state* state = fe->demodulator_priv; nxt6000_writereg(state, RS_COR_SYNC_PARAM, SYNC_PARAM); nxt6000_writereg(state, BER_CTRL, /*(1 << 2) | */ (0x01 << 1) | 0x01); nxt6000_writereg(state, VIT_BERTIME_2, 0x00); // BER Timer = 0x000200 * 256 = 131072 bits nxt...
false
false
false
false
false
0
make_cmp_localize(Block *b, const int amax, Lm **lm, const int vnum, IntSet local_var, const int level) { Cmp_localize *cl; if (b->cmp_localize == NULL) { cl = alloc_cmp_localize(); } else { cl = b->cmp_localize; } set_cmp_localize(b, cl, b->modu...
false
false
false
false
false
0
c_end_compound_stmt (location_t loc, tree stmt, bool do_scope) { tree block = NULL; if (do_scope) { if (c_dialect_objc ()) objc_clear_super_receiver (); block = pop_scope (); } stmt = pop_stmt_list (stmt); stmt = c_build_bind_expr (loc, block, stmt); /* If this compound statement is ne...
false
false
false
false
false
0
instantiateList(UVector& list, UErrorCode& ec) { UVector tlist(ec); if (U_FAILURE(ec)) { goto RETURN; } tlist.setDeleter(_deleteTransliteratorTrIDPars); Transliterator* t; int32_t i; for (i=0; i<=list.size(); ++i) { // [sic]: i<=list.s...
false
false
false
false
false
0
bs_thread_request_done(int fd, int events, void *data) { struct scsi_cmd *cmd; int nr_events, ret; ret = read(done_fd[0], &nr_events, sizeof(nr_events)); if (ret < 0) { eprintf("wrong wakeup\n"); return; } while (!list_empty(&ack_list)) { cmd = list_first_entry(&ack_list, struct scsi_cmd, bs_li...
false
false
false
false
false
0
setup_style_and_decor( FvwmWindow *fw, window_style *pstyle, short *buttons) { /* first copy the static styles into the window struct */ memcpy(&(FW_COMMON_FLAGS(fw)), &(SCF(*pstyle)), sizeof(common_flags_t)); fw->wShaped = None; if (FShapesSupported) { int i; unsigned int u; Bool b; int boundingS...
false
false
false
false
false
0
getDotStandIn(UErrorCode& status) { if (dotStandIn == (UChar) -1) { UnicodeSet* tempus = new UnicodeSet(UnicodeString(TRUE, DOT_SET, -1), status); // Null pointer check. if (tempus == NULL) { status = U_MEMORY_ALLOCATION_ERROR; return (UChar)0x0000; } ...
false
false
false
false
false
0
katoob_big_info(const std::string& message, bool enable_insert) { Gtk::Dialog dlg; Gtk::ScrolledWindow sw; sw.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); Gtk::TextView tv; tv.set_editable(false); tv.get_buffer()->set_text(message); sw.add(tv); dlg.get_vbox()->pack_start(sw, true, true); ...
false
false
false
false
false
0
theme_loaded_cb (GogGraph *graph) { if (gog_theme_get_name (graph->theme) == NULL) return TRUE; apply_theme (GOG_OBJECT (graph), graph->theme, FALSE); return FALSE; }
false
false
false
false
false
0
IMG_RegisterMimeTypes(const GF_InputService *plug){ u32 i; if (!plug){ GF_LOG(GF_LOG_MEDIA, GF_LOG_ERROR, ("IMG_RegisterMimeTypes : plug is NULL !!\n")); } for (i = 0 ; IMG_MIME_TYPES[i]; i+=3) gf_term_register_mime_type(plug, IMG_MIME_TYPES[i], IMG_MIME_TYPES[i+1], IMG_MIME_TYPES[i+2]); ...
false
false
false
false
false
0
OCSP_id_issuer_cmp(OCSP_CERTID *a, OCSP_CERTID *b) { int ret; ret = OBJ_cmp(a->hashAlgorithm->algorithm, b->hashAlgorithm->algorithm); if (ret) return ret; ret = ASN1_OCTET_STRING_cmp(a->issuerNameHash, b->issuerNameHash); if (ret) return ret; return ASN1_OCTET_STRING_cmp(a->issuerKeyHash, b->issuerKeyHash); }
false
false
false
false
false
0
saveGame() { if(!database()->isReadOnly()) { databaseInfo()->saveGame(); database()->index()->setTag("Length", QString::number((game().plyCount() + 1) / 2), gameIndex()); m_gameList->updateFilter(); slotFilterChanged(); slotGameChanged(); game().setModified(false)...
false
false
false
false
false
0
cx23885_set_audclk_freq(struct i2c_client *client, u32 freq) { struct cx25840_state *state = to_state(i2c_get_clientdata(client)); if (state->aud_input != CX25840_AUDIO_SERIAL) { switch (freq) { case 32000: case 44100: case 48000: /* We don't have register values * so avoid destroying registers. */ ...
false
false
false
false
false
0
loadConfig(KConfig *_config, bool reparse ) { if ( reparse ) _config->reparseConfiguration(); KConfigGroup dlgGroup(_config, "Cookie Dialog"); m_showCookieDetails = dlgGroup.readEntry( "ShowCookieDetails" , false ); m_preferredPolicy = static_cast<KCookieDefaultPolicy>(dlgGroup.readEntry("Prefe...
false
false
false
false
false
0
disable_write(const UDTSOCKET& uid, set<int>& eids) { CGuard pg(m_EPollLock); map<int, CEPollDesc>::iterator p; vector<int> lost; for (set<int>::iterator i = eids.begin(); i != eids.end(); ++ i) { p = m_mPolls.find(*i); if (p == m_mPolls.end()) { lost.push_back(*i); } ...
false
false
false
false
false
0
tcp_seg_prepend_connection(u_char *pkt, int pktlen) { ELEM *new, *list = NULL; struct ip *iph = (struct ip *)pkt; int ip_hl = iph->ip_hl * 4; struct tcphdr *tcph = (struct tcphdr *)(pkt + ip_hl); u_char *data; if ((tcph->th_flags & TH_SYN) == 0) return NULL; /* Add our decoy SYN packet. */ if (!(d...
false
true
false
false
false
1
operator==(const ToolbarPrefs& other) { return id == other.id && name == other.name && keys == other.keys && dock == other.dock && // dirty == other.dirty && on == other.on && locked == other.locked && // stretchable == other.stretchable && // index == ot...
false
false
false
false
false
0
expr(Home home, IntConLevel icl) const { Region r(home); return NNF::nnf(r,n,false)->expr(home,icl); }
false
false
false
false
false
0
_pvcreate_write(struct cmd_context *cmd, struct pv_to_create *pvc) { int zero = pvc->pp->zero; struct physical_volume *pv = pvc->pv; struct device *dev = pv->dev; const char *pv_name = dev_name(dev); /* Wipe existing label first */ if (!label_remove(pv_dev(pv))) { log_error("Failed to wipe existing label on %s...
true
true
false
false
false
1
isBoundaryPoint(LineIntersector *li, vector<Node*> *tstBdyNodes) { if ( ! tstBdyNodes ) return false; for(vector<Node*>::iterator i=tstBdyNodes->begin();i<tstBdyNodes->end();i++) { Node *node=*i; const Coordinate& pt=node->getCoordinate(); if (li->isIntersection(pt)) return true; } return false; }
false
false
false
false
false
0
getLatency(LLVMDisasmContext *DC, const MCInst &Inst) { // Try to compute scheduling information. const MCSubtargetInfo *STI = DC->getSubtargetInfo(); const MCSchedModel SCModel = STI->getSchedModel(); const int NoInformationAvailable = -1; // Check if we have a scheduling model for instructions. if (!SCMo...
false
false
false
false
false
0
replace_object(struct alisp_instance *instance, struct alisp_object * name, struct alisp_object * onew) { struct alisp_object_pair *p; struct alisp_object *r; struct list_head *pos; const char *id; if (!alisp_compare_type(name, ALISP_OBJ_IDENTIFIER) && !alisp_compare_type(name, ALISP_OBJ_STRING)) { del...
false
false
false
false
false
0
doAutoScrollBars() { int viewW = width() - frameWidth() - minViewX(); int viewH = height() - frameWidth() - minViewY(); bool vScrollOn = testTableFlags(Tbl_vScrollBar); bool hScrollOn = testTableFlags(Tbl_hScrollBar); int w = 0; int h = 0; int i; if ( testTableFlags(Tbl_autoHScrollBar)...
false
false
false
false
false
0
acpi_pci_irq_lookup(struct pci_dev *dev, int pin) { struct acpi_prt_entry *entry = NULL; struct pci_dev *bridge; u8 bridge_pin, orig_pin = pin; int ret; ret = acpi_pci_irq_find_prt_entry(dev, pin, &entry); if (!ret && entry) { #ifdef CONFIG_X86_IO_APIC acpi_reroute_boot_interrupt(dev, entry); #endif /* CONFIG_...
false
false
false
false
false
0
parser_skip_whitespace(char **cur) { for (; isspace(**cur); (*cur)++) {} }
false
true
false
false
false
1
cd_util_get_devices_by_kind (CdUtilPrivate *priv, gchar **values, GError **error) { CdDevice *device; gboolean ret = TRUE; GPtrArray *array = NULL; guint i; if (g_strv_length (values) < 1) { ret = FALSE; g_set_error_literal (error, 1, 0, "Not enough arguments, " "expected device kin...
false
false
false
false
false
0
is_ancestor(struct seccomp_filter *parent, struct seccomp_filter *child) { /* NULL is the root ancestor. */ if (parent == NULL) return 1; for (; child; child = child->prev) if (child == parent) return 1; return 0; }
false
false
false
false
false
0
FtypemapN_box(CTX ctx, ksfp_t *sfp _RIX) { kTypeMap *tmr = sfp[K_TMRIDX].tmr; // N RETURN_(new_Boxing(ctx, sfp, ClassTBL(tmr->scid))); }
false
false
false
false
false
0
button_new_toggle (gint w, gint h, gint nx, gint ny, gint px, gint py, gint pnx, gint pny, gint ppx, gint ppy, SkinPixmapId si1, SkinPixmapId si2) { GtkWidget * button = button_new_base (BUTTON_TYPE_TOGGLE, w, h); ButtonData * data = g_object_get_data ((GObject *) button, "buttondata"); g_return_val_if_fai...
false
false
false
false
false
0
getBinCoeff(int i, int j) { if(i >= NBIN || j >= NBIN) throw "Error in integral_info getBinCoeff: (i >= NBIN || j >= NBIN)."; return BinCoeffs[i*NBIN+j]; }
false
false
false
false
true
1
is_chmod_supported(const char *file_path) { struct stat st1, st2; static int _is_supported = -1; if (_is_supported > -1) return _is_supported; if (p_stat(file_path, &st1) < 0) return false; if (p_chmod(file_path, st1.st_mode ^ S_IXUSR) < 0) return false; if (p_stat(file_path, &st2) < 0) return false; ...
false
false
false
false
false
0
treeFinishCom (FILE *fp, char **strp) { /* treeFinishCom */ int ch; while ((ch = getc(fp)) != EOF && ch != ']') { if (strp != NULL) *(*strp)++ = ch; /* save character */ if (ch == '[') { /* nested comment; find its end */ if ((ch = treeFinishCom(fp, strp)) == EOF...
false
false
false
false
false
0
cmci_supported(int *banks) { u64 cap; if (mca_cfg.cmci_disabled || mca_cfg.ignore_ce) return 0; /* * Vendor check is not strictly needed, but the initial * initialization is vendor keyed and this * makes sure none of the backdoors are entered otherwise. */ if (boot_cpu_data.x86_vendor != X86_VENDOR_INTE...
false
false
false
false
false
0
pscsi_transport_complete(struct se_cmd *cmd, struct scatterlist *sg, unsigned char *sense_buffer) { struct pscsi_dev_virt *pdv = PSCSI_DEV(cmd->se_dev); struct scsi_device *sd = pdv->pdv_sd; int result; struct pscsi_plugin_task *pt = cmd->priv; unsigned char *cdb; /* * Special case for REPORT_LUNs hand...
false
true
false
false
false
1
nzn_val(GwyDataField *data_field, gint i, gint j) { gint ch, ip, jp; ch = 0; for (ip = -1; ip <= 1; ip++) { for (jp = -1; jp <= 1; jp++) { if (!(ip == 0 && jp == 0)) ch += pixel_status(data_field, i + ip, j + jp); } } return ch; }
false
false
false
false
false
0
pulse_sinks_watch(Pulse *conn) { Pulse_Tag *tag; uint32_t type = PA_COMMAND_SUBSCRIBE; EINA_SAFETY_ON_NULL_RETURN_VAL(conn, EINA_FALSE); tag = calloc(1, sizeof(Pulse_Tag)); EINA_SAFETY_ON_NULL_RETURN_VAL(tag, EINA_FALSE); tag->dsize = 3 * PA_TAG_SIZE_U32; tag->data = malloc(tag->dsize); tag->ta...
false
false
false
false
false
0
rank3(graph_t * g, aspect_t * asp) { Agnode_t *n; int i; int iterations = asp->nextIter; double lastAR = MAXDOUBLE; computeNodeGroups(g); /* groups of UF DS nodes */ for (i = 0; (i < iterations) || (iterations == -1); i++) { /* initialize all ranks to be 0 */ for (n = agfstnode(g); n; n = ag...
false
false
false
false
false
0
_clean_symtbl(gp_object_type *object) { gp_symbol_type *current = NULL; gp_symbol_type *next_symbol = NULL; gp_symbol_type *old_symbol = NULL; unsigned int i; current = object->symbols; while (current != NULL) { /* assign section pointer, section numbers start at 1 not 0 */ if (current->section...
false
false
false
false
false
0
cmddb_enum(cmddb_enum_func_t func, void *user_data) { int i; for (i = 0; i < ARRAY_LEN(commands); i++) if (func(user_data, &commands[i]) < 0) return -1; return 0; }
false
false
false
false
false
0
__padata_stop(struct padata_instance *pinst) { if (!(pinst->flags & PADATA_INIT)) return; pinst->flags &= ~PADATA_INIT; synchronize_rcu(); get_online_cpus(); padata_flush_queues(pinst->pd); put_online_cpus(); }
false
false
false
false
false
0
pk_backend_spawn_helper_va_list (PkBackendSpawn *backend_spawn, PkBackendJob *job, const gchar *executable, va_list *args) { gboolean ret; gchar *filename; gchar **argv; gchar **envp; PkHintEnum background; GError *error = NULL; PkBackendSpawnPrivate *priv = backend_spawn->priv; #if PK_BUILD_LOCAL...
false
false
false
false
false
0
setAllowSpace(bool allow) { TokenizerLanguageMultiLevel* multi = getTokens()->get_language()->getMulti(); if (allow) multi->resetEndToken(' '); else multi->setEndToken(' '); }
false
false
false
false
false
0
filter_lua(GtArray *filters, GtFeatureNode *fn, GtSelectLogic logic, bool *select_node, GtError *err) { int had_err = 0; unsigned long i; gt_assert(filters && fn && select_node); gt_error_check(err); for (i = 0; !had_err && i < gt_array_size(filters); i++) { bool result; GtScrip...
false
false
false
false
false
0
generate_cdfname(int startseq, char *vname, char **oldval) { struct varname *vp = lookuphash(vname); int ch, cnt; FILE *result; if (!vp->vn_value || vp->vn_value[0] == '\0') { fprintf(stderr, "%s not defined in control file\n", vname); exit(10); } if ((int) strlen(vp->vn_value) > 70 || strchr(vp->vn_value...
false
false
false
false
false
0
clip_lerp_x(int val, int m, int x0, int y0, int x1, int y1, int *out) { int v0out = m ? x0 > val : x0 < val; int v1out = m ? x1 > val : x1 < val; if (v0out + v1out == 0) return INSIDE; if (v0out + v1out == 2) return OUTSIDE; if (v1out) { *out = y0 + (int)(((float)(y1 - y0)) * (val - x0) / (x1 - x0)); r...
false
false
false
false
false
0
write_ordered_buffers(spinlock_t * lock, struct reiserfs_journal *j, struct reiserfs_journal_list *jl, struct list_head *list) { struct buffer_head *bh; struct reiserfs_jh *jh; int ret = j->j_errno; struct buffer_chunk chunk; struct list_head tmp; INIT_LIST_HEAD(&tmp); chunk.nr = 0; spin_lock(lo...
false
false
false
false
false
0
cave_unlight(struct point_set *ps) { int i; /* Apply flag changes */ for (i = 0; i < ps->n; i++) { int y = ps->pts[i].y; int x = ps->pts[i].x; /* No longer in the array */ cave->info[y][x] &= ~(CAVE_TEMP); /* Darken the grid */ cave->info[y][x] &= ~(CAVE_GLOW); /* Hack -- Forget "boring" grids */ ...
false
false
false
false
false
0
reformatBoundingItemSpacing() { reformatBoundingItemSpacing(topOfSelection().block()); reformatBoundingItemSpacing(bottomOfSelection().block()); }
false
false
false
false
false
0
printElapTime( FLMUINT64 ui64ElapTime, char* pszBuffer, JustificationType eJustify, FLMBOOL bTimeIsMilli) { FLMUINT uiHours; FLMUINT uiMinutes; FLMUINT uiSeconds; FLMUINT uiMilli = 0; if (bTimeIsMilli) { uiHours = (FLMUINT) (ui64ElapTime / (FLMUINT64) (1000 * 3600)); uiMinutes = (FLMUINT) ((ui64...
false
false
false
false
false
0
lookup_softdep(struct kmod_ctx *ctx, const char * const * array, unsigned int count) { struct kmod_list *ret = NULL; unsigned i; for (i = 0; i < count; i++) { const char *depname = array[i]; struct kmod_list *lst = NULL; int err; err = kmod_module_new_from_lookup(ctx, depname, &lst); if (err < 0) { ER...
false
false
false
false
false
0