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
gf_xml_sax_binary_file(GF_SAXParser *parser) { if (!parser) return 0; #ifdef NO_GZIP return 0; #else if (!parser->gz_in) return 0; return (((z_stream*)parser->gz_in)->data_type==Z_BINARY) ? 1 : 0; #endif }
false
false
false
false
false
0
LowerConstantPool(SDValue Op, SelectionDAG &DAG) const { ConstantPoolSDNode *N = cast<ConstantPoolSDNode>(Op); // FIXME there isn't really any debug info here DebugLoc dl = Op.getDebugLoc(); const Constant *C = N->getConstVal(); SDValue CP = DAG.getTargetConstant...
false
false
false
false
false
0
sh_keysc_map_dbg(struct device *dev, unsigned long *map, const char *str) { int k; for (k = 0; k < BITS_TO_LONGS(SH_KEYSC_MAXKEYS); k++) dev_dbg(dev, "%s[%d] 0x%lx\n", str, k, map[k]); }
false
false
false
false
false
0
ccHasReverseArc(const Literal p, uint32 maxLevel, uint32 maxNew) { assert(seen(p.var()) && isFalse(p) && level(p.var()) == maxLevel); const ShortImplicationsGraph& btig = shared_->shortImplications(); Antecedent ante; if (btig.reverseArc(*this, p, maxLevel, ante)) { return ante; } WatchList& wl = watches_[p.inde...
false
false
false
false
false
0
parse_suffix(chunk_t *pc) { while (CharTable::IsKw1(pc->str[pc->len])) { pc->len++; cpd.column++; } }
false
false
false
false
false
0
nasgpio_led_get_attr(struct led_classdev *led_cdev, u32 port) { struct nasgpio_led *led = led_classdev_to_nasgpio_led(led_cdev); u32 gpio_in; spin_lock(&nasgpio_gpio_lock); gpio_in = inl(nas_gpio_io_base + port); spin_unlock(&nasgpio_gpio_lock); if (gpio_in & (1<<led->gpio_bit)) return 1; return 0; }
false
false
false
false
false
0
AreaTrigger_at_zulgurub(Player* pPlayer, AreaTriggerEntry const* pAt) { if (pAt->id == AREATRIGGER_ENTER || pAt->id == AREATRIGGER_ALTAR) { if (pPlayer->isGameMaster() || pPlayer->IsDead()) { return false; } if (instance_zulgurub* pInstance = (instance_zulgurub*)pPla...
false
false
false
false
false
0
terminate_atfork_i(st_data_t key, st_data_t val, st_data_t current_th) { VALUE thval = key; rb_thread_t *th; GetThreadPtr(thval, th); if (th != (rb_thread_t *)current_th) { rb_mutex_abandon_keeping_mutexes(th); rb_mutex_abandon_locking_mutex(th); thread_cleanup_func(th, TRUE); } return ST_CO...
false
false
false
false
false
0
__env_dbrename_pp(dbenv, txn, name, subdb, newname, flags) DB_ENV *dbenv; DB_TXN *txn; const char *name, *subdb, *newname; u_int32_t flags; { DB *dbp; DB_THREAD_INFO *ip; ENV *env; int handle_check, ret, t_ret, txn_local; env = dbenv->env; dbp = NULL; txn_local = 0; handle_check = 0; ENV_ILLEGAL_BEFORE_O...
false
false
false
false
false
0
mISDN_register_clock(char *name, int pri, clockctl_func_t *ctl, void *priv) { u_long flags; struct mISDNclock *iclock; if (*debug & (DEBUG_CORE | DEBUG_CLOCK)) printk(KERN_DEBUG "%s: %s %d\n", __func__, name, pri); iclock = kzalloc(sizeof(struct mISDNclock), GFP_ATOMIC); if (!iclock) { printk(KERN_ERR "%s: ...
false
false
false
false
false
0
lpfc_sha_iterate(uint32_t * HashResultPointer, uint32_t * HashWorkingPointer) { int t; uint32_t TEMP; uint32_t A, B, C, D, E; t = 16; do { HashWorkingPointer[t] = S(1, HashWorkingPointer[t - 3] ^ HashWorkingPointer[t - 8] ^ HashWorkingPointer[t - 14] ^ HashWorkingPointer[t - 16...
false
false
false
false
false
0
call_usermodehelper_exec_sync(struct subprocess_info *sub_info) { pid_t pid; /* If SIGCLD is ignored sys_wait4 won't populate the status. */ kernel_sigaction(SIGCHLD, SIG_DFL); pid = kernel_thread(call_usermodehelper_exec_async, sub_info, SIGCHLD); if (pid < 0) { sub_info->retval = pid; } else { int ret = -E...
false
false
false
false
false
0
nouveau_bufctx_refn(struct nouveau_bufctx *bctx, int bin, struct nouveau_bo *bo, uint32_t flags) { struct nouveau_bufctx_priv *pctx = nouveau_bufctx(bctx); struct nouveau_bufbin_priv *pbin = &pctx->bins[bin]; struct nouveau_bufref_priv *pref = pctx->free; if (!pref) pref = malloc(sizeof(*pref)); else pc...
false
false
false
false
false
0
iso_constants(int domain_size, int max_element) { int id; int num_constants = 0; struct symbol *s, *constants[MAX_SYMBOLS]; int clause[MAX_SYMBOLS]; int tempclause[MAX_SYMBOLS]; /* because add_clause changes the clause! */ for (id = 0; id < Num_symbols; id++) { s = Symbols + id; if (s->type == FUNC...
false
false
false
false
false
0
tw68_enum_input(struct file *file, void *priv, struct v4l2_input *i) { struct tw68_dev *dev = video_drvdata(file); unsigned int n; n = i->index; if (n >= TW68_INPUT_MAX) return -EINVAL; i->index = n; i->type = V4L2_INPUT_TYPE_CAMERA; snprintf(i->name, sizeof(i->name), "Composite %d", n); /* If the quer...
false
false
false
false
false
0
Teardown() { this->OutputMesh = 0; this->OutputPoints = 0; if ( this->OutputAttributes ) { delete [] this->OutputAttributes; } if ( this->OutputAttributeIndices ) { delete [] this->OutputAttributeIndices; } this->Subdivider->ResetFieldList(); this->Subdivider->SetMesh(0); }
false
false
false
false
false
0
H5WB_actual_clear(H5WB_t *wb, size_t need) { void *ret_value; /* Return value */ FUNC_ENTER_NOAPI(NULL) /* * Check arguments. */ HDassert(wb); HDassert(wb->wrapped_buf); /* Get a pointer to an actual buffer */ if(NULL == (ret_value = H5WB_actual(wb, need))) HG...
false
false
false
false
false
0
check_active(bool& up, bool& down) { unsigned int i; FILE_XFER* fxp; up = up_active; down = down_active; for (i=0; i<file_xfers.size(); i++) { fxp = file_xfers[i]; fxp->is_upload?up=true:down=true; } up_active = false; down_active = false; }
false
false
false
false
false
0
str_gsub (lua_State *L) { size_t srcl; const char *src = luaL_checklstring(L, 1, &srcl); const char *p = luaL_checkstring(L, 2); int tr = lua_type(L, 3); int max_s = luaL_optint(L, 4, srcl+1); int anchor = (*p == '^') ? (p++, 1) : 0; int n = 0; MatchState ms; luaL_Buffer b; luaL_argcheck(L, tr == L...
false
false
false
false
false
0
unshiftBytes(ByteVec *pVec, OxydVersion ver) { for (int nByte = 0; nByte < (int)pVec->size(); nByte++) { (*pVec)[nByte] = (int((*pVec)[nByte]) + 256 - levelShifts[ver][nByte % 16]) % 256; } }
false
false
false
false
false
0
AddJunk ( int iStart, int iLength, int iBoundary ) { int iChunkStart = iStart; int iSaved = 0; for ( int i = iStart; i < iStart+iLength; i++ ) if ( sphIsSpace ( m_sBuffer.cstr () [i] ) != sphIsSpace ( m_sBuffer.cstr () [iChunkStart] ) ) { m_dTokens.Resize ( m_dTokens.GetLength () + 1 ); Token_t & tLast = ...
false
false
false
false
false
0
Expand ( int increase_amount ) { int num_chunks_to_expand = ( int ) ( ( increase_amount / MIDITrackChunkSize ) + 1 ); int num_chunks_alloced = ( int ) ( buf_size / MIDITrackChunkSize ); int new_last_chunk_num = ( int ) ( num_chunks_to_expand + num_chunks_alloced ); if ( new_last_chunk_num >= MIDIChunks...
false
false
false
false
false
0
module_probe_insert_module(struct kmod_module *mod, unsigned int flags, const char *extra_options, struct probe_insert_cb *cb, struct kmod_list *rec, unsigned int reccount) { int err; const char *install_cmds; const struct kmod_list *dep; struct kmod_list *pre = NULL, *post = NULL; char *options; if ((f...
false
false
false
false
false
0
out_event () { // If write buffer is empty, try to read new data from the encoder. if (!outsize) { outpos = NULL; encoder.get_data (&outpos, &outsize); // If IO handler has unplugged engine, flush transient IO handler. if (unlikely (!plugged)) { zmq_assert (epheme...
false
false
false
true
false
1
ecp_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) { ECellPopup *ecp = E_CELL_POPUP (ecell); ECellPopupView *ecp_view; /* We must have a child ECell before we create any views. */ g_return_val_if_fail (ecp->child != NULL, NULL); ecp_view = g_new0 (ECellP...
false
false
false
false
false
0
process_filter_frame (StackFrameInfo *info, MonoContext *ctx, gpointer user_data) { ComputeFramesUserData *ud = (ComputeFramesUserData *)user_data; /* * 'tls->filter_ctx' is the location of the throw site. * * mono_walk_stack() will never actually hit the throw site, but unwind * directly from the filter to ...
false
false
false
false
false
0
converttologp(float t, int dof) { float logp=0.0; if(!islarget(t,dof,logp)) { logp = log(1-MISCMATHS::stdtr(dof, t)); } else if(t<0) { // t < 0 and abs(t) is large enough to require asymptotic approx. // but t to logp is not available for negative t // so just hardcode it to be ...
false
false
false
false
false
0
step_zoom(struct map_geometry *geom, int step) { double zoom = geom->zoom; if (zoom < 1) { zoom = floor(1.0 / zoom + 0.5); } else { zoom = floor(zoom + 0.5); } if (zoom == 1.0) { if (step > 0) geom->zoom = 2.0; else geom->zoom = 0.5; return; } if (geom->zoom < 1) step = -step; if (step > 0...
false
false
false
false
false
0
count_nodes(struct gr_learn_file_node *node) { unsigned long ret = 0; for_each_list_entry(node, node) ret++; return ret; }
false
false
false
false
false
0
skip_balanced_braces(const String &text, int p) { const char *s = text.data(); int len = text.length(); int brace_level = 0; while (p < len) { if (s[p] == '{') brace_level++; else if (s[p] == '}') { if (!--brace_level) return p + 1; } p++; } return p; }
false
false
false
false
false
0
copy(int argc, const char **argv, const char *prefix) { int retval = 0, force = 0, from_stdin = 0; const unsigned char *from_note, *note; const char *object_ref; unsigned char object[20], from_obj[20]; struct notes_tree *t; const char *rewrite_cmd = NULL; struct option options[] = { OPT__FORCE(&force, "replace...
true
true
true
false
false
1
jsonb_exists_all(PG_FUNCTION_ARGS) { Jsonb *jb = PG_GETARG_JSONB(0); ArrayType *keys = PG_GETARG_ARRAYTYPE_P(1); int i; Datum *key_datums; bool *key_nulls; int elem_count; deconstruct_array(keys, TEXTOID, -1, false, 'i', &key_datums, &key_nulls, &elem_count); for (i = 0; i < elem_count; i...
false
false
false
false
false
0
Mpushmark (void *p) { if (marki == markn) { markarray = Marraygrow ( markarray, (long) (markn + MARKINCR) * MARKSIZE ); markn += MARKINCR; } markarray[marki++] = p; if (Mgcstate == M_GCON) Mmkcurr (p); return marki - 1; }
false
false
false
false
false
0
Close() { /* -------------------------------------------------------------------- */ /* Close the file. */ /* -------------------------------------------------------------------- */ if( fpDDF != NULL ) { VSIFCloseL( fpDDF ); fpDDF = NULL; ...
false
false
false
false
true
1
addrcompl_add_entry( CompletionWindow *cw, gchar *address ) { GtkListStore *store; GtkTreeIter iter; GtkTreeSelection *selection; gboolean is_group = FALSE; GList *grp_emails = NULL; store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(cw->list_view))); GdkPixbuf *pixbuf; if (!group_pixbuf) { stock_...
false
false
false
false
false
0
HandleUserControlPressed(const cec_command &command) { if (!m_processor->CECInitialised() || !m_processor->IsHandledByLibCEC(command.destination)) return CEC_ABORT_REASON_NOT_IN_CORRECT_MODE_TO_RESPOND; if (command.parameters.size == 0) return CEC_ABORT_REASON_INVALID_OPERAND; CCECBusDevice *devic...
false
false
false
false
false
0
OnAddUrlButton (wxCommandEvent & WXUNUSED(event)) { wxString url(m_inputAddTextCtrl->GetValue()); if (!url.IsEmpty()) { // Check if the URL already exist in list size_t i; bool UrlNotExists = true; for (i=0;i < m_inputUrlListBox->GetCount();++i) { if (url == m_inputUrl...
false
false
false
false
false
0
drm_display_get_param(struct native_display *ndpy, enum native_param_type param) { int val; switch (param) { case NATIVE_PARAM_USE_NATIVE_BUFFER: case NATIVE_PARAM_PRESERVE_BUFFER: case NATIVE_PARAM_MAX_SWAP_INTERVAL: default: val = 0; break; } return val; }
false
false
false
false
false
0
kwsysProcessAppendArgument(char** local, char*** begin, char*** end, int* size, char* arg_local, char** arg_begin, char** arg_end, ...
false
true
false
false
false
1
common_outf(void *priv_, mmbuffer_t *mb, int nbuf) { int i; mmfile_t *dst = priv_; for (i = 0; i < nbuf; i++) { memcpy(dst->ptr + dst->size, mb[i].ptr, mb[i].size); dst->size += mb[i].size; } return 0; }
false
true
false
false
false
1
Thunk_reftrace(CTX ctx, kRawPtr *o FTRARG) { kThunk *thk = (kThunk*)o; size_t i; for(i = 0; i < (thk)->envsize; i++) { KNH_ADDREF(ctx, (thk)->envsfp[i].o); } KNH_SIZEREF(ctx); }
false
false
false
false
false
0
fm10k_alloc_netdev(const struct fm10k_info *info) { netdev_features_t hw_features; struct fm10k_intfc *interface; struct net_device *dev; dev = alloc_etherdev_mq(sizeof(struct fm10k_intfc), MAX_QUEUES); if (!dev) return NULL; /* set net device and ethtool ops */ dev->netdev_ops = &fm10k_netdev_ops; fm10k_se...
false
false
false
false
false
0
ToneGen(int16 *ToneBuf,int Samples) { int i = 0; int NewSamples; if(bToneGenActive || LastToneSample != 0) { // We're not done while(i < Samples) { if(bGenCW) { i += GenCW(&ToneBuf[i],Samples-i); if(ToneChar == NULL) { // We're done bGenCW =...
false
false
false
false
false
0
jclass_class_new(const char* filename, const ClassPath *classpath) { JavaClass* new_class = NULL; FILE* classfile; ClassFile* class_file_info; int is_filename; if(filename == NULL) return NULL; is_filename = ((strlen(filename) > 6) && !strcmp(".class", &filename[strlen(filename) - 6]) || (!strcmp(filename,...
false
false
false
false
false
0
test_create_object (ETestServerFixture *fixture, gconstpointer user_data) { ECal *cal; icalcomponent *component; icalcomponent *component_final; gchar *uid; cal = E_TEST_SERVER_UTILS_SERVICE (fixture, ECal); component = icalcomponent_new (ICAL_VEVENT_COMPONENT); uid = ecal_test_utils_cal_cr...
false
false
false
false
false
0
HFAGetBandInfo( HFAHandle hHFA, int nBand, int * pnDataType, int * pnBlockXSize, int * pnBlockYSize, int *pnCompressionType ) { if( nBand < 0 || nBand > hHFA->nBands ) { CPLAssert( FALSE ); return CE_Failure; } HFABand *poBand = hHFA->papoB...
false
false
false
false
false
0
gg_svg_parse_stroke_width (struct gg_svg_style *style, const char *value) { /* parsing an SVG StrokeWidth attribute */ style->stroke = 1; style->stroke_width = atof (value); if (style->stroke_width <= 0.0) style->stroke_width = 1.0; }
false
false
false
false
false
0
max98088_probe(struct snd_soc_codec *codec) { struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec); struct max98088_cdata *cdata; int ret = 0; regcache_mark_dirty(max98088->regmap); /* initialize private data */ max98088->sysclk = (unsigned)-1; max98088->...
false
false
false
false
false
0
standard_display_init(standard_display *dp, png_store* ps, png_uint_32 id, int do_interlace, int use_update_info) { memset(dp, 0, sizeof *dp); dp->ps = ps; dp->colour_type = COL_FROM_ID(id); dp->bit_depth = DEPTH_FROM_ID(id); if (dp->bit_depth < 1 || dp->bit_depth > 16) internal_error(ps, "inte...
false
false
false
false
false
0
cmd_inq_tpl(int ctl, int hdev, char *opt) { int dd; dd = hci_open_dev(hdev); if (dd < 0) { fprintf(stderr, "Can't open device hci%d: %s (%d)\n", hdev, strerror(errno), errno); exit(1); } if (opt) { int8_t level = atoi(opt); if (hci_write_inquiry_transmit_power_level(dd, level, 2000) < 0) { fpri...
false
false
false
false
false
0
read_number (c, cfile) int c; struct parse *cfile; { int i = 0; int token = NUMBER; cfile -> tokbuf [i++] = c; for (; i < sizeof cfile -> tokbuf; i++) { c = get_char (cfile); /* Promote NUMBER -> NUMBER_OR_NAME -> NAME, never demote. * Except in the case of '0x' syntax hex, which gets called * a NAME ...
false
false
false
false
false
0
getPointsBuffer( size_t &outPointsCount, const float *&xs, const float *&ys, const float *&zs ) const { outPointsCount = size(); if (outPointsCount>0) { xs = &x[0]; ys = &y[0]; zs = &z[0]; } else { xs = ys = zs = NULL; } }
false
false
false
false
false
0
rbd_dev_v2_header_onetime(struct rbd_device *rbd_dev) { int ret; ret = rbd_dev_v2_object_prefix(rbd_dev); if (ret) goto out_err; /* * Get the and check features for the image. Currently the * features are assumed to never change. */ ret = rbd_dev_v2_features(rbd_dev); if (ret) goto out_err; /* If t...
false
false
false
false
false
0
maki_dbus_dcc_send (const gchar* server, const gchar* target, const gchar* path, GError** error) { makiServer* serv; makiInstance* inst = maki_instance_get_default(); if ((serv = maki_instance_get_server(inst, server)) != NULL) { makiDCCSend* dcc; makiUser* user; user = maki_server_add_user(serv, target); ...
false
false
false
false
false
0
set_order(unsigned char *header, enum BedVersion version, enum SnpOrder snp_order) { unsigned char snp_order_as_byte = 1; if( snp_order == BED_ONE_SAMPLE_PER_ROW ) { snp_order_as_byte = 0; } if( version == PIO_VERSION_100 ) { header[ 2 ] = snp_order_as_byte; } else if( v...
false
false
false
false
false
0
init_org_mdl_set() { int ns = get_max_module_entry(MODULE_SUB); int nf = get_max_module_entry(MODULE_FUNC); if (ns > 0) { construct_IntSet(org_sb_set, ns+1); } else { org_sb_set = NULL; } if (nf > 0) { construct_IntSet(org_func_set, nf+1); } else { org_f...
false
false
false
false
false
0
add_mac(new) struct macro *new; { register struct macro *mp, *prev = NULL; for (mp = macros; mp != NULL; prev = mp, mp = mp->m_nextm) if (mp == new) return; if (prev) prev->m_nextm = new; else macros = new; new->m_nextm = NULL; new->Type = MACRO; }
false
false
false
false
false
0
dev_manager_info(struct dm_pool *mem, const struct logical_volume *lv, const char *layer, int with_open_count, int with_read_ahead, struct dm_info *info, uint32_t *read_ahead) { char *dlid, *name; int r; if (!(name = dm_build_dm_name(mem, lv->vg->name, lv->name, layer))) { log_error("name bui...
false
false
false
false
false
0
computedStyle() { if (m_render && m_render->style()) return m_render->style(); if (!attached()) // FIXME: Try to do better than this. Ensure that styleForElement() works for elements that are not in the // document tree and figure out when to destroy the computed style for such elements. ...
false
false
false
false
false
0
shsess_store(unsigned char *s_id, unsigned char *data, int data_len) { struct shared_session *shsess, *oldshsess; shsess = shsess_get_next(data_len); if (!shsess) { /* Could not retrieve enough free blocks to store that session */ return 0; } /* prepare key */ memcpy(shsess->key_data, s_id, SSL_MAX_SSL_SESS...
false
false
false
false
false
0
jbd2_journal_init_handle_cache(void) { jbd2_handle_cache = KMEM_CACHE(jbd2_journal_handle, SLAB_TEMPORARY); if (jbd2_handle_cache == NULL) { printk(KERN_EMERG "JBD2: failed to create handle cache\n"); return -ENOMEM; } jbd2_inode_cache = KMEM_CACHE(jbd2_inode, 0); if (jbd2_inode_cache == NULL) { printk(KERN_...
false
false
false
false
false
0
write_params(struct params *params, int *first) { struct params *p; for (p = params; p != NULL; p = p->next) { if (*first) *first = 0; else printf(", "); printf("%s %s", p->type, p->name); } }
false
false
false
false
false
0
socialNumbers() const { return QStringList() << patient()->data(Core::IPatient::SocialNumber).toString() << patient()->data(Core::IPatient::SocialNumber2).toString() << patient()->data(Core::IPatient::SocialNumber3).toString() << patient()->data(Core::IPatient::Social...
false
false
false
false
false
0
ginContinueSplit(ginIncompleteSplit *split) { GinBtreeData btree; GinState ginstate; Relation reln; Buffer buffer; GinBtreeStack stack; /* * elog(NOTICE,"ginContinueSplit root:%u l:%u r:%u", split->rootBlkno, * split->leftBlkno, split->rightBlkno); */ buffer = XLogReadBuffer(split->node, split->leftBlkn...
false
false
false
false
false
0
determineGroup(std::string &user, int &fg) { if (user.length() < 1 || user == "-") { return DGAUTH_NOMATCH; } String u(user); u.toLower(); // since the filtergroupslist is read in in lowercase, we should do this. user = u.toCharArray(); // also pass back to ConnectionHandler, so appears lowercase in logs Stri...
false
false
false
false
false
0
resize_vector(git_vector *v) { v->_alloc_size = ((unsigned int)(v->_alloc_size * resize_factor)) + 1; if (v->_alloc_size < minimum_size) v->_alloc_size = minimum_size; v->contents = realloc(v->contents, v->_alloc_size * sizeof(void *)); if (v->contents == NULL) return GIT_ENOMEM; return GIT_SUCCESS; }
false
false
false
false
false
0
ci_thermal_set_temperature_range(struct amdgpu_device *adev, int min_temp, int max_temp) { int low_temp = 0 * 1000; int high_temp = 255 * 1000; u32 tmp; if (low_temp < min_temp) low_temp = min_temp; if (high_temp > max_temp) high_temp = max_temp; if (high_temp < low_temp) { DRM_ERROR("invalid ther...
false
false
false
false
false
0
gconf_cnxn_new (GConfEngine *conf, const gchar *namespace_section, GConfNotifyFunc func, gpointer user_data) { GConfCnxn *cnxn; static guint next_id = 1; cnxn = g_new0 (GConfCnxn, 1); cnxn->namespace_section = g_strdup (namespace_section); cnxn->conf = conf; cnxn->client_id = next_id; cnxn->func...
false
false
false
false
false
0
__read_verify( struct xfs_buf *bp, __uint16_t magic) { struct xfs_mount *mp = bp->b_target->bt_mount; if (xfs_sb_version_hascrc(&mp->m_sb) && !xfs_buf_verify_cksum(bp, XFS_DIR3_LEAF_CRC_OFF)) xfs_buf_ioerror(bp, -EFSBADCRC); else if (!xfs_dir3_leaf_verify(bp, magic)) xfs_buf_ioerror(bp, -EFSCORRUPTED);...
false
false
false
false
false
0
print_netjoins(NETJOIN_SERVER_REC *server) { TEMP_PRINT_REC *temp; GHashTable *channels; GSList *tmp, *next, *old; g_return_if_fail(server != NULL); printing_joins = TRUE; /* save nicks to string, clear now_channels and remove the same channels from old_channels list */ channels = g_hash_table_new((GHashF...
false
false
false
false
false
0
mpegts_packetizer_stream_subtable_new (guint8 table_id, guint16 subtable_extension, guint8 last_section_number) { MpegTSPacketizerStreamSubtable *subtable; subtable = g_new0 (MpegTSPacketizerStreamSubtable, 1); subtable->version_number = VERSION_NUMBER_UNSET; subtable->table_id = table_id; subtable->subt...
false
false
false
false
false
0
splitval() { if (yylex() != VAL || yylex() != INT) syntax(); if (yyval < 0 || yyval > 16383) error("Value must be between 0 and 16383"); data[0] = yyval % 128; data[1] = yyval / 128; }
false
false
false
false
false
0
barracks_prev_pic() { // check if no pilot images or no pilot selected if ((Num_pilot_images == 0) || (Cur_pilot->callsign[0] == '\0')) { gamesnd_play_iface(SND_GENERAL_FAIL); return; } // reset pilot pic number Pic_number--; if (Pic_number < 0) { Pic_number = Num_pilot_images - 1; } // copy pilot pic f...
false
false
false
false
false
0
fsprobe_get_value(const char *name, const char *devname, int *ambi) { int fd, rc; const char *data = NULL; if (!devname || !name) return NULL; fd = open(devname, O_RDONLY); if (fd < 0) return NULL; if (!blprobe) blprobe = blkid_new_probe(); if (!blprobe) goto done; if (blkid_probe_set_device(blprobe, f...
false
false
false
false
false
0
doinit() { HwMEBase::doinit(); // cast the SM pointer to the Herwig SM pointer tcHwSMPtr hwsm=ThePEG::dynamic_ptr_cast<tcHwSMPtr>(standardModel()); // do the initialisation if(!hwsm) throw InitException() << "Must be the Herwig++ StandardModel class in " << "MEGammaGamma2ff::doinit" << Exception::abo...
false
false
false
false
false
0
Peek32u(LFA_FileRef file, bool bigEndian = false ) { XMP_Uns32 value = tree->digest32u(file, "", bigEndian ); Rewind(file, 4); return value; }
false
false
false
false
false
0
click_user_finalize (GObject* obj) { ClickUser * self; self = G_TYPE_CHECK_INSTANCE_CAST (obj, CLICK_TYPE_USER, ClickUser); _g_object_unref0 (self->priv->_db); _g_free0 (self->priv->_name); _g_object_unref0 (self->priv->users); _g_free0 (self->priv->old_umask); G_OBJECT_CLASS (click_user_parent_class)->finalize ...
false
false
false
false
false
0
pe_notify(resource_t * rsc, node_t * node, action_t * op, action_t * confirm, notify_data_t * n_data, pe_working_set_t * data_set) { char *key = NULL; action_t *trigger = NULL; const char *value = NULL; const char *task = NULL; if (op == NULL || confirm == NULL) { pe_rsc_trace(rsc...
false
false
false
true
false
1
handle_get_messages(GUI_RPC_CONN& grc) { int seqno=0; bool translatable = false; while (!grc.xp.get_tag()) { if (grc.xp.parse_int("seqno", seqno)) continue; if (grc.xp.parse_bool("translatable", translatable)) continue; } message_descs.write(seqno, grc.mfout, translatable); }
false
false
false
false
false
0
dbq_wait_to_finish(struct dbq *q) { static const char diag[] = "dbq_wait_to_finish"; gfarm_mutex_lock(&q->mutex, diag, "mutex"); q->quitting = 1; while (!q->quited) { gfarm_cond_signal(&q->nonempty, diag, "nonempty"); gfarm_cond_wait(&q->finished, &q->mutex, diag, "finished"); } gfarm_mutex_unlock(&q->mutex,...
false
false
false
false
false
0
CriticalPathStep(const SUnit *SU) { const SDep *Next = 0; unsigned NextDepth = 0; // Find the predecessor edge with the greatest depth. for (SUnit::const_pred_iterator P = SU->Preds.begin(), PE = SU->Preds.end(); P != PE; ++P) { const SUnit *PredSU = P->getSUnit(); unsigned PredLatency = P->getLa...
false
false
false
false
false
0
get_member_non_recursive(node *obj,char *key) { if(obj==NULL) return(NULL); node *members = node_GetItemByKey(obj,"members"); if(members!=NULL) { node_ItemIterationReset(members); while(node_ItemIterationUnfinished(members)) { node *member = node_ItemIterate(members); node...
false
false
false
false
false
0
sock_settimeout(PySocketSockObject *s, PyObject *arg) { double timeout; if (arg == Py_None) timeout = -1.0; else { timeout = PyFloat_AsDouble(arg); if (timeout < 0.0) { if (!PyErr_Occurred()) PyErr_SetString(PyExc_ValueError, ...
false
false
false
false
false
0
tracker_sparql_buffer_update_cb (GObject *object, GAsyncResult *result, gpointer user_data) { UpdateData *update_data = user_data; SparqlTaskData *task_data; GError *error = NULL; tracker_sparql_connection_update_finish (TRACKER_SPARQL_CON...
false
false
false
false
false
0
ivtvfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) { struct ivtv *itv = (struct ivtv *) info->par; IVTVFB_DEBUG_INFO("ivtvfb_check_var\n"); return _ivtvfb_check_var(var, itv); }
false
false
false
false
false
0
convert_descriptor_to_mode (enum machine_mode mode, dw_loc_descr_ref op) { enum machine_mode outer_mode = mode; dw_die_ref type_die; dw_loc_descr_ref cvt; if (GET_MODE_SIZE (mode) <= DWARF2_ADDR_SIZE) { add_loc_descr (&op, new_loc_descr (DW_OP_GNU_convert, 0, 0)); return op; } type_die = ...
false
false
false
false
false
0
saveStructuredReport(const char *filename, OFBool explicitVR) { if (pReport==NULL) return EC_IllegalCall; if (filename==NULL) return EC_IllegalCall; OFCondition status = EC_IllegalCall; DcmFileFormat *fileformat = new DcmFileFormat(); DcmDataset *dataset = NULL; if (fileformat) dataset=fileform...
false
false
false
false
false
0
bgav_sdp_get_attr_string(bgav_sdp_attr_t * attrs, int num_attrs, const char * name, char ** ret) { int i; for(i = 0; i < num_attrs; i++) { if(!strcmp(attrs[i].name, name)) { if((attrs[i].type != BGAV_SDP_TYPE_STRING) && (attrs[i].type != BGAV_SDP_TYPE_GENE...
false
false
false
false
false
0
brasero_task_ctx_set_output_size_for_current_track (BraseroTaskCtx *self, goffset sectors, goffset bytes) { BraseroTaskCtxPrivate *priv; /* NOTE: we don't need block size here as it's pretty easy to have it by * dividing size by sectors or by guessing it with image or audio format * of the ou...
false
false
false
false
false
0
param_check_bytes(gs_param_list * plist, gs_param_name pname, const byte * str, uint size, bool is_defined) { int code; gs_param_string new_value; switch (code = param_read_string(plist, pname, &new_value)) { case 0: if (is_defined && new_value.size == size && ...
false
false
false
false
false
0
vlv_DeleteIndexEntry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg) { ldbm_instance *inst = (ldbm_instance*)arg; if (inst && is_instance_busy(inst)) { LDAPDebug( LDAP_DEBUG_ANY, "Backend instance: '%s' is already ...
false
false
false
false
false
0
nextbuf(MatroskaFile *mf) { fillbuf(mf); if (mf->bufpos < mf->buflen) return (unsigned char)(mf->inbuf[mf->bufpos++]); return EOF; }
false
false
false
false
false
0
write(MIOFILE& out, bool to_server) { unsigned int i; FILE_INFO* fip; int n, retval; out.printf( "<result>\n" " <name>%s</name>\n" " <final_cpu_time>%f</final_cpu_time>\n" " <final_elapsed_time>%f</final_elapsed_time>\n" " <exit_status>%d</exit_status...
false
false
false
false
false
0
lj_meta_arith(lua_State *L, TValue *ra, cTValue *rb, cTValue *rc, BCReg op) { MMS mm = bcmode_mm(op); TValue tempb, tempc; cTValue *b, *c; if ((b = str2num(rb, &tempb)) != NULL && (c = str2num(rc, &tempc)) != NULL) { /* Try coercion first. */ setnumV(ra, lj_vm_foldarith(numV(b), numV(c), (int...
false
false
false
false
false
0
product_get_build(void) { static uint32 build; static bool initialized; if G_UNLIKELY(!initialized) { const char *p; initialized = TRUE; p = is_strprefix(product_build, "$Revision: "); if (p) { int error; build = parse_uint32(p, NULL, 10, &error); } } return build; }
false
false
false
false
false
0
ll_check_data_len(struct hci_dev *hdev, struct ll_struct *ll, int len) { int room = skb_tailroom(ll->rx_skb); BT_DBG("len %d room %d", len, room); if (!len) { hci_recv_frame(hdev, ll->rx_skb); } else if (len > room) { BT_ERR("Data length is too large"); kfree_skb(ll->rx_skb); } else { ll->rx_state = HCIL...
false
false
false
false
false
0
ld_usb_release(struct inode *inode, struct file *file) { struct ld_usb *dev; int retval = 0; dev = file->private_data; if (dev == NULL) { retval = -ENODEV; goto exit; } if (mutex_lock_interruptible(&dev->mutex)) { retval = -ERESTARTSYS; goto exit; } if (dev->open_count != 1) { retval = -ENODEV; ...
false
false
false
false
false
0
fswc_add_image_rgb32(src_t *src, avgbmp_t *abitmap) { uint8_t *img = (uint8_t *) src->img; uint32_t i = src->width * src->height; if(src->length << 2 < i) return(-1); while(i-- > 0) { *(abitmap++) += *(img++); *(abitmap++) += *(img++); *(abitmap++) += *(img++); img++; } return(0); }
false
false
false
false
false
0
open_log(const char * logfile) { logfp = fopen(logfile, "a"); if (!logfp) { fprintf(stderr, "Cannot open logfile %s: %s\n", logfile, strerror(errno)); exit(EXIT_FAILURE); } setbuf(logfp, NULL); time_t t; time(&t); /* Note that ctime() appends '\n' */ fprintf(logfp, "---- Log for %s %s opened on %s", ...
false
false
false
false
true
1
GetGeoTransform( double * padfTransform ) { memcpy( padfTransform, adfGeoTransform, sizeof(adfGeoTransform[0]) * 6 ); if( sHeader.iGeorefFlag ) return CE_None; else return CE_Failure; }
false
false
false
false
false
0