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
swallow_to_glyph(int mnum, int loc) { if (loc < S_sw_tl || S_sw_br < loc) { impossible("swallow_to_glyph: bad swallow location"); loc = S_sw_br; } return ((int) (what_mon(mnum)<<3) | (loc - S_sw_tl)) + GLYPH_SWALLOW_OFF; }
false
false
false
false
false
0
mpl_alloc(const struct mempool *mpl) { unsigned tsz; struct memitem *mi; CHECK_OBJ_NOTNULL(mpl, MEMPOOL_MAGIC); tsz = *mpl->cur_size; mi = calloc(sizeof *mi + tsz, 1); AN(mi); mi->magic = MEMITEM_MAGIC; mi->size = tsz; mpl->vsc->sz_wanted = tsz; mpl->vsc->sz_needed = tsz + sizeof *mi; return (mi); }
false
false
false
true
false
1
cert_RememberOCSPProcessingFailure(CERTOCSPCertID *certID, PRBool *certIDWasConsumed) { SECStatus rv = SECSuccess; PR_EnterMonitor(OCSP_Global.monitor); if (OCSP_Global.maxCacheEntries >= 0) { rv = ocsp_CreateOrUpdateCacheEntry(&OCSP_Global.cache, certID, N...
false
false
false
false
false
0
zc_crk_bforce_start(struct zc_crk_bforce *crk, char *out_pw, size_t out_pw_size) { struct zc_key key; struct zc_key key_cache[out_pw_size]; size_t idem_char = 0; bool found = false; if (!out_pw || !is_valid_cracker(crk)) return -EINVAL; memset(&key_cache, 0, out_pw_size * sizeof(struct...
false
false
false
false
false
0
pixel_status(GwyDataField *data_field, gint i, gint j) { if (data_field->data[j + data_field->xres * i] == 0) return 0; else return 1; }
false
false
false
false
false
0
gnucash_cursor_set_cell (GnucashCursor *cursor, gint cell_row, gint cell_col) { GnucashItemCursor *item_cursor; SheetBlockStyle *style; g_return_if_fail (cursor != NULL); g_return_if_fail (GNUCASH_IS_CURSOR (cursor)); item_cursor = GNUCASH_ITEM_CURSOR(cursor->cursor[GNUCASH_CURSOR_CELL]); styl...
false
false
false
false
false
0
load(istream* is, const SparseVector& sparseWeights) { FeatureArray entry; while (!is->eof()) { if (!is->good()) { cerr << "ERROR FeatureData::load inFile.good()" << endl; } entry.clear(); entry.load(is, sparseWeights); if (entry.size() == 0) break; if (size() == 0) se...
false
false
false
false
false
0
SCGetObjectValue(CmdSet &Set) { WorldSession *ws = ((PseuInstance*)parentMethod)->GetWSession(); if(!ws) { logerror("Invalid Script call: SCGetObjectValue: WorldSession not valid"); DEF_RETURN_ERROR; } uint64 guid = DefScriptTools::toUint64(Set.defaultarg); Object *o = ws->objmg...
false
false
false
false
false
0
aes128rounds(const u32 rk[/*44*/], const u8 pt[16], u8 ct[16], int rounds, int start) { u32 s[4]; int i; s[0] = GETU32(pt ); s[1] = GETU32(pt + 4); s[2] = GETU32(pt + 8); s[3] = GETU32(pt + 12); for (i=0; i<rounds; i++) { aes128round(s, rk+4*(start+i)); } PUTU32(ct , s[0]); ...
false
false
false
false
false
0
fw_core_handle_bus_reset(struct fw_card *card, int node_id, int generation, int self_id_count, u32 *self_ids, bool bm_abdicate) { struct fw_node *local_node; unsigned long flags; /* * If the selfID buffer is not the immediate successor of the * previously processed one, we cannot reliably compare the ...
false
false
false
false
false
0
log_init(int level, const char *file) { loglvl = level; if (!file) logf = stderr; else { if ((logf = fopen(file, "a")) == NULL) { perror("error opening log file"); fprintf(stderr, "%s\n", "falling back to standard error"); logf = stderr; }...
false
false
false
false
true
1
Listen(int backlog) { ASSERT(SOCK_STREAM == type_); ASSERT(CS_CLOSED == state_); if (local_addr_.IsAny()) { error_ = EINVAL; return -1; } ASSERT(NULL == listen_queue_); listen_queue_ = new ListenQueue; state_ = CS_CONNECTING; return 0; }
false
false
false
false
false
0
walk_kbnode( KBNODE root, KBNODE *context, int all ) { KBNODE n; do { if( !*context ) { *context = root; n = root; } else { n = (*context)->next; *context = n; } } while( !all && n && is_deleted_kbnode(n) ); return n; }
false
false
false
false
false
0
transfer_instant_pull(const char *path) { int res; char *pc, *pr; size_t p_len = strlen(path); bool path_equal = false; VERBOSE("instant_pulling %s", path); pthread_mutex_lock(&m_instant_pull); worker_block(); pr = remote_path2(path, p_len); pc = cache_path2(path, p_len); pt...
false
false
false
false
false
0
sge_mirror_update_master_list_host_key(lList **list, const lDescr *list_descr, int key_nm, const char *key, sge_event_action action, lListElem *event) { lListElem *ep; sge_mirror_error ret; DENTER(T...
false
false
false
false
false
0
AttackStart(Unit* pWho) { if (!pWho) { return; } if (m_creature->Attack(pWho, true)) { m_creature->AddThreat(pWho); m_creature->SetInCombatWith(pWho); pWho->SetInCombatWith(m_creature); if (IsCombatMovement()) { m_creature->GetMotionMaste...
false
false
false
false
false
0
xaw_key_unit_road_or_trade_route(Widget w, XEvent *event, String *argv, Cardinal *argc) { unit_list_iterate(get_units_in_focus(), punit) { if (unit_can_est_trade_route_here(punit)) { key_unit_trade_route(); } else { key_unit_road(); } } unit_list_iterate_end; }
false
false
false
false
false
0
writecell(std::ostream &os, node *root, int depth) { g_uintptr_t thiscell = 0 ; if (root == zeronode(depth)) return 0 ; if (depth == 2) { if (root->nw != 0) return (g_uintptr_t)(root->nw) ; } else { if (marked2(root)) return (g_uintptr_t)(root->next) ; unhash_node(r...
false
false
false
false
false
0
shrink_cb (GtkButton *button, VgRuleEditor *editor) { int i; if (editor->callers->len == 1) return; i = editor->callers->len - 1; gtk_widget_destroy (editor->callers->pdata[i]); g_ptr_array_remove_index (editor->callers, editor->callers->len - 1); }
false
false
false
false
false
0
print_pids(guint64 which, guint64 arg) { pid_t *pids; unsigned i; glibtop_proclist buf; pids = glibtop_get_proclist(&buf, which, arg); printf("glibtop_get_proclist(%#llx, %llu) -> %lu processes\n", which, arg, (unsigned long)buf.number); for (i = 0; i < buf.number; ++i) printf("%u ", pids[i]); putc...
false
false
false
false
false
0
SeekToLast() { for (int i = 0; i < n_; i++) { children_[i].SeekToLast(); } FindLargest(); direction_ = kReverse; }
false
false
false
false
false
0
output_state_ainsn_table (state_ainsn_table_t tab, char *table_name, void (*output_full_vect_name_func) (FILE *, automaton_t), void (*output_comb_vect_name_func) (FILE *, automaton_t), void (*output_check_vect_name_func) (FILE *, automaton_t), void (*output_base_vect_name_func) (FILE *, automaton_t)...
false
false
false
false
false
0
inxsearch(int b, int g, int r) { int i, j, dist, a, bestd; int *p; int best; bestd = 1000; // biggest possible dist is 256*3 best = -1; i = netindex[g]; // index on g j = i-1; // start at netindex[g] and work outwards while ((i < netsize) || (j >= 0)) { if (i < netsize) { p = network[i]; dist = p[F...
false
false
false
false
false
0
ParseSEHRegisterNumber(unsigned &RegNo) { SMLoc startLoc = getLexer().getLoc(); if (getLexer().is(AsmToken::Percent)) { const MCRegisterInfo &MRI = getContext().getRegisterInfo(); SMLoc endLoc; unsigned LLVMRegNo; if (getParser().getTargetParser().ParseRegister(LLVMRegNo,startLoc,endLoc)) retu...
false
false
false
false
false
0
WorkSuspend(char* url, char* name) { int iRetVal = 0; RESULT* pStateResult = state.lookup_result(url, name); if (pStateResult) { iRetVal = rpc.result_op((*pStateResult), "suspend"); } else { ForceCacheUpdate(); } return iRetVal; }
false
false
false
false
false
0
vxml_record_fatal_error(vxml_parser_t *vp, vxml_error_t error) { vp->error = error; vp->flags |= VXML_F_FATAL_ERROR; if (vp->options & VXML_O_FATAL) g_error("VXML fatal error: %s", vxml_strerror(error)); }
false
false
false
false
false
0
_e_border_cb_efreet_cache_update(void *data __UNUSED__, int ev_type __UNUSED__, void *ev __UNUSED__) { Eina_List *l; E_Border *bd; /* mark all borders for desktop/icon updates */ EINA_LIST_FOREACH(borders, l, bd) { if (bd->d...
false
false
false
false
false
0
quiesce_fgetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { call_stub_t *stub = NULL; quiesce_local_t *local = NULL; local = frame->local; frame->local = NULL; if ((op_ret ==...
false
false
false
false
false
0
Curl_hash_init(struct curl_hash *h, int slots, curl_hash_dtor dtor) { int i; h->dtor = dtor; h->size = 0; h->slots = slots; h->table = (struct curl_llist **) malloc(slots * sizeof(struct curl_llist *)); if(h->table) { for (i = 0; i < slots; ++i) { h->table[i] = Curl_llist_alloc((curl_llist_dtor)...
false
false
false
false
false
0
gimplify_omp_workshare (tree *expr_p, gimple_seq *pre_p) { tree expr = *expr_p; gimple stmt; gimple_seq body = NULL; gimplify_scan_omp_clauses (&OMP_CLAUSES (expr), pre_p, ORT_WORKSHARE); gimplify_and_add (OMP_BODY (expr), &body); gimplify_adjust_omp_clauses (&OMP_CLAUSES (expr)); if (TREE_CODE (expr) =...
false
false
false
false
false
0
qlcnic_sriov_vf_init_driver(struct qlcnic_adapter *adapter) { struct qlcnic_hardware_context *ahw = adapter->ahw; struct qlcnic_info nic_info; int err; err = qlcnic_sriov_get_vf_vport_info(adapter, &nic_info, 0); if (err) return err; ahw->max_mc_count = nic_info.max_rx_mcast_mac_filters; err = qlcnic_get_ni...
false
false
false
false
false
0
run_timer(Timer *) { uint32_t part = (_max_thresh - _min_thresh) / 2; uint32_t avg = _size.unscaled_average(); if (avg < _min_thresh + part && _max_p > ONE_HUNDREDTH) { _max_p = (_max_p * NINE_TENTHS) >> 16; } else if (avg > _max_thresh - part && _max_p < 0x8000) { uint32_t alpha = ONE_HUNDREDTH; if ...
false
false
false
false
false
0
serial_proxy_init(struct serial_adapter *adapter) { GKeyFile *config; GError *gerr = NULL; const char *file = CONFIGDIR "/serial.conf"; char **group_list; int i; config = g_key_file_new(); if (!g_key_file_load_from_file(config, file, 0, &gerr)) { error("Parsing %s failed: %s", file, gerr->message); g_error...
false
false
false
false
false
0
clear_s_newconf(void) { struct server_conf *server_p; rb_dlink_node *ptr; rb_dlink_node *next_ptr; RB_DLINK_FOREACH_SAFE(ptr, next_ptr, shared_conf_list.head) { /* ptr here is ptr->data->node */ rb_dlinkDelete(ptr, &shared_conf_list); free_remote_conf(ptr->data); } RB_DLINK_FOREACH_SAFE(ptr, next_ptr, cl...
false
false
false
false
false
0
sd_start(struct gspca_dev *gspca_dev) { struct sd *sd = (struct sd *) gspca_dev; int ret, value; /* create the JPEG header */ jpeg_define(sd->jpeg_hdr, gspca_dev->pixfmt.height, gspca_dev->pixfmt.width, 0x22); /* JPEG 411 */ jpeg_set_qual(sd->jpeg_hdr, QUALITY); /* work on alternate 1 */ usb_set_interfa...
false
false
false
false
false
0
AddLogLine( const wxString &file, int line, bool critical, DebugType /*type*/, const std::ostringstream &msg) { std::string s; if (critical) { s = "Critical message: "; } printf("%s(%d): %s%s\n", (const char *)unicode2char(file), line, s.c_str(), msg.str().c_str()); }
false
false
false
false
false
0
readPIR(struct ReadSeqVars *V) { char *sptr; /* load first line of entry */ while (!feof(V->f) && strncmp(V->buf, "ENTRY", 5) != 0) { SeqfileGetLine(V); } if (feof(V->f)) return; if (V->ssimode >= 0) V->r_off = V->ssioffset; if ((sptr = strtok(V->buf + 15, "\n\t ")) != NULL) { SetSeqinfo...
false
false
false
false
false
0
cache_add(SSL *ssl, SSL_SESSION *sess) { struct tls_info *info=SSL_get_app_data(ssl); unsigned char buffer[BUFSIZ]; unsigned char *ucp; time_t timeout= (time_t)SSL_SESSION_get_time(sess) + SSL_SESSION_get_timeout(sess); void *session_id=(void *)sess->session_id; size_t session_id_len=sess->session_id_length; s...
true
true
false
false
false
1
rb_xfade_stream_dispose (GObject *object) { RBXFadeStream *sd = RB_XFADE_STREAM (object); rb_debug ("disposing stream %s", sd->uri); if (sd->decoder != NULL) { gst_object_unref (sd->decoder); sd->decoder = NULL; } if (sd->volume != NULL) { gst_object_unref (sd->volume); sd->volume = NULL; } if (sd->f...
false
false
false
false
false
0
azx_via_get_position(struct azx *chip, struct azx_dev *azx_dev) { unsigned int link_pos, mini_pos, bound_pos; unsigned int mod_link_pos, mod_dma_pos, mod_mini_pos; unsigned int fifo_size; link_pos = snd_hdac_stream_get_pos_lpib(azx_stream(azx_dev)); if (azx_dev->core.substream->stream == SNDRV_PCM_STREAM_PL...
false
false
false
false
false
0
dump_udp(packet_t *pkt) { udp_header_t udp; service_func_t app_src; service_func_t app_dst; /* Set the layer */ set_layer(LAYER_TRANSPORT); /* Stats accounting */ stats_update(STATS_UDP); /* * Get the UDP header */ if (get_packet_bytes((u_int8_t *) &udp, pkt, 8) == 0) return; /* *...
false
false
false
false
false
0
select_next_imf(gpointer dialog) { GList *sel = NULL; GtkList *list; int index, len; GtkWidget *scw; GtkAdjustment *vadj; double nv; d3_printf("select next\n"); list = gtk_object_get_data(GTK_OBJECT(dialog), "image_file_list"); g_return_if_fail(list != NULL); sel = list->selection; if (sel == NULL) { gt...
false
false
false
false
false
0
dropRank2(t,alpha,n) /* Drop a (potentially) rank2 type */ Type t; Int alpha; Int n; { if (whatIs(t)==RANK2) { Cell r = fst(snd(t)); Int i = intOf(r); Type as = NIL; for (t=snd(snd(t)); i>0; i--) { Type a = arg(fun(t)); if (isPolyType(a)) a = dropRank1(a,alpha,n); as = fn(a,as); t =...
false
false
false
false
false
0
joinPath(upath dir, upath name) { if (dir == null) return name; if (name.isAbsolute()) return name; return dir.relative(name); }
false
false
false
false
false
0
delAttachment(std::string filename) // att*.txt { restartAutosaveTimer(); std::vector<AttachmentButton *>::iterator b, e, p; b=attachmentList.begin(); e=attachmentList.end(); while (b != e) { p=b; AttachmentButton *a= *b++; if (a && a->getFilename() == filename) { a->erase(); bool needFocus=fals...
false
false
false
false
false
0
get_word_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) /* This version is for reading raw-word-format PGM files with any maxval */ { ppm_source_ptr source = (ppm_source_ptr) sinfo; register JSAMPROW ptr; register U_CHAR * bufferptr; register JSAMPLE *rescale = source->rescale; JDIMENSION col; if ...
false
false
false
false
false
0
php_disable_classes(TSRMLS_D) { char *s = NULL, *e; if (!*(INI_STR("disable_classes"))) { return; } e = PG(disable_classes) = strdup(INI_STR("disable_classes")); while (*e) { switch (*e) { case ' ': case ',': if (s) { *e = '\0'; zend_disable_class(s, e-s TSRMLS_CC); s = NULL; } ...
false
false
false
false
false
0
find_or_add_name(Names ** names, const char *str) { unsigned i; for (i = 0; i < (*names)->size; i++) if (!mystrcasecmp((*names)->names[i], str)) { /* old name */ return i; } if ((*names)->size == (*names)->max_size) { unsigned old_max = (*names)->max_size; Names *new = new_names(old_max * 2); uns...
false
false
false
false
false
0
db_unescape_object(JCR *jcr, char *from, int32_t expected_len, POOLMEM **dest, int32_t *dest_len) { if (!from) { *dest[0] = 0; *dest_len = 0; return; } *dest = check_pool_memory_size(*dest, expected_len+1); base64_to_bin(*dest, expected_len+1, from, str...
false
false
false
false
false
0
panel_action_button_set_type (PanelActionButton *button, PanelActionButtonType type) { g_return_if_fail (type > PANEL_ACTION_NONE && type < PANEL_ACTION_LAST); if (panel_action_get_is_deprecated (type)) return; if (type == button->priv->type) return; button->priv->type = type; if (actions [ty...
false
false
false
false
false
0
asymmetric_key_generate_id(const void *val_1, size_t len_1, const void *val_2, size_t len_2) { struct asymmetric_key_id *kid; kid = kmalloc(sizeof(struct asymmetric_key_id) + len_1 + len_2, GFP_KERNEL); if (!kid) return ERR_PTR(-ENOMEM); kid->len = len_1 + len_2; memcpy(...
false
false
false
false
false
0
transport_find_fn(const char *url, git_transport_cb *callback, void **param) { size_t i = 0; unsigned priority = 0; transport_definition *definition = NULL, *definition_iter; // First, check to see if it's an obvious URL, which a URL scheme for (i = 0; i < GIT_TRANSPORT_COUNT; ++i) { definition_iter = &transpor...
false
false
false
false
false
0
QueryGeometry(w, req, ret) Widget w; XtWidgetGeometry *req; XtWidgetGeometry *ret; { ICLabelWidget iclw = (ICLabelWidget)w; ret->request_mode = CWWidth | CWHeight; ret->width = iclw->iclabel.width + iclw->iclabel.hspace * 2; ret->height = iclw->iclabel.fontheight + iclw->iclabel.vspace * 2; if ((...
false
false
false
false
false
0
count_bound_coefficient_constraints(isl_ctx *ctx, struct isl_sched_graph *graph, int *n_eq, int *n_ineq) { int i; if (ctx->opt->schedule_max_coefficient == -1) return 0; for (i = 0; i < graph->n; ++i) *n_ineq += 2 * graph->node[i].nparam + 2 * graph->node[i].nvar; return 0; }
false
false
false
false
false
0
city_build_free_buildings(struct city *pcity) { struct player *pplayer; struct nation_type *nation; int i; bool has_small_wonders; fc_assert_ret(NULL != pcity); pplayer = city_owner(pcity); fc_assert_ret(NULL != pplayer); nation = nation_of_player(pplayer); fc_assert_ret(NULL != nation); if (pplay...
false
false
false
false
true
1
Disengage() { if (!engaged_) return; // Stop receiving ticks. LOGGER->ticker_->ClearProfiler(); // Terminate the worker thread by setting running_ to false, // inserting a fake element in the queue and then wait for // the thread to terminate. running_ = false; TickSample sample; // Reset 'paused_' ...
false
false
false
false
false
0
Jim_FreeTimeHandler(Jim_Interp *interp, Jim_TimeEvent *te) { if (te->finalizerProc) te->finalizerProc(interp, te->clientData); Jim_Free(te); }
false
false
false
false
false
0
git_fetch_download_pack(git_remote *remote, git_off_t *bytes, git_indexer_stats *stats) { if(!remote->need_pack) return 0; return remote->transport->download_pack(remote->transport, remote->repo, bytes, stats); }
false
false
false
false
false
0
writePeer(int fd, const char* buffer, int n) { int nbytes = write(fd,buffer,n); if (nbytes < 0) { ERROR2("[DS]: writePeer() error %d",errno); errnoDebug("[DS]: writePeer() write ",errno); // testing debug } return nbytes; }
false
false
false
false
false
0
parseJSON(char *filename) { FILE *fp; size_t fsize; char *fbuf; cJSON* json; if( (fp=fopen(filename, "rb")) == NULL ) { fprintf(stderr, "Error0: Couldn't open '%s' for reading\n", filename); return NULL; } if( fseek(fp,0,SEEK_END) == -1) { fprintf(stderr, "Error1: Couldn't determain filesize of '%s'\n",...
false
false
false
false
true
1
grsdef(void) { /* C----> C**** GRSDEF - Initial (default) setting of common area variables C for GRIBEX package. C C Purpose. C -------- C C Sets initial values for common area variables for all C routines of GRIBEX package, if not already done. C C** Interface. C ---------- C C ...
false
false
false
false
true
1
message_calc_anim_start_frame(int time, generic_anim *ani, int reverse) { float wave_time, anim_time; int start_frame; start_frame=0; // If no voice clip exists, start from beginning of anim if ( time <= 0 ) { return; } // convert time to seconds wave_time = time/1000.0f; anim_time = ani->total_time; //...
false
false
false
false
false
0
gt_priorityqueue_delete_min(GtPriorityQueue *pq) { gt_assert(pq != NULL && !gt_priorityqueue_is_empty(pq)); if (pq->capacity < (unsigned long) GT_MINPQSIZE) { pq->minelement = pq->elements[--pq->numofelements]; gt_priorityqueue_checkorder(pq); } else { unsigned long idx, child; GtPriorityQueue...
false
false
false
false
false
0
VLight_InitAnormTable (void) { int x, y; float angle; float sp, sy, cp, cy; for ( x = 0; x < VLIGHT_GRIDSIZE_X; x++ ) { angle = (x * 360 / VLIGHT_GRIDSIZE_X) * ( M_PI / 180.0f ); sy = sin(angle); cy = cos(angle); for ( y = 0; y < VLIGHT_GRIDSIZE_Y; y++ ) { angle = (y * 360 / VLIGHT_GRI...
false
false
false
false
false
0
RecordCodeGeneration(Code* code, MacroAssembler* masm) { code->set_major_key(MajorKey()); PROFILE(CodeCreateEvent(Logger::STUB_TAG, code, GetName())); GDBJIT(AddCode(GDBJITInterface::STUB, GetName(), code)); Counters::total_stubs_code_size.Increment(code->instruction_size()); #ifdef ENABLE_DISASSEMBLER if (...
false
false
false
false
false
0
osinfo_avatar_format_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { OsinfoAvatarFormat *avatar = OSINFO_AVATAR_FORMAT (object); switch (property_id) { case...
false
false
false
false
false
0
recordNameToType(const char *recordTypeName) { E_DirRecType recType = ERT_Private; if (recordTypeName != NULL) { short i = 0; while (i < DIM_OF_DRTypeNames && strcmp(DRTypeNames[i], recordTypeName) != 0) i++; if (i < DIM_OF_DRTypeNames && strcmp(DRTypeNames[i], recordTyp...
false
false
false
false
false
0
Indexdb_write_positions (char *positionsfile, char *gammaptrsfile, char *offsetscompfile, FILE *sequence_fp, IIT_T chromosome_iit, int offsetscomp_basesize, #ifdef PMAP int alphabet_size, int index1part_aa, bool watsonp, #else int index1part, #endif int index1interval, bool genome_lc_p, bool writefilep,...
false
false
false
false
false
0
_length(Request& r, MethodParams& params) { const String& s=params.as_string(0, "text must not be code"); VImage& vimage=GET_SELF(r, VImage); r.write_no_lang(*new VInt(vimage.font().string_width(s))); }
false
false
false
false
false
0
FindOrCreate(const FontParameters &fp) { FontID ret = 0; FontMutexLock(); int hashFind = HashFont(fp); for (FontCached *cur = first; cur; cur = cur->next) { if ((cur->hash == hashFind) && cur->SameAs(fp)) { cur->usage++; ret = cur->fid; } } if (ret == 0) { FontCached *fc = new FontCached(fp)...
false
false
false
false
false
0
decodeConsUInt8 (OOCTXT* pctxt, ASN1UINT8* pvalue, ASN1UINT lower, ASN1UINT upper) { ASN1UINT range_value, value; ASN1UINT adjusted_value; int stat = ASN_OK; /* Check for special case: if lower is 0 and upper is ASN1UINT_MAX, */ /* set range to ASN1UINT_MAX; otherwise to upper - lower + 1 */ ...
false
false
false
false
false
0
IsInstalled() { if (mInstalled == eUnknown) { mInstalled = IsPluginInstalled() ? eTrue : eFalse; } return mInstalled == eTrue; }
false
false
false
false
false
0
bg_out(const string &fname) { ofstream o; o.open(fname.c_str()); if(o.fail()) { cerr << "error: could not open `" << fname << "` for writing" << endl; exit(1); } o << setfill('0') << setbase(16); o.setf(ios::uppercase); #define USECODE_INTRINSIC_PTR(NAME) std::string(__STRING(NAME)) std::string bgut[...
false
false
false
false
false
0
list_keynames(dns_view_t *view, dns_tsig_keyring_t *ring, isc_buffer_t *text, unsigned int *foundkeys) { char namestr[DNS_NAME_FORMATSIZE]; char creatorstr[DNS_NAME_FORMATSIZE]; isc_result_t result; dns_rbtnodechain_t chain; dns_name_t foundname; dns_fixedname_t fixedorigin; dns_name_t *origin; dns_rbtnod...
false
false
false
false
false
0
eat_para_separator(const string& line, size_t start, GB_ERROR& error) { size_t para_sep = next_non_white(line, start); if (para_sep == string::npos) { error = "',' or ')' expected after parameter"; } else { switch (line[para_sep]) { case ')' : was_last_parame...
false
false
false
false
false
0
apbps2_open(struct serio *io) { struct apbps2_priv *priv = io->port_data; int limit; unsigned long tmp; /* clear error flags */ iowrite32be(0, &priv->regs->status); /* Clear old data if available (unlikely) */ limit = 1024; while ((ioread32be(&priv->regs->status) & APBPS2_STATUS_DR) && --limit) tmp = ioread...
false
false
false
false
false
0
store_color_common(struct device *dev, const char *buf, int color) { struct i2c_client *client; struct blinkm_data *data; int ret; u8 value; client = to_i2c_client(dev); data = i2c_get_clientdata(client); ret = kstrtou8(buf, 10, &value); if (ret < 0) { dev_err(dev, "BlinkM: value too large!\n"); return re...
false
false
false
false
false
0
pop_stack(hscriptlet *r, bytecode *value) { if (!r->it_stack) return empty_tc; bytecode code = &r->stack[--r->it_stack]; if (code->tc == int_tc) *value = code; else if (code->tc == real_tc) *value = code; else if (code->tc == string_tc) *value = code; return code->tc; }
false
false
false
false
false
0
_menu_cb_post(void *data, E_Menu *m __UNUSED__) { Instance *inst = data; if (inst) e_gadcon_locked_set(inst->gcc->gadcon, 0); if (!cpufreq_config->menu) return; e_object_del(E_OBJECT(cpufreq_config->menu)); cpufreq_config->menu = NULL; if (cpufreq_config->menu_poll) e_object_del(E_OBJECT(c...
false
false
false
false
false
0
s48_read_char(FILE *port) { int result; while(1) { if (ferror(port) && errno == EINTR) { clearerr(port); result = getc(port); if (EOF != result) return result; } else return EOF; } }
false
true
false
false
true
1
xyzoptfunc(void *cntx, double *v) { clink *p = (clink *)cntx; double swxyz[3], jab[3], dev[MAX_CHAN]; double rv; int rc = 0; rv = 2.0 - v[0]; /* Make Y as large as possible */ /* If we wanted to use this function to maximise the brightness */ /* we would not limit the scale to 1.0 */ if (v[0] > 1.0) { rv +=...
false
false
false
false
false
0
fftw_destroy_twiddle(fftw_twiddle * tw) { fftw_twiddle **p; --tw->refcnt; if (tw->refcnt == 0) { /* remove from the list of known twiddle factors */ for (p = &twlist; p; p = &((*p)->next)) if (*p == tw) { *p = tw->next; fftw_twiddle_size -= tw->n; fftw_free(tw->twarray); ...
false
false
false
false
false
0
intel_gmch_probe(struct pci_dev *bridge_pdev, struct pci_dev *gpu_pdev, struct agp_bridge_data *bridge) { int i, mask; /* * Can be called from the fake agp driver but also directly from * drm/i915.ko. Hence we need to check whether everything is set up * already. */ if (intel_private.driver) { inte...
false
false
false
false
false
0
mpd_qsset_ssize(mpd_t *result, mpd_ssize_t a, const mpd_context_t *ctx, uint32_t *status) { mpd_uint_t u; uint8_t sign = MPD_POS; if (a < 0) { if (a == MPD_SSIZE_MIN) { u = (mpd_uint_t)MPD_SSIZE_MAX + (-(MPD_SSIZE_MIN+MPD_SSIZE_MAX)); } el...
false
false
false
false
false
0
each_with_parse (CSPARSE *parse, int cmd, char *arg) { NEOERR *err; CSTREE *node; char *lvar; char *p; char tmp[256]; err = alloc_node (&node, parse); if (err) return nerr_pass(err); node->cmd = cmd; if (arg[0] == '!') node->flags |= CSF_REQUIRED; arg++; p = lvar = neos_strip(arg); while (...
false
false
false
true
false
1
LookInList(name_list *list_head, char *name, XClassHint *class) { name_list *nptr; /* look for the name first */ for (nptr = list_head; nptr != NULL; nptr = nptr->next) if (match (nptr->name, name)) return (nptr->ptr); if (class) { /* look for the res_name next */ for (nptr = list_head; np...
false
false
false
false
false
0
addscpcel( Column ) scpcol_list *Column; { scpcel_list *Cell; Cell = allocscpcel(); Cell->COL = Column; Cell->NEXT = Column->CELL; Cell->PREV = NULL; if ( Column->CELL != NULL ) { Column->CELL->PREV = Cell; } else { Column->LAST_CELL = Cell; } Column->CELL = Cell; Co...
false
false
false
false
false
0
nv_split(char *buf, struct nv_pair *nv) { /* Get the name part */ char *ptr, *saved=NULL; nv->name = NULL; nv->value = NULL; ptr = audit_strsplit_r(buf, &saved); if (ptr == NULL) return 0; /* If there's nothing, go to next line */ if (ptr[0] == '#') return 0; /* If there's a comment, go to next line */ nv-...
false
false
false
false
false
0
loadTrigger(fxStr& emsg) { if (sendQueuerACK(emsg, "T%s", (const char*) trigSpec) && fifoResponse.length() > 2) { tid = atoi(&fifoResponse[2]); return (true); } else return (false); }
false
false
false
false
false
0
polynomial_irreg_reg_nonans( int nin, double *xi, double *yi, int nout, double xo0, double dxo, int order) { double *tmpVals = NULL, *x = NULL, *y = NULL; int new_size = 0; KMCLIPM_TRY { remove_2nans(nin, xi, yi, &new_size, &x, &y); ...
false
false
false
false
false
0
tpo_process_waypoints(void) { unsigned int waypoint_count; unsigned int ii; //printf("Processing Waypoints...\n"); // Find block 0x0e0000 (GPS-Waypoints) if (tpo_find_block(0x0e0000)) { return; } // Read the number of waypoints. 8/16/32-bit value. waypoint_count = tpo_read_int(); //printf("Total...
false
true
false
false
false
1
release() { free(const_cast<void*>(ptr)); delete this; }
false
false
false
false
false
0
obuf_putsnumw(obuf* out, long data, unsigned width, char pad, unsigned base, const char* digits) { int sign; sign = 0; if (data < 0) { sign = 1; data = -data; if (width) -- width; } if (data < (long)base) { if (width) { if (!obuf_sign_pad(out, sign, width-1, pad)) return 0; } ...
false
false
false
false
false
0
lpfc_pci_resume_one_s4(struct pci_dev *pdev) { struct Scsi_Host *shost = pci_get_drvdata(pdev); struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; uint32_t intr_mode; int error; lpfc_printf_log(phba, KERN_INFO, LOG_INIT, "0292 PCI device Power Management resume.\n"); /* Restore device stat...
false
false
false
false
false
0
checkSparkCountInvariant (void) { SparkCounters sparks = { 0, 0, 0, 0, 0, 0 }; StgWord64 remaining = 0; nat i; for (i = 0; i < n_capabilities; i++) { sparks.created += capabilities[i].spark_stats.created; sparks.dud += capabilities[i].spark_stats.dud; sparks.overflowed+=...
false
false
false
false
false
0
set_peer_operational( n2n_edge_t * eee, const n2n_mac_t mac, const n2n_sock_t * peer ) { struct peer_info * prev = NULL; struct peer_info * scan; macstr_t mac_buf; n2n_sock_str_t sockbuf; traceEvent( TRACE_INFO, "set_peer_operational: %s -> %s", ...
false
false
false
false
false
0
merge(void *priv, int (*cmp)(void *priv, struct flist_head *a, struct flist_head *b), struct flist_head *a, struct flist_head *b) { struct flist_head head, *tail = &head; while (a && b) { /* if equal, take 'a' -- important for sort stability */ if ((*cmp)(priv, a, b) <= 0) { tail->next = a; a ...
false
false
false
false
false
0
getNumPoints() const { size_t numPoints = shell->getNumPoints(); for(size_t i=0, n=holes->size(); i<n; ++i) { const LinearRing* lr = dynamic_cast<const LinearRing *>((*holes)[i]); numPoints += lr->getNumPoints(); } return numPoints; }
false
false
false
false
false
0
connectTo(const char *host, int port) { char localhost[maxHostNameLen()]; myError = NoErr; myErrorStr.clear(); if (myFD < 0) return(false); if (!host) { if (gethostname(localhost, sizeof(localhost)) == 1) { myErrorStr="Failure to locate host '"; myErrorStr+=localhost; myErrorS...
false
false
false
false
false
0
axnet_suspend(struct pcmcia_device *link) { struct net_device *dev = link->priv; if (link->open) netif_device_detach(dev); return 0; }
false
false
false
false
false
0