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
drop_ref(struct hidraw *hidraw, int exists_bit) { if (exists_bit) { hidraw->exist = 0; if (hidraw->open) { hid_hw_close(hidraw->hid); wake_up_interruptible(&hidraw->wait); } device_destroy(hidraw_class, MKDEV(hidraw_major, hidraw->minor)); } else { --hidraw->open; } if (!hidraw->open) { ...
false
false
false
false
false
0
alarm_applet_alarms_add (AlarmApplet *applet, Alarm *alarm) { applet->alarms = g_list_append (applet->alarms, alarm); g_signal_connect (alarm, "notify", G_CALLBACK (alarm_applet_alarm_changed), applet); g_signal_connect (alarm, "notify::sound-file", G_CALLBACK (alarm_sound_file_changed), applet); g_signal_conn...
false
false
false
false
false
0
intel_runtime_pm_get_if_in_use(struct drm_i915_private *dev_priv) { struct drm_device *dev = dev_priv->dev; struct device *device = &dev->pdev->dev; if (IS_ENABLED(CONFIG_PM)) { int ret = pm_runtime_get_if_in_use(device); /* * In cases runtime PM is disabled by the RPM core and we get * an -EINVAL return...
false
false
false
false
false
0
vs_clip(int handle, int clipping, int pxy[4]) { DEFINE_VPB; int i; o_vdipb.intin[0] = clipping; if(clipping != 0) /* ignore pxy if clipping is off */ for(i=0 ; i<4 ; i++) o_vdipb.ptsin[i] = pxy[i]; o_vdipb.contrl[VDI_HANDLE] = handle; o_vdipb.contrl[ROUTINE] = 129; o_vdipb.contrl[N_PTSIN] = 2...
false
false
false
false
false
0
PyvtkDSPFilterGroup_GetOutput(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetOutput"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkDSPFilterGroup *op = static_cast<vtkDSPFilterGroup *>(vp); int temp0; int temp1; int temp2; PyObject *result = NULL; if (op && ap.CheckArgCou...
false
false
false
false
false
0
recursive_mkdir (const char *path) { int loop = 0; int r; char *p; struct stat buf; again: r = mkdir (path, 0777); if (r == -1) { if (errno == EEXIST) { /* Something exists here, might not be a dir. */ r = lstat (path, &buf); if (r == -1) return -1; if (!S_ISDIR (buf.st_mode)) return...
false
false
false
false
false
0
findFormattedLineSplitPoint(int sequenceLength) const { // don't split if the last char is a semi-colon or space if (formattedLine.length() == maxCodeLength + 1 && (currentChar == ';' || currentChar == ' ')) return 0; // determine where to split size_t indentLength_ = static_cast<size_t>(getIndentLength...
false
false
false
false
false
0
pps_add_offset(struct pps_ktime *ts, struct pps_ktime *offset) { ts->nsec += offset->nsec; while (ts->nsec >= NSEC_PER_SEC) { ts->nsec -= NSEC_PER_SEC; ts->sec++; } while (ts->nsec < 0) { ts->nsec += NSEC_PER_SEC; ts->sec--; } ts->sec += offset->sec; }
false
false
false
false
false
0
omac_init(omac_state *omac, int cipher, const unsigned char *key, unsigned long keylen) { int err, x, y, mask, msb, len; LTC_ARGCHK(omac != NULL); LTC_ARGCHK(key != NULL); /* schedule the key */ if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { return err; } #ifdef LTC_FAST if (cipher_de...
false
false
false
false
false
0
noop_scissor(struct gl_context *ctx, struct gl_framebuffer *fb) { return ctx->Scissor.ScissorArray[0].X <= 0 && ctx->Scissor.ScissorArray[0].Y <= 0 && ctx->Scissor.ScissorArray[0].Width >= fb->Width && ctx->Scissor.ScissorArray[0].Height >= fb->Height; }
false
false
false
false
false
0
AddMember(ObjectGuid playerGuid) { std::string plName; uint8 plClass; // arena team is full (can't have more than type * 2 players!) if (GetMembersSize() >= GetMaxMembersSize()) return false; Player* pl = sObjectMgr.GetPlayer(playerGuid); if (pl) { if (pl->GetArenaTeamId(Ge...
false
false
false
false
false
0
libipv6addr_get_included_ipv4addr(const ipv6calc_ipv6addr *ipv6addrp, ipv6calc_ipv4addr *ipv4addrp, const int selector) { int result = -1; uint32_t typeinfo; int begin = -1; int i; uint8_t xor = 0; typeinfo = ipv6addrp->scope; DEBUGPRINT_WA(DEBUG_libipv6addr, "Called with IPv6 address having typeinfo: 0x%08x",...
false
false
false
false
false
0
reset_uart401(struct uart401_devc *devc) { int ok, timeout, n; /* * Send the RESET command. Try again if no success at the first time. */ ok = 0; for (n = 0; n < 2 && !ok; n++) { for (timeout = 30000; timeout > 0 && !output_ready(devc); timeout--); devc->input_byte = 0; uart401_cmd(devc, MPU_RESET); ...
false
false
false
false
false
0
escape(const char *text, int cnt, const char *extra) { int len = 0; char *esc = NULL, *e; if (cnt < 0 || cnt > strlen(text)) cnt = strlen(text); for (int i=0; i < cnt; i++) { if (text[i] && (strchr(escape_chars, text[i]) != NULL)) len += 2; /* Escaped as '\x' */ e...
false
false
false
false
false
0
H5SM_type_shared(H5F_t *f, unsigned type_id, hid_t dxpl_id) { H5SM_master_table_t *table = NULL; /* Shared object master table */ unsigned type_flag; /* Flag corresponding to message type */ size_t u; /* Local index variable */ htri_t ret_value = FALSE; ...
false
false
false
false
false
0
mov_read_stts(MOVContext *c, ByteIOContext *pb, MOVAtom atom) { AVStream *st; MOVStreamContext *sc; unsigned int i, entries; int64_t duration=0; int64_t total_sample_count=0; if (c->fc->nb_streams < 1) return 0; st = c->fc->streams[c->fc->nb_streams-1]; sc = st->priv_data; ...
false
false
false
false
false
0
lpphy_tx_pctl_init_sw(struct b43_wldev *dev) { struct lpphy_tx_gains gains; if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) { gains.gm = 4; gains.pad = 12; gains.pga = 12; gains.dac = 0; } else { gains.gm = 7; gains.pad = 14; gains.pga = 15; gains.dac = 0; } lpphy_set_tx_gains(dev, gains); ...
false
false
false
false
false
0
pause_or_play_song() { if (!player || !player->tracks) return; if (is_stopped()) { GError *err1 = NULL; set_control_state(GST_STATE_PLAYING); player->thread = g_thread_try_new ("play-song-thread", (GThreadFunc)thread_play_song, NULL, &err1); if (!player->thread) { ...
false
false
false
false
false
0
emit_sos (j_compress_ptr cinfo) /* Emit a SOS marker */ { int i, td, ta; jpeg_component_info *compptr; emit_marker(cinfo, M_SOS); emit_2bytes(cinfo, 2 * cinfo->comps_in_scan + 2 + 1 + 3); /* length */ emit_byte(cinfo, cinfo->comps_in_scan); for (i = 0; i < cinfo->comps_in_scan; i++) { comppt...
false
false
false
false
false
0
borg_projectable_dark(int y1, int x1, int y2, int x2) { int dist, y, x; int unknown = 0; borg_grid *ag; /* Start at the initial location */ y = y1; x = x1; /* Simulate the spell/missile path */ for (dist = 0; dist <= MAX_RANGE; dist++) { /* Get the grid */ ag = &borg_gr...
false
false
false
false
false
0
bisho_utils_make_exclusive_expander (MuxExpandingItem *item) { g_return_if_fail (MUX_IS_EXPANDING_ITEM (item)); expander_list = g_list_prepend (expander_list, item); g_object_weak_ref (G_OBJECT (item), item_finalized_cb, NULL); g_signal_connect (item, "notify::expanded", G_CALLBACK (expanded_cb), NULL); }
false
false
false
false
false
0
showgthgenomicinformation(GthSA *sa, GthInput *input, bool showseqnums, GtFile *outfp) { gt_assert(gth_sa_gen_file_num(sa) != GT_UNDEF_ULONG); gt_file_xprintf(outfp, "Genomic Template: file=%s, strand=%c, from=%lu, " "to=%lu, description=", ...
false
false
false
false
false
0
mcf_find_vcl(struct cli *cli, const char *name) { struct vclprog *vp; vp = mgt_vcc_byname(name); if (vp != NULL) return (vp); VCLI_SetResult(cli, CLIS_PARAM); VCLI_Out(cli, "No configuration named %s known.", name); return (NULL); }
false
false
false
false
false
0
STREAM_begin(STREAM *stream) { STREAM_cancel(stream); if (!stream->common.redirect) { ALLOC_ZERO(&stream->common.redirect, sizeof(STREAM), "STREAM_begin"); STREAM_open(stream->common.redirect, NULL, ST_STRING | ST_WRITE); } stream->common.redirected = TRUE; }
false
false
false
false
false
0
get_var_tv(name, len, rettv, verbose) char_u *name; int len; /* length of "name" */ typval_T *rettv; /* NULL when only checking existence */ int verbose; /* may give error message */ { int ret = OK; typval_T *tv = NULL; typval_T atv; dictitem_T *v; int cc; /* truncate the ...
false
false
false
false
false
0
php_cli_server_buffer_dtor(php_cli_server_buffer *buffer) /* {{{ */ { php_cli_server_chunk *chunk, *next; for (chunk = buffer->first; chunk; chunk = next) { next = chunk->next; php_cli_server_chunk_dtor(chunk); pefree(chunk, 1); } }
false
false
false
false
false
0
getState ( std::istream& is ) { unsigned short cseed[3]; if ( possibleKeywordInput ( is, "Uvec", cseed[0] ) ) { std::vector<unsigned long> v; unsigned long uu; #ifdef TRACE_IO std::cout << "DRand48Engine::getState detected Uvec keyword\n"; uu = 999999; #endif for (unsigned int ivec=0; ...
false
false
false
false
false
0
mono_arch_get_unbox_trampoline (MonoMethod *m, gpointer addr) { guint8 *code, *start; int this_reg, size = NACL_SIZE (20, 32); MonoDomain *domain = mono_domain_get (); this_reg = mono_arch_get_this_arg_reg (NULL); start = code = mono_domain_code_reserve (domain, size); amd64_alu_reg_imm (code, X86_ADD, this_r...
false
false
false
false
false
0
dib0070_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct dib0070_config *cfg) { struct dib0070_state *state = kzalloc(sizeof(struct dib0070_state), GFP_KERNEL); if (state == NULL) return NULL; state->cfg = cfg; state->i2c = i2c; state->fe = fe; mutex_init(&state->i2c_buffer_lock); fe->tuner_pr...
false
false
false
false
false
0
store_clique(set_t clique, graph_t *g, clique_options *opts) { clique_list_count++; /* clique_list[] */ if (opts->clique_list) { /* * This has been a major source of bugs: * Has clique_list_count been set to 0 before calling * the recursions? */ if (clique_list_count <= 0) { fprintf(stderr,"CLI...
false
false
false
false
false
0
travel_block(Block *start, int (*func)(Block *, void *), void *data) { Block *bp; for(bp = start; bp != NULL; bp = bp->next) { if(func(bp, data) == 0) { return 0; } if(bp->inner != NULL) { if(travel_block(bp->inner, func, data) == 0) { return 0; } } } return 1; }
false
false
false
false
false
0
PatientSaved(Creature* /*soldier*/, Player* pPlayer, Location* pPoint) { if (pPlayer && m_playerGuid == pPlayer->GetObjectGuid()) { if (pPlayer->GetQuestStatus(QUEST_TRIAGE_A) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(QUEST_TRIAGE_H) == QUEST_STATUS_INCOMPLETE) { ++m_uiPa...
false
false
false
false
false
0
dwarf_loclist_from_expr_a(Dwarf_Debug dbg, Dwarf_Ptr expression_in, Dwarf_Unsigned expression_length, Dwarf_Half addr_size, Dwarf_Locdesc ** llbuf, Dwarf_Signed * listlen, Dwarf_Error * error) { /* Dwarf_Block that describes a single location expression. */ Dwarf_Block loc_block; /* A p...
false
false
false
false
false
0
unmap_bf_area(struct mlx5_core_dev *dev) { if (dev->priv.bf_mapping) io_mapping_free(dev->priv.bf_mapping); }
false
false
false
false
false
0
c_square(COMPLEX *c) { COMPLEX *r; NUMBER *q1, *q2; if (ciszero(c)) return clink(&_czero_); if (cisrunit(c)) return clink(&_cone_); if (cisiunit(c)) return clink(&_cnegone_); r = comalloc(); if (cisreal(c)) { qfree(r->real); r->real = qsquare(c->real); return r; } if (cisimag(c)) { qfree(r->real...
false
false
false
false
false
0
cyapa_i2c_pip_write(struct cyapa *cyapa, u8 *buf, size_t size) { int ret; if (!buf || !size) return -EINVAL; ret = i2c_master_send(cyapa->client, buf, size); if (ret != size) return (ret < 0) ? ret : -EIO; return 0; }
false
false
false
false
false
0
editor_fileinfo_cleanup (GuEditor* ec) { gchar* auxfile = NULL; gchar* logfile = NULL; gchar* syncfile = NULL; if (ec->filename) { gchar* dirname = g_path_get_dirname (ec->filename); gchar* basename = g_path_get_basename (ec->filename); auxfile = g_strdup_printf ("%s%c.%s.au...
false
false
false
false
false
0
_elm_layout_smart_box_insert_at(Evas_Object *obj, const char *part, Evas_Object *child, unsigned int pos) { Elm_Layout_Sub_Object_Data *sub_d; ELM_LAYOUT_DATA_GET(obj, sd); if (!edje_object_part_box_insert_at ...
false
false
false
false
false
0
NotifyCleanWorkspace() { if (m_CommandQueue.GetCount() == 0) { CodeBlocksEvent evt(cbEVT_CLEAN_WORKSPACE_STARTED, 0, 0, 0, this); Manager::Get()->ProcessEvent(evt); } Manager::Yield(); }
false
false
false
false
false
0
parse_comm (char **word, size_t *word_length, size_t *max_length, const char *words, size_t *offset, int flags, wordexp_t *pwordexp, const char *ifs, const char *ifs_white) { /* We are poised just after "$(" */ int paren_depth = 1; int error = 0; int quoted = 0; /* 1 for singly-quoted, 2 for doubly-qu...
false
false
false
false
false
0
dibusb_i2c_msg(struct dvb_usb_device *d, u8 addr, u8 *wbuf, u16 wlen, u8 *rbuf, u16 rlen) { u8 sndbuf[MAX_XFER_SIZE]; /* lead(1) devaddr,direction(1) addr(2) data(wlen) (len(2) (when reading)) */ /* write only ? */ int wo = (rbuf == NULL || rlen == 0), len = 2 + wlen + (wo ? 0 : 2); if (4 + wlen > sizeof(sn...
false
true
false
false
false
1
redirect_reply(BIO *const c, const char *url, const int code) { char rep[MAXBUF], cont[MAXBUF], safe_url[MAXBUF], *code_msg; int i, j; switch(code) { case 301: code_msg = "Moved Permanently"; break; case 307: code_msg = "Temporary Redirect"; break; default...
false
false
false
false
false
0
doopts(char *args) { char *cmdopts; if ((cmdopts = strchr(args, ' ')) != NULL) { cmdopts++; (void) cmdopts; } # ifdef WITH_RFC2640 if (strncasecmp("utf8 ", args, 5) == 0 || strncasecmp("utf-8 ", args, 6) == 0) { if (cmdopts == NULL || *cmdopts == 0) { ...
false
false
false
false
false
0
WriteData() { FILE *geomFp; vtkPolyData *input= this->GetInput(); int numPts=input->GetNumberOfPoints(); if ( numPts < 1 ) { vtkErrorMacro(<<"No data to write!"); return; } if ( !this->GeometryFileName ) { vtkErrorMacro(<< "Geometry file name was not specified"); this->SetErrorC...
false
false
false
false
false
0
conv_rgbAF_rgb8 (unsigned char *srcc, unsigned char *dstc, long samples) { float *src = (void *) srcc; unsigned char *dst = (void *) dstc; long n = samples; while (n--) { float alpha = src[3]; if (alpha < BABL_ALPHA_THRESHOLD) ...
false
false
false
false
false
0
Wait_2(WamWord pid_word, WamWord status_word) { int pid; int status; pid = Rd_Integer_Check(pid_word); Check_For_Un_Integer(status_word); #ifdef _WIN32 Os_Test_Error(_cwait(&status, pid, _WAIT_CHILD) == -1); #else Os_Test_Error(waitpid(pid, &status, 0) == -1); if (WIFEXITED(status)) status = WEXITS...
false
false
false
false
false
0
iwch_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc) { struct iwch_dev *rhp; struct iwch_cq *chp; unsigned long flags; int npolled; int err = 0; chp = to_iwch_cq(ibcq); rhp = chp->rhp; spin_lock_irqsave(&chp->lock, flags); for (npolled = 0; npolled < num_entries; ++npolled) { #ifdef DEBUG in...
false
false
false
false
false
0
testFBuf(struct node *node) { struct v4l2_framebuffer fbuf; struct v4l2_pix_format &fmt = fbuf.fmt; __u32 caps; __u32 flags; int ret; memset(&fbuf, 0xff, sizeof(fbuf)); fbuf.fmt.priv = 0; ret = doioctl(node, VIDIOC_G_FBUF, &fbuf); fail_on_test(ret == 0 && !(node->caps & (V4L2_CAP_VIDEO_OVERLAY | V4L2_CAP_VIDE...
false
false
false
false
false
0
main_entry_completion_match (GtkEntryCompletion *completion, const gchar *key, GtkTreeIter *iter) { GtkTreeModel *model; gchar *s1, *s2; gboolean match; model = gtk_entry_completion_get_model (completion); gtk_tree_model_...
false
false
false
false
false
0
emitCondStore(MachineInstr *MI, MachineBasicBlock *MBB, unsigned StoreOpcode, unsigned STOCOpcode, bool Invert) const { const SystemZInstrInfo *TII = static_cast<const SystemZInstrInfo *>(Subtarget.get...
false
false
false
false
false
0
round_to_power_of_2(uint64_t u64) { int lg2 = tor_log2(u64); uint64_t low = U64_LITERAL(1) << lg2, high = U64_LITERAL(1) << (lg2+1); if (high - u64 < u64 - low) return high; else return low; }
false
false
false
false
false
0
fetch(unsigned int ms) { // We need to fetch as many samples // as needed for a theoretical 44100hz loop. // That is 44100 samples each second. // 44100/1000 = x/ms // x = (44100*ms) / 1000 unsigned int nSamples = (441*ms) / 10; // We double because sound_ha...
false
false
false
false
false
0
dec_mpd_adjexp(PyObject *self, PyObject *dummy UNUSED) { mpd_ssize_t retval; if (mpd_isspecial(MPD(self))) { retval = 0; } else { retval = mpd_adjexp(MPD(self)); } return PyLong_FromSsize_t(retval); }
false
false
false
false
false
0
draw_boxes (state *st) { int i; for (i = 0; i < st->nboxes; i++) { box *b = &st->boxes[i]; if (b->flags & UNDEAD) continue; if (! (b->flags & CHANGED)) continue; b->flags &= ~CHANGED; if (!st->growing_p) { /* When shrinking, black out an area outside of the bord...
false
false
false
false
false
0
skl_update_pipe_wm(struct drm_crtc *crtc, struct skl_ddb_allocation *ddb, /* out */ struct skl_pipe_wm *pipe_wm /* out */) { struct intel_crtc *intel_crtc = to_intel_crtc(crtc); struct intel_crtc_state *cstate = to_intel_crtc_state(crtc->state); skl_allocate_pipe_ddb(cstate, ddb); skl_compute_p...
false
false
false
false
false
0
loadAllRootForms(const QString &uuidOrAbsPath) const { XmlFormName &form = formName(uuidOrAbsPath, m_FormNames); // XmlFormName form(uuidOrAbsPath); // qWarning() << Q_FUNC_INFO << uuidOrAbsPath << form.uid << form.absFileName; QList<Form::FormMain *> toReturn; QString uuid = uuidOrAbsPath; if (u...
false
false
false
false
false
0
lj_gc_barriertrace(global_State *g, uint32_t traceno) { if (g->gc.state == GCSpropagate || g->gc.state == GCSatomic) gc_marktrace(g, traceno); }
false
false
false
false
false
0
xml_sax_repeat_top (GsfXMLIn *xin, xmlChar const **attrs) { XMLSaxParseState *state = (XMLSaxParseState *)xin->user_state; PrintInformation *pi; xml_sax_must_have_sheet (state); pi = state->sheet->print_info; for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2) if (!strcmp (CXML2C (attrs[0]), "value")) ...
false
false
false
false
false
0
protocol_client_reopendir (clnt_fd_ctx_t *fdctx, xlator_t *this) { int ret = -1; gfs3_opendir_req req = {{0,},}; clnt_local_t *local = NULL; call_frame_t *frame = NULL; clnt_conf_t *conf = NULL; conf = this->private; local = mem_...
false
true
false
false
false
1
GetFeatureCount(int bForce ) { if (TestCapability(OLCFastFeatureCount)) return nRecords; return OGRLayer::GetFeatureCount(bForce); }
false
false
false
false
false
0
PyvtkRenderWindow_GetRGBACharPixelData(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetRGBACharPixelData"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkRenderWindow *op = static_cast<vtkRenderWindow *>(vp); int temp0; int temp1; int temp2; int temp3; int temp4; vtkUnsigne...
false
false
false
false
false
0
ajFilenameReplacePathC(AjPStr* Pfilename, const char* txt) { AjPStr tmpname = NULL; AjPStr tmpdir = NULL; if(!txt) return ajFalse; if(!fileFilenameExp) #ifndef WIN32 fileFilenameExp = ajRegCompC("(.*/)?([^/]+)$"); #else /* WIN32 */ fileFilenameExp = ajRegCompC("(.*[/\\\\])?([^/\\\\...
false
false
false
false
false
0
gretl_function_print_code (ufunc *u, PRN *prn) { int this_indent = 0; int next_indent = 0; int i, j; if (u == NULL) { return E_DATA; } print_function_start(u, prn); for (i=0; i<u->n_lines; i++) { adjust_indent(u->lines[i], &this_indent, &next_indent); for (j=0; j<=this_indent; j++) ...
false
false
false
false
false
0
_e_mod_comp_fps_toggle(void) { if (_comp_mod) { Eina_List *l; E_Comp *c; if (_comp_mod->conf->fps_show) { _comp_mod->conf->fps_show = 0; e_config_save_queue(); } else { _comp_mod->conf->fps_show = 1; ...
false
false
false
false
false
0
CheckRecoveryConsistency(void) { /* * Have we passed our safe starting point? */ if (!reachedMinRecoveryPoint && XLByteLE(minRecoveryPoint, EndRecPtr) && XLogRecPtrIsInvalid(ControlFile->backupStartPoint)) { reachedMinRecoveryPoint = true; ereport(LOG, (errmsg("consistent recovery state reached at %X...
false
false
false
false
false
0
osinfo_db_find_deployment(OsinfoDb *db, OsinfoOs *os, OsinfoPlatform *platform) { g_return_val_if_fail(OSINFO_IS_DB(db), NULL); g_return_val_if_fail(OSINFO_IS_OS(os), NULL); g_return_val_if_fail(OSINFO_IS_PLATFORM(platfo...
false
false
false
false
false
0
reset_stream_view_state(MAILSTREAM *stream) { MSGNO_S *mm; if(!stream) return; mm = sp_msgmap(stream); if(!mm) return; sp_set_viewing_a_thread(stream, 0); sp_set_need_to_rethread(stream, 0); mn_reset_cur(mm, stream->nmsgs > 0L ? stream->nmsgs : 0L); /* default */ mm->v...
false
false
false
false
false
0
calc_frame_len(struct sbc_frame_hdr *hdr) { int tmp, nrof_subbands, nrof_blocks; nrof_subbands = (hdr->subbands + 1) * 4; nrof_blocks = (hdr->blocks + 1) * 4; switch (hdr->channel_mode) { case 0x00: nrof_subbands /= 2; tmp = nrof_blocks * hdr->bitpool; break; case 0x01: tmp = nrof_blocks * hdr->bitpool ...
false
false
false
false
false
0
saveg_write_mobj_t(mobj_t *str) { // thinker_t thinker; saveg_write_thinker_t(&str->thinker); // fixed_t x; saveg_write32(str->x); // fixed_t y; saveg_write32(str->y); // fixed_t z; saveg_write32(str->z); // struct mobj_s* snext; saveg_writep(str->snext); // struct mobj_...
false
false
false
false
false
0
overlaps(const Interval &that) const { #if 1 Range *a = this->head; Range *b = that.head; while (a && b) { if (b->bgn < a->end && b->end > a->bgn) return true; if (a->end <= b->bgn) a = a->next; else b = b->next; } #else for (Range *rA = this->head;...
false
false
false
false
false
0
read_extension(git_index *index, const char *buffer, size_t buffer_size) { const struct index_extension *source; struct index_extension dest; size_t total_size; source = (const struct index_extension *)(buffer); memcpy(dest.signature, source->signature, 4); dest.extension_size = ntohl(source->extension_size); ...
false
false
false
false
false
0
_equalColumnDef(ColumnDef *a, ColumnDef *b) { COMPARE_STRING_FIELD(colname); COMPARE_NODE_FIELD(typename); COMPARE_SCALAR_FIELD(inhcount); COMPARE_SCALAR_FIELD(is_local); COMPARE_SCALAR_FIELD(is_not_null); COMPARE_NODE_FIELD(raw_default); COMPARE_STRING_FIELD(cooked_default); COMPARE_NODE_FIELD(constraints); ...
false
false
false
false
false
0
__pyx_tp_clear_9xmmsvalue_CollectionOperands(PyObject *o) { struct __pyx_obj_9xmmsvalue_CollectionOperands *p = (struct __pyx_obj_9xmmsvalue_CollectionOperands *)o; PyObject* tmp; if (__pyx_ptype_9xmmsvalue_CollectionRef->tp_clear) { __pyx_ptype_9xmmsvalue_CollectionRef->tp_clear(o); } tmp = ((PyObject*)p...
false
false
false
false
false
0
r300_startup(struct radeon_device *rdev) { int r; /* set common regs */ r100_set_common_regs(rdev); /* program mc */ r300_mc_program(rdev); /* Resume clock */ r300_clock_startup(rdev); /* Initialize GPU configuration (# pipes, ...) */ r300_gpu_init(rdev); /* Initialize GART (initialize after TTM so we can al...
false
false
false
false
false
0
load_image_from_file(int lp, const char *file) { int len=strlen(file); g_assert(lp>0); if (strcmp(file+len-4,".ply")) return load_image_from_file_not_ply(lp,file); else { #if HAVE_LIBPLY_H if(!read_ply_) { show_error(_("gtkmorph could not find libply, so it cannot load PLY surfaces. R...
false
false
false
false
false
0
gfs2_rgrp_print(struct gfs2_rgrp *rg) { gfs2_meta_header_print(&rg->rg_header); pv(rg, rg_flags, "%u", "0x%x"); pv(rg, rg_free, "%u", "0x%x"); pv(rg, rg_dinodes, "%u", "0x%x"); }
false
false
false
false
false
0
ReadStates(FILE *f, char *filename, char *header, TStateModel *model) { FILE *f_in=f ? f : filename ? fopen(filename,"rt") : (FILE*)NULL; char *format="//== %sStates ==//"; int err, i; if (!f_in) err=SWITCHIO_FILE_ERROR; else { if (!(err=ReadIntArray(f_in,format,header,model->S))) {...
false
false
false
false
true
1
drm_dp_validate_guid(struct drm_dp_mst_topology_mgr *mgr, u8 *guid) { static u8 zero_guid[16]; if (!memcmp(guid, zero_guid, 16)) { u64 salt = get_jiffies_64(); memcpy(&guid[0], &salt, sizeof(u64)); memcpy(&guid[8], &salt, sizeof(u64)); return false; } return true; }
false
true
false
false
false
1
mv64460_sdma_access(cpu_gen_t *cpu,struct vdevice *dev, m_uint32_t offset,u_int op_size,u_int op_type, m_uint64_t *data) { struct mv64460_data *mv_data = dev->priv_data; struct sdma_channel *channel; int id = -1; /* Access to SDMA channel 0 r...
false
false
false
false
false
0
Capture_ListDevices _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])) { struct ng_devinfo * info = NULL; char name[50]; int i = 0; Tcl_HashTable table; int isNew; struct list_head *item;...
false
false
false
false
false
0
snd_mixart_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer) { struct snd_mixart *chip = entry->private_data; u32 ref; snd_iprintf(buffer, "Digigram miXart (alsa card %d)\n\n", chip->chip_idx); /* stats available when embedded OS is running */ if (...
false
false
false
false
false
0
resource_show(struct device *dev, struct device_attribute *attr, char *buf) { struct pci_dev *pci_dev = to_pci_dev(dev); char *str = buf; int i; int max; resource_size_t start, end; if (pci_dev->subordinate) max = DEVICE_COUNT_RESOURCE; else max = PCI_BRIDGE_RESOURCES; for (i = 0; i < max; i++) { ...
false
true
false
false
false
1
nlh_setup (struct nl_sock *nlh, nl_recvmsg_msg_cb_t valid_func, gpointer cb_data, GError **error) { int err; nl_socket_modify_cb (nlh, NL_CB_MSG_IN, NL_CB_CUSTOM, event_msg_recv, NULL); if (valid_func) nl_socket_modify_cb (nlh, NL_CB_VALID, NL_CB_CUSTOM, valid_func, cb_data); e...
false
false
false
false
false
0
gl2cns(float q[16]) { int i, j, min_ij; float min, min2; min = min2 = 1e30; min_ij = -1; for (i = 0; i < 4; ++i) { for (j = i; j < 4; ++j) { if (q[i<<2|j] < min) min_ij = i<<2|j, min2 = min, min = q[i<<2|j]; else if (q[i<<2|j] < min2) min2 = q[i<<2|j]; } } return (min_ij>>2&3) == (min_ij&3)? 0 : 1<<18 |...
false
false
false
false
false
0
rs780_force_voltage(struct radeon_device *rdev, u16 voltage) { struct igp_ps *current_state = rs780_get_ps(rdev->pm.dpm.current_ps); if ((current_state->max_voltage == RS780_VDDC_LEVEL_HIGH) && (current_state->min_voltage == RS780_VDDC_LEVEL_HIGH)) return; WREG32_P(GFX_MACRO_BYPASS_CNTL, SPLL_BYPASS_CNTL, ~...
false
false
false
false
false
0
current_search_col (ETable *et) { if (!et->search_col_set) { et->current_search_col = e_table_util_calculate_current_search_col ( et->header, et->full_header, et->sort_info, et->always_search); et->search_col_set = TRUE; } return et->current_search_col; }
false
false
false
false
false
0
CDataType_from_param(PyObject *type, PyObject *value) { PyObject *as_parameter; int res = PyObject_IsInstance(value, type); if (res == -1) return NULL; if (res) { Py_INCREF(value); return value; } if (PyCArg_CheckExact(value)) { PyCArgObject *p = (PyCArgObject *)v...
false
false
false
false
false
0
add_alias(char* name, int len, unsigned short port, unsigned short proto) { struct host_alias* a; if ((port) && (proto)){ /* don't add if there is already an alias matching it */ if (grep_aliases(name,len, port, proto)) return 0; }else{ /* don't add if already in the list with port or proto ==0*/ for(a=ali...
false
true
false
false
false
1
addParameter(std::string name, exp_ptr e, unsigned depth) { static const char* const KnownParams[] = { "CF::AllowOverlap", "CF::Alpha", "CF::Background", "CF::BorderDynamic", "CF::BorderFixed", "CF::Color", "CF::ColorDepth", "CF::Frame", "CF::F...
false
false
false
false
false
0
tg3_phy_toggle_auxctl_smdsp(struct tg3 *tp, bool enable) { u32 val; int err; err = tg3_phy_auxctl_read(tp, MII_TG3_AUXCTL_SHDWSEL_AUXCTL, &val); if (err) return err; if (enable) val |= MII_TG3_AUXCTL_ACTL_SMDSP_ENA; else val &= ~MII_TG3_AUXCTL_ACTL_SMDSP_ENA; err = tg3_phy_auxctl_write((tp), MII_TG3_AU...
false
false
false
false
false
0
Chrom_from_string (char *string, char *mitochondrial_string, unsigned int order) { T new = (T) MALLOC(sizeof(*new)); int ndigits = 0; char *p; bool mitochondrial_p = false, sex_p = false; debug(printf("string is %s\n",string)); new->order = order; new->string = (char *) CALLOC(strlen(string)+1,sizeof(c...
false
true
true
false
true
1
template_convert_to_template(gchar *content) { char buf_in[16384]; char buf_out[16384]; gint read_buffer_pos; gint write_buffer_pos; gchar *ret; strncpy(buf_in, content, 16383); read_buffer_pos = 0; write_buffer_pos = 0; while (buf_in[read_buffer_pos] && read_buffer_pos<16380) {// 16384 - a few to ...
false
false
false
false
true
1
lm95245_set_conversion_rate(struct i2c_client *client, unsigned long interval) { int rate; if (interval <= 63) { interval = 63; rate = RATE_CR0063; } else if (interval <= 364) { interval = 364; rate = RATE_CR0364; } else if (interval <= 1000) { interval = 1000; rate = RATE_CR1000; } else { interv...
false
false
false
false
false
0
buf_reload(buf, orig_mode) buf_T *buf; int orig_mode; { exarg_T ea; pos_T old_cursor; linenr_T old_topline; int old_ro = buf->b_p_ro; buf_T *savebuf; int saved = OK; aco_save_T aco; /* set curwin/curbuf for "buf" and save some things */ aucmd_prepbuf(&aco, buf); /* W...
false
false
false
false
false
0
iforce_usb_xmit(struct iforce *iforce) { int n, c; unsigned long flags; spin_lock_irqsave(&iforce->xmit_lock, flags); if (iforce->xmit.head == iforce->xmit.tail) { clear_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags); spin_unlock_irqrestore(&iforce->xmit_lock, flags); return; } ((char *)iforce->out->transf...
false
false
false
false
false
0
hr222_update_analog_audio_level(struct snd_pcxhr *chip, int is_capture, int channel) { dev_dbg(chip->card->dev, "hr222_update_analog_audio_level(%s chan=%d)\n", is_capture ? "capture" : "playback", channel); if (is_capture) { int level_l, level_r, level_mic; /* we have to update all levels */ if...
false
false
false
false
false
0
saveparams() { int i; for (i=0; i < nall; i++) outsavex[i] = x[i]; }
false
true
false
false
false
1
eb_subbook(EB_Book *book, EB_Subbook_Code *subbook_code) { EB_Error_Code error_code; eb_lock(&book->lock); LOG(("in: eb_subbook(book=%d)", (int)book->code)); /* * The current subbook must have been set. */ if (book->subbook_current == NULL) { error_code = EB_ERR_NO_CUR_SUB; goto failed...
false
false
false
false
false
0
get_range(char *src, int max, const char * const names[], const char *msg) { int start, end; /* start and ending position */ unsigned int mask = 0; char *part; /* Check for whole range */ if (ast_strlen_zero(src) || !strcmp(src, "*")) { return (1 << max) - 1; } while ((part = strsep(&src, "&"))) { /* Get s...
false
false
false
false
false
0
ao_uri_is_link(const gchar *uri) { gchar *dot; g_return_val_if_fail (uri != NULL, FALSE); if ((dot = strchr(uri, '.')) && *dot != '\0') { /* we require two dots and don't allow any spaces (www.domain.tld) * unless we get too many matches */ return (strchr(dot + 1, '.') && ! strchr(uri, ' ')); } return FAL...
false
false
false
false
false
0