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
load_city_name_list(struct section_file *file, struct nation_type *pnation, const char *secfile_str1, const char *secfile_str2) { size_t dim, j; const char **cities = secfile_lookup_str_vec(file, &dim, "%s.%s", ...
true
true
false
false
false
1
clear() { if (reg) XDestroyRegion(reg); for (unsigned i = 0; i < 256; ++i) if (GCs[i]) XFreeGC(display, GCs[i]); }
false
false
false
false
false
0
DecodePosition(void){ USHORT i, j, c; i = GETBITS(8); DROPBITS(8); c = (USHORT) (d_code[i] << 8); j = d_len[i]; i = (USHORT) (((i << j) | GETBITS(j)) & 0xff); DROPBITS(j); return (USHORT) (c | i) ; }
false
false
false
false
false
0
read_blk(struct quota_handle *h, unsigned int blk, dqbuf_t buf) { int err; err = h->e2fs_read(&h->qh_qf, blk << QT_BLKSIZE_BITS, buf, QT_BLKSIZE); if (err < 0) log_err("Cannot read block %u: %s", blk, strerror(errno)); else if (err != QT_BLKSIZE) memset(buf + err, 0, QT_BLKSIZE - err); }
false
false
false
false
false
0
cfapi_object_pay_item(int *type, ...) { object *op; object *tobuy; int *rint; va_list args; va_start(args, type); tobuy = va_arg(args, object *); op = va_arg(args, object *); rint = va_arg(args, int *); va_end(args); *rint = pay_for_item(tobuy, op); *type = CFAPI_INT; }
false
false
false
false
false
0
GdipGetImageDecoders (UINT numDecoders, UINT size, ImageCodecInfo *decoders) { if (!decoders || (numDecoders != g_decoders) || (size != sizeof (ImageCodecInfo) * g_decoders)) return GenericError; memcpy (decoders, g_decoder_list, size); return Ok; }
false
true
false
false
false
1
sqlite3Expr(int op, Expr *pLeft, Expr *pRight, const Token *pToken){ Expr *pNew; pNew = sqliteMalloc( sizeof(Expr) ); if( pNew==0 ){ /* When malloc fails, delete pLeft and pRight. Expressions passed to ** this function must always be allocated with sqlite3Expr() for this ** reason. */ sqlit...
false
false
false
false
false
0
reg_block_dump(struct adapter *ap, void *buf, unsigned int start, unsigned int end) { u32 *p = buf + start; for ( ; start <= end; start += sizeof(u32)) *p++ = readl(ap->regs + start); }
false
false
false
false
false
0
GetLogSize(UInt32 size) { for (int i = kSubBits; i < 32; i++) for (UInt32 j = 0; j < (1 << kSubBits); j++) if (size <= (((UInt32)1) << i) + (j << (i - kSubBits))) return (i << kSubBits) + j; return (32 << kSubBits); }
false
false
false
false
false
0
EXEC_auto_create(CLASS *class, bool ref) { void *object; object = CLASS_auto_create(class, 0); /* object is checked by CLASS_auto_create */ /*if (UNLIKELY(class->must_check && (*(class->check))(object))) THROW(E_IOBJECT);*/ if (ref) OBJECT_REF(object, "EXEC_auto_create"); return object; }
false
false
false
false
false
0
indicator_menu_item_get_icon_name (IndicatorMenuItem *self) { const gchar *name = NULL; if (gtk_image_get_storage_type (self->priv->image) == GTK_IMAGE_ICON_NAME) gtk_image_get_icon_name (self->priv->image, &name, NULL); return name; }
false
false
false
false
false
0
crypt_cipher_destroy(struct crypt_cipher *ctx) { if (ctx->tfmfd != -1) close(ctx->tfmfd); if (ctx->opfd != -1) close(ctx->opfd); memset(ctx, 0, sizeof(*ctx)); free(ctx); return 0; }
false
false
false
false
false
0
redrat3_init_rc_dev(struct redrat3_dev *rr3) { struct device *dev = rr3->dev; struct rc_dev *rc; int ret = -ENODEV; u16 prod = le16_to_cpu(rr3->udev->descriptor.idProduct); rc = rc_allocate_device(); if (!rc) { dev_err(dev, "remote input dev allocation failed\n"); goto out; } snprintf(rr3->name, sizeof(rr...
false
false
false
false
false
0
gst_tag_to_metadata_block_picture (const gchar * tag, const GValue * image_value) { gchar *comment_data, *data_result; const gchar *mime_type; guint mime_type_len; GstStructure *mime_struct; GstBuffer *buffer; GList *l = NULL; GstByteWriter writer; GstTagImageType image_type = GST_TAG_IMAGE_TYPE_NON...
false
false
false
false
false
0
Scale( double *p1, double *p2, int vtkNotUsed( X ), int Y ) { // Get the motion vector double v[3]; v[0] = p2[0] - p1[0]; v[1] = p2[1] - p1[1]; v[2] = p2[2] - p1[2]; double center[3] = { 0., 0., 0. }; double avgdist = 0.; double *prevctr = this->HandleGeometry[0]->GetCenter(); double *ctr; center[...
false
false
false
false
false
0
JS_RemoveArgumentFormatter(JSContext *cx, const char *format) { size_t length; JSArgumentFormatMap **mpp, *map; length = strlen(format); mpp = &cx->argumentFormatMap; while ((map = *mpp) != NULL) { if (map->length == length && !strcmp(map->format, format)) { *mpp = map->next; ...
false
false
false
false
false
0
Gif_ReleaseUncompressedImage(Gif_Image *gfi) { Gif_DeleteArray(gfi->img); if (gfi->image_data && gfi->free_image_data) (*gfi->free_image_data)(gfi->image_data); gfi->img = 0; gfi->image_data = 0; gfi->free_image_data = 0; }
false
false
false
false
false
0
acf_cut_exec(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) { int ret = -1; struct ast_str *str = ast_str_create(16); switch (cut_internal(chan, data, &str, len)) { case ERROR_NOARG: ast_log(LOG_ERROR, "Syntax: CUT(<varname>,<char-delim>,<range-spec>) - missing argument!\n"); bre...
false
false
false
false
false
0
entries( const std::string& path ) { std::list<std::string> result; DirTree* dt = io->dirtree; DirEntry* e = dt->entry( path, false ); if( e && e->dir ) { unsigned parent = dt->indexOf( e ); std::vector<unsigned> children = dt->children( parent ); for( unsigned i = 0; i < children.size(); i++ ) ...
false
false
false
false
false
0
show_parconfig_smsc37c669(int io, int key) { int cr1, cr4, cra, cr23, cr26, cr27; struct superio_struct *s; static const char *const modes[] = { "SPP and Bidirectional (PS/2)", "EPP and SPP", "ECP", "ECP and EPP" }; outb(key, io); outb(key, io); outb(1, io); cr1 = inb(io + 1); outb(4, io); cr4 = inb(...
false
false
false
false
false
0
setStyle(RenderStyle* style) { RenderStyle* useStyle = style; // SVG text layout code expects us to be a block-level style element. if (useStyle->display() == NONE) setChildrenInline(false); else if (useStyle->isDisplayInlineType()) { useStyle = new /*khtml: don't use it like that!(...
false
false
false
false
false
0
fnmatch_pattern_has_wildcards (const char *str, int options) { while (1) { switch (*str++) { case '\\': str += ! (options & FNM_NOESCAPE) && *str; break; case '+': case '@': case '!': if (options & FNM_EXTMATCH && *str == '(') return true; ...
false
false
false
false
false
0
read_ancestry(const char *graft_file) { FILE *fp = fopen(graft_file, "r"); char buf[1024]; if (!fp) return -1; while (fgets(buf, sizeof(buf), fp)) { /* The format is just "Commit Parent1 Parent2 ...\n" */ int len = strlen(buf); struct commit_graft *graft = read_graft_line(buf, len); if (graft) register...
true
true
false
false
true
1
rb_ary_collect(VALUE ary) { long i; VALUE collect; RETURN_ENUMERATOR(ary, 0, 0); collect = rb_ary_new2(RARRAY_LEN(ary)); for (i = 0; i < RARRAY_LEN(ary); i++) { rb_ary_push(collect, rb_yield(RARRAY_PTR(ary)[i])); } return collect; }
false
false
false
false
false
0
theora_enc_stop (GstVideoEncoder * benc) { GstTheoraEnc *enc; GST_DEBUG_OBJECT (benc, "stop: clearing theora state"); enc = GST_THEORA_ENC (benc); if (enc->encoder) th_encode_free (enc->encoder); enc->encoder = NULL; th_comment_clear (&enc->comment); th_info_clear (&enc->info); if (enc->input_sta...
false
false
false
false
false
0
star_list_update_labels(GtkWidget *window) { struct gui_star *gs; GSList *sl = NULL; struct gui_star_list *gsl; gsl = gtk_object_get_data(GTK_OBJECT(window), "gui_star_list"); if (gsl == NULL) return; sl = gsl->sl; while(sl != NULL) { gs = GUI_STAR(sl->data); sl = g_slist_next(sl); if (gs->s) { gui_s...
false
false
false
false
false
0
M_SetupReadFields(void) { if(META_DEBUG) METAIO_STREAM::cout << "MetaGroup: M_SetupReadFields" << METAIO_STREAM::endl; MetaObject::M_SetupReadFields(); MET_FieldRecordType * mF = new MET_FieldRecordType; MET_InitReadField(mF, "EndGroup", MET_NONE, true); mF->terminateRead = true; m_Fields.push_back(mF); ...
false
false
false
false
false
0
e_gadcon_layout_orientation_get(Evas_Object *obj) { E_Smart_Data *sd; if (!obj) return 0; sd = evas_object_smart_data_get(obj); if (!sd) return 0; return sd->horizontal; }
false
false
false
false
false
0
tst_flt_delta_equal(int line_num, tst_case *tc, const double expected, const double actual, const double delta) { double diff; a_cnt++; update_status(); if (tc->failed && !force) { return false; } if (expected == actual) { return true; } /* acco...
false
false
false
false
false
0
xmlSecNssDigestInitialize(xmlSecTransformPtr transform) { xmlSecNssDigestCtxPtr ctx; xmlSecAssert2(xmlSecNssDigestCheckId(transform), -1); xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecNssDigestSize), -1); ctx = xmlSecNssDigestGetCtx(transform); xmlSecAssert2(ctx != NULL, -1); /* in...
false
false
false
false
false
0
load_method(private_xauth_t* this) { identification_t *server, *peer; enumerator_t *enumerator; xauth_method_t *xauth; xauth_role_t role; peer_cfg_t *peer_cfg; auth_cfg_t *auth; char *name; if (this->initiator) { server = this->ike_sa->get_my_id(this->ike_sa); peer = this->ike_sa->get_other_id(this->ike_s...
false
false
false
false
false
0
jgdi_report_queue_begin(qhost_report_handler_t* handler, const char* qname, lList** alpp) { jgdi_report_handler_t* ctx = (jgdi_report_handler_t*)handler->ctx; JNIEnv *env = ctx->env; DENTER(JGDI_LAYER, "jgdi_report_queue_begin"); DPRINTF(("jgdi_report_queue_begin: %s\n", qname)); if (QueueInfoImpl_...
false
false
false
false
false
0
GenerateEnchSuffixFactor(uint32 item_id) { ItemPrototype const* itemProto = ObjectMgr::GetItemPrototype(item_id); if (!itemProto) return 0; if (!itemProto->RandomSuffix) return 0; RandomPropertiesPointsEntry const* randomProperty = sRandomPropertiesPointsStore.LookupEntry(itemProto->It...
false
false
false
false
false
0
disk_cache_shift(struct key_disk_cache *c) { UINT32 key_size, offset; struct key_disk_cache *tmp = key_disk_cache_head; /* offset is the end of the key location in the file */ offset = TSSPS_VENDOR_DATA_OFFSET(c) + c->vendor_data_size; /* key_size is the size of the key entry on disk */ key_size = offset - TSSPS...
false
false
false
false
false
0
open(const std::string& mode) { close(); p_->openMode_ = mode; p_->opMode_ = Impl::opSeek; #ifdef EXV_UNICODE_PATH if (p_->wpMode_ == Impl::wpUnicode) { p_->fp_ = ::_wfopen(wpath().c_str(), s2ws(mode).c_str()); } else #endif { p_->fp_ =...
false
false
false
false
false
0
getConfigItemQualityAmount(AuctionQuality quality) const { switch (quality) { case AUCTION_QUALITY_GREY: return getConfig(CONFIG_UINT32_AHBOT_ITEM_GREY_AMOUNT); case AUCTION_QUALITY_WHITE: return getConfig(CONFIG_UINT32_AHBOT_ITEM_WHITE_AMOUNT); case AUCTION_QUALITY_GREEN: return getCon...
false
false
false
false
false
0
qstrlower(char *str) { char *cp; if (!str) return NULL; for (cp = str; *cp; cp++) if (*cp >= 'A' && *cp <= 'Z') *cp += 32; return str; }
false
false
false
false
false
0
locateItemforSignatureCreation(DcmItem& dataset, const char *location) { DcmTagKey key; Uint32 idx; int pos = 0; int token = 0; int expected = 1; OFBool finished = OFFalse; DcmItem *result = &dataset; DcmSequenceOfItems *sq = NULL; DcmStack stack; do { token = readNextToken(location, pos, key,...
false
false
false
false
false
0
crypto_spawn_alg(struct crypto_spawn *spawn) { struct crypto_alg *alg; struct crypto_alg *alg2; down_read(&crypto_alg_sem); alg = spawn->alg; alg2 = alg; if (alg2) alg2 = crypto_mod_get(alg2); up_read(&crypto_alg_sem); if (!alg2) { if (alg) crypto_shoot_alg(alg); return ERR_PTR(-EAGAIN); } return ...
false
false
false
false
false
0
H5Tenum_create(hid_t parent_id) { H5T_t *parent = NULL; /*base integer data type */ H5T_t *dt = NULL; /*new enumeration data type */ hid_t ret_value; /*return value */ FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", parent_id); /* Check args */ if(NULL == (parent = (H5T_t *)H5I_object_...
false
false
false
false
false
0
dm_get_live_table_fast(struct mapped_device *md) __acquires(RCU) { rcu_read_lock(); return rcu_dereference(md->map); }
false
false
false
false
false
0
GetDomainMinNumberOfPeriods(const String& domain) const { // Well ... if a domain has been specified, we need some check-ups // as the standard says. static char* TopLevelDomains[] = { "com", "edu", "net", "org", "gov", "mil", "int", 0}; const char* s = strrchr(domain.get(), '.'); if (!s) ...
false
false
false
false
false
0
FSBlkNextElm( BTSK * pStack) { RCODE rc = FERR_BT_END_OF_DATA; FLMBYTE * elmPtr; FLMUINT uiElmSize; elmPtr = &pStack->pBlk[pStack->uiCurElm]; if (pStack->uiBlkType == BHT_LEAF) { uiElmSize = BBE_LEN( elmPtr); if (pStack->uiCurElm + BBE_LEM_LEN < pStack->uiBlkEnd) { if ((pStack->uiCurElm += uiElmSi...
false
false
false
false
false
0
mark_address (gimple stmt, tree addr, tree, void *data) { addr = get_base_address (addr); if (TREE_CODE (addr) == FUNCTION_DECL) { struct cgraph_node *node = cgraph_get_create_real_symbol_node (addr); cgraph_mark_address_taken_node (node); ipa_record_reference ((symtab_node)data, (symta...
false
false
false
false
false
0
ftdi_elan_edset_output(struct usb_ftdi *ftdi, u8 ed_number, void *endp, struct urb *urb, u8 address, u8 ep_number, u8 toggle_bits, void (*callback) (void *endp, struct urb *urb, u8 *buf, int len, int toggle_bits, int error_count, int condition_code, int repeat_number, int halted, int ski...
false
false
false
false
false
0
_parse_subpath_extension(BITSTREAM *bits, MPLS_PL *pl) { MPLS_SUB *sub_path; int ii; uint32_t len = bs_read(bits, 32); int sub_count = bs_read(bits, 16); if (len < 1 || sub_count < 1) { return 0; } sub_path = calloc(sub_count, sizeof(MPLS_SUB)); for (ii = 0; ii < s...
false
false
false
false
false
0
xkill (class reader_t *pipe_) { zmq_assert (pipe_ == reply_pipe); reply_pipe_active = false; }
false
false
false
false
false
0
evalAsLongLongV() { IdlLongLongVal a = a_->evalAsLongLongV(); IdlLongLongVal b = b_->evalAsLongLongV(); if (a.negative) return IdlLongLongVal(IDL_LongLong(a.s ^ b.s)); else return IdlLongLongVal(IDL_ULongLong(a.u ^ b.u)); }
false
false
false
false
false
0
proc_sync_cmd(struct mcap_mcl *mcl, uint8_t *cmd, uint32_t len) { if (!mcl->mi->csp_enabled || !mcl->csp) { switch (cmd[0]) { case MCAP_MD_SYNC_CAP_REQ: send_unsupported_cap_req(mcl); break; case MCAP_MD_SYNC_SET_REQ: send_unsupported_set_req(mcl); break; } return; } switch (cmd[0]) { case MC...
false
false
false
false
false
0
isl_seq_lcm(isl_int *p, unsigned len, isl_int *lcm) { int i; if (len == 0) { isl_int_set_si(*lcm, 1); return; } isl_int_set(*lcm, p[0]); for (i = 1; i < len; ++i) isl_int_lcm(*lcm, *lcm, p[i]); }
false
false
false
false
false
0
search_neighbors(double **x,double **cy,struct param p,struct sfound sf) { int ei,ej,i,hdim,whichsize,whichbox; long found; double epsilon; hdim=p.hdim; ei=(int)(cy[0][hdim]*EPSILONS); if (ei < 0) ei=0; else if (ei>(EPSILONS-1)) ei=EPSILONS-1; ej=(int)(cy[nsseconddim][hdim]*EPSILONS); if (ej < 0) ej=0...
false
false
false
false
false
0
callAsFunction(ExecState *exec, JSObject *thisObj, const List &args) { KJS_CHECK_THIS( KJS::DOMNamedNodeMap, thisObj ); DOMExceptionTranslator exception(exec); DOM::NamedNodeMapImpl& map = *static_cast<DOMNamedNodeMap *>(thisObj)->impl(); switch(id) { case DOMNamedNodeMap::GetNamedItem: return getDOM...
false
false
false
true
false
1
tei_debug(struct FsmInst *fi, char *fmt, ...) { struct teimgr *tm = fi->userdata; struct va_format vaf; va_list va; if (!(*debug & DEBUG_L2_TEIFSM)) return; va_start(va, fmt); vaf.fmt = fmt; vaf.va = &va; printk(KERN_DEBUG "sapi(%d) tei(%d): %pV\n", tm->l2->sapi, tm->l2->tei, &vaf); va_end(va); ...
false
false
false
false
false
0
cyttsp4_spi_probe(struct spi_device *spi) { struct cyttsp4 *ts; int error; /* Set up SPI*/ spi->bits_per_word = CY_SPI_BITS_PER_WORD; spi->mode = SPI_MODE_0; error = spi_setup(spi); if (error < 0) { dev_err(&spi->dev, "%s: SPI setup error %d\n", __func__, error); return error; } ts = cyttsp4_probe(&cy...
false
false
false
false
false
0
SP(GeneralMatrix* gm, GeneralMatrix* gm2) { REPORT Real* s2=gm2->Store(); Real* s=gm->Store(); int i=gm->Storage() >> 2; while (i--) { *s++ *= *s2++; *s++ *= *s2++; *s++ *= *s2++; *s++ *= *s2++; } i=gm->Storage() & 3; while (i--) *s++ *= *s2++; }
false
false
false
false
false
0
saveLog(std::string name) { mrpt::synch::CCriticalSectionLocker cs( &semaphore ); saveToFile( name ); }
false
false
false
false
false
0
py_rgb_px(uint8_t *img_out, comp_t px, const int ch) { for (int k = 0; k < ch; k++) { img_out[k] = (uint8_t)px; px >>= CHANNEL_WIDTH_RGB; } }
false
false
false
false
false
0
get_pixbuf (GdkPixbufAnimationIter *anim_iter) { GdkPixbufSimpleAnimIter *iter; GdkPixbufFrame *frame; iter = GDK_PIXBUF_SIMPLE_ANIM_ITER (anim_iter); if (iter->current_frame) frame = iter->current_frame->data; else if (g_list_length (iter->simpl...
false
false
false
false
false
0
update_state() { for (int i=0, ss=sreg; i<8; i++,ss>>=1) m_Q[i]->putState(ss&1); }
false
false
false
false
false
0
on_cme__response (GtkWidget *widget, gint response_id, GapCmeGlobalParams *gpp) { GtkWidget *dialog; if(gpp) { gpp->val.run = FALSE; } switch (response_id) { case GTK_RESPONSE_OK: if(gpp) { switch(gpp->video_encoder_run_state) { ...
false
false
false
false
false
0
ftglue_qalloc( FT_Memory memory, FT_ULong size, FT_Error *perror ) { FT_Error error = 0; FT_Pointer block = NULL; if ( size > 0 ) { block = memory->alloc( memory, size ); if ( !block ) error = FT_Err_Out_Of_Memory; } *perror = error; return block; }
false
false
false
false
false
0
uv_fs_unlink(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) { uv_fs_req_init(loop, req, UV_FS_UNLINK, cb); if (cb) { /* async */ uv_ref(loop); req->eio = eio_unlink(path, EIO_PRI_DEFAULT, uv__fs_after, req); if (!req->eio) { uv_err_new(loop, ENOMEM); return -1; } }...
false
false
false
false
false
0
STRING(ch) int ch; { int nest_level = 1; tokenType = TOKEN_STRING; do { ch = next_ch(); while(!isSTRING_SPECIAL(ch)) { save_ch(ch); ch = next_ch(); }; switch (ch) { case '(': ++nest_level; save_ch(ch); break; case ')': if (--nest_leve...
false
false
false
false
false
0
restore_from_file(VMG_ vm_obj_id_t, CVmFile *fp, CVmObjFixup *) { size_t prec; /* read the precision */ prec = fp->read_uint2(); /* free any existing extension */ if (ext_ != 0) { G_mem->get_var_heap()->free_mem(ext_); ext_ =...
false
false
false
false
false
0
b44_phy_reset(struct b44_private *bp) { u32 val; int err; err = b44_phy_write(bp, MII_BMCR, BMCR_RESET); if (err) return err; udelay(100); err = b44_phy_read(bp, MII_BMCR, &val); if (!err) { if (val & BMCR_RESET) { return -ENODEV; } } return 0; }
false
false
false
false
false
0
decl_instconns(struct mod_t *mdp) { register struct cell_t *cp; register struct cell_pin_t *cpp; /* at this point all mod. insts., and gates on cell list */ /* SJM 03/25/99 - all gate ports including control must be declared imp. */ for (cp = mdp->mcells; cp != NULL; cp = cp->cnxt) { if (cp->cmsym == NULL) ...
false
false
false
false
false
0
SetSocket( int handle, eSocketType sockettype ) { CString ip; int port; if ( m_eState != estNONE ) { return -1; } m_pConnMutex->Lock(); m_sIP.Empty(); m_nPort = 0; if ( CSocket::SetSocket(handle,sockettype) == -1 ) { m_pConnMutex->UnLock(); return -1; } // get remote host & port if ( GetPeerName...
false
false
false
false
false
0
utf8word_to_unicode(uint32 c) { uint32 ucs; if (c <= 0x7F) { ucs = c; } else if (c <= 0xFFFF) { ucs = ((c >> 8) & 0x1F) << 6; ucs |= c & 0x3F; } else if (c <= 0xFFFFFF) { ucs = ((c >> 16) & 0x0F) << 12; ucs |= ((c >> 8) & 0x3F) << 6; ucs |= c & 0x3F; } else { ucs = ((c >> 24) & 0x07) << 18; ...
false
false
false
false
false
0
x_T_hot(KILL_NODE *node, ARTICLE *articles, SUBJECT *subj) { long n = 0; ARTICLE *art, *thr; while (subj) { thr = subj->thread; if (THREAD_HAS_UNREAD(subj)) for (art = thr ; art ; art = next_in_thread_preorder(art)) if (art->xref && regexec(node->expr_re, art->xref, 0, NULL, 0) == 0) { ...
false
false
false
false
false
0
runnable_alias (gchar *def, gint argc, gchar **argv, const gchar *line, gchar **runnable) { gint k, len; gchar **subst; gboolean retval = TRUE; GList *tokens, *it; /* Substitute parameters: $0: line, $@: line, $1: field 1, $2: field 2, ... */ tokens = alias_tokenize (def); len = g_list_length (tokens); subs...
false
false
false
false
false
0
mmc_test_profile_trim_perf(struct mmc_test_card *test) { struct mmc_test_area *t = &test->area; unsigned long sz; unsigned int dev_addr; struct timespec ts1, ts2; int ret; if (!mmc_can_trim(test->card)) return RESULT_UNSUP_CARD; if (!mmc_can_erase(test->card)) return RESULT_UNSUP_HOST; for (sz = 512; sz ...
false
false
false
false
false
0
read_config(void) { DIR *conf_dir; struct dirent *dent; char *path; conf_dir = opendir(IBV_CONFIG_DIR); if (!conf_dir) { fprintf(stderr, PFX "Warning: couldn't open config directory '%s'.\n", IBV_CONFIG_DIR); return; } while ((dent = readdir(conf_dir))) { struct stat buf; if (asprintf(&path, "%s/%s...
true
true
false
false
true
1
clear_huge_page(struct page *page, unsigned long addr, unsigned int pages_per_huge_page) { int i; if (unlikely(pages_per_huge_page > MAX_ORDER_NR_PAGES)) { clear_gigantic_page(page, addr, pages_per_huge_page); return; } might_sleep(); for (i = 0; i < pages_per_huge_page; i++) { cond_resched(); cle...
false
false
false
false
false
0
add_class_flag (class_flag_node **rootp, const char *ident, int value) { class_flag_node *root = *rootp; class_flag_node *parent, *node; /* Create the root of the tree if it doesn't exist yet. */ if (NULL == root) { root = XNEW (class_flag_node); root->ident = ""; root->value = 0; ...
false
false
false
false
false
0
start_program() { struct stat info; int result; result = stat(program_argv[0], &info); if(result != 0) { debug(D_DEBUG, "couldn't stat %s: %s\n", program_argv[0], strerror(errno)); return 0; } program_mtime = info.st_mtime; program_ctime = info.st_ctime; pid = fork(); if(pid == 0) { setpgid(getpid(), ...
false
false
false
false
true
1
tryUriConvert(std::string& filename) { void* gLib = dlopen("libglib-2.0.so", RTLD_LAZY); void* gobjectLib = dlopen("libgobject-2.0.so", RTLD_LAZY); void* gioLib = dlopen("libgio-2.0.so", RTLD_LAZY); if (gioLib && gLib && gobjectLib) { FileCreateFunc createFunc = (FileCreateFunc) dlsym(gi...
false
false
false
false
false
0
sd_start(struct gspca_dev *gspca_dev) { struct sd *sd = (struct sd *) gspca_dev; if (sd->sensor == SENSOR_PAS106) Et_init1(gspca_dev); else Et_init2(gspca_dev); setautogain(gspca_dev); reg_w_val(gspca_dev, ET_RESET_ALL, 0x08); et_video(gspca_dev, 1); /* video on */ return 0; }
false
false
false
false
false
0
OnLeftButtonDown() { int x = this->Interactor->GetEventPosition()[0]; int y = this->Interactor->GetEventPosition()[1]; this->FindPokedRenderer(x, y); this->FindPickedActor(x, y); if (this->CurrentRenderer == NULL || this->InteractionProp == NULL) { return; } this->GrabFocus(this->EventCallbac...
false
false
false
false
false
0
activate_back_or_forward_menu_item (GtkMenuItem *menu_item, NemoWindow *window, gboolean back) { int index; g_assert (GTK_IS_MENU_ITEM (menu_item)); index = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (menu_item), "user_data")); nemo_window_back_or_forward (window, back, index, should_open_in_...
false
false
false
false
false
0
browseModule(mod,all) Module mod; Bool all; { /* include all names in scope in the module? */ List exports = resolveImportList(mod, DOTDOT, FALSE); Printf("module %s where\n",textToStr(module(mod).text)); if (all) { List all_names = dupList(module(mod).names); mapProc(browseName,rev(all_names)); } e...
false
false
false
false
false
0
g_strconcat (const gchar *string1, ...) { gsize l; va_list args; gchar *s; gchar *concat; gchar *ptr; if (!string1) return NULL; l = 1 + strlen (string1); va_start (args, string1); s = va_arg (args, gchar*); while (s) { l += strlen (s); s = va_arg (args, gchar*); ...
false
false
false
false
false
0
add_bracket () { int gauge; if (importflag != 0) return; gauge = 10 + (boxgap * mark.h / 600 * mark.w / 600); add_struct (mark.x, mark.y, mark.x + gauge, mark.y, 0, 0, 0, 1, curpen); add_struct (mark.x, mark.y, mark.x, mark.y + mark.h, 0, 0, 0, 1, curpen); add_struct (mark.x, mark.y + mark.h, mark.x + ...
false
false
false
false
false
0
IsJFPFile(FileHelper * fh) { char firstbyte; fhReset(fh); firstbyte = fhReadNextChar(fh); if (firstbyte < 124 || firstbyte > 126) return FALSE; if ((fhReadNextChar(fh) == '\0')) return TRUE; else return FALSE; }
false
false
false
false
false
0
folder_have_mailbox (void) { GList *cur; for (cur = folder_list; cur != NULL; cur = g_list_next(cur)) { Folder *folder = FOLDER(cur->data); if (folder->inbox && folder->outbox) return TRUE; } return FALSE; }
false
false
false
false
false
0
parse_config(const char *filename) { char line[MAX_LINE], *p; FILE *f; struct match *list = NULL; struct match **ep = &list; struct match *m; if (!filename) filename = syslinux_config_file(); f = fopen(filename, "r"); if (!f) return list; while (fgets(line, sizeof line, f)) { p...
false
false
false
false
true
1
option_color_command(int argc, const char *argv[]) { struct line_info *info; if (argc != 3 && argc != 4) { config_msg = "Wrong number of arguments given to color command"; return ERR; } info = get_line_info(argv[0]); if (!info) { if (!string_enum_compare(argv[0], "main-delim", strlen("main-delim"))) { i...
false
false
false
false
false
0
f_setpos(argvars, rettv) typval_T *argvars; typval_T *rettv; { pos_T pos; int fnum; char_u *name; rettv->vval.v_number = -1; name = get_tv_string_chk(argvars); if (name != NULL) { if (list2fpos(&argvars[1], &pos, &fnum) == OK) { if (--pos.col < 0) pos.col = 0; if (nam...
false
false
false
false
false
0
computeVertexStat ( BipolarPointer p ) { DLVertex& v = (*this)[p]; bool pos = isPositive(p); // this vertex is already processed if ( v.isProcessed(pos) ) return; // in case of cycle: mark concept as such if ( v.isVisited(pos) ) { v.setInCycle(pos); return; } v.setVisited(pos); // ensure that the st...
false
false
false
false
false
0
bt_ctf_field_sequence_serialize(struct bt_ctf_field *field, struct ctf_stream_pos *pos) { size_t i; int ret = 0; struct bt_ctf_field_sequence *sequence = container_of( field, struct bt_ctf_field_sequence, parent); for (i = 0; i < sequence->elements->len; i++) { ret = bt_ctf_field_serialize( g_ptr_array_in...
false
false
false
false
false
0
gap_story_render_debug_print_maskdef_elem(GapStoryRenderMaskDefElem *maskdef_elem, gint l_idx) { if(maskdef_elem) { printf("\n ===== maskdef_elem start ============ \n" ); printf(" [%d] record_type : %d\n", (int)l_idx, (int)maskdef_elem->record_type ); printf(" [%d] mask_name : "...
false
false
false
false
false
0
scsi_prep_fn(struct request_queue *q, struct request *req) { struct scsi_device *sdev = q->queuedata; struct scsi_cmnd *cmd; int ret; ret = scsi_prep_state_check(sdev, req); if (ret != BLKPREP_OK) goto out; cmd = scsi_get_cmd_from_req(sdev, req); if (unlikely(!cmd)) { ret = BLKPREP_DEFER; goto out; } ...
false
false
false
false
false
0
rfb_decoder_state_wait_for_security (RfbDecoder * decoder) { /* * Version 3.3 The server decides the security type and sends a single word * * The security-type may only take the value 0, 1 or 2. A value of 0 means that the * connection has failed and is followed by a string giving the reason, as describe...
false
false
false
false
false
0
mono_metadata_generic_inst_hash (gconstpointer data) { const MonoGenericInst *ginst = (const MonoGenericInst *) data; guint hash = 0; int i; for (i = 0; i < ginst->type_argc; ++i) { hash *= 13; hash += mono_metadata_type_hash (ginst->type_argv [i]); } return hash ^ (ginst->is_open << 8); }
false
false
false
false
false
0
gst_stream_synchronizer_src_event (GstPad * pad, GstObject * parent, GstEvent * event) { GstStreamSynchronizer *self = GST_STREAM_SYNCHRONIZER (parent); gboolean ret = FALSE; GST_LOG_OBJECT (pad, "Handling event %s: %" GST_PTR_FORMAT, GST_EVENT_TYPE_NAME (event), event); switch (GST_EVENT_TYPE (even...
false
false
false
false
false
0
make_args(int argc, char **argv, intmax_t seed) { if (*argv && !strncmp("--", *argv, 3)) { argc--; argv++; } const char **args = malloc((argc+6)*sizeof(*args)); int i = 0; args[i++] = atc_cmd; if (seed != -1) { static char buf[30]; sprintf(buf, "%jd", seed); ...
false
false
false
false
false
0
PyvtkMath_AreBoundsInitialized(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "AreBoundsInitialized"); double temp0[6]; double save0[6]; const int size0 = 6; PyObject *result = NULL; if (ap.CheckArgCount(1) && ap.GetArray(temp0, size0)) { ap.SaveArray(temp0, save0, size0); int tem...
false
false
false
false
false
0
forward_page_function (gint current_page, glNewLabelDialog *this) { gchar *name; lglTemplate *template; const lglTemplateFrame *frame; gdouble w, h; switch (current_page) { ...
false
false
false
false
false
0
send_to_channel (MsgChannel *c) const { Msg::send_to_channel (c); *c << (uint32_t) job->language(); *c << job->jobID(); if (IS_PROTOCOL_30(c)) *c << job->remoteFlags(); else { if (job->compilerName().find("clang") != string::npos) { // Hack for compilerwrapper. std::list<std::string> fla...
false
false
false
false
false
0
apcmaster_status(StonithPlugin *s) { struct pluginDevice* ms; int rc; ERRIFNOTCONFIGED(s,S_OOPS); ms = (struct pluginDevice*) s; if ((rc = MSRobustLogin(ms) != S_OK)) { LOG(PIL_CRIT, "Cannot log into %s.", ms->idinfo); return(rc); } /* Expect ">" */ SEND(ms->wrfd, "\033\r"); EXPECT(ms->rdfd, Prompt, 5...
true
true
false
false
false
1
updateHashChain(unsigned short* hashchain, int* hashhead, int* hashval, size_t pos, int hash, unsigned windowSize) { unsigned wpos = pos % windowSize; hashval[wpos] = hash; if(hashhead[hash] != -1) hashchain[wpos] = hashhead[hash]; hashhead[hash] = wpos; }
false
false
false
false
false
0