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
append_to_open_fork_cb (GObject *source_object, GAsyncResult *res, gpointer user_data) { GVfsAfpVolume *volume = G_VFS_AFP_VOLUME (source_object); GVfsJobOpenForWrite *job = G_VFS_JOB_OPEN_FOR_WRITE (user_data); GVfsBackendAfp *afp_backend = G_VFS_BACKEND_AFP (job->backend); gint16 fork_refnum; GError *err =...
false
false
false
false
false
0
vidioc_s_fmt_vbi_cap(struct file *file, void *priv, struct v4l2_format *f) { struct cx231xx_fh *fh = priv; struct cx231xx *dev = fh->dev; if (dev->vbi_stream_on && !fh->stream_on) { dev_err(dev->dev, "%s device in use by another fh\n", __func__); return -EBUSY; } return vidioc_try_fmt_vbi_cap(file, p...
false
false
false
false
false
0
p1d_activate (gint state, displayd * display, ggobid * gg) { GList *slist; splotd *sp; GGobiData *d = display->d; if (state) { for (slist = display->splots; slist; slist = slist->next) { sp = (splotd *) slist->data; if (sp->p1dvar >= d->ncols) sp->p1dvar = 0; } varpanel_refresh ...
false
false
false
false
false
0
ccmp_encrypt ( struct net80211_crypto *crypto, struct io_buffer *iob ) { struct ccmp_ctx *ctx = crypto->priv; struct ieee80211_frame *hdr = iob->data; struct io_buffer *eiob; const int hdrlen = IEEE80211_TYP_FRAME_HEADER_LEN; int datalen = iob_len ( iob ) - hdrlen; struct ccmp_head head; struct ccmp_nonce ...
false
false
false
false
false
0
InitializeImpl(const OptionsList& options, const std::string& prefix) { ma77_default_control(&control_); control_.f_arrays = 1; // Use Fortran numbering (faster) control_.bits=32; // FIXME: HSL_MA77 should be updated to allow a matrix with new // values to be refactorized after a -11 (singul...
false
false
false
false
false
0
sched_free_deps (rtx head, rtx tail, bool resolved_p) { rtx insn; rtx next_tail = NEXT_INSN (tail); for (insn = head; insn != next_tail; insn = NEXT_INSN (insn)) if (INSN_P (insn) && INSN_LUID (insn) > 0) { /* Clear resolved back deps together with its dep_nodes. */ delete_dep_nodes_in_back_deps (in...
false
false
false
false
false
0
clock_sweep() { int sweep_period = (regs [0] & period_mask) >> 4; if ( sweep_period && sweep_delay && !--sweep_delay ) { sweep_delay = sweep_period; regs [3] = sweep_freq & 0xFF; regs [4] = (regs [4] & ~0x07) | (sweep_freq >> 8 & 0x07); int offset = sweep_freq >> (regs [0] & shift_mask); if ( regs [0] & 0...
false
false
false
false
false
0
QuadNormal(HPoint3 *v[4], Point3 *nu_av) { int n; HPoint3 *v1, *v2, *v3, **vp; Point3 nu; nu_av->x = nu_av->y = nu_av->z = 0.0; n = 4; v1 = v[n-2]; v2 = v[n-1]; vp = v; #define ANTI(P,Q) \ ((v2->P - v1->P) * (v3->Q - v1->Q) - \ (v2->Q - v1->Q) * (v3->P - v1->P)) do { v3 = *vp++;...
false
false
false
false
false
0
use_cmd(UAContext *ua, const char *cmd) { CAT *oldcatalog, *catalog; close_db(ua); /* close any previously open db */ oldcatalog = ua->catalog; if (!(catalog = get_catalog_resource(ua))) { ua->catalog = oldcatalog; } else { ua->catalog = catalog; } if (open_db(ua...
false
false
false
false
false
0
_join(CueMemPool *pool, const char *sep, CueList *list) { size_t len; char *buf; CueListNode *cur; const size_t seplen = strlen(sep); cur = cue_list_head(list); len = 0; while (cur != NULL) { len += strlen((const char *)cur->data); if (cur->next) len += seplen; c...
false
true
false
false
false
1
focus_sidebar(void) { if (ui_prefs.sidebar_visible) { gint page_num = gtk_notebook_get_current_page(GTK_NOTEBOOK(main_widgets.sidebar_notebook)); GtkWidget *page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(main_widgets.sidebar_notebook), page_num); /* gtk_widget_grab_focus() won't work because of the scrolled win...
false
false
false
false
false
0
key_event( GtkWidget *input, GdkEventKey *event ) { XKeyEvent xevent; switch( event->type ) { case GDK_KEY_PRESS: xevent.type = KeyPress; break; case GDK_KEY_RELEASE: xevent.type = KeyRelease; break; default: return FALSE; } xevent.display = gdk_x11_get_default_xd...
false
false
false
false
false
0
get_Q(int i, int len) const { Qfloat *data; int j, real_i = index[i]; if(cache->get_data(real_i,&data,l) < l) { for(j=0;j<l;j++) data[j] = (Qfloat)(this->*kernel_function)(real_i,j); } // reorder and copy Qfloat *buf = buffer[next_buffer]; next_buffer = 1 - next_buffer; schar si = sign[i]; ...
false
false
false
false
false
0
zzip_disk_fread(void *ptr, zzip_size_t sized, zzip_size_t nmemb, ZZIP_DISK_FILE * file) { zzip_size_t size = sized * nmemb; if (size > file->avail) size = file->avail; if (file->stored) { memcpy(ptr, file->stored, size); file->stored += size; file->avail -...
false
false
false
false
false
0
rxdesc_get_next(struct mueslix_channel *channel, m_uint32_t rxd_addr) { m_uint32_t nrxd_addr; switch(channel->parent->chip_mode) { case 0: nrxd_addr = rxd_addr + sizeof(struct rx_desc); if (nrxd_addr == channel->rx_end) nrxd_addr = channel->rx...
false
false
false
false
false
0
get_image_info (GUPnPDLNAGstImageInformation *gst_info) { GUPnPDLNAGstImageInformationPrivate *priv = gst_info->priv; if (!priv->image_info) { GList *iter; if (!priv->stream_list) { priv->stream_list = gst_discovere...
false
false
false
false
false
0
ex_spell(eap) exarg_T *eap; { spell_add_word(eap->arg, (int)STRLEN(eap->arg), eap->cmdidx == CMD_spellwrong, eap->forceit ? 0 : (int)eap->line2, eap->cmdidx == CMD_spellundo); }
false
false
false
false
false
0
getGlyph(int ch) { FaceData *face_data = (FaceData *) cairo_font_face_get_user_data(iCairoFont, &key); if (!face_data->iFace) // face is not available return 0; if (type() == Font::EType1) return iGlyphIndex[ch]; else return FT_Get_Char_Index(face_data->iFace, (FT_ULong) ch); }
false
false
false
false
false
0
usb_get_location(struct usb_device *dev) { if(!dev->dev) { return 0; } return (dev->bus << 16) | dev->address; }
false
false
false
false
false
0
decode_base(uint8_t type, uint16_t *loc) { if (type == 0) *loc = WORD(pc++); /* Large constant. */ else if(type == 1) *loc = BYTE(pc); /* Small constant. */ else if(type == 2) *loc = variable(BYTE(pc)); /* Variable. */ else return 0; /* Omitted. */ pc++; return 1; }
false
false
false
false
false
0
checkNext() { Word w = m_filter->nextWord(); if (w.end) { emit done(); return; } if (KDE_ISUNLIKELY( m_dict.isMisspelled(w.word) )) { //kDebug()<<"found misspelling "<< w.word; emit misspelling(w.word, w.start); //wait for the handler. the parent will decide itse...
false
false
false
false
false
0
inet_get_sockaddr(int sockfd, const char *devname, struct sockaddr_in *sin_addr) { int ret; struct ifreq ifr; text_copy(ifr.ifr_ifrn.ifrn_name, devname); ret = ioctl(sockfd, SIOCGIFADDR, &ifr); if (ret < 0) { print_error("get deivce %s sockaddr", devname); return ret; } *sin_addr = *(struct sockaddr_in *...
false
false
false
false
false
0
print_version (void) { int year; int day; char buff[64]; char month[64]; memset (buff, 0, sizeof(buff)); memset (month, 0, sizeof(month)); day = 0; year = 0; sscanf (__DATE__, "%s %d %d", month, &day, &year); if (day && year) { sprintf (buff, "%s %2.2d %4.4d %s", month, day, year, __TIME__); } else { sp...
true
true
false
false
true
1
sfip_is_loopback(const sfip_t *ip) { const unsigned int *p; ARG_CHECK1(ip, 0); if(sfip_family(ip) == AF_INET) { // 127.0.0.0/8 is IPv4 loopback return (ip->ip8[0] == 0x7f); } p = ip->ip32; /* Check the first 64 bits in an IPv6 address, and */ /* verify they're zero. If n...
false
false
false
false
false
0
i40evf_remove(struct pci_dev *pdev) { struct net_device *netdev = pci_get_drvdata(pdev); struct i40evf_adapter *adapter = netdev_priv(netdev); struct i40evf_mac_filter *f, *ftmp; struct i40e_hw *hw = &adapter->hw; cancel_delayed_work_sync(&adapter->init_task); cancel_work_sync(&adapter->reset_task); if (adapte...
false
false
false
false
false
0
match(char const* pattern, char const* str) { while (*pattern && *str) { if (*pattern == '*') { SKIP_STARS(pattern); while (*str) { if (*pattern == '?') return match(pattern, str); else if (*str != *pattern) ...
false
false
false
false
false
0
refresh_from_database_blank() { if(m_find_mode) return refresh_from_database(); if(m_refListStore) { m_refListStore->clear(); //Remove all rows. } return true; }
false
false
false
false
false
0
SVGParseGlyphBody(SplineChar *sc, xmlNodePtr glyph,int *flags) { xmlChar *path; path = _xmlGetProp(glyph,(xmlChar *) "d"); if ( path!=NULL ) { sc->layers[ly_fore].splines = SVGParseExtendedPath(glyph,glyph); _xmlFree(path); } else { Entity *ent = SVGParseSVG(glyph,sc->parent->ascent+sc->parent->desc...
true
true
false
false
false
1
kernel_version(void) { struct utsname utsname; unsigned long major, minor, patch; char *p; if (uname(&utsname) < 0) { fprintf(stderr, "uname failed: %s\n", strerror(errno)); return -1; } p = utsname.release; major = strtoul(p, &p, 10); if (major == ULONG_MAX) { fprintf(stderr, "strtoul failed: %s\n", st...
false
false
false
false
false
0
__memp_init_config(env, mp, create) ENV *env; MPOOL *mp; int create; { DB_ENV *dbenv; dbenv = env->dbenv; MPOOL_SYSTEM_LOCK(env); if (create) { mp->mp_mmapsize = (db_size_t)dbenv->mp_mmapsize; mp->mp_maxopenfd = dbenv->mp_maxopenfd; mp->mp_maxwrite = dbenv->mp_maxwrite; mp->mp_maxwrite_sleep = dbenv->m...
false
false
false
false
false
0
intersect(const ImmutableComparison &other) const { _check_comparison_compatibility(this, &other); MutableComparison cmp(_top_length, _bottom_length, _windowsize); // easy to do: just go through & grab. matches_iterator iter1, iter2; for (iter1 = _matches.begin(); iter1 != _matches.end(); iter1++) { ...
false
false
false
false
false
0
intel_uncore_check_errors(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev->dev_private; if (HAS_FPGA_DBG_UNCLAIMED(dev) && (__raw_i915_read32(dev_priv, FPGA_DBG) & FPGA_DBG_RM_NOCLAIM)) { DRM_ERROR("Unclaimed register before interrupt\n"); __raw_i915_write32(dev_priv, FPGA_DBG, FPGA_DBG_RM...
false
false
false
false
false
0
FDKaacEnc_Index2Parcor( const INT *index, FIXP_DBL *RESTRICT parcor, const INT order, const INT bitsPerCoeff ) { INT i; for(i=0; i<order; i++) parcor[i] = bitsPerCoeff == 4 ? FDKaacEnc_tnsEncCoeff4[index[i]+8] : FDKaacEnc_tnsEncCoeff3[index[i]+4]; }
false
false
false
false
false
0
ttusb_iso_irq(struct urb *urb) { struct ttusb *ttusb = urb->context; struct usb_iso_packet_descriptor *d; u8 *data; int len, i; if (!ttusb->iso_streaming) return; #if 0 printk("%s: status %d, errcount == %d, length == %i\n", __func__, urb->status, urb->error_count, urb->actual_length); #endif ...
false
false
false
false
false
0
myhypot(double a, double b) /* sqrt(a^2 + b^2) numerically stable. */ { double r = 0; if (fabs(a) > fabs(b)) { r = b/a; r = fabs(a)*sqrt(1+r*r); } else if (b != 0) { r = a/b; r = fabs(b)*sqrt(1+r*r); } return r; }
false
false
false
false
false
0
get_operand_regtype_str( int regtype, char *str, int len ) { static struct { char *name; int value; } operand_regtypes[] = { {"reg_gen" , 0x00001}, {"reg_in" , 0x00002}, {"reg_out" , 0x00004}, {"reg...
false
false
false
false
false
0
cmd_show_idle_pc_prop(hypervisor_conn_t *conn,int argc,char *argv[]) { vm_instance_t *vm; cpu_gen_t *cpu; int i; if (!(vm = hypervisor_find_object(conn,argv[0],OBJ_TYPE_VM))) return(-1); if (!(cpu = find_cpu(conn,vm,atoi(argv[1])))) return(-1); for(i=0;i<cpu->idle_pc_prop_count;i++) { ...
false
false
false
false
true
1
free_vpid(int vpid) { if (!enable_vpid || vpid == 0) return; spin_lock(&vmx_vpid_lock); __clear_bit(vpid, vmx_vpid_bitmap); spin_unlock(&vmx_vpid_lock); }
false
false
false
false
false
0
io_start_multiplex_out(int fd) { io_flush(FULL_FLUSH); if (msgs2stderr && DEBUG_GTE(IO, 2)) rprintf(FINFO, "[%s] io_start_multiplex_out(%d)\n", who_am_i(), fd); if (!iobuf.msg.buf) alloc_xbuf(&iobuf.msg, ROUND_UP_1024(IO_BUFFER_SIZE)); iobuf.out_empty_len = 4; /* See also OUT_MULTIPLEXED */ io_start_bufferi...
false
false
false
false
false
0
_dxf_ExReceivePeerPacket(SlavePeers *sp) { DistMsg type; int graphId; UIPackage pkg; if(_dxf_ExReceiveBuffer(sp->sfd, &type, 1, TYPE_INT, sp->SwapMsg) < 0) { #if 0 DXUIMessage("ERROR", "bad distributed packet type %d", type); return(ERROR); #endif _dxf_ExDie("b...
false
false
false
false
false
0
crc32_buf(const void *buf, size_t size) { uint32_t crc = ~0; const uint8_t *p = buf; while (size--) crc = (crc >> 8) ^ crc32tab[(crc ^ (*p++)) & 0xFF]; return ~crc; }
false
false
false
false
false
0
admin_space_left_action_parser(struct nv_pair *nv, int line, struct daemon_conf *config) { int i; audit_msg(LOG_DEBUG, "admin_space_left_action_parser called with: %s", nv->value); for (i=0; failure_actions[i].name != NULL; i++) { if (strcasecmp(nv->value, failure_actions[i].name) == 0) { if (failur...
false
false
false
false
true
1
gst_apexraop_write_bits (guchar * buffer, int data, int numbits, int *bit_offset, int *byte_offset) { const static guchar masks[] = { 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF }; if (((*bit_offset) != 0) && (((*bit_offset) + numbits) > 8)) { gint numwritebits; guchar bitstowrite; numwri...
false
false
false
false
false
0
zzip_fread(void *ptr, zzip_size_t size, zzip_size_t nmemb, ZZIP_FILE * file) { if (! size) size = 1; return zzip_read(file, ptr, size * nmemb) / size; }
false
false
false
false
false
0
writeMasterControl() { bool error = false; VPrint( 1, "Writing OTF master control\n" ); // trigger phase pre hook theHooks->triggerPhaseHook( HooksC::Phase_WriteMasterControl_pre ); const std::string tmp_out_file_prefix = Params.out_file_prefix + TmpFileSuffix; // open file manager // ...
false
false
false
false
false
0
mkP(P *pln, INT n, INT is, INT os, R *ro, R *io, planner *plnr) { plan *cld1 = (plan *) 0; plan *cld2 = (plan *) 0; plan *cld_omega = (plan *) 0; R *buf = (R *) 0; /* initial allocation for the purpose of planning */ buf = (R *) MALLOC(sizeof(R) * (n - 1) * 2, BUFFERS); cld1...
false
false
false
false
false
0
LDAP_get_string_value(HDB * db, LDAPMessage * entry, const char *attribute, char **ptr) { struct berval **vals; vals = ldap_get_values_len(HDB2LDAP(db), entry, attribute); if (vals == NULL || vals[0] == NULL) { *ptr = NULL; return HDB_ERR_NOENTRY; } *ptr = malloc(vals[0]->bv_len + 1); ...
false
false
false
false
false
0
batch_queue_type_from_string(const char *str) { if(!strcmp(str, "condor")) return BATCH_QUEUE_TYPE_CONDOR; if(!strcmp(str, "sge")) return BATCH_QUEUE_TYPE_SGE; if(!strcmp(str, "moab")) return BATCH_QUEUE_TYPE_MOAB; if(!strcmp(str, "torque")) return BATCH_QUEUE_TYPE_TORQUE; if(!strcmp(str, "cluster")) ret...
false
false
true
false
true
1
getHash (name) char *name; { int hashValue = hashval (name, HASHSIZE); if (!name || !*name) return NIL; if (name && !strcmp (lastname ? lastname : "", name)) return lastentry; else strcpy (lastname, name); if (!hashTable[hashValue].name) { /* nothing found */ lastentry = NIL; ret...
false
false
false
false
false
0
vect_pattern_recog (loop_vec_info loop_vinfo) { struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo); basic_block *bbs = LOOP_VINFO_BBS (loop_vinfo); unsigned int nbbs = loop->num_nodes; gimple_stmt_iterator si; unsigned int i, j; vect_recog_func_ptr vect_recog_func; VEC (gimple, heap) *stmts_to_replace = VEC...
false
false
false
false
false
0
address_read_file(struct pci_slot *slot, char *buf) { if (slot->number == 0xff) return sprintf(buf, "%04x:%02x\n", pci_domain_nr(slot->bus), slot->bus->number); else return sprintf(buf, "%04x:%02x:%02x\n", pci_domain_nr(slot->bus), slot->bus->number, slot->number); }
false
true
false
false
false
1
retrieveSvg(ViewLayer::ViewLayerID viewLayerID, QHash<QString, QString> & svgHash, bool blackOnly, double dpi, double & factor) { QString xml = ""; switch (viewLayerID) { case ViewLayer::Copper0: case ViewLayer::Copper1: case ViewLayer::PartImage: //case ViewLayer::Silkscreen0: case ViewLayer::Silkscreen1:...
false
false
false
false
false
0
genecs() { register int i, j; int numrows; out_str_dec( C_int_decl, "yy_ec", csize ); for ( i = 1; i < csize; ++i ) { if ( caseins && (i >= 'A') && (i <= 'Z') ) ecgroup[i] = ecgroup[clower( i )]; ecgroup[i] = ABS( ecgroup[i] ); mkdata( ecgroup[i] ); } dataend(); if ( trace ) { fputs( _( "\n...
false
false
false
false
false
0
FreeWild(count, files) int count; char_u **files; { if (count <= 0 || files == NULL) return; #if defined(__EMX__) && defined(__ALWAYS_HAS_TRAILING_NULL_POINTER) /* XXX */ /* * Is this still OK for when other functions than expand_wildcards() have * been used??? */ _fnexplodefree...
false
false
false
false
false
0
create_m4_override_file () { FILE *f; m4_override_file = "gnet-gsch2pcb-tmp.scm"; f = fopen (m4_override_file, "wb"); if (!f) { m4_override_file = NULL; return; } if (m4_pcbdir) fprintf (f, "(define gsch2pcb:pcb-m4-dir \"%s\")\n", m4_pcbdir); if (m4_files) fprintf (f, "(define gsch2pcb:m4...
false
false
false
false
true
1
findMaxExternalIds(int& max_ext_nd_id, int& max_ext_el_id) { enum fidapKeywordId keyword = FIDAP_NO_ID; bool count_only = true; while ( !infile.eof() ) { // Read new line readFileLine(infile, read_buffer); // Check if it was an interesting keyword line keyword = next_is_keyword_line(read_buffer...
false
false
false
false
false
0
pause_board (gboolean pause) { if(gcomprisBoard==NULL) return; if ( LoadNextLevelAfterEndOfBonusDisplay==TRUE && pause==FALSE ) { LoadNextLevelAfterEndOfBonusDisplay = FALSE; if(increment_sublevel()) StartLevel( ); } board_paused = pause; }
false
false
false
false
false
0
lheapAdd(L_HEAP *lh, void *item) { PROCNAME("lheapAdd"); if (!lh) return ERROR_INT("lh not defined", procName, 1); if (!item) return ERROR_INT("item not defined", procName, 1); /* If necessary, expand the allocated array by a factor of 2 */ if (lh->n >= lh->nal...
false
false
false
false
false
0
_copyPrepareStmt(PrepareStmt *from) { PrepareStmt *newnode = makeNode(PrepareStmt); COPY_STRING_FIELD(name); COPY_NODE_FIELD(argtypes); COPY_NODE_FIELD(argtype_oids); COPY_NODE_FIELD(query); return newnode; }
false
false
false
false
false
0
lex_tail(void) { const char *t = lex_expression + lex_offset; while(*t == ' ') t++; lex_offset = n_strlen(lex_expression); return t; }
false
false
false
false
false
0
libssh2_scp_send64(LIBSSH2_SESSION *session, const char *path, int mode, libssh2_int64_t size, time_t mtime, time_t atime) { LIBSSH2_CHANNEL *ptr; BLOCK_ADJUST_ERRNO(ptr, session, scp_send(session, path, mode, size, mtime, atime)); return ptr; }
false
false
false
false
false
0
readBookmarks() { if ( QFile::exists( QDir::currentDirPath() + "/.bookmarks" ) ) { QFile f( QDir::currentDirPath() + "/.bookmarks" ); f.open( QIODevice::ReadOnly ); QDataStream s( &f ); s >> bookmarks; f.close(); } }
false
false
false
false
false
0
f_ibeta(union argument *arg) { struct value a; double x; double arg1; double arg2; (void) arg; /* avoid -Wunused warning */ x = real(pop(&a)); arg2 = real(pop(&a)); arg1 = real(pop(&a)); x = ibeta(arg1, arg2, x); if (x == -1.0) { undefined = TRUE; push(Ginteger(&a, 0)); ...
false
false
false
false
false
0
as_mysql_register_ctld(mysql_conn_t *mysql_conn, char *cluster, uint16_t port) { char *query = NULL; char *address = NULL; char hostname[255]; time_t now = time(NULL); uint32_t flags = slurmdb_setup_cluster_flags(); int rc = SLURM_SUCCESS; if (slurmdbd_conf) fatal("clusteracct_storage_g_register_ctld " ...
false
false
false
false
false
0
set_mem_attrs_for_spill (rtx mem) { alias_set_type alias; rtx addr, offset; tree expr; expr = get_spill_slot_decl (true); alias = MEM_ALIAS_SET (DECL_RTL (expr)); /* We expect the incoming memory to be of the form: (mem:MODE (plus (reg sfp) (const_int offset))) with perhaps the plus missing for offs...
false
false
false
false
false
0
brute_awa(uint16_t but, uint16_t somme, uint8_t lng) { uint8_t p; static uint8_t const tbl_car[]={'0','1','2','3','4','5','6'}; if (lng==0) return (but==somme); else for (p=0;p<4;p++) if (brute_awa(but, rol(somme) + tbl_car[p], lng-1)) { awa_res[awa_pos++]=tbl_car[p]; return 1; ...
false
false
false
false
false
0
getPostWord(UT_sint32& iLength) const { iLength = m_iSentenceEnd - m_iStartIndex + 1; // If it ever becomes necessary to mutate the pre-word, allocate // space to m_pMutatedString and return it. Caller will consume // that buffer before calling any other function. if (0 >= iLength) return NULL; return reint...
false
false
false
false
false
0
hasbom(const std::string &str) { return bool(str.size() >= 3 && static_cast<unsigned char>(str[0]) == 0xef && static_cast<unsigned char>(str[1]) == 0xbb && static_cast<unsigned char>(str[2]) == 0xbf); }
false
false
false
false
false
0
luaX_newstring (LexState *ls, const char *str, size_t l) { lua_State *L = ls->L; TValue *o; /* entry for `str' */ TString *ts = luaS_newlstr(L, str, l); /* create new string */ setsvalue2s(L, L->top++, ts); /* temporarily anchor it in stack */ o = luaH_set(L, ls->fs->h, L->top - 1); if (ttisnil(o)) { /*...
false
false
false
false
false
0
ds1wm_isr(int isr, void *data) { struct ds1wm_data *ds1wm_data = data; u8 intr; u8 inten = ds1wm_read_register(ds1wm_data, DS1WM_INT_EN); /* if no bits are set in int enable register (except the IAS) than go no further, reading the regs below has side effects */ if (!(inten & DS1WM_INTEN_NOT_IAS)) return IRQ_NO...
false
false
false
false
false
0
fl_set_xyplot_mark_active( FL_OBJECT * ob, int y ) { FLI_XYPLOT_SPEC *sp = ob->spec; int old = sp->mark_active; if ( old != y ) { sp->mark_active = y; fl_redraw_object( ob ); } return old; }
false
false
false
false
false
0
DateTimeCompare(const struct tm *tm1, const struct tm *tm2) { int compare_date = DateCompare(tm1, tm2); if(compare_date) return compare_date; // Different days // We are in the same day. Let's check the time int compare_time = TimeCompare(tm1, tm2); if(compare_time) return compare_time; // Diffe...
false
false
false
false
false
0
mlx4_en_dcbnl_ieee_getmaxrate(struct net_device *dev, struct ieee_maxrate *maxrate) { struct mlx4_en_priv *priv = netdev_priv(dev); int i; for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) maxrate->tc_maxrate[i] = priv->maxrate[i] * MLX4_RATELIMIT_UNITS_IN_KB; return 0; }
false
false
false
false
false
0
ParseContentMessage( SignalingProtocol protocol, const buzz::XmlElement* action_elem, bool expect_transports, const ContentParserMap& content_parsers, const TransportParserMap& trans_parsers, SessionInitiate* init, ParseError* error) { init->owns_contents = true; if (protocol == PROTOCOL...
false
false
false
false
false
0
epr_add_ptr_array_elem(EPR_SPtrArray* ptr_array, void* elem) { assert(ptr_array != NULL); assert(ptr_array->elems != NULL); if (ptr_array->length + 1 > ptr_array->capacity) { int status = epr_grow_ptr_array(ptr_array, 2 * ptr_array->capacity); if (status != 0) return status; ...
false
false
false
false
false
0
chartXtoDateTime( qreal x ) const { assert( startDateTime.isValid() ); int days = static_cast<int>( x/dayWidth ); qreal secs = x*( 24.*60.*60. )/dayWidth; QDateTime dt = startDateTime; QDateTime result = dt.addDays( days ) .addSecs( static_cast<int>(secs-(days*24.*60.*60.) ) )...
false
false
false
false
false
0
g_web_set_accept(GWeb *web, const char *format, ...) { va_list args; gboolean result; if (web == NULL) return FALSE; va_start(args, format); result = set_accept_option(web, format, args); va_end(args); return result; }
false
false
false
false
false
0
fm10k_ndo_set_vf_vlan(struct net_device *netdev, int vf_idx, u16 vid, u8 qos) { struct fm10k_intfc *interface = netdev_priv(netdev); struct fm10k_iov_data *iov_data = interface->iov_data; struct fm10k_hw *hw = &interface->hw; struct fm10k_vf_info *vf_info; /* verify SR-IOV is active and that vf idx is valid ...
false
false
false
false
false
0
lowerSTORE(SDValue Op, SelectionDAG &DAG) const { StoreSDNode &Nd = *cast<StoreSDNode>(Op); if (Nd.getMemoryVT() != MVT::f64 || !NoDPLoadStore) return MipsTargetLowering::lowerSTORE(Op, DAG); // Replace a double precision store with two extractelement64s and i32 stores. SDLoc DL(Op); SDValue Val = Nd.ge...
false
false
false
false
false
0
simple_action(Packet *p_in) { const click_ip *iph_in = p_in->ip_header(); const click_icmp *icmph_in = p_in->icmp_header(); if (p_in->transport_length() < (int) sizeof(click_icmp_sequenced) || iph_in->ip_p != IP_PROTO_ICMP || icmph_in->icmp_type != ICMP_ECHO) { if (noutputs() == 2) output(1).push(p_...
false
false
false
false
false
0
_comedi_data_write(comedi_t *it,unsigned int subdev,unsigned int chan,unsigned int range, unsigned int aref,lsampl_t data) { subdevice *s; if(!valid_chan(it,subdev,chan)) return -1; s=it->subdevices+subdev; if(it->has_insnlist_ioctl){ comedi_insn insn; memset(&insn,0,sizeof(insn)); insn.insn = INSN_W...
false
false
false
false
false
0
CJointStereo_Read( HANDLE_FDK_BITSTREAM bs, CJointStereoData *pJointStereoData, const int windowGroups, const int scaleFactorBandsTransmitted, const UINT flags ) { int group,band; pJointStereoData->MsMaskPresent = (UCHAR) FDKreadBits(bs,2); FDKmemclear(pJointStere...
false
false
false
false
false
0
mark_my_descriptor_dirty_if_too_old(time_t now) { networkstatus_t *ns; const routerstatus_t *rs; const char *retry_fast_reason = NULL; /* Set if we should retry frequently */ const time_t slow_cutoff = now - FORCE_REGENERATE_DESCRIPTOR_INTERVAL; const time_t fast_cutoff = now - FAST_RETRY_DESCRIPTOR_INTERVAL;...
false
false
false
false
false
0
vrml_end_edge(GVJ_t *job) { if (IsSegment) finishSegment(job, job->obj->u.e); gvputs(job, "] }\n"); }
false
false
false
false
false
0
CompareStrings(Handle<String> s1, Handle<String> s2) { s1 = FlattenGetString(s1); s2 = FlattenGetString(s2); LineEndsWrapper line_ends1(s1); LineEndsWrapper line_ends2(s2); LineArrayCompareInput input(s1, s2, line_ends1, line_ends2); TokenizingLineArrayCompareOutpu...
false
false
false
false
false
0
xmlSecGnuTLSAppKeyLoadMemory(const xmlSecByte* data, xmlSecSize dataSize, xmlSecKeyDataFormat format, const char *pwd, void* pwdCallback, void* pwdCallbackCtx) { xmlSecKeyPtr key; xmlSecAssert2(data != NULL, NULL); xmlSecAssert2(format != xmlSecKeyDataFormatU...
false
false
false
false
false
0
hash_superfast(const char *key, unsigned int len) { /* Paul Hsieh (http://www.azillionmonkeys.com/qed/hash.html) * used by WebCore (http://webkit.org/blog/8/hashtables-part-2/) * EFL's eina and possible others. */ unsigned int tmp, hash = len, rem = len & 3; const unsigned short *itr = (const unsigned short *)...
false
false
false
false
false
0
mg_update_xtext (GtkWidget *wid) { GtkXText *xtext = GTK_XTEXT (wid); gtk_xtext_set_palette (xtext, colors); gtk_xtext_set_max_lines (xtext, prefs.hex_text_max_lines); gtk_xtext_set_tint (xtext, prefs.hex_text_tint_red, prefs.hex_text_tint_green, prefs.hex_text_tint_blue); gtk_xtext_set_background (xtext, channel...
false
false
false
false
false
0
must_be_deep_in_do( int how_deep ) { int functional_depth = do_loop_depth; if ( incolon ) { functional_depth -= last_colon_do_depth; } if ( functional_depth < how_deep ) { char deep_do[64] = ""; int indx; bool prefix = FALSE; for ( indx = 0; indx < how_deep ; indx ++ ) { strca...
true
true
false
false
false
1
print_module_array_def_use(Module_table *module_head) { Module_table *mpt; mpt = module_head; while(mpt != NULL){ if(mpt->kind != MODULE_BLOCKDATA){ print_block_array_def_use(mpt->block_head); } if(make_memory_access_region_table_flg && mpt->memory_access_region_head != NULL) { print...
false
false
false
false
false
0
request_disconnect (TpAccountChannelRequest *self) { if (self->priv->invalidated_sig == 0) return; g_assert (self->priv->chan_request != NULL); g_signal_handler_disconnect (self->priv->chan_request, self->priv->invalidated_sig); self->priv->invalidated_sig = 0; g_signal_handler_disconnect (self->...
false
false
false
false
false
0
amdmsEvalSmoothData(void *henv, double x) { amdmsFIT_SMOOTH_DATA_ENV *env = (amdmsFIT_SMOOTH_DATA_ENV*)henv; if (env == NULL) { return 0.0; } else { return amdmsEvalData(&(env->env), x); } }
false
false
false
false
false
0
collidecheck(int b, int y, int x) /* is this location on the selected zboard adjacent to a ship? */ { bool collide; /* anything on the square */ if ((collide = IS_SHIP(board[b][x][y])) != FALSE) return (collide); /* anything on the neighbors */ if (!closepack) { int i; for (i = 0; i < 8; i++) ...
false
false
false
false
false
0
checkattributevalue(LDAP *ld, char *dn, char *attribute, char **attrvalues, int *mask) { int st=0, one=1; char **values=NULL, *attributes[2] = {NULL}; LDAPMessage *result=NULL, *entry=NULL; if (strlen(dn) == 0) { ...
false
false
false
false
false
0
pwd_command() { char *save_file = NULL; save_file = (char *) gp_alloc(PATH_MAX, "print current dir"); if (save_file) { GP_GETCWD(save_file, PATH_MAX); fprintf(stderr, "%s\n", save_file); free(save_file); } c_token++; }
false
false
false
false
false
0
control_config_axis_default(int axis) { Assert(axis >= 0); if ( axis > 1 ) { if (Axis_map_to_defaults[axis] < 0) { return -1; } if (!joystick.axis_valid[Axis_map_to_defaults[axis]]) { return -1; } } return Axis_map_to_defaults[axis]; }
false
false
false
false
false
0
flash_area(struct Map_info *Map, plus_t area, struct line_pnts *Points, int flash_colr) { struct line_pnts *Points_i; int i, j, isle, n_isles, n_points; double xl, yl; Points_i = Vect_new_line_struct(); /* fill */ Vect_get_area_points(Map, area, Points); n_points = Points->n_points; ...
false
false
false
false
false
0
cb_scroll_wheel (GtkWidget *w, GdkEventScroll *event, WBCGtk *wbcg) { SheetControlGUI *scg = wbcg_get_scg (wbcg, wbcg_focus_cur_scg (wbcg)); Sheet *sheet = scg_sheet (scg); /* scroll always operates on pane 0 */ GnmPane *pane = scg_pane (scg, 0); gboolean go_horiz = (event->direction == GDK_SCROLL_LEFT || ...
false
false
false
false
false
0
SRP_create_verifier(const char *user, const char *pass, char **salt, char **verifier, const char *N, const char *g) { int len; char * result=NULL; char *vf; BIGNUM *N_bn = NULL, *g_bn = NULL, *s = NULL, *v = NULL; unsigned char tmp[MAX_LEN]; unsigned char tmp2[MAX_LEN]; char * defgNid = NULL; if ((user =...
false
false
false
false
false
0
makeStorePath(const string & type, const Hash & hash, const string & name) { /* e.g., "source:sha256:1abc...:/nix/store:foo.tar.gz" */ string s = type + ":sha256:" + printHash(hash) + ":" + nixStore + ":" + name; checkStoreName(name); return nixStore + "/" + printHash32(compressHas...
false
false
false
false
false
0