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
rb_select_poll(long delay) { int num; int fd; int ci; PF *hdl; void *data; struct pollfd *pfd; int revents; num = poll(pollfd_list.pollfds, pollfd_list.maxindex + 1, delay); rb_set_time(); if(num < 0) { if(!rb_ignore_errno(errno)) return RB_OK; else return RB_ERROR; } if(num == 0) return RB_OK...
false
false
false
false
false
0
scm_m_atbind (SCM expr, SCM env) { SCM bindings; SCM rvariables; SCM inits; SCM variable_idx; const SCM top_level = scm_env_top_level (env); const SCM cdr_expr = SCM_CDR (expr); ASSERT_SYNTAX (scm_ilength (cdr_expr) >= 0, s_bad_expression, expr); ASSERT_SYNTAX (scm_ilength (cdr_expr) >= 2, s_missing_e...
false
false
false
false
false
0
howOrthogonal (const Hep3Vector & v) const { // | V1 dot V2 | / | V1 x V2 | double v1v2 = std::fabs(dot(v)); //-| Safe because both v1 and v2 can be squared if ( v1v2 == 0 ) { return 0; // Even if one or both are 0, they are considered orthogonal } Hep3Vector v1Xv2 ( cross(v) ); double abscross = v1X...
false
false
false
false
false
0
addProc ( char *procname , int mem , int rss ) { register struct ProcInfo *thisproc ; /* * is the array empty? */ if ( !procs ) { lastallocated = minProcs ; if ( ( procs = calloc ( minProcs , sizeof ( struct ProcInfo ) ) ) == NULL ) { fprintf ( stderr , "%s: cannot alloc %d proc...
false
true
false
false
false
1
RelationFlushRelation(Relation relation) { if (relation->rd_createSubid != InvalidSubTransactionId) { /* * New relcache entries are always rebuilt, not flushed; else we'd * forget the "new" status of the relation, which is a useful * optimization to have. * * The rel could have zero refcnt here, so t...
false
false
false
false
false
0
GetSpellCastTimeForBonus(SpellEntry const* spellProto, DamageEffectType damagetype) { uint32 CastingTime = !IsChanneledSpell(spellProto) ? GetSpellCastTime(spellProto) : GetSpellDuration(spellProto); if (CastingTime > 7000) CastingTime = 7000; if (CastingTime < 1500) CastingTime = 1500; if (damagetype...
false
false
false
false
false
0
decode_vax_g (const struct real_format *fmt ATTRIBUTE_UNUSED, REAL_VALUE_TYPE *r, const long *buf) { unsigned long image0, image1; int exp; if (FLOAT_WORDS_BIG_ENDIAN) image1 = buf[0], image0 = buf[1]; else image0 = buf[0], image1 = buf[1]; image0 &= 0xffffffff; image1 &= 0xffffffff; exp ...
false
false
false
false
false
0
fix_dce(size_t reallen, size_t *len) { if (reallen == ASN1_INDEFINITE) return (1); if (*len < reallen) return (-1); *len = reallen; return (0); }
false
false
false
false
false
0
gst_video_balance_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { GstVideoBalance *balance = GST_VIDEO_BALANCE (object); gdouble d; const gchar *label = NULL; GST_OBJECT_LOCK (balance); switch (prop_id) { case PROP_CONTRAST: d = g_value_get_double (val...
false
false
false
false
false
0
Reconfig() { TextButton::Reconfig(); MakeBackground(); if (shape->Undefined()) { MakeShape(); shape->width += output->GetFont()->Width(" "); shape->height += 2*pad; } }
false
false
false
false
false
0
draw_sphereplot(double f1(double),double f2(double),double f3(double), double t_min, double t_max, int num_pts, bool front, sphere_proj_type TYPE, const Sphere& S) { std::vector<P> data(num_pts+1); double t(t_min); const double dt((t_max - t_min)/num_pts); for (int i=0; i <= num_p...
false
false
false
false
false
0
cx_filteredit_right(void) { if (panel->filter->curs < panel->filter->size) panel->filter->curs++; }
false
false
false
false
false
0
test_socks_4_unsupported_commands(void *ptr) { SOCKS_TEST_INIT(); /* SOCKS 4 Send BIND [02] to IP address 2.2.2.2:4369 */ ADD_DATA(buf, "\x04\x02\x11\x11\x02\x02\x02\x02\x00"); test_assert(fetch_from_buf_socks(buf, socks, get_options()->TestSocks, get_options()->SafeSocks) ==...
false
false
false
false
false
0
str_i_str(const string& haystack, int from, const char* needle) { int endIndex = haystack.length(); int patternLength = strlen(needle); int endPattern = endIndex - patternLength + 1; if (endPattern < 0) { return -1; } if (patternLength <= 0) { return 0; } char patternChar0 = toupper(needle[0]); for (int ct...
false
false
false
false
false
0
_on_icon_view_key_press_event (GtkWidget *widget, GdkEventKey *event, gpointer data) { FrogrMainView *mainview = FROGR_MAIN_VIEW (data); FrogrMainViewPrivate *priv = FROGR_MAIN_VIEW_GET_PRIVATE (data); /* Actions are only allowed in IDLE state */ if...
false
false
false
false
false
0
bfa_rport_sm_delete_pending(struct bfa_rport_s *rp, enum bfa_rport_event event) { bfa_trc(rp->bfa, rp->rport_tag); bfa_trc(rp->bfa, event); switch (event) { case BFA_RPORT_SM_FWRSP: bfa_stats(rp, sm_delp_fwrsp); if (bfa_rport_send_fwdelete(rp)) bfa_sm_set_state(rp, bfa_rport_sm_deleting); else bfa_...
false
false
false
false
false
0
cipher_psub_encrypt(const unsigned char *inblk, unsigned char *outblk, int blksize, unsigned char *key) { int i,mod; static int keyoffset=0; mod=(int) key[0]; for (i=0;i<blksize;i++) { if (!(i%mod)) { keyoffset=((keyoffset+1)&0xff); } outblk[i]=key[((((int) inblk[i])+keyoffset)&0xff)+1]; } return(blksiz...
false
false
false
false
false
0
db_symlink_arg_alloc(gfarm_ino_t inum, const char *source_path) { struct db_symlink_arg *arg; size_t sz; int overflow = 0; sz = gfarm_size_add(&overflow, sizeof(*arg), strlen(source_path) + 1); if (!overflow) arg = malloc(sz); if (overflow || arg == NULL) { gflog_debug(GFARM_MSG_1002037, "allocation of 'd...
false
false
false
false
false
0
luaC_freeallobjects (lua_State *L) { global_State *g = G(L); int i; separatetobefnz(L, 1); /* separate all objects with finalizers */ lua_assert(g->finobj == NULL); callallpendingfinalizers(L, 0); g->currentwhite = WHITEBITS; /* this "white" makes all objects look dead */ g->gckind = KGC_NORMAL; sweepw...
false
false
false
false
false
0
removeBlock(ulong start, ulong length) { if(!d->file) return; ulong bufferLength = bufferSize(); long readPosition = start + length; long writePosition = start; ByteVector buffer(static_cast<uint>(bufferLength)); ulong bytesRead = 1; while(bytesRead != 0) { seek(readPosition); bytesRead =...
false
false
false
false
false
0
pkt_rbtree_insert(struct pktcdvd_device *pd, struct pkt_rb_node *node) { struct rb_node **p = &pd->bio_queue.rb_node; struct rb_node *parent = NULL; sector_t s = node->bio->bi_iter.bi_sector; struct pkt_rb_node *tmp; while (*p) { parent = *p; tmp = rb_entry(parent, struct pkt_rb_node, rb_node); if (s < tmp-...
false
false
false
false
false
0
ok_to_eliminate_div(struct isl_basic_map *bmap, isl_int *eq, unsigned div) { int k; int last_div; unsigned space_total = isl_space_dim(bmap->dim, isl_dim_all); unsigned pos = space_total + div; last_div = isl_seq_last_non_zero(eq + 1 + space_total, bmap->n_div); if (last_div < 0 || last_div <= div) return 1; ...
false
false
false
false
false
0
SetIndentWithTabs(ExState &State) { int No; if (State.GetIntParam(View, &No) == 0) return 0; Flags.num[BFI_IndentWithTabs] = No ? 1 : 0; return 1; }
false
false
false
false
false
0
client_user (const char *user, const char *passwd) { /* send the user command and get server's reply */ if (debug) { fprintf (stderr, "%s: writing `USER %s %s'\n", program_name, user, passwd); } fprintf (serv_write, "USER %s %s\r\n", user, passwd); get_reply(stdout); /* this will exit on...
false
false
false
false
false
0
brasero_task_add_item (BraseroTask *task, BraseroTaskItem *item) { BraseroTaskPrivate *priv; g_return_if_fail (BRASERO_IS_TASK (task)); g_return_if_fail (BRASERO_IS_TASK_ITEM (item)); priv = BRASERO_TASK_PRIVATE (task); if (priv->leader) { brasero_task_item_link (priv->leader, item); g_object_unref (priv->l...
false
false
false
false
false
0
get_precompiled_patterns(gchar **patterns) { guint i; GSList *pattern_list = NULL; if (!patterns) return NULL; for (i = 0; patterns[i] != NULL; i++) { GPatternSpec *pattern_spec = g_pattern_spec_new(patterns[i]); pattern_list = g_slist_prepend(pattern_list, pattern_spec); } return pattern_list; }
false
false
false
false
false
0
MakeDisabledLiveCallbackLocked( const void* ptr, const HeapProfileTable::AllocInfo& info) { RAW_DCHECK(heap_checker_lock.IsHeld(), ""); bool stack_disable = false; bool range_disable = false; for (int depth = 0; depth < info.stack_depth; depth++) { uintptr_t addr = AsInt(info.call_stack[depth]); if ...
false
false
false
false
false
0
adp5588_gpio_remove(struct adp5588_kpad *kpad) { struct device *dev = &kpad->client->dev; const struct adp5588_kpad_platform_data *pdata = dev_get_platdata(dev); const struct adp5588_gpio_platform_data *gpio_data = pdata->gpio_data; int error; if (!kpad->export_gpio) return; if (gpio_data->teardown) { error...
false
false
false
false
false
0
remove_pidfiles() { if (pidfilename[0] != 0 && unlink(pidfilename) < 0 && errno != ENOENT) warn("unable to delete pid file %s: %m", pidfilename); pidfilename[0] = 0; if (linkpidfile[0] != 0 && unlink(linkpidfile) < 0 && errno != ENOENT) warn("unable to delete pid file %s: %m", linkpidfile); linkpidfil...
false
false
false
false
false
0
handshake_switch_codec(int dns_fd, int bits) { char in[4096]; int i; int read; struct encoder *tempenc; if (bits == 5) tempenc = get_base32_encoder(); else if (bits == 6) tempenc = get_base64_encoder(); else if (bits == 26) /* "2nd" 6 bits per byte, with underscore */ tempenc = get_base64u_encoder(); els...
false
false
false
false
false
0
can_reach_floor() { return (boolean)(!u.uswallow && #ifdef STEED /* Restricted/unskilled riders can't reach the floor */ !(u.usteed && P_SKILL(P_RIDING) < P_BASIC) && #endif (!Levitation || Is_airlevel(&u.uz) || Is_waterlevel(&u.uz))); }
false
false
false
false
false
0
beginGuard(std::ostream& ostr, const std::string& headerFileName) { Path p(headerFileName); std::string guard(p.getBaseName()); guard += "_INCLUDED"; ostr << "#ifndef " << guard << "\n"; ostr << "#define " << guard << "\n"; ostr << "\n\n"; }
false
false
false
false
false
0
lp_gpio_request(struct gpio_chip *chip, unsigned offset) { struct lp_gpio *lg = container_of(chip, struct lp_gpio, chip); unsigned long reg = lp_gpio_reg(chip, offset, LP_CONFIG1); unsigned long conf2 = lp_gpio_reg(chip, offset, LP_CONFIG2); unsigned long acpi_use = lp_gpio_reg(chip, offset, LP_ACPI_OWNED); pm_ru...
false
false
false
false
false
0
insert_vg_attrs(int32 vg_in, char *path) { int n_attrs; int32 data_type, size, n_values; char attr_name[H4_MAX_NC_NAME]; int i; /* Get the number of attributes attached to this vgroup. */ if((n_attrs = Vnattrs2 (vg_in))==FAIL) { printf( "Failed t...
true
true
false
false
false
1
samplexx_sinc_handler (int *datasp) { int i, n; int const *winsinc; if (sound_use_filter_sinc) { n = (sound_use_filter_sinc == FILTER_MODEL_A500) ? 0 : 2; if (led_filter_on) n += 1; } else { n = 4; } winsinc = winsinc_integral[n]; for (i = 0; i < 4; i += 1) { int j, v; struct audio_channel_dat...
false
false
false
false
false
0
numaGetSumOnInterval(NUMA *na, l_int32 first, l_int32 last, l_float32 *psum) { l_int32 i, n, truelast; l_float32 val, sum; PROCNAME("numaGetSumOnInterval"); if (!na) return ERROR_INT("na not defined", procName, 1); i...
false
false
false
false
false
0
invalidate_labels (NemoIconContainer *container) { GList *p; NemoIcon *icon; for (p = container->details->icons; p != NULL; p = p->next) { icon = p->data; nemo_icon_canvas_item_invalidate_label (icon->item); } }
false
false
false
false
false
0
ahb_mod(struct qib_devdata *dd, int quad, int chan, int addr, u32 data, u32 mask) { u32 rd_data, wr_data, sz_mask; u64 trans, acc, prev_acc; u32 ret = 0xBAD0BAD; int tries; prev_acc = qib_read_kreg64(dd, KR_AHB_ACC); /* From this point on, make sure we return access */ acc = (quad << 1) | 1; qib_write_kr...
false
false
false
false
false
0
init(const GPixmap &pm, const GP<GBitmap> gmask, CRCBMode crcbmode) { /* Free */ close_codec(); delete ymap; delete cbmap; delete crmap; ymap = cbmap = crmap = 0; /* Create */ int w = pm.columns(); int h = pm.rows(); signed char *buffer; GPBuffer<signed char> gbuffer(buffer,w*h); // Create maps ...
false
false
false
false
false
0
erts_pcre_copy_substring(const char *subject, int *ovector, int stringcount, int stringnumber, char *buffer, int size) { int yield; if (stringnumber < 0 || stringnumber >= stringcount) return PCRE_ERROR_NOSUBSTRING; stringnumber *= 2; yield = ovector[stringnumber+1] - ovector[stringnumber]; if (size < yield + 1) re...
false
false
false
false
false
0
FvhFbhGetStack( Name ) char *Name; { chain_list *ScanChain; int Index; Index = 0; for ( ScanChain = FvhDefaultStackName; ScanChain != (chain_list *)0; ScanChain = ScanChain->NEXT ) { if ( ScanChain->DATA == (void *)Name ) { return( Index ); } Index = Index...
false
false
false
false
false
0
__jffs2_set_acl(struct inode *inode, int xprefix, struct posix_acl *acl) { char *value = NULL; size_t size = 0; int rc; if (acl) { value = jffs2_acl_to_medium(acl, &size); if (IS_ERR(value)) return PTR_ERR(value); } rc = do_jffs2_setxattr(inode, xprefix, "", value, size, 0); if (!value && rc == -ENODATA)...
false
false
false
false
false
0
gst_wavenc_create_header_buf (GstWavEnc * wavenc, guint audio_data_size) { struct wave_header wave; GstBuffer *buf; guint8 *header; buf = gst_buffer_new_and_alloc (WAV_HEADER_LEN); header = GST_BUFFER_DATA (buf); memset (header, 0, WAV_HEADER_LEN); wave.common.wChannels = wavenc->channels; wave.common...
false
false
false
false
false
0
i18n( const QString &text, const QVariantList &arguments ) const { KLocalizedString ls = ki18n(text.toUtf8()); return substituteArguments( ls, arguments ).toString(); }
false
false
false
false
false
0
altera_mbox_startup(struct mbox_chan *chan) { struct altera_mbox *mbox = mbox_chan_to_altera_mbox(chan); int ret = 0; if (!mbox) return -EINVAL; if (mbox->is_sender) ret = altera_mbox_startup_sender(chan); else ret = altera_mbox_startup_receiver(chan); return ret; }
false
false
false
false
false
0
angleleft (double x0, double y0, double x1, double y1, double x2, double y2) { // return angle on the left side of the vertex at the juntion of line segments // (x0,y0) to (x1,y1), and (x1,y1) to (x2,y2) double vectora [3], vectorb [3], vectoraxb [3]; vectora [0] = x1 - x0; vectora [1] = y1 - y0; vectora [2...
false
false
false
false
false
0
vv_sub3(vectorA, vectorB, v_result) const hvec3_t *vectorA; const hvec3_t *vectorB; hvec3_t *v_result; { v_result = gm_ALLOC(hvec3_t, v_result, "vv_sub3()"); v_x(*v_result) = v_x(*vectorA) - v_x(*vectorB); v_y(*v_result) = v_y(*vectorA) - v_y(*vectorB); v_z(*v_result) = v_z(*vectorA) - v_z(*vectorB); v_...
false
false
false
true
true
1
gth_window_attach_toolbar (GthWindow *window, int page, GtkWidget *child) { g_return_if_fail (window != NULL); g_return_if_fail (GTH_IS_WINDOW (window)); g_return_if_fail (page >= 0 && page < window->priv->n_pages); g_return_if_fail (child != NULL); g_return_if_fail (GTK_IS_WIDGET (child)); _g...
false
false
false
false
false
0
CLSIZE(const ShowerParticleVector::const_iterator & a) { return (*a)->colourInfo()->colourLines().size(); }
false
false
false
false
false
0
atl1e_hw_set_mac_addr(struct atl1e_hw *hw) { u32 value; /* * 00-0B-6A-F6-00-DC * 0: 6AF600DC 1: 000B * low dword */ value = (((u32)hw->mac_addr[2]) << 24) | (((u32)hw->mac_addr[3]) << 16) | (((u32)hw->mac_addr[4]) << 8) | (((u32)hw->mac_addr[5])) ; AT_WRITE_REG_ARRAY(hw, REG_MAC_STA_ADDR, 0, value);...
false
false
false
false
false
0
coeff(int narg, char **arg) { if (narg != 3) error->all(FLERR,"Incorrect number of args for sph/rhosum coefficients"); if (!allocated) allocate(); int ilo, ihi, jlo, jhi; force->bounds(arg[0], atom->ntypes, ilo, ihi); force->bounds(arg[1], atom->ntypes, jlo, jhi); double cut_one = force->numeric(F...
false
false
false
false
false
0
city_unit_supported(const struct city *pcity, struct universal target) { if (VUT_UTYPE == target.kind) { struct unit_type *tvtype = target.value.utype; unit_list_iterate(pcity->units_supported, punit) { if (unit_type(punit) == tvtype) return TRUE; } unit_list_iterate_end; } return FALSE; }
false
false
false
false
false
0
GetSubDirList(const string& dir) { vector<string> subDirs; string rootdir; #ifdef _WIN32 stringstream s; if (dir == "") { CHAR path[4096]; GetCurrentDirectoryA(4096, path); s << path << "/"; } else { s << dir << "/"; } rootdir = s.str(); WIN32_FIND_DATAA FindFi...
false
false
false
false
false
0
xen_intel_read_pmc(int counter) { struct xen_pmu_intel_ctxt *ctxt; uint64_t *fixed_counters; struct xen_pmu_cntr_pair *arch_cntr_pair; struct xen_pmu_data *xenpmu_data = get_xenpmu_data(); uint8_t xenpmu_flags = get_xenpmu_flags(); if (!xenpmu_data || !(xenpmu_flags & XENPMU_IRQ_PROCESSING)) { uint32_t msr; ...
false
false
false
false
false
0
change_exp(object *op, sint64 exp, const char *skill_name, int flag) { #ifdef EXP_DEBUG char name[MAX_BUF]; query_name(op, name, MAX_BUF); #ifndef WIN32 LOG(llevDebug, "change_exp() called for %s, exp = %lld\n", name, exp); #else LOG(llevDebug, "change_exp() called for %s, exp = %I64d\n", name, exp); #e...
false
false
false
false
false
0
check_final_overrider (tree overrider, tree basefn) { tree over_type = TREE_TYPE (overrider); tree base_type = TREE_TYPE (basefn); tree over_return = TREE_TYPE (over_type); tree base_return = TREE_TYPE (base_type); tree over_throw = TYPE_RAISES_EXCEPTIONS (over_type); tree base_throw = TYPE_RAISES_EXCEPTION...
false
false
false
false
false
0
log_set(enum log_file which, const char *path) { struct logfile *lf; log_file_check(which); g_assert(path != NULL); lf = &logfile[which]; if (NULL == lf->path || strcmp(path, lf->path) != 0) lf->changed = log_inited; /* Pending a reopen when inited */ if (atoms_are_inited) { if (lf->path_is_atom) atom_...
false
false
false
false
false
0
read_indirect_string (unit, buf, bytes_read_ptr) struct comp_unit* unit; char *buf; unsigned int *bytes_read_ptr; { bfd_vma offset; struct dwarf2_debug *stash = unit->stash; if (unit->offset_size == 4) offset = read_4_bytes (unit->abfd, buf); else offset = read_8_bytes (unit->abfd, buf);...
false
false
false
false
false
0
read_environments( Environments &envs ) { envs.clear(); uint32_t count; *this >> count; for ( unsigned int i = 0; i < count; i++ ) { string plat; string vers; *this >> plat; *this >> vers; envs.push_back( make_pair( plat, vers ) ); } }
false
false
false
false
false
0
sec_pmic_dump_rev(struct sec_pmic_dev *sec_pmic) { unsigned int val; /* For each device type, the REG_ID is always the first register */ if (!regmap_read(sec_pmic->regmap_pmic, S2MPS11_REG_ID, &val)) dev_dbg(sec_pmic->dev, "Revision: 0x%x\n", val); }
false
false
false
false
false
0
calculate_label (GcrGnupgRenderer *self) { gchar *userid; gchar *label = NULL; if (self->pv->attrs) { if (gck_attributes_find_string (self->pv->attrs, CKA_LABEL, &label)) return label; } userid = _gcr_gnupg_records_get_user_id (self->pv->records); if (userid != NULL) { if (!_gcr_gnupg_records_parse_user_...
false
false
false
false
false
0
zfile_goto(struct zfile *fil, struct zcache *zc, avoff_t offset) { int res; AV_LOCK(zc->lock); AV_LOCK(zread_lock); #ifdef USE_SYSTEM_ZLIB if ( offset < fil->s.total_out ) { res = zfile_reset(fil); } else res = 0; #else res = zfile_seek(fil, zc, offset); #endif AV_UNLOCK(zread_lock)...
false
false
false
false
false
0
_e_mod_comp_win_do_shadow(E_Comp_Win *cw) { if (cw->shaped) return 0; if (cw->argb) { if (_e_mod_comp_win_is_borderless(cw)) return 0; } return 1; }
false
false
false
false
false
0
srtp_aes_cbc_decrypt(aes_cbc_ctx_t *c, unsigned char *data, unsigned int *bytes_in_data) { int i; v128_t state, previous; unsigned char *input = data; /* pointer to data being read */ unsigned char *output = data; /* pointer to data being written */ int bytes_to_encr = *bytes_in_data; uint8_t t...
false
false
false
false
false
0
computeBaseType(const Type& tp) { const Expr& e = tp.getExpr(); Type res; switch(e.getKind()) { case SUBTYPE: { DebugAssert(e.arity() == 1, "Expr::computeBaseType(): "+e.toString()); Type lambdaTp = e[0].getType(); Type lambdaBaseTp = getBaseType(lambdaTp); DebugAssert(lambdaBaseTp.isFunction(),...
false
false
false
false
false
0
_pam_ldap_get_session (pam_handle_t * pamh, const char *username, const char *configFile, pam_ldap_session_t ** psession) { pam_ldap_session_t *session; int rc; if (pam_get_data (pamh, PADL_LDAP_SESSION_DATA, (const void **) &session) == PAM_SUCCESS) { /* * we cache the informatio...
false
false
false
false
false
0
print_semantic_function_header (lf *file, const char *basename, const char *format_name, opcode_bits *expanded_bits, int is_function_definition, int nr_prefetched_words) { int indent; lf_printf (file, "\n"); lf_print__function_type_function (file, print_semantic_function_type, "EXTERN_...
false
false
false
false
false
0
openProperties() { for (int mode = 0; mode <= 2; ++mode) { // search for defaults-database const char *name = ED4_propertyName(mode); AW_default found = ED4_ROOT->aw_root->open_default(name, mode == 2); // if mode == 2 -> create if missing if (found) { ED4_ROOT->db = foun...
false
false
false
false
false
0
usb_port_runtime_suspend(struct device *dev) { struct usb_port *port_dev = to_usb_port(dev); struct usb_device *hdev = to_usb_device(dev->parent->parent); struct usb_interface *intf = to_usb_interface(dev->parent); struct usb_hub *hub = usb_hub_to_struct_hub(hdev); struct usb_port *peer = port_dev->peer; int port...
false
false
false
false
false
0
toElem (IRState *irs) { if (unhandled_arrayop_p (this)) return error_mark_node; tree exp = toElemBin (irs, MINUS_EXPR); return convert_expr (exp, e1->type, type); }
false
false
false
false
false
0
super_fgets(char **b, size_t *blen, Image *file) { int c; size_t len; unsigned char *p, *q; len=*blen; p=(unsigned char *) (*b); for (q=p; ; q++) { c=ReadBlobByte(file); if (c == EOF || c == '\n') break; if ((q-p+1) >= (int) len) { int tlen; ...
false
false
false
false
false
0
set_wrong_args(Jim_Interp *interp, const jim_subcmd_type * command_table, Jim_Obj *subcmd) { Jim_SetResultString(interp, "wrong # args: should be \"", -1); add_cmd_usage(interp, command_table, subcmd); Jim_AppendStrings(interp, Jim_GetResult(interp), "\"", NULL); }
false
false
false
false
false
0
make_component_list() { DIR *dir; struct dirent *dirent; const char *name; dir = opendir(_lib_path); if (dir == NULL) error(TRUE, "Cannot read directory: %s", _lib_path); //save_fd = dup(STDOUT_FILENO); ARRAY_create(&_components); while ((dirent = readdir(dir)) != NULL) { name = dirent->d_name; i...
false
false
false
false
false
0
switch_to_manual_layout (NemoIconView *icon_view) { if (!nemo_icon_view_using_auto_layout (icon_view)) { return; } icon_view->details->sort = &sort_criteria[0]; nemo_icon_container_set_auto_layout (get_icon_container (icon_view), FALSE); }
false
false
false
false
false
0
_pack_node_subgrp(node_subgrp_t *subgrp, Buf buffer, uint16_t protocol_version) { if (protocol_version >= SLURM_2_3_PROTOCOL_VERSION) { pack_bit_fmt(subgrp->bitmap, buffer); pack16(subgrp->cnode_cnt, buffer); pack16(subgrp->state, buffer); } return SLURM_SUCCESS; }
false
false
false
false
false
0
gfire_server_query_add_server(gfire_server_query *p_query, guint32 p_ip, guint16 p_port, gpointer p_data) { if(!p_query || p_ip == 0 || p_port == 0) return; gfire_game_query_server *server = g_malloc0(sizeof(gfire_game_query_server)); server->server = g_malloc0(sizeof(gfire_game_server)); server->p_data = p_data...
false
false
false
false
false
0
dump_solution_for_var (FILE *file, unsigned int var) { varinfo_t vi = get_varinfo (var); unsigned int i; bitmap_iterator bi; /* Dump the solution for unified vars anyway, this avoids difficulties in scanning dumps in the testsuite. */ fprintf (file, "%s = { ", vi->name); vi = get_varinfo (find (var))...
false
false
false
false
false
0
internal_generic_eventhandler(plugin_event_t *event) { lcd_t *lcd = (lcd_t*) event->lcd; switch (event->event) { case G15_EVENT_KEYPRESS: { if(lcd->g15plugin->plugin_handle){ /* loadable plugin */ /* plugin had null for eventhandler therefore doesnt want events...
false
false
false
false
false
0
et131x_tx_dma_memory_alloc(struct et131x_adapter *adapter) { int desc_size = 0; struct tx_ring *tx_ring = &adapter->tx_ring; /* Allocate memory for the TCB's (Transmit Control Block) */ tx_ring->tcb_ring = kcalloc(NUM_TCB, sizeof(struct tcb), GFP_ATOMIC | GFP_DMA); if (!tx_ring->tcb_ring) return -ENOMEM...
false
false
false
false
false
0
vnic_dev_cmd_status(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd, int *status) { u64 a0 = cmd, a1 = 0; int wait = 1000; int ret; ret = vnic_dev_cmd(vdev, CMD_STATUS, &a0, &a1, wait); if (!ret) *status = (int)a0; return ret; }
false
false
false
false
false
0
view_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec) { GiggleViewPriv *priv = GET_PRIV (object); switch (param_id) { case PROP_ACTION: g_assert (NULL == priv->action); priv->action = g_value_dup_object (value); break; case PROP_ACCELERATOR...
false
false
false
false
false
0
remove_subtree(const char *path) { DIR *dir = opendir(path); struct dirent *de; char pathbuf[PATH_MAX]; char *name; if (!dir) die_errno("cannot opendir '%s'", path); strcpy(pathbuf, path); name = pathbuf + strlen(path); *name++ = '/'; while ((de = readdir(dir)) != NULL) { struct stat st; if (is_dot_or_d...
false
false
false
false
false
0
mem_alloc_tiny(size_t size, size_t align) { static char *buffer = NULL; static size_t bufree = 0; size_t mask; char *p; #if ARCH_ALLOWS_UNALIGNED if (mem_saving_level > 2) align = MEM_ALIGN_NONE; #endif mask = align - 1; do { if (buffer) { size_t need = size + mask - (((size_t)buffer + mask) & m...
false
false
false
false
false
0
commitValue() { // Handle the ,, case gracefully by doing nothing. if (x || y || blur || color) { if (!values) values = new CSSValueListImpl(CSSValueListImpl::Comma); // Construct the current shadow value and add it to the list. values->append(new Sha...
false
false
false
false
false
0
Xmg_setx11display(Display *dpy) { int rgbmap[216][3], i, cube, colfail = 1; unsigned int nplanes = 0; unsigned long planemasks[1]; char *colorenv; _mgx11c->mgx11display = dpy; if (mgx11display == dpy) return; mgx11display = dpy; if (_mgx11c->bitdepth == 1) /* We are on a black and white screen...
false
false
false
false
false
0
__btrfs_releasepage(struct page *page, gfp_t gfp_flags) { struct extent_io_tree *tree; struct extent_map_tree *map; int ret; tree = &BTRFS_I(page->mapping->host)->io_tree; map = &BTRFS_I(page->mapping->host)->extent_tree; ret = try_release_extent_mapping(map, tree, page, gfp_flags); if (ret == 1) { ClearPageP...
false
false
false
false
false
0
diff_lists(struct rel *a1, struct rel *a2) { if (a1 == NULL && a2 == NULL) { struct ilist *v = get_ilist(); v->i = 0; return v; } else if (a1 == NULL || a2 == NULL) { struct ilist *v = get_ilist(); v->i = 1; return v; } else { return add_vecs(diff(a1->argval, a2->argval), dif...
false
false
false
false
false
0
range_include(range, val) VALUE range, val; { VALUE beg, end; beg = rb_ivar_get(range, id_beg); end = rb_ivar_get(range, id_end); if (r_le(beg, val)) { if (EXCL(range)) { if (r_lt(val, end)) return Qtrue; } else { if (r_le(val, end)) return Qtrue; } } return Qfalse; }
false
false
false
false
false
0
WiggleReaderPop(WiggleIterator * wi) { WiggleReaderData * data = (WiggleReaderData*) wi->data; char line[5000]; if (wi->done) return; while (fgets(line, 5000, data->file)) { if (line[0] == '#' || line[0] == EOF) continue; else if ( !strncmp("variableStep", line, 12)) { data->readingMode = VARIABLE_STE...
false
false
false
false
false
0
PDestroyFvwmPicture(Display *dpy, FvwmPicture *p) { FvwmPicture *q = FvwmPictureList; if (!p) { return; } /* Remove a weight */ if(--(p->count)>0) { /* still too heavy? */ return; } /* Let it fly */ if (p->alloc_pixels != NULL) { if (p->nalloc_pixels != 0) { PictureFreeColors( dpy, Pcmap, ...
false
false
false
false
false
0
gen_host(addr, mask, proto, dir, type) bpf_u_int32 addr; bpf_u_int32 mask; int proto; int dir; int type; { struct block *b0, *b1; const char *typestr; if (type == Q_NET) typestr = "net"; else typestr = "host"; switch (proto) { case Q_DEFAULT: b0 = gen_host(addr, mask, Q_IP, dir, type); /* * Onl...
false
false
false
false
false
0
test_repo_init__bare_repo_escaping_current_workdir(void) { git_buf path_repository = GIT_BUF_INIT; git_buf path_current_workdir = GIT_BUF_INIT; cl_git_pass(git_path_prettify_dir(&path_current_workdir, ".", NULL)); cl_git_pass(git_buf_joinpath(&path_repository, git_buf_cstr(&path_current_workdir), "a/b/c")); cl_g...
false
false
false
false
false
0
format_expand_code(const char **format, GString *out, int *flags) { int set; if (flags == NULL) { /* flags are being ignored - skip the code */ while (**format != ']') (*format)++; return; } set = TRUE; (*format)++; while (**format != ']' && **format != '\0') { if (**format == '+') set = TRUE; e...
false
false
false
false
false
0
undoLevel(Solver& s) { while (!nogoods.empty() && nogoods.back().second >= s.decisionLevel()) { Constraint* c = nogoods.back().first; nogoods.pop_back(); c->destroy(&s, true); } }
false
false
false
false
false
0
gt_freefmindex(Fmindex *fmindex) { if (fmindex->mappedptr != NULL) { gt_fa_xmunmap(fmindex->mappedptr); } if (fmindex->bwtformatching != NULL) { gt_encseq_delete(fmindex->bwtformatching); fmindex->bwtformatching = NULL; } gt_alphabet_delete((GtAlphabet *) fmindex->alphabet); }
false
false
false
false
false
0
mthca_get_dma_mr(struct ib_pd *pd, int acc) { struct mthca_mr *mr; int err; mr = kmalloc(sizeof *mr, GFP_KERNEL); if (!mr) return ERR_PTR(-ENOMEM); err = mthca_mr_alloc_notrans(to_mdev(pd->device), to_mpd(pd)->pd_num, convert_access(acc), mr); if (err) { kfree(mr); return ERR_PTR(err); ...
false
false
false
false
false
0
orte_pretty_print_timing(int64_t secs, int64_t usecs) { unsigned long minutes, seconds; float fsecs; char *timestring; seconds = secs + (usecs / 1000000l); minutes = seconds / 60l; seconds = seconds % 60l; if (0 == minutes && 0 == seconds) { fsecs = ((float)(secs)*1000000.0 + (f...
false
false
false
false
false
0
bmg160_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, int state) { struct bmg160_data *data = iio_priv(indio_dev); int ret; if (state && data->ev_enable_state) return 0; mutex_lock(&data-...
false
false
false
false
false
0
toString(const std::string& qualifier) const { ValueType::const_iterator i = value_.find(qualifier); if (i != value_.end()) { ok_ = true; return i->second; } ok_ = false; return ""; }
false
false
false
false
false
0
BumblebeeCamera() { CSetOfObjectsPtr camera = opengl::CSetOfObjects::Create(); CPolyhedronPtr rect = opengl::CPolyhedron::CreateCubicPrism( -0.02, 0.14, -0.02, 0.02, 0, -0.04 ); rect->setColor( 1, 0.8, 0 ); camera->insert( rect ); CCylinderPtr lCam = opengl::CCylinder::Create( 0.01,0.01, 0.003, 10, 10 ); lCam...
false
false
false
false
false
0