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
sfmtv(cchar *fmt, va_list arg) { mprAssert(fmt); return mprAsprintfv(fmt, arg); }
false
false
false
false
false
0
testing_util_engine_free (PeasEngine *engine_) { /* In case a test needs to free the engine */ if (engine != NULL) { g_object_unref (engine_); /* Make sure that at the end of every test the engine is freed */ g_assert (engine == NULL); } /* Pop the log hooks so the test cases don't hav...
false
false
false
false
false
0
js_alloc_sftbl_entry(void *priv, const void *key) { size_t nbytes = offsetof(ScriptFilenameEntry, filename) + strlen((const char *) key) + 1; return (JSHashEntry *) js_malloc(JS_MAX(nbytes, sizeof(JSHashEntry))); }
false
false
false
false
false
0
alberta_calloc(size_t size, size_t elsize, const char *fct, const char *file, int line) { FUNCNAME("alberta_calloc"); void *mem; if (size <= 0 || elsize <= 0) { ERROR("one of size = %d or data size = %d is zero\n", size, elsize); ALLOC_ERR(fct, file, line); } if (!(mem = CALLOC(size,elsiz...
false
false
false
false
true
1
optimize_code6(FILE *lf) { unsigned i, j; int changed = 0; code_t *c0, *c1, *c2; char *s; for(i = 0; i < code_size; i++) { c0 = code + i; c1 = code + (j = next_code(i)); c2 = code + (j = next_code(j)); if( c0->type == t_int && c0->value.u == 0 && c1->type == t_int && (c1->value.u ...
false
false
false
false
false
0
ShiftBreakpoint(cb::shared_ptr<DebuggerBreakpoint> bp, int nroflines) { // notify driver if it is active if (m_pDriver) { m_pDriver->RemoveBreakpoint(bp); bp->line += nroflines; m_pDriver->AddBreakpoint(bp); } else bp->line += nroflines; }
false
false
false
false
false
0
gee_set_base_init (GeeSetIface * iface) { static gboolean initialized = FALSE; if (!initialized) { initialized = TRUE; /** * The read-only view of this set. */ g_object_interface_install_property (iface, g_param_spec_object ("read-only-view", "read-only-view", "read-only-view", GEE_TYPE_SET, G_PARAM_STATI...
false
false
false
false
false
0
build_dentry_path(struct dentry *dentry, const char **ppath, int *ppathlen, u64 *pino, int *pfreepath) { char *path; struct inode *dir; rcu_read_lock(); dir = d_inode_rcu(dentry->d_parent); if (dir && ceph_snap(dir) == CEPH_NOSNAP) { *pino = ceph_ino(dir); rcu_read_unlock(); *ppath = dentry-...
false
false
false
false
false
0
FileEditComment(char * TempFileName, char * Comment, int CommentSize) { FILE * file; int a; char QuotedPath[PATH_MAX+10]; file = fopen(TempFileName, "w"); if (file == NULL){ fprintf(stderr, "Can't create file '%s'\n",TempFileName); ErrFatal("could not create temporary file"); } ...
true
true
false
false
true
1
alloc_root(struct super_block *sb) { int err; struct inode *inode; struct dentry *root; err = -ENOMEM; inode = au_iget_locked(sb, AUFS_ROOT_INO); err = PTR_ERR(inode); if (IS_ERR(inode)) goto out; inode->i_op = aufs_iop + AuIop_DIR; /* with getattr by default */ inode->i_fop = &aufs_dir_fop; inode->i_mode...
false
false
false
false
false
0
compiler_listcomp(struct compiler *c, expr_ty e) { assert(e->kind == ListComp_kind); ADDOP_I(c, BUILD_LIST, 0); return compiler_listcomp_generator(c, e->v.ListComp.generators, 0, e->v.ListComp.elt); }
false
false
false
false
false
0
gtk_combo_box_get_active_text( GtkComboBox *psComboBox ) { GtkTreeIter sIter; gchar *pnText = NULL; GtkTreeModel *psModel = gtk_combo_box_get_model( psComboBox ); if ( gtk_combo_box_get_active_iter( psComboBox, &sIter ) ) { gtk_tree_model_get( psModel, &sIter, 0, &pnText, -1 ); } return pnText; }
false
false
false
false
false
0
draw_chars(struct view *view, enum line_type type, const char *string, int max_len, bool use_tilde) { static char out_buffer[BUFSIZ * 2]; int len = 0; int col = 0; int trimmed = FALSE; size_t skip = view->yoffset > view->col ? view->yoffset - view->col : 0; if (max_len <= 0) return 0; len = utf8_length(&...
false
false
false
false
false
0
cfile_init(char *exe_dir, char *cdrom_dir) { int i; // initialize encryption encrypt_init(); if ( !cfile_inited ) { char buf[CFILE_ROOT_DIRECTORY_LEN]; cfile_inited = 1; memset(buf, 0, CFILE_ROOT_DIRECTORY_LEN); strncpy(buf, exe_dir, CFILE_ROOT_DIRECTORY_LEN - 1); i = strlen(buf); // are we in a r...
false
false
false
false
false
0
_gdk_pixbuf_load_module (GdkPixbufModule *image_module, GError **error) { gboolean ret; gboolean locked = FALSE; /* be extra careful, maybe the module initializes * the thread system */ if (g_threads_got_initialized) { G...
false
false
false
false
false
0
reader_process ( void *data ) /* executed as a child process */ { int status; FILE *fp; Pie_Scanner * scanner; sigset_t ignore_set; struct SIGACTION act; scanner = (Pie_Scanner *)data; if (sanei_thread_is_forked ()) { close ( scanner->pipe ); sigfillset (&ignore_set); ...
false
false
false
false
false
0
subj_hash_table_clear(SUBJECT **subj_ht) { SUBJECT *loop, *next; long i; for (i = 0 ; i < HASH_SIZE ; i++) { for (loop = subj_ht[i] ; loop ; loop = next) { next = loop->hash_next; XtFree(loop->subject); XtFree((char *)loop); } subj_ht[i] = NULL; } }
false
false
false
false
false
0
applicable_action(int action, const State* s) { assert(s); assert(action >=0 && action < gnum_op_conn); assert(gop_conn[action].num_E == 1); int ef = gop_conn[action].E[0]; // Only check if all known preconditions present in the state for (int j=0;j<gef_conn[ef].num_PC;j++) { int p = gef_conn[ef].PC[j]; if (...
false
false
false
false
false
0
Pk11Install_Pair_Print(Pk11Install_Pair* _this, int pad) { while (_this) { /*PAD(pad); printf("**Pair\n"); PAD(pad); printf("***Key====\n");*/ PAD(pad); printf("%s {\n", _this->key); /*PAD(pad); printf("====\n");*/ /*PAD(pad); printf("***ValueList\n");*/ Pk11Install_ValueList_Print(_this->list,pad+PADINC);...
false
false
false
false
false
0
FetchParent() { int id = m_Community->GetParentId(); if(id) { mdo::Community* parent = new mdo::Community; m_Community->SetParentCommunity(parent); parent->SetId(m_Community->GetParentId()); mws::Community remote; remote.SetWebAPI(mws::WebAPI::Instance()); remote.SetObject(parent); ...
false
false
false
false
false
0
ToUpper(std::string s) { std::string u; for (std::string::size_type i = 0; i < s.length(); i++) { u.append(1, static_cast<char>(toupper(s[i]))); } return u; }
false
false
false
false
false
0
httpCreateStage(Http *http, cchar *name, int flags, MprModule *module) { HttpStage *stage; mprAssert(http); mprAssert(name && *name); if ((stage = httpLookupStage(http, name)) != 0) { if (!(stage->flags & HTTP_STAGE_UNLOADED)) { mprError("Stage %s already exists", name); ...
false
false
false
false
false
0
GetSliceSize(void) { int limit; int n; limit = (pcsound_sample_rate * MAX_SOUND_SLICE_TIME) / 1000; // Try all powers of two, not exceeding the limit. for (n=0;; ++n) { // 2^n <= limit < 2^n+1 ? if ((1 << (n + 1)) > limit) { return (1 << n); } ...
false
false
false
false
false
0
inlineScan(InlineScanState *iss) { aggr = aggr->inlineScan(iss); if (body) body = body->inlineScan(iss); return this; }
false
false
false
false
false
0
LUKS_PBKDF2_performance_check(const char *hashSpec, uint64_t *PBKDF2_per_sec, struct crypt_device *ctx) { if (!*PBKDF2_per_sec) { if (PBKDF2_performance_check(hashSpec, PBKDF2_per_sec) < 0) { log_err(ctx, _("Not compatible PBKDF2 options (using hash algorithm %s).\n"), hashSpec); return -EINVAL; ...
false
false
false
false
false
0
__log_inmem_lsnoff(dblp, lsnp, offsetp) DB_LOG *dblp; DB_LSN *lsnp; size_t *offsetp; { LOG *lp; struct __db_filestart *filestart; lp = (LOG *)dblp->reginfo.primary; SH_TAILQ_FOREACH(filestart, &lp->logfiles, links, __db_filestart) if (filestart->file == lsnp->file) { *offsetp = (u_int32_t) (filesta...
false
false
false
false
false
0
gigaset_m10x_input(struct inbuf_t *inbuf) { struct cardstate *cs = inbuf->cs; unsigned numbytes, procbytes; gig_dbg(DEBUG_INTR, "buffer state: %u -> %u", inbuf->head, inbuf->tail); while (inbuf->head != inbuf->tail) { /* check for DLE escape */ handle_dle(inbuf); /* process a contiguous block of bytes */ ...
false
false
false
false
false
0
decode(Char *to, const char *s, size_t slen, const char **rest) { size_t n = decoder_->decode(to, s, slen, rest); for (size_t i = 0; i < n; i++) to[i] = (*map_)[to[i]]; return n; }
false
false
false
false
false
0
transform (guint32 * src, guint32 * dest, gint video_area, gint edge_a, gint edge_b) { guint32 in, red, green, blue; gint x; for (x = 0; x < video_area; x++) { in = *src++; red = (in >> 16) & 0xff; green = (in >> 8) & 0xff; blue = (in) & 0xff; red = abs_int (cos_from_table ((red + edge_...
false
false
false
false
false
0
radeon_miptree_create(radeonContextPtr rmesa, GLenum target, mesa_format mesaFormat, GLuint baseLevel, GLuint numLevels, GLuint width0, GLuint height0, GLuint depth0, GLuint tilebits) { radeon_mipmap_tree *mt = CALLOC_STRUCT(_radeon_mipmap_tree); radeon_print(RADEON_TEXTURE, RADEON_NORMAL, "%s(%p) ne...
false
false
false
false
false
0
init_perdim(struct perdim **pdp, int dim) { /* allocate zero so uninitialized pointers are NULL. */ *pdp = (struct perdim *)DXAllocateZero(sizeof(struct perdim)); if (! *pdp) return ERROR; if (((*pdp)->binsplus1 = (int *)DXAllocate(dim * sizeof(int))) == NULL) goto error; if ((...
false
false
false
false
false
0
wsm_channel_switch_indication(struct cw1200_common *priv, struct wsm_buf *buf) { WARN_ON(WSM_GET32(buf)); priv->channel_switch_in_progress = 0; wake_up(&priv->channel_switch_done); wsm_unlock_tx(priv); return 0; underflow: return -EINVAL; }
false
false
false
false
false
0
Perl_op_scope(pTHX_ OP *o) { dVAR; if (o) { if (o->op_flags & OPf_PARENS || PERLDB_NOOPT || TAINTING_get) { o = op_prepend_elem(OP_LINESEQ, newOP(OP_ENTER, 0), o); o->op_type = OP_LEAVE; o->op_ppaddr = PL_ppaddr[OP_LEAVE]; } else if (o->op_type == OP_LINESEQ) { OP *kid; o->op_type = ...
false
false
false
false
false
0
check_surface_consistency(EncaSurface surface) { return count_bits((unsigned long int)surface & ENCA_SURFACE_MASK_EOL) <= 1 && count_bits((unsigned long int)surface & ENCA_SURFACE_MASK_PERM) <= 1 && (surface & ENCA_SURFACE_REMOVE) == 0 && (surface & ENCA_SURFACE_UNKNOWN) == 0; }
false
false
false
false
false
0
ebitset_resize (bitset src, bitset_bindex n_bits) { bitset_windex oldsize; bitset_windex newsize; if (n_bits == BITSET_NBITS_ (src)) return n_bits; oldsize = EBITSET_SIZE (src); newsize = EBITSET_N_ELTS (n_bits); if (oldsize < newsize) { bitset_windex size; /* The bitset needs to gro...
false
true
false
false
false
1
r600_wait_for_power_level_unequal(struct radeon_device *rdev, enum r600_power_level index) { int i; for (i = 0; i < rdev->usec_timeout; i++) { if (r600_power_level_get_target_index(rdev) != index) break; udelay(1); } for (i = 0; i < rdev->usec_timeout; i++) { if (r600_power_level_get_current_i...
false
false
false
false
false
0
messageAnimatedImage(gchar* format) { if(strcmp(format,"pov")==0) return messagePovray(); gchar* t = g_strdup_printf( _(" You can create an animated file using convert software :\n" " convert -delay 10 -loop 1000 gab*.%s imageAnim.gif (for a gif animated file)\n" " or\n" " convert -delay 10 -loop 1000...
false
false
false
false
false
0
replace_all(string& str,const string&old_value,const string& new_value) { string::size_type pos; if (str.length()<1) return str; for(pos=0; pos!=string::npos; pos+=new_value.length()) { if( (pos=str.find(old_value,pos))!=string::npos ) { str.replace(pos,old_value.lengt...
false
false
false
false
false
0
gst_asf_mux_audio_set_caps (GstPad * pad, GstCaps * caps) { GstAsfMux *asfmux; GstAsfAudioPad *audiopad; GstStructure *structure; const gchar *caps_name; gint channels, rate; gchar *aux; const GValue *codec_data; asfmux = GST_ASF_MUX (gst_pad_get_parent (pad)); audiopad = (GstAsfAudioPad *) gst_pad_...
false
false
false
false
false
0
move_to_close_lru(struct nfs4_ol_stateid *s, struct net *net) { struct nfs4_ol_stateid *last; struct nfs4_openowner *oo = openowner(s->st_stateowner); struct nfsd_net *nn = net_generic(s->st_stid.sc_client->net, nfsd_net_id); dprintk("NFSD: move_to_close_lru nfs4_openowner %p\n", oo); /* * We know that w...
false
false
false
false
false
0
read(hsStream* S, plResManager* mgr) { plSingleModifier::read(S, mgr); setEnterMsg(S->readBool() ? plMessage::Convert(mgr->ReadCreatable(S)) : NULL); setExitMsg(S->readBool() ? plMessage::Convert(mgr->ReadCreatable(S)) : NULL); }
false
false
false
false
false
0
dp_set_link_config(struct dp_state *dp) { struct nvkm_output_dp *outp = dp->outp; struct nvkm_disp *disp = outp->base.disp; struct nvkm_subdev *subdev = &disp->engine.subdev; struct nvkm_bios *bios = subdev->device->bios; struct nvbios_init init = { .subdev = subdev, .bios = bios, .offset = 0x0000, .outp =...
false
false
false
false
false
0
getArgv(int *pargc, char ***pargv, int originalArgc, char **originalArgv) { char *switches, *next, sbuf[1024]; int i; *pargc = 0; if (getQueryString(&queryBuf, &queryLen) < 0) { return -1; } numQueryKeys = getVars(&queryKeys, queryBuf, queryLen); switches = 0; for (i = 0...
true
true
false
false
true
1
JustReachedHome() override { if (m_pInstance) { if (!(m_pInstance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == NOT_STARTED) || !(m_pInstance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == FAIL)) { m_pInstance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, FAIL); ...
false
false
false
false
false
0
button_widget_button_press (GtkWidget *widget, GdkEventButton *event) { g_return_val_if_fail (BUTTON_IS_WIDGET (widget), FALSE); g_return_val_if_fail (event != NULL, FALSE); if (event->button == 1 && BUTTON_WIDGET (widget)->priv->activatable && /* we don't want to have two/three "click" events for double/triple ...
false
false
false
false
false
0
binsearch (gint64 targ, const gint64 *vals, int n, int offset) { int m = n/2; if (targ == vals[m]) { return m + offset; } else if (targ < vals[0] || targ > vals[n-1]) { return -1; } else if (targ < vals[m]) { return binsearch(targ, vals, m, offset); } else { return binsearch(targ, vals + m, n -...
false
false
false
false
false
0
toAgentItem() const { AgentItem ai; ai.setJid( jid() ); ai.setName( name() ); Identity id; if ( !identities().isEmpty() ) id = identities().first(); ai.setCategory( id.category ); ai.setType( id.type ); ai.setFeatures( d->features ); return ai; }
false
false
false
false
false
0
FindConstant(const char* F) const { if(data->Constants.size()) { unsigned ind = 0; while(isalnum(F[ind]) || F[ind] == '_') ++ind; if(ind) { string name(F, ind); return data->Constants.find(name); } } return data->Constants.end(); }
false
false
false
false
false
0
PyvtkMedicalImageProperties_GetDateAsFields(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "GetDateAsFields"); char *temp0 = NULL; int temp1; int temp2; int temp3; PyObject *result = NULL; if (ap.CheckArgCount(4) && ap.GetValue(temp0) && ap.GetValue(temp1) && ap.GetValue(temp2) &...
false
false
false
false
false
0
join_search_one_level(PlannerInfo *root, int level, List **joinrels) { List *result_rels = NIL; List *new_rels; ListCell *r; int k; /* * First, consider left-sided and right-sided plans, in which rels of * exactly level-1 member relations are joined against initial relations. * We prefer to join u...
false
false
false
false
false
0
AlterTableGetRelOptionsLockLevel(List *defList) { LOCKMODE lockmode = NoLock; ListCell *cell; if (defList == NIL) return AccessExclusiveLock; if (need_initialization) initialize_reloptions(); foreach(cell, defList) { DefElem *def = (DefElem *) lfirst(cell); int i; for (i = 0; relOpts[i]; i++)...
false
false
false
false
false
0
inPaths(string const& path, string const& list) { std::istringstream s(list + ":"); string buf; while (getline(s, buf, ':') && buf.size()) { if (buf == "/" || !fnmatch(buf.c_str(), path.c_str(), 0) || !path.find(buf + "/")) return true; } return false; }
false
false
false
false
false
0
put(ostream& s) const { // Too lazy to implement all the const_iterator stuff, so cast const away ConfigFile* self = const_cast<ConfigFile*>(this); for (iterator i = self->begin(), e = self->end(); i != e; ++i) s << *i << '\n'; return s; }
false
false
false
false
false
0
syck_map_initialize(VALUE self, VALUE type_id, VALUE val, VALUE style) { SyckNode *node; Data_Get_Struct( self, SyckNode, node ); if ( !NIL_P( val ) ) { VALUE hsh = rb_check_convert_type(val, T_HASH, "Hash", "to_hash"); VALUE keys; int i; if ( NIL_P(hsh) ) { ...
false
false
false
false
false
0
Keyboard_configure( const char * filename ) { struct stat statbuf; int fd, devmajor, devminor; linux_keyboard * keyboard; unsigned char relcaps[(REL_MAX / 8) + 1]; unsigned char abscaps[(ABS_MAX / 8) + 1]; unsigned char keycaps[(KEY_MAX / 8) + 1]; if( stat( filename, &statbuf ) == -1 ) ...
false
false
false
false
false
0
rfio_dircleanup(s) /* cleanup rfio dir. descriptor */ int s; { int s_index; INIT_TRACE("RFIO_TRACE"); TRACE(1, "rfio", "rfio_dircleanup(%d)", s); if ((s_index = rfio_rdirfdt_findentry(s,FINDRDIR_WITHOUT_SCAN)) != -1) { if (rdirfdt[s_index] != NULL) { if (rdirfdt[s_index]->mag...
false
false
false
false
false
0
writeAsDX() { //generate filename string fn=makeFilename(); // write header ofstream out_file(fn.c_str()); out_file << "points = " << m_data.size() << endl; out_file << "format = ascii" << endl; out_file << "dependency = positions, positions" << endl; out_file << "interleaving = field" << endl; out_...
false
false
false
false
false
0
fso_framework_inotifier_handleEvent (FsoFrameworkINotifier* self, struct inotify_event* event) { INotifyDelegateHolder* holder = NULL; GHashTable* _tmp0_ = NULL; struct inotify_event _tmp1_ = {0}; gint _tmp2_ = 0; gconstpointer _tmp3_ = NULL; INotifyDelegateHolder* _tmp4_ = NULL; const gchar* _tmp5_ = NULL; str...
false
false
false
false
false
0
parse_port(cfg_parser_t *pctx, cfg_obj_t **ret) { isc_result_t result; CHECK(cfg_parse_uint32(pctx, NULL, ret)); if ((*ret)->value.uint32 > 0xffff) { cfg_parser_error(pctx, CFG_LOG_NEAR, "invalid port"); cfg_obj_destroy(pctx, ret); result = ISC_R_RANGE; } cleanup: return (result); }
false
false
false
false
false
0
ena_update_on_link_change(void *adapter_data, struct ena_admin_aenq_entry *aenq_e) { struct ena_adapter *adapter = (struct ena_adapter *)adapter_data; struct ena_admin_aenq_link_change_desc *aenq_desc = (struct ena_admin_aenq_link_change_desc *)aenq_e; int status = aenq_desc->flags & ENA_ADMIN_AENQ_LIN...
false
false
false
false
false
0
gss_inquire_cred (OM_uint32 * minor_status, const gss_cred_id_t cred_handle, gss_name_t * name, OM_uint32 * lifetime, gss_cred_usage_t * cred_usage, gss_OID_set * mechanisms) { gss_cred_id_t credh = cred_handle; _gss_mech_api_t mech; OM_uint32 maj_stat; if (cred_handle == GSS_C_NO_CREDENTIAL) ...
false
false
false
false
false
0
try_rich_compare(PyObject *v, PyObject *w, int op) { richcmpfunc f; PyObject *res; if (v->ob_type != w->ob_type && PyType_IsSubtype(w->ob_type, v->ob_type) && (f = RICHCOMPARE(w->ob_type)) != NULL) { res = (*f)(w, v, _Py_SwappedOp[op]); if (res != Py_NotImplemented) ...
false
false
false
false
false
0
isDevelopmentVersion( const QString &version ) { return version.indexOf( "alpha", 0, Qt::CaseInsensitive ) != -1 || version.indexOf( "beta", 0, Qt::CaseInsensitive ) != -1 || version.indexOf( "rc", 0, Qt::CaseInsensitive ) != -1 || version.indexOf( "svn", 0, Qt::CaseInsensitiv...
false
false
false
false
false
0
readlinkname(s, len) CONST char *s; int len; { int i; for (i = 0; i < LINKLISTSIZ; i++) { if (linklist[i].len > len) continue; if (!strncmp(s, linklist[i].name, linklist[i].len)) { s += linklist[i].len; return(skipspace(s)); } } return(NULL); }
false
false
false
false
false
0
poll_sensor(struct gspca_dev *gspca_dev) { static const u8 poll1[] = {0x67, 0x05, 0x68, 0x81, 0x69, 0x80, 0x6a, 0x82, 0x6b, 0x68, 0x6c, 0x69, 0x72, 0xd9, 0x73, 0x34, 0x74, 0x32, 0x75, 0x92, 0x76, 0x00, 0x09, 0x01, 0x60, 0x14}; static const u8 poll2[] = {0x67, 0x02, 0x68, 0x71, 0x69, 0x72, 0x72, 0xa9, ...
false
false
false
false
false
0
ncio_spx_init2(ncio *const nciop, const size_t *const sizehintp) { ncio_spx *const pxp = (ncio_spx *)nciop->pvt; assert(nciop->fd >= 0); pxp->bf_extent = *sizehintp; assert(pxp->bf_base == NULL); /* this is separate allocation because it may grow */ pxp->bf_base = mal...
false
false
false
false
false
0
value_destroy(struct value_obj *vo) { TRACE_FLOW_ENTRY(); if (vo) { /* Free arrays if any */ value_destroy_arrays(vo->raw_lines, vo->raw_lengths); /* Free the simple buffer if any */ simplebuffer_free(vo->unfolded); /* Function checks validit...
false
false
false
false
true
1
gst_y4m_dec_sink_event (GstPad * pad, GstEvent * event) { gboolean res; GstY4mDec *y4mdec; y4mdec = GST_Y4M_DEC (gst_pad_get_parent (pad)); GST_DEBUG_OBJECT (y4mdec, "event"); switch (GST_EVENT_TYPE (event)) { case GST_EVENT_FLUSH_START: res = gst_pad_push_event (y4mdec->srcpad, event); bre...
false
false
false
false
false
0
bfa_fcport_cfg_speed(struct bfa_s *bfa, enum bfa_port_speed speed) { struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); bfa_trc(bfa, speed); if (fcport->cfg.trunked == BFA_TRUE) return BFA_STATUS_TRUNK_ENABLED; if ((fcport->cfg.topology == BFA_PORT_TOPOLOGY_LOOP) && (speed == BFA_PORT_SPEED_16GBPS)) return...
false
false
false
false
false
0
PlaceTileLower(wxUint32 x, wxUint32 y, Tile tile, bool enablemonster) { if(x >= 32 || y >= 32) return tile == TILE_FLOOR; if(enablemonster && IsTileMonster(tile)) AddMonster(x, y); else if(!IsTileMonster(upper[x + 32 * y])) RemoveMonster(x, y); #if 0 if(lower[x + 32 * y] == tile)...
false
false
false
false
false
0
gmpc_profiles_set_db_update_time (GmpcProfiles * self, const gchar * id, int value) { #line 1217 "gmpc-profiles.c" #define __GOB_FUNCTION__ "Gmpc:Profiles::set_db_update_time" #line 606 "gmpc-profiles.gob" g_return_if_fail (self != NULL); #line 606 "gmpc-profiles.gob" g_return_if_fail (GMPC_IS_PROFILES (self)); #line...
false
false
false
false
false
0
scontrol_print_job (char * job_id_str) { int error_code = SLURM_SUCCESS, i, print_cnt = 0; uint32_t job_id = 0; job_info_msg_t * job_buffer_ptr = NULL; job_info_t *job_ptr = NULL; if (job_id_str) job_id = (uint32_t) strtol (job_id_str, (char **)NULL, 10); error_code = _scontrol_load_jobs(&job_buffer_ptr, job_...
true
true
false
false
false
1
rhkspm32_detect(const GwyFileDetectInfo *fileinfo, gboolean only_name) { gint score = 0; if (only_name) return g_str_has_suffix(fileinfo->name_lowercase, EXTENSION) ? 20 : 0; if (fileinfo->buffer_len > MAGIC_SIZE && memcmp(fileinfo->head, MAGIC, MAGIC_SIZE) == 0) sc...
false
false
false
false
false
0
start_redo_ins() { register int c; if (read_redo(TRUE) == FAIL) return FAIL; start_stuff(); /* skip the count and the command character */ while ((c = read_redo(FALSE)) != NUL) { c = TO_UPPER(c); if (strchr("AIRO", c) != NULL) { if (c == 'O') stuffReadbuff(NL_STR); break; } } /* copy the ty...
false
false
false
false
false
0
iwl_dealloc_bcast_stations(struct iwl_priv *priv) { int i; spin_lock_bh(&priv->sta_lock); for (i = 0; i < IWLAGN_STATION_COUNT; i++) { if (!(priv->stations[i].used & IWL_STA_BCAST)) continue; priv->stations[i].used &= ~IWL_STA_UCODE_ACTIVE; priv->num_stations--; if (WARN_ON(priv->num_stations < 0)) p...
false
false
false
false
false
0
display_what_to_do(GooCanvasItem *parent) { gint base_Y = 90; gint base_X = 570; /* Load the text to find */ textToFind = get_random_word(NULL); g_assert(textToFind != NULL); /* Decide now if this time we will display the text to find */ /* Use this formula to have a better random number see 'man 3 r...
false
false
false
false
false
0
check_fileending(struct dirent const *entry, char *fileending) { struct stat buf; char *end; /* get stats for the file */ if(stat(entry->d_name,&buf)) { perror("couldn't get stats for file"); } /* check if file is a regular file and if it has and ending (.*) */ if(S_ISREG(buf.st_mode) &&...
false
false
false
false
false
0
sgen_hash_table_replace (SgenHashTable *hash_table, gpointer key, gpointer new_value, gpointer old_value) { guint hash; SgenHashTableEntry *entry; rehash_if_necessary (hash_table); entry = lookup (hash_table, key, &hash); if (entry) { if (old_value) memcpy (old_value, entry->data, hash_table->data_size); ...
false
false
false
false
false
0
_lt_ext_ldml_t_get_tag(lt_ext_module_data_t *data) { lt_ext_ldml_t_data_t *d = (lt_ext_ldml_t_data_t *)data; lt_string_t *s = lt_string_new(lt_tag_get_string(d->tag)); lt_list_t *l; if (d->fields) { for (l = d->fields; l != NULL; l = lt_list_next(l)) { const lt_string_t *t = lt_list_value(l); char *ts = st...
false
false
false
false
false
0
mkflatdtype(MPI_Datatype dtype, int dtlabel, char **pbuf, int *psize) { int nrec; /* # records available */ struct trsrc *psrc; /* ptr src header */ struct trdtype *pdhdr; /* ptr trace datatype header */ struct trdtype *p; /* favourite pointer */ /* * Initialize. */ if (dtbuf == 0) { dtbufrec = TR...
false
false
false
false
false
0
check_password(struct ast_vm_user *vmu, char *password) { /* check minimum length */ if (strlen(password) < minpassword) return 1; /* check that password does not contain '*' character */ if (!ast_strlen_zero(password) && password[0] == '*') return 1; if (!ast_strlen_zero(ext_pass_check_cmd)) { char cmd[255]...
false
false
false
false
false
0
precompute(void) { G_message(_("Precomputing: e/w distances")); precompute_ew_dists(); G_message(_("Precomputing: quantization tolerances")); precompute_epsilons(); if (parm.up) { G_message(_("Precomputing: inverted elevations")); upslope_correction(); } if (!parm.aspin) { G_message(_("Pr...
false
false
false
false
false
0
on_link_clicked(GObject * ignored, DhLink * dhlink, DevhelpPlugin *self) { gchar *uri; g_return_if_fail(DEVHELP_IS_PLUGIN(self)); uri = dh_link_get_uri(dhlink); devhelp_plugin_set_webview_uri(self, uri); devhelp_plugin_activate_webview_tab(self); g_free(uri); }
false
false
false
false
false
0
pwm_lpss_probe(struct device *dev, struct resource *r, const struct pwm_lpss_boardinfo *info) { struct pwm_lpss_chip *lpwm; int ret; lpwm = devm_kzalloc(dev, sizeof(*lpwm), GFP_KERNEL); if (!lpwm) return ERR_PTR(-ENOMEM); lpwm->regs = devm_ioremap_resource(dev, r); if (IS_ERR(lpwm->regs)) return ER...
false
false
false
false
false
0
ves_icall_System_Reflection_Assembly_GetEntryAssembly (void) { MonoDomain* domain = mono_domain_get (); MONO_ARCH_SAVE_REGS; if (!domain->entry_assembly) return NULL; return mono_assembly_get_object (domain, domain->entry_assembly); }
false
false
false
false
false
0
remove_all_edges() { //not calling remove_edge because this would take O ( e*ln(e)*ln(e) ) //doing it this way takes only O(e * ln(e)) for(EdgeIterator it = _edges.begin(); it != _edges.end(); it ++) { (*it)->remove_self(); delete *it; } _edges.clear(); }
false
false
false
false
false
0
tile_move_cost_ptrs(const struct unit *punit, const struct player *pplayer, const struct tile *t1, const struct tile *t2) { bool cardinal_move; struct unit_class *pclass = NULL; bool native = TRUE; if (punit) { pclass = unit_class(punit); native = is_native_tile...
false
false
false
true
false
1
findfilendir(argvars, rettv, find_what) typval_T *argvars UNUSED; typval_T *rettv; int find_what UNUSED; { #ifdef FEAT_SEARCHPATH char_u *fname; char_u *fresult = NULL; char_u *path = *curbuf->b_p_path == NUL ? p_path : curbuf->b_p_path; char_u *p; char_u pathbuf[NUMBUFLEN]; int co...
false
false
false
false
false
0
Print( const wxString & rosPrefix ) { CmdBase::Print( rosPrefix + wxT("CmdBase::") ); cout << rosPrefix.mb_str( ) << "m_osStart : " << m_osStart.mb_str( ) << '\n'; cout << rosPrefix.mb_str( ) << "m_osStop : " << m_osStop .mb_str( ) << '\n'; cout << rosPrefix.mb_str( ) << "m_osStep : " <<...
false
false
false
false
false
0
replaceIfDefined(const std::string &str) const { std::string ret(str); std::string::size_type pos; pos = 0; while ((pos = ret.find("#if defined(", pos)) != std::string::npos) { std::string::size_type pos2 = ret.find(")", pos + 9); if (pos2 > ret.length() - 1) break; ...
false
false
false
false
false
0
csc_next(Scorer *self) { ConjunctionScorer *csc = CSc(self); if (csc->first_time) { csc_init(self, true); } else if (csc->more) { /* trigger further scanning */ const int last_idx = PREV_NUM(csc->first_idx, csc->ss_cnt); Scorer *sub_scorer = csc->sub_scorers[last_idx]; ...
false
false
false
false
false
0
read_reuc(git_index *index, const char *buffer, size_t size) { const char *endptr; size_t len; int i; /* If called multiple times, the vector might already be initialized */ if (index->reuc._alloc_size == 0 && git_vector_init(&index->reuc, 16, reuc_cmp) < 0) return -1; while (size) { git_index_reuc_entry ...
false
false
false
false
false
0
indicator_ranges(const struct indicator *indicators) { int i; GString *gstr; gstr = g_string_new("\r\n+CIND: "); for (i = 0; indicators[i].desc != NULL; i++) { if (i == 0) g_string_append_printf(gstr, "(\"%s\",(%s))", indicators[i].desc, indicators[i].range); else g_string_append_printf(gstr...
false
false
false
false
false
0
btmrvl_tx_pkt(struct btmrvl_private *priv, struct sk_buff *skb) { int ret = 0; if (!skb || !skb->data) return -EINVAL; if (!skb->len || ((skb->len + BTM_HEADER_LEN) > BTM_UPLD_SIZE)) { BT_ERR("Tx Error: Bad skb length %d : %d", skb->len, BTM_UPLD_SIZE); return -EINVAL; } skb_push(skb, BTM_HEADER_LEN...
false
false
false
false
false
0
gt_sain_incrementfirstSstar(GtSainseq *sainseq, unsigned long *suftab) { unsigned long charidx, sum = 0; for (charidx = 0; charidx < sainseq->numofchars; charidx++) { sum += sainseq->bucketsize[charidx]; gt_assert(sainseq->bucketfillptr[charidx] <= sum); if (sa...
false
false
false
false
false
0
jbig2_decode_generic_template0_TPGDON(Jbig2Ctx *ctx, Jbig2Segment *segment, const Jbig2GenericRegionParams *params, Jbig2ArithState *as, Jbig2Image *image, Jbig2ArithCx *GB_stats) { const int GBW = image->width; const int GBH = image->height; uint32_t CONTEXT; int x, y; bool bit; int LT...
false
false
false
false
false
0
_idn2_contexto_rule (const uint32_t * label, size_t llen, size_t pos) { uint32_t cp = label[pos]; if (!_idn2_contexto_p (cp)) return IDN2_OK; switch (cp) { case 0x00B7: /* MIDDLE DOT */ if (llen < 3) return IDN2_CONTEXTO; if (pos == 0 || pos == llen - 1) return IDN2_CONTEXTO; ...
false
false
false
false
false
0
replace_jmp(Statement *spt, void *param) { Label_table **buf = param; Quadruple *qpt; for (qpt = spt->qr_head; qpt != NULL; qpt = qpt->next) { if (qpt->ope == OPE_LABEL) continue; int i; for (i = 0; i < 4; i++) { Operand *op = qpt->op[i]; if (op == NULL) break; if (op->kind == KIND_LABEL)...
false
false
false
false
false
0
list_select(GtkWidget *w, gint row, gint column, GdkEventButton *eb, gpointer data) { struct gui_object *obj; GdkPixmap *pm = NULL; GdkBitmap *bm = NULL; char *text; guint8 spacing; obj = gtk_clist_get_row_data(GTK_CLIST(w), row); if (!eb) return; current = obj; if (eb->button == 1) { gtk_clist_get_pixtext...
false
false
false
false
false
0
initialize_basics(void) { static int initialized; int err; if (!initialized) { initialized = 1; err = ath_mutex_init (&pool_lock); if (err) log_fatal ("failed to create the pool lock: %s\n", strerror (err) ); err = ath_mutex_init (&nonce_buffer_lock); if (err) l...
false
false
false
false
false
0