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
get_call_frame_for_req (fuse_state_t *state) { call_pool_t *pool = NULL; fuse_in_header_t *finh = NULL; call_frame_t *frame = NULL; xlator_t *this = NULL; fuse_private_t *priv = NULL; pool = state->pool; finh = state->f...
false
false
false
false
false
0
help_update_wonder(const struct help_item *pitem, char *title) { char buf[8192]; struct impr_type *imp = improvement_by_translated_name(title); create_help_page(HELP_WONDER); if (imp && is_great_wonder(imp)) { int i; char req_buf[512]; sprintf(buf, "%d", impr_build_shield_cost(imp)); ...
true
true
false
false
false
1
gst_inter_sub_src_create (GstBaseSrc * src, guint64 offset, guint size, GstBuffer ** buf) { GstInterSubSrc *intersubsrc = GST_INTER_SUB_SRC (src); GstBuffer *buffer; GST_DEBUG_OBJECT (intersubsrc, "create"); buffer = NULL; g_mutex_lock (&intersubsrc->surface->mutex); if (intersubsrc->surface->sub_buf...
false
false
false
false
false
0
find_next_mod_format(int start_index, void *v, const char **fmt, loff_t *pos) { struct trace_bprintk_fmt *mod_fmt; if (list_empty(&trace_bprintk_fmt_list)) return NULL; /* * v will point to the address of the fmt record from t_next * v will be NULL from t_start. * If this is the first pointer or called fro...
false
false
false
false
false
0
loadExternalDictionaries() { const char* env = NULL; int len; int sepCnt = 0; OFBool msgIfDictAbsent = OFTrue; OFBool loadFailed = OFFalse; env = getenv(DCM_DICT_ENVIRONMENT_VARIABLE); if ((env == NULL) || (strlen(env) == 0)) { env = DCM_DICT_DEFAULT_PATH; msgIfDictAbsent = ...
false
true
false
false
true
1
mc13783_adc_read_gp(struct device *dev, struct device_attribute *devattr, char *buf) { unsigned val; int ret = mc13783_adc_read(dev, devattr, &val); if (ret) return ret; /* * input range is [0, 2.3V], val has 10 bits, so each bit * is worth 9/4 mV. */ val = DIV_ROUND_CLOSEST(val * 9, 4); return sprin...
false
true
false
false
false
1
method_to_desc (const Description descriptions[], gint n_elems, const gchar *method) { Description d, *ret; d.method = (gchar*) method; ret = (Description *) bsearch (&d, descriptions, n_elems, sizeof (Description), compare_methods); return (ret) ? ret->desc : method; }
false
false
false
false
false
0
Bar(ostream &os, double numer, double denom, int length) { int decimalPlaces = NumDigits(denom); int maxDec = 4; //int power = decimalPlaces-maxDec; //cout << "decimal places: " << decimalPlaces << ", " << "10^" << power << " = " << Power(3,4) << endl; if (decimalPlaces <= maxDec || int(numer) % P...
false
false
false
false
false
0
addChunk_iTXt(ucvector* out, unsigned compressed, const char* keyword, const char* langtag, const char* transkey, const char* textstring, LodePNGCompressSettings* zlibsettings) { unsigned error = 0; ucvector data; size_t i, textsize = strlen(textstring); ucvector_init(&data); f...
false
false
false
false
false
0
check_QStringToGooString() { QFETCH(QString, string); QFETCH(GooString*, result); GooString *goo = Poppler::QStringToGooString(string); QCOMPARE(goo->getCString(), result->getCString()); delete goo; }
false
false
false
false
false
0
ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *eckey, void *(*KDF)(const void *in, size_t inlen, void *out, size_t *outlen)) { ECDH_DATA *ecdh = ecdh_check(eckey); if (ecdh == NULL) return 0; return ecdh->meth->compute_key(out, outlen, pub_key, eckey, KDF); }
false
false
false
false
false
0
BBox( const wchar_t* string, float& llx, float& lly, float& llz, float& urx, float& ury, float& urz) { const wchar_t* c = string; llx = lly = llz = urx = ury = urz = 0; FTBBox bbox; while( *c) { if( !glyphList->Glyph( static_cast<unsigned int>(*c))) { unsigned int g = face....
false
false
false
false
false
0
event_base_assert_ok_nolock_(struct event_base *base) { int i; int count; /* First do checks on the per-fd and per-signal lists */ evmap_check_integrity_(base); /* Check the heap property */ for (i = 1; i < (int)base->timeheap.n; ++i) { int parent = (i - 1) / 2; struct event *ev, *p_ev; ev = base->timehea...
false
false
false
false
false
0
tag_string(Pulse_Tag *tag, const char *val) { uint8_t *ret; ret = tag->data + tag->size; if (val) { *ret = PA_TAG_STRING; strcpy((char*)ret + 1, val); ret += PA_TAG_SIZE_STRING + strlen(val); tag->size = ret - tag->data; } else *ret = PA_TAG_STRING_NULL, tag->...
false
true
false
false
false
1
scc_transmit(int port, word32 val, double dcycs) { Scc *scc_ptr; int out_wrptr; int out_rdptr; scc_ptr = &(scc_stat[port]); /* See if port initialized, if not, do so now */ if(scc_ptr->state == 0) { scc_port_init(port); } if(scc_ptr->state < 0) { /* No working serial port, just toss it and go */ return;...
false
false
false
false
false
0
preg_do_eval(char *eval_str, int eval_str_len, char *subject, int *offsets, int count, char **result TSRMLS_DC) { zval retval; /* Return value from evaluation */ char *eval_str_end, /* End of eval string */ *match, /* Current match for a backref */ *esc_match, /* Quote-escaped match */ *w...
false
false
false
false
false
0
test_read() { bert_data_t *data; int result; if ((result = bert_decoder_pull(decoder,&data)) != 1) { test_fail(bert_strerror(result)); } if (data->type != bert_data_string) { test_fail("bert_decoder_next did not decode a string"); } const char *expected = "hello world"; size_t expected_length = strlen(...
false
false
false
false
false
0
quotearg_n_options (int n, char const *arg, size_t argsize, struct quoting_options const *options) { int e = errno; unsigned int n0 = n; struct slotvec *sv = slotvec; if (n < 0) abort (); if (nslots <= n0) { /* FIXME: technically, the type of n1 should be 'unsigned int', ...
false
false
false
false
false
0
sys_setpriority(struct tcb *tcp) { if (entering(tcp)) { printxval(priorities, tcp->u_arg[0], "PRIO_???"); tprintf(", %lu, %ld", tcp->u_arg[1], tcp->u_arg[2]); } return 0; }
false
false
false
false
false
0
display_initial_sids(policydb_t * p, FILE * fp) { ocontext_t *cur; char *user, *role, *type; fprintf(fp, "Initial SIDs:\n"); for (cur = p->ocontexts[OCON_ISID]; cur != NULL; cur = cur->next) { user = p->p_user_val_to_name[cur->context[0].user - 1]; role = p->p_role_val_to_name[cur->context[0].role - 1]; type...
false
false
false
false
false
0
source_client_callback (client_t *client, void *arg) { const char *agent; source_t *source = arg; refbuf_t *old_data = client->refbuf; if (client->con->error) { global_lock(); global.sources--; global_unlock(); source_clear_source (source); source_free_source...
false
false
false
false
false
0
params_parse_tsig(const char *value, knot_key_params_t *key_params) { if (value == NULL || key_params == NULL) { DBG_NULL; return KNOT_EINVAL; } /* Invalidate previous key. */ if (key_params->name) { ERR("Key specified multiple times.\n"); return KNOT_EINVAL; } char *h = strdup(value); if (!h) { retu...
false
false
false
false
false
0
calendar_islamic_cleanup(void) { if (gMonthCache) { delete gMonthCache; gMonthCache = NULL; } if (gIslamicCalendarAstro) { delete gIslamicCalendarAstro; gIslamicCalendarAstro = NULL; } umtx_destroy(&astroLock); return TRUE; }
false
false
false
false
false
0
transmit_linestatres(struct skinny_device *d, int instance) { struct skinny_req *req; struct skinny_line *l; struct skinny_speeddial *sd; if (!(req = req_alloc(sizeof(struct line_stat_res_message), LINE_STAT_RES_MESSAGE))) return; if ((l = find_line_by_instance(d, instance))) { req->data.linestat.lineNumber ...
false
false
false
false
false
0
putObject(const Object *object, const char *name, ObjectID id) { Object *d = duplicate ? d->clone() : d; mStream->write(&d, sizeof d); }
false
false
false
false
true
1
bna_rxq_qpt_setup(struct bna_rxq *rxq, struct bna_rxp *rxp, u32 page_count, u32 page_size, struct bna_mem_descr *qpt_mem, struct bna_mem_descr *swqpt_mem, struct bna_mem_descr *page_mem) { u8 *kva; u64 dma; struct bna_dma_addr bna_dma; int i; rxq->qpt.hw_qpt_ptr.lsb = qpt_mem->dma.lsb; rxq->qpt.hw_qp...
false
false
false
false
false
0
combineOperandShadows(Instruction *Inst) { if (Inst->getNumOperands() == 0) return DFS.ZeroShadow; Value *Shadow = getShadow(Inst->getOperand(0)); for (unsigned i = 1, n = Inst->getNumOperands(); i != n; ++i) { Shadow = combineShadows(Shadow, getShadow(Inst->getOperand(i)), Inst); } return Shadow; }
false
false
false
false
false
0
hx509_private_key_private_decrypt(hx509_context context, const heim_octet_string *ciphertext, const heim_oid *encryption_oid, hx509_private_key p, heim_octet_string *cleartext) { int ret; cleartext->data = NULL; cleartext->length = 0; if (p->private_key.rsa == NULL) { hx50...
false
false
false
false
false
0
kgdb_nmi_tty_open(struct tty_struct *tty, struct file *file) { struct kgdb_nmi_tty_priv *priv = tty->driver_data; unsigned int mode = file->f_flags & O_ACCMODE; int ret; ret = tty_port_open(&priv->port, tty, file); if (!ret && (mode == O_RDONLY || mode == O_RDWR)) atomic_inc(&kgdb_nmi_num_readers); return ret...
false
false
false
false
false
0
get_density_matrix (const double *x, const DATASET *dset, double bws, int ctrl, int *err) { gretl_matrix *(*kdfunc) (const double *, const DATASET *, double, gretlopt, int *); void *handle; gretl_matrix *m = NULL; gretlopt opt; kdfunc = get_plugin_function("kernel_densit...
false
false
false
false
false
0
ecryptfs_inode_newsize_ok(struct inode *inode, loff_t offset) { struct ecryptfs_crypt_stat *crypt_stat; loff_t lower_oldsize, lower_newsize; crypt_stat = &ecryptfs_inode_to_private(inode)->crypt_stat; lower_oldsize = upper_size_to_lower_size(crypt_stat, i_size_read(inode)); lower_newsize = upper_size_to_lo...
false
false
false
false
false
0
GNUNET_CRYPTO_rsa_public_key_to_string (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *pub) { char *pubkeybuf; size_t keylen = (sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded)) * 8; char *end; if (keylen % 5 > 0) keylen += 5 - keylen % 5; keylen /= 5; pubkeybuf = GNUNET_malloc (keylen + 1); ...
false
false
false
false
false
0
cg_print (Sym ** timesortsym) { unsigned int sym_index; Sym *parent; if (print_descriptions && bsd_style_output) bsd_callg_blurb (stdout); print_header (); for (sym_index = 0; sym_index < symtab.len + num_cycles; ++sym_index) { parent = timesortsym[sym_index]; if ((ignore_zeros && pare...
false
false
false
false
false
0
cmsIT8Free(cmsHANDLE hIT8) { cmsIT8* it8 = (cmsIT8*) hIT8; if (it8 == NULL) return; if (it8->MemorySink) { OWNEDMEM* p; OWNEDMEM* n; for (p = it8->MemorySink; p != NULL; p = n) { n = p->Next; if (p->Ptr) _cmsFree(it8 ->ContextID, p->Ptr); ...
false
false
false
false
false
0
read_data(void) { int ret, ret2; unsigned char *buf = out_state.buf; int blen; ret2 = -1; assert(!out_state.len); #if defined(HAVE_LIBZ) || defined(HAVE_LIBCRYPTO) if (out_state.zip || out_state.crypt) buf = tmp_buf; #endif while ((ret = check_error(read(LOCAL_R.fd, buf, READLEN), ...
false
false
false
false
false
0
rtl8723a_init_default_value(struct rtw_adapter *padapter) { struct hal_data_8723a *pHalData; struct dm_priv *pdmpriv; u8 i; pHalData = GET_HAL_DATA(padapter); pdmpriv = &pHalData->dmpriv; /* init default value */ pHalData->bIQKInitialized = false; if (!padapter->pwrctrlpriv.bkeepfwalive) pHalData->LastHMEB...
false
false
false
false
false
0
PerlIO_clone(pTHX_ PerlInterpreter *proto, CLONE_PARAMS *param) { #ifdef USE_ITHREADS PerlIOl **table = &proto->Iperlio; PerlIOl *f; PL_perlio = NULL; PL_known_layers = PerlIO_clone_list(aTHX_ proto->Iknown_layers, param); PL_def_layerlist = PerlIO_clone_list(aTHX_ proto->Idef_layerlist, param); ...
false
false
false
false
false
0
meshMatch(MeshT *this, const MeshT *other) { if((this->nx != other->nx) || (this->ny != other->ny)) { #ifdef DEBUG printf("meshMatch: about to wreck the other mesh. This needs fixing.\n"); #endif /* Save a backup copy of the orignal mesh for possible "undo" */ meshStore(this); meshFreeReally(this);...
false
false
false
false
false
0
image_loader_set_buffer_size(ImageLoader *il, guint count) { if (!il) return; g_mutex_lock(il->data_mutex); il->idle_read_loop_count = count ? count : 1; g_mutex_unlock(il->data_mutex); }
false
false
false
false
false
0
remove_policy(struct connman_session_policy *policy) { GHashTableIter iter; gpointer key, value; struct connman_session *session; if (session_hash == NULL) return; DBG("policy %p name %s", policy, policy->name); g_hash_table_iter_init(&iter, session_hash); while (g_hash_table_iter_next(&iter, &key, &value)...
false
false
false
false
false
0
info_register_framework (mca_base_framework_t *framework, opal_pointer_array_t *component_map) { opal_info_component_map_t *map; int rc; rc = mca_base_framework_register(framework, opal_info_register_flags); if (OPAL_SUCCESS != rc && OPAL_ERR_BAD_PARAM != rc) { return rc; } if (NULL !=...
false
false
false
false
false
0
Hash() { ASSERT(length_ >= 0); ASSERT(from_ + length_ <= string_->length()); StringHasher hasher(length_, string_->GetHeap()->HashSeed()); // Very long strings have a trivial hash that doesn't inspect the // string contents. if (hasher.has_trivial_hash()) { hash_field_ = hasher.GetHashFie...
false
false
false
false
false
0
zremrangebyrankCommand(redisClient *c) { long start; long end; int llen; long deleted; robj *zsetobj; zset *zs; if ((getLongFromObjectOrReply(c, c->argv[2], &start, NULL) != REDIS_OK) || (getLongFromObjectOrReply(c, c->argv[3], &end, NULL) != REDIS_OK)) return; if ((zsetobj = l...
false
false
false
false
false
0
mkfount(int mazeflag, struct mkroom *croom) { coord m; int tryct = 0; do { if (++tryct > 200) { return; } if (mazeflag) { mazexy(&m); } else { if (!somexy(croom, &m)) { return; ...
false
false
false
false
false
0
vfp_gzip_bytes(struct sess *sp, struct http_conn *htc, ssize_t bytes) { struct vgz *vg; ssize_t l, w; int i = -100; uint8_t ibuf[params->gzip_stack_buffer]; size_t dl; const void *dp; vg = sp->wrk->vgz_rx; CHECK_OBJ_NOTNULL(vg, VGZ_MAGIC); AZ(vg->vz.avail_in); while (bytes > 0 || !VGZ_IbufEmpty(vg)) { if (...
false
false
false
true
false
1
setOptSSL ( bool ssl ) { kDebug() << "Setting SSL to " << ssl; setUseSSL ( ssl ); }
false
false
false
false
false
0
_copyCreateTrigStmt(CreateTrigStmt *from) { CreateTrigStmt *newnode = makeNode(CreateTrigStmt); COPY_STRING_FIELD(trigname); COPY_NODE_FIELD(relation); COPY_NODE_FIELD(funcname); COPY_NODE_FIELD(args); COPY_SCALAR_FIELD(before); COPY_SCALAR_FIELD(row); strcpy(newnode->actions, from->actions); /* in-line string...
false
false
false
false
false
0
AF80_Initialise(int *argc, char *argv[]) { int i, j; int help_only = FALSE; for (i = j = 1; i < *argc; i++) { if (strcmp(argv[i], "-af80") == 0) { AF80_enabled = TRUE; } else { if (strcmp(argv[i], "-help") == 0) { help_only = TRUE; Log_print("\t-af80 Emulate the Austin Franklin 80 co...
false
false
false
false
false
0
bubble_sort (uint8_t* sort_data, size_t count) { size_t i, j, limit, k; double sum = 0.0; limit = count / 3; for (i = 0; i < limit; ++i) { uint16_t ti = 0; uint16_t tj = 0; for (j = (i + 1); j < count; ++j) { ti = get_double ((sort_data + i*2)); tj = get_double ((sort_d...
false
false
false
false
false
0
RenameRelation(RenameStmt *stmt) { Oid relid; ObjectAddress address; /* * Grab an exclusive lock on the target table, index, sequence, view, * materialized view, or foreign table, which we will NOT release until * end of transaction. * * Lock level used here should match RenameRelationInternal, to avoid...
false
false
false
false
false
0
vpfe_ccdc_get_frame_format(struct vpfe_ccdc *ccdc) { if (ccdc->ccdc_cfg.if_type == VPFE_RAW_BAYER) return ccdc->ccdc_cfg.bayer.frm_fmt; return ccdc->ccdc_cfg.ycbcr.frm_fmt; }
false
false
false
false
false
0
Curl_getoff_all_pipelines(struct SessionHandle *data, struct connectdata *conn) { bool recv_head = (conn->readchannel_inuse && (gethandleathead(conn->recv_pipe) == data)) ? TRUE : FALSE; bool send_head = (conn->writechannel_inuse && (gethandleathead(conn->send_pipe) == data))...
false
false
false
false
false
0
Get_Integer (Object x) { double d; int expo; switch (TYPE(x)) { case T_Fixnum: return FIXNUM(x); case T_Bignum: return Bignum_To_Integer (x); case T_Flonum: d = FLONUM(x)->val; if (d != floor (d)) Wrong_Type (x, T_Fixnum); (void)frexp (d, &exp...
false
false
false
false
false
0
eb_read_binary(book, binary_max_length, binary, binary_length) EB_Book *book; size_t binary_max_length; char *binary; ssize_t *binary_length; { EB_Error_Code error_code; eb_lock(&book->lock); LOG(("in: eb_read_binary(book=%d, binary_max_length=%ld)", (int)book->code, (long)binary_max_leng...
false
false
false
false
false
0
tabmanager_foreach_editor (GFunc func, gpointer user_data) { GList* tabs = g_tabs; while (tabs) { GList *next = tabs->next; (*func) (GU_TAB_CONTEXT (tabs->data)->editor, user_data); tabs = next; } }
false
false
false
false
false
0
RemoveSource(uint32 source, const CKnownFile* owner) { // A NULL owner means remove it no matter what. wxCHECK_RET(source, wxT("NULL source in CGenericClientListCtrl::RemoveSource")); // Retrieve all entries matching the source ListIteratorPair rangeIt = m_ListItems.equal_range(source); int removedItems = 0; ...
false
false
false
false
false
0
bthci_CmdAMPTestEnd(struct rtw_adapter *padapter, struct packet_irp_hcicmd_data *pHciCmd) { enum hci_status status = HCI_STATUS_SUCCESS; struct bt_30info *pBTInfo = GET_BT_INFO(padapter); struct bt_hci_info *pBtHciInfo = &pBTInfo->BtHciInfo; if (!pBtHciInfo->bInTestMode) { RTPRINT(FIOCTL, (IOCTL_BT_EVENT|I...
false
false
false
false
false
0
isdn_tty_edit_at(const char *p, int count, modem_info *info) { atemu *m = &info->emu; int total = 0; u_char c; char eb[2]; int cnt; for (cnt = count; cnt > 0; p++, cnt--) { c = *p; total++; if (c == m->mdmreg[REG_CR] || c == m->mdmreg[REG_LF]) { /* Separator (CR or LF) */ m->mdmcmd[m->mdmcmdl] = 0; ...
false
false
false
false
false
0
atmel_spi_next_xfer_pio(struct spi_master *master, struct spi_transfer *xfer) { struct atmel_spi *as = spi_master_get_devdata(master); if (as->fifo_size) atmel_spi_next_xfer_fifo(master, xfer); else atmel_spi_next_xfer_single(master, xfer); }
false
false
false
false
false
0
addForce(const btVector3& force,int node) { Node& n=m_nodes[node]; if(n.m_im>0) { n.m_f += force; } }
false
false
false
false
false
0
move(void) { char *src2; src = ne_concat(i_path, "move", NULL); src2 = ne_concat(i_path, "move2", NULL); dest = ne_concat(i_path, "movedest", NULL); coll = ne_concat(i_path, "movecoll/", NULL); ncoll = ne_concat(i_path, "movecoll", NULL); /* Upload it twice. */ CALL(upload_foo("move"))...
false
false
false
false
false
0
df_bb_refs_collect (struct df_collection_rec *collection_rec, basic_block bb) { collection_rec->def_vec.truncate (0); collection_rec->use_vec.truncate (0); collection_rec->eq_use_vec.truncate (0); collection_rec->mw_vec.truncate (0); if (bb->index == ENTRY_BLOCK) { df_entry_block_defs_collect (coll...
false
false
false
false
false
0
clear() { _visionManagement = VISION_ONCE; if(_calendar) { delete _calendar; _calendar = NULL; } }
false
false
false
false
false
0
bfa_cee_isr(void *cbarg, struct bfi_mbmsg *m) { union bfi_cee_i2h_msg_u *msg; struct bfi_cee_get_rsp *get_rsp; struct bfa_cee *cee = (struct bfa_cee *) cbarg; msg = (union bfi_cee_i2h_msg_u *) m; get_rsp = (struct bfi_cee_get_rsp *) m; switch (msg->mh.msg_id) { case BFI_CEE_I2H_GET_CFG_RSP: bfa_cee_get_attr_is...
false
false
false
false
false
0
doExcept (EndPoint endp) { int optval; socklen_t size ; int fd = endPointFd (endp) ; if (getsockopt (fd, SOL_SOCKET, SO_ERROR, (char *) &optval, &size) != 0) syswarn ("ME exception: getsockopt (%d)", fd) ; else if (optval != 0) { errno = optval ; syswarn ("ME exception: ...
false
false
false
false
false
0
ac97_volume_get(struct snd_kcontrol *ctl, struct snd_ctl_elem_value *value) { struct oxygen *chip = ctl->private_data; unsigned int codec = (ctl->private_value >> 24) & 1; int stereo = (ctl->private_value >> 16) & 1; unsigned int index = ctl->private_value & 0xff; u16 reg; mutex_lock(&chip->mutex); reg = ...
false
false
false
false
false
0
reorderqueue_pop(IndexScanState *node) { HeapTuple result; ReorderTuple *topmost; int i; topmost = (ReorderTuple *) pairingheap_remove_first(node->iss_ReorderQueue); result = topmost->htup; for (i = 0; i < node->iss_NumOrderByKeys; i++) { if (!node->iss_OrderByTypByVals[i] && !topmost->orderbynulls[i]) ...
false
false
false
false
false
0
modperl_hook_post_config_last(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s) { /* in the threaded environment, no server_rec/process_rec * modifications should be done beyond this point */ #ifdef USE_ITHREADS MP_dSCFG(s); dTHXa(scfg->mip-...
false
false
false
false
false
0
utl_GetRHeaderString (str, separ) char *str ; char separ; { char *head = NULL; int found = 0 ; int len ; int i ; if (str != NULL) { len = strlen (str); for (i=len-1 ; i>0 ; i--) { if (str [i] == separ) { found = 1; break; } }...
false
false
false
false
false
0
hwloc_strdup_mntpath(const char *escapedpath, size_t length) { char *path = malloc(length+1); const char *src = escapedpath, *tmp; char *dst = path; while ((tmp = strchr(src, '\\')) != NULL) { strncpy(dst, src, tmp-src); dst += tmp-src; if (!strncmp(tmp+1, "040", 3)) *dst = ' '; else if (...
false
false
false
false
false
0
snippets_provider_load (SnippetsProvider *snippets_provider, IAnjutaEditorAssist *editor_assist) { SnippetsProviderPrivate *priv = NULL; /* Assertions */ g_return_if_fail (ANJUTA_IS_SNIPPETS_PROVIDER (snippets_provider)); g_return_if_fail (IANJUTA_IS_EDITOR_ASSIST (editor_assist)); priv = ...
false
false
false
false
false
0
Deal_With_Telnet( SOCKET Fd, netAddress &TelnetAddress ) { int res; int time_out = 1; netSocket NewTelnet; NewTelnet.setHandle (Fd); netSocket* RecvSockets[2]; netSocket* SendSockets[2]; if (VERB9) { string s = TelnetAddress.getHost(); SPRTF("Acceped telnet connection from...
false
false
false
false
false
0
regmap_register_patch(struct regmap *map, const struct reg_sequence *regs, int num_regs) { struct reg_sequence *p; int ret; bool bypass; if (WARN_ONCE(num_regs <= 0, "invalid registers number (%d)\n", num_regs)) return 0; p = krealloc(map->patch, sizeof(struct reg_sequence) * (map->patch_regs ...
false
false
false
false
false
0
execute_cset(snd_ctl_t *ctl, const char *cset) { const char *pos; int err; snd_ctl_elem_id_t *id; snd_ctl_elem_value_t *value; snd_ctl_elem_info_t *info; snd_ctl_elem_id_malloc(&id); snd_ctl_elem_value_malloc(&value); snd_ctl_elem_info_malloc(&info); err = __snd_ctl_ascii_elem_id_parse(id, cset, &pos); if (...
false
false
false
false
false
0
getAsString(unsigned Index, bool InAttrGrp) const { AttributeSetNode *ASN = getAttributes(Index); return ASN ? ASN->getAsString(InAttrGrp) : std::string(""); }
false
false
false
false
false
0
translate_rx_signal_stuff(struct ieee80211_hw *hw, struct sk_buff *skb, struct rtl_stats *pstatus, u8 *pdesc, struct rx_fwinfo_8723e *p_drvinfo) { struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); struct ieee80211_hdr *hdr; u8 *tmp_buf; ...
false
false
false
false
false
0
SyfRemoveStable( Expr ) ablexpr *Expr; { if ( Expr == (ablexpr *)0 ) return; if ( ! ABL_ATOM( Expr ) ) { if ( ABL_OPER( Expr ) == ABL_STABLE ) { freechain( ABL_CADR( Expr ) ); freechain( ABL_CDR( Expr ) ); freechain( ABL_CAR( Expr ) ); ABL_CDR( Expr ) = (ablexpr *)0; ABL...
false
false
false
false
false
0
put_ldops(struct tty_ldisc_ops *ldops) { unsigned long flags; raw_spin_lock_irqsave(&tty_ldiscs_lock, flags); ldops->refcount--; module_put(ldops->owner); raw_spin_unlock_irqrestore(&tty_ldiscs_lock, flags); }
false
false
false
false
false
0
gfs_pio_open(const char *url, int flags, GFS_File *gfp) { gfarm_error_t e; struct gfm_connection *gfm_server; int fd, type; gfarm_timerval_t t1, t2; GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); gfs_profile(gfarm_gettimerval(&t1)); if ((e = gfm_open_fd(url, flags, &gfm_server, &fd, &type)) == GFARM_ERR_NO_ERR...
false
false
false
false
false
0
GetScreenshot(JLScreenInfo &info, Data &image) { // start fresh image.Zap(); Data cmd(-1, 8), data(-1, 8), response; JLPacket packet(cmd, data, response); // Send the screenshot command : // 00000000: 04 00 08 00 87 00 04 00 packet.GetScreenshot(); m_socket->Packet(packet); if( packet.Command() != SB_CO...
false
false
false
false
false
0
gwy_func_use_add(GwyFunctionUse *functions, const gchar *name) { GArray *funcs; GQuark quark; guint i, found; /* Find function info, using linear search (but most used funcs are * near the head). */ funcs = functions->funcs; quark = g_quark_from_string(name); found = (...
false
false
false
false
false
0
empty_inline_dir(struct inode *dir, int *has_inline_data) { int err, inline_size; struct ext4_iloc iloc; void *inline_pos; unsigned int offset; struct ext4_dir_entry_2 *de; int ret = 1; err = ext4_get_inode_loc(dir, &iloc); if (err) { EXT4_ERROR_INODE(dir, "error %d getting inode %lu block", err, dir->i...
false
false
false
false
false
0
DI_timer(AW_root *aw_root, AW_CL cl_gbmain, AW_CL cd2) { GBDATA *gb_main = reinterpret_cast<GBDATA*>(cl_gbmain); { GB_transaction ta(gb_main); GB_tell_server_dont_wait(gb_main); // trigger database callbacks } aw_root->add_timed_callback(500, DI_timer, cl_gbmain, cd2); }
false
false
false
false
false
0
tumblep_drawsprites(struct mame_bitmap *bitmap,const struct rectangle *cliprect) { int offs; for (offs = 0;offs < 0x400;offs += 4) { int x,y,sprite,colour,multi,fx,fy,inc,flash,mult; sprite = spriteram16[offs+1] & 0x3fff; if (!sprite) continue; y = spriteram16[offs]; flash=y&0x1000; if (f...
false
false
false
false
false
0
mr_nick(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) { struct Client *target_p; char nick[NICKLEN]; char *s; if (strlen(client_p->id) == 3) { exit_client(client_p, client_p, client_p, "Mixing client and server protocol"); return 0; } if(parc < 2 || EmptyString(parv[1]) ||...
false
false
false
false
false
0
quantize( int d, /* Raw difference signal sample */ int y, /* Step size multiplier */ int *table, /* quantization table */ int size) /* table size of integers */ { int dqm; /* Magnitude of 'd' */ int exp; /* Integer part of base 2 log of 'd' */ int mant; /* Fractional part of base 2 log */ int dl; /* L...
false
false
false
false
false
0
_eglCompareModes(const void *a, const void *b) { const _EGLMode *aMode = *((const _EGLMode **) a); const _EGLMode *bMode = *((const _EGLMode **) b); EGLint i; for (i = 0; SortInfo[i].Attrib; i++) { const EGLint aVal = getModeAttrib(aMode, SortInfo[i].Attrib); const EGLint bVal = getModeAttrib(b...
false
false
false
false
false
0
cfg_free_multiple(conf_mult_obj * data) { conf_mult_obj *list = data; if (list == NULL) return; /* go to first */ while (list->prev != NULL) { list = list->prev; } while (list != NULL) { if (list->value) cfg_free_string(list->value); if (list->...
false
false
false
false
false
0
IdentityMatrix(TMatrix X, int m) { int i; PRECISION *pX; if (!X) { if (!(X=CreateMatrix(m,m))) return (TMatrix)NULL; } else if ((m != RowM(X)) || (m != ColM(X))) { dw_Error(SIZE_ERR); return (TMatrix)NULL; } for (pX=pElementM(X), i=m*m-1; i >= 0; i--) pX[i]...
false
false
false
false
false
0
getPageOffset(int page) { if ((page < 1) || (page > nPages)) return 0; if (page-1 > pageFirst) return pageOffset[page-1]; else if (page-1 < pageFirst) return pageOffset[page]; else return pageOffset[0]; }
false
false
false
false
false
0
keep_on_fetching_validx(struct gspca_dev *gspca_dev, struct validx *tbl, int len, int n) { while (++n < len) { if (tbl[n].idx != 0xffff) ctrl_out(gspca_dev, 0x40, 1, tbl[n].val, tbl[n].idx, 0, NULL); else if (tbl[n].val == 0xffff) break; else msleep(tbl[n].val); } return n; }
false
false
false
false
false
0
FlushQueuedStanzas() { for (size_t i = 0; i < pvecQueuedStanzas_->size(); i += 1) { pctx_->InternalSendStanza((*pvecQueuedStanzas_)[i]); delete (*pvecQueuedStanzas_)[i]; } pvecQueuedStanzas_->clear(); }
false
false
false
false
false
0
oscar_chatnav_connect(AyConnection *fd, int error, void *data) { eb_local_account *account = (eb_local_account *)data; struct eb_aim_local_account_data *alad = (struct eb_aim_local_account_data *)account-> protocol_local_account_data; if (!fd) { WARNING(("unable to create socket to chatnav server\n")) retu...
false
false
false
false
false
0
read_long_string (LexState *ls, SemInfo *seminfo, int sep) { save_and_next(ls); /* skip 2nd `[' */ if (currIsNewline(ls)) /* string starts with a newline? */ inclinenumber(ls); /* skip it */ for (;;) { switch (ls->current) { case EOZ: lexerror(ls, (seminfo) ? "unfinished long string" : ...
false
false
false
false
false
0
dumpSymbolTypeAndName(const PDBSymbol &Type, StringRef Name) { if (auto *ArrayType = dyn_cast<PDBSymbolTypeArray>(&Type)) { std::string IndexSpec; raw_string_ostream IndexStream(IndexSpec); std::unique_ptr<PDBSymbol> ElementType = ArrayType->getElementType(); ...
false
false
false
false
false
0
btusb_suspend(struct usb_interface *intf, pm_message_t message) { struct btusb_data *data = usb_get_intfdata(intf); BT_DBG("intf %p", intf); if (data->suspend_count++) return 0; spin_lock_irq(&data->txlock); if (!(PMSG_IS_AUTO(message) && data->tx_in_flight)) { set_bit(BTUSB_SUSPENDING, &data->flags); spi...
false
false
false
false
false
0
getIncludedLabels(const QVariant &SID) { if (!database().isOpen()) { if (!database().open()) { LOG_ERROR(tkTr(Trans::Constants::UNABLE_TO_OPEN_DATABASE_1_ERROR_2).arg(Constants::DB_NAME).arg(database().lastError().text())); return QStringList(); } } QSqlQuery query(da...
false
false
false
false
false
0
wma_decode_superframe_frame(WMADecodeContext* s, int32_t* samples, /*output*/ const uint8_t *buf, /*input*/ int buf_size) { int pos, len; uint8_t *q; int done = 0; if ((s->use_bit_reservoir) && (s->current_f...
false
false
false
false
false
0
b64decode (char *in, char *out) { int len = strlen (in); unsigned int q; if (len % 4) return; while (*in) { q = b64idx (*in++); q = q << 6 | b64idx (*in++); q = q << 6 | b64idx (*in++); q = q << 6 | b64idx (*in++); *out++ = (q >> 16) & 0xff; *out++ = (q >> 8) & 0xff; *out++ = q & 0xff; } }
false
false
false
false
false
0
geany_vala_plugin_VERSION_CHECK (gint abi_version, gint api_required) { gint result = 0; gint _tmp0_; gint _tmp1_; gint _tmp2_; _tmp0_ = abi_version; _tmp1_ = GEANY_ABI_VERSION; if (_tmp0_ != _tmp1_) { result = -1; return result; } _tmp2_ = api_required; result = _tmp2_; return result; }
false
false
false
false
false
0