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
vbo_exec_End( void ) { GET_CURRENT_CONTEXT( ctx ); struct vbo_exec_context *exec = &vbo_context(ctx)->exec; if (!_mesa_inside_begin_end(ctx)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glEnd"); return; } ctx->Exec = ctx->OutsideBeginEnd; if (ctx->CurrentDispatch == ctx->BeginEnd) { ...
false
false
false
false
false
0
lamnet_findhosts(struct lamnode *lamnet, int nlamnet, int *badhost) { int i; char buffer[16]; if (badhost != NULL) *badhost = -1; /* Find INET addresses for each node */ for (i = 0; i < nlamnet; ++i) { /* Skip empty entries */ if (lamnet[i].lnd_nodeid == NOTNODEID) continue; ...
true
true
false
true
false
1
_mesa_ActiveTexture(GLenum texture) { const GLuint texUnit = texture - GL_TEXTURE0; GLuint k; GET_CURRENT_CONTEXT(ctx); /* See OpenGL spec for glActiveTexture: */ k = MAX2(ctx->Const.MaxCombinedTextureImageUnits, ctx->Const.MaxTextureCoordUnits); ASSERT(k <= Elements(ctx->Texture.Unit));...
false
false
false
false
false
0
initShowError() { cerr << ">> Option " << getObject()->getOptionPrefix() << getOption()->getName(); if (getOption()->getMaxNbArgs() != 1) { cerr << " argument '" << getName() << "'"; } }
false
false
false
false
false
0
register_handler (int signum, ACE_Event_Handler *new_sh, ACE_Sig_Action *new_disp, ACE_Event_Handler **, ACE_Sig_Action *old_disp) { ACE_TRACE ("ACE_Sig_Handlers::register_ha...
false
false
false
false
false
0
outputv(const char *sz, va_list val) { char *szFormatted; if (cOutputDisabled || !foutput_on) return; szFormatted = g_strdup_vprintf(sz, val); output(szFormatted); g_free(szFormatted); }
false
false
false
false
false
0
startsWith(DOMStringImpl* str, CaseSensitivity cs) const { if (l < str->l) return false; const QChar *a = s; const QChar *b = str->s; int i = str->l; if (cs == CaseSensitive) { while (i--) { if (*a != *b) return false; a++, b++; } } else { while (i...
false
false
false
false
false
0
octeon_free_device_mem(struct octeon_device *oct) { u32 i; for (i = 0; i < MAX_OCTEON_OUTPUT_QUEUES; i++) { /* could check mask as well */ vfree(oct->droq[i]); } for (i = 0; i < MAX_OCTEON_INSTR_QUEUES; i++) { /* could check mask as well */ vfree(oct->instr_queue[i]); } i = oct->octeon_id; vfree(oct)...
false
false
false
false
false
0
region_is_trivial(struct isl_tab *tab, int pos, int len) { int i; if (len == 0) return 0; for (i = 0; i < len; i += 2) { int neg_row; int pos_row; neg_row = tab->var[pos + i].is_row ? tab->var[pos + i].index : -1; pos_row = tab->var[pos + i + 1].is_row ? tab->var[pos + i + 1].index : -1; if ...
false
false
false
false
false
0
ProcessAttValue( const char *pszValType, const char *pszRawValue, char **ppszAttName, char **ppszAttValue, char **ppszCodeDesc ) { /* ---------------------------------------...
false
false
false
false
false
0
initCurrSymbolsEquiv() { U_ASSERT(gCurrSymbolsEquiv == NULL); UErrorCode status = U_ZERO_ERROR; ucln_i18n_registerCleanup(UCLN_I18N_CURRENCY, currency_cleanup); icu::Hashtable *temp = new icu::Hashtable(status); if (temp == NULL) { return; } if (U_FAILURE(status)) { delete te...
false
false
false
false
false
0
init_root(struct augeas *aug, const char *root0) { if (root0 == NULL) root0 = getenv(AUGEAS_ROOT_ENV); if (root0 == NULL || root0[0] == '\0') root0 = "/"; aug->root = strdup(root0); if (aug->root == NULL) return -1; if (aug->root[strlen(aug->root)-1] != SEP) { if (R...
false
true
false
false
true
1
w1_unregister_family(struct w1_family *fent) { struct list_head *ent, *n; struct w1_family *f; spin_lock(&w1_flock); list_for_each_safe(ent, n, &w1_families) { f = list_entry(ent, struct w1_family, family_entry); if (f->fid == fent->fid) { list_del(&fent->family_entry); break; } } spin_unlock(&w1_fl...
false
false
false
false
false
0
mbfl_html_numeric_entity( mbfl_string *string, mbfl_string *result, int *convmap, int mapsize, int type) { struct collector_htmlnumericentity_data pc; mbfl_memory_device device; mbfl_convert_filter *encoder; int n; unsigned char *p; if (string == NULL || result == NULL) { return NULL; } m...
false
false
false
false
false
0
get_work(struct thr_info *thr, const int thr_id) { struct cgpu_info *cgpu = thr->cgpu; struct work *work = NULL; time_t diff_t; thread_reportout(thr); applog(LOG_DEBUG, "Popping work from get queue to get work"); diff_t = time(NULL); while (!work) { work = hash_pop(true); if (stale_work(work, false)) { d...
false
false
false
false
false
0
gs_imager_state_pre_assign(gs_imager_state *pto, const gs_imager_state *pfrom) { const char *const cname = "gs_imager_state_pre_assign"; #define RCCOPY(element)\ rc_pre_assign(pto->element, pfrom->element, cname) RCCOPY(cie_joint_caches); RCCOPY(cie_joint_caches_alt); RCCOPY(set_transfer.blue); ...
false
false
false
false
false
0
allocated_session_in_use(job_desc_msg_t *new_alloc) { ListIterator job_iter; struct job_record *job_ptr; /* Locks: Read job */ slurmctld_lock_t job_read_lock = { NO_LOCK, READ_LOCK, NO_LOCK, NO_LOCK }; if ((new_alloc->script != NULL) || (new_alloc->alloc_node == NULL)) return false; lock_slurmctld(job_read_...
false
false
false
false
false
0
tcl_getdccidle STDVAR { int x, idx; char s[21]; BADARGS(2, 2, " idx"); idx = findidx(atoi(argv[1])); if (idx < 0) { Tcl_AppendResult(irp, "invalid idx", NULL); return TCL_ERROR; } x = (now - dcc[idx].timeval); egg_snprintf(s, sizeof s, "%d", x); Tcl_AppendElement(irp, s); return TCL_OK; }
false
false
false
false
false
0
tree_add_auth_node(STACK_OF(X509_POLICY_NODE) **pnodes, X509_POLICY_NODE *pcy) { if (!*pnodes) { *pnodes = policy_node_cmp_new(); if (!*pnodes) return 0; } else if (sk_X509_POLICY_NODE_find(*pnodes, pcy) != -1) return 1; if (!sk_X509_POLICY_NODE_push(*pnodes, pcy)) return 0; return 1; }
false
false
false
false
false
0
putResource ( const Resources& res, bool queryonly, int scope, int player) { Resources result; for ( int i = 0; i < resourceNum; i++ ) result.resource(i) = putResource ( res.resource(i), i , queryonly, scope, player ); return result; }
false
false
false
false
false
0
cdns_uart_config_port(struct uart_port *port, int flags) { if (flags & UART_CONFIG_TYPE && cdns_uart_request_port(port) == 0) port->type = PORT_XUARTPS; }
false
false
false
false
false
0
alloc(unsigned int size) { void *buf = malloc(size); if(!buf) throw(E_NOMEM, NULL); resource(buf, free); return buf; }
false
false
false
false
false
0
mono_test_marshal_stringbuilder_ref (char **s) { const char m[] = "This is my message. Isn't it nice?"; char *str; if (strcmp (*s, "ABC")) return 1; str = marshal_alloc (strlen (m) + 1); memcpy (str, m, strlen (m) + 1); *s = str; return 0; }
false
false
false
false
false
0
H5O_layout_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * stream, int indent, int fwidth) { const H5O_layout_t *mesg = (const H5O_layout_t *) _mesg; unsigned u; FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_layout_debug) /* check args */ HDassert(f); HDa...
false
false
false
false
false
0
sendmailext(std::string aliasname, std::string cmd) { static int first_time=1; if (tmpdir == 0) return; std::ostringstream aliasnameEscaped; std::string::iterator b=aliasname.begin(), e=aliasname.end(); while (b != e) { if (strchr("/.-+\"\\", *b)) { aliasnameEscaped << '+' << std::hex << std::setw(2...
false
false
false
false
false
0
Clone(FCDAsset* clone, bool cloneAllContributors) const { if (clone == NULL) clone = new FCDAsset(const_cast<FCDocument*>(GetDocument())); // Clone all the asset-level parameters. clone->creationDateTime = creationDateTime; clone->modifiedDateTime = FUDateTime::GetNow(); clone->keywords = keywords; clone...
false
false
false
false
false
0
output_type( FILE *fp, int type ) { fprintf( fp, "PT " ); if ( type==TYPE_ARTICLE ) fprintf( fp, "Journal" ); else if ( type==TYPE_INBOOK ) fprintf( fp, "Chapter" ); else if ( type==TYPE_BOOK ) fprintf( fp, "Book" ); else fprintf( fp, "Unknown" ); fprintf( fp, "\n" ); }
false
false
false
false
false
0
getUint16(Uint16 &wordVal, const unsigned long pos) { Uint16 *uintValues = NULL; errorFlag = getUint16Array(uintValues); /* check data before returning */ if (errorFlag.good()) { if (uintValues == NULL) errorFlag = EC_IllegalCall; ...
false
false
false
false
false
0
begin(QPaintDevice* device) { //previous operation not ended? if (m_proxy) { return false; } //allow only proxy devices QPaintDeviceColorProxy* proxyDevice = dynamic_cast<QPaintDeviceColorProxy*>(device); if (!proxyDevice) { return false; } //check proxied device QPaintDevice* proxiedDevice = proxyDevice...
false
false
false
false
false
0
ResizeControls(unsigned nInputs, const std::list<std::string> & names) { ClearControls(); unsigned i=0; for (std::list<std::string>::const_iterator it = names.begin(); it != names.end(); it++) { std::string type; type=_config.GetTypesMask()[i]; mInControls.push_back(createControl(type,*it)); i++; ...
false
false
false
false
false
0
Execute() { int gameNum = SelectGame(); if ( gameNum<0 || gameNum>=byoGameLauncher::GetGamesCount() ) return 0; byoGameLauncher::PlayGame(gameNum); return 0; }
false
false
false
false
false
0
xml_read_mono_neumes (xmlNodePtr current_node, xmlDocPtr doc, gregorio_syllable * syllable, char alterations[][13], int clefs[]) { if (xmlStrcmp (current_node->name, (const xmlChar *) "neume")) { gregorio_message (_ ("unknown markup, expecting neume"), "xml_read_syllable", WARNING, 0); ...
false
false
false
false
false
0
get_double_config_value(struct collection_item *item, int strict, double def, int *error) { const char *str; char *endptr; double val = 0; TRACE_FLOW_STRING("get_double_config_value", "Entry"); /* Do we have the item ? */ if ((item == NULL) || (col_get_it...
false
false
false
false
false
0
steal_suitable_fallback(struct zone *zone, struct page *page, int start_type) { unsigned int current_order = page_order(page); int pages; /* Take ownership for orders >= pageblock_order */ if (current_order >= pageblock_order) { change_pageblock_range(page, current_order, start_type); return; } pag...
false
false
false
false
false
0
postLogMsg(EventsBuf *eb, EventTypeNum type, char *msg, va_list ap) { char buf[BUF]; nat size; size = vsnprintf(buf,BUF,msg,ap); if (size > BUF) { buf[BUF-1] = '\0'; size = BUF; } if (!hasRoomForVariableEvent(eb, size)) { // Flush event buffer to make room for new event...
true
true
false
false
true
1
gftp_config_file_write_hidetext (gftp_config_vars * cv, char *buf, size_t buflen, int to_config_file) { char *outstr; if (cv->value != NULL) { outstr = cv->value; if (*outstr != '\0') { if (to_config_file) g_snprintf (buf, buflen, "%s",...
false
false
false
false
false
0
active_insn_between (rtx head, rtx tail) { while (tail) { if (active_insn_p (tail)) return true; if (tail == head) return false; tail = PREV_INSN (tail); } return false; }
false
false
false
false
false
0
cpyr1(int n, R *in, int is, R *out, int os, R scale) { int i; for (i = 0; i < n; ++i) out[i * os] = in[i * is] * scale; }
false
false
false
false
false
0
ServiceFromLegacyString(std::string type_flavour_url) { ConfigEndpoint service; size_t pos = type_flavour_url.find(":"); if (pos != type_flavour_url.npos) { std::string type = type_flavour_url.substr(0, pos); std::string flavour_url = type_flavour_url.substr(pos + 1); if (type == "index") ...
false
false
false
false
false
0
pageIsEmpty(BFDimage *image, unsigned int addr, unsigned int size, BFDmemoryType memtype) { bool emptyPage = true; // Check if page is used for (unsigned int idx=addr; idx<addr+size; idx++) { if (idx >= image->last_address) break; // 1. If this addre...
false
false
false
false
false
0
VasySynopsysTreatVex( VexExpr ) vexexpr *VexExpr; { rtldecl_list *RtlDeclar; char *AtomValue; chain_list *ScanChain; vexexpr *Operand; int Type; long Oper; if ( VexExpr != (vexexpr *)0 ) { if ( IsVexNodeAtom( VexExpr ) ) { if ( IsVexAtomLiteral( VexExp...
false
false
false
false
false
0
gda_vprovider_data_model_open_connection (GdaServerProvider *provider, GdaConnection *cnc, GdaQuarkList *params, GdaQuarkList *auth, G_GNUC_UNUSED guint *task_id, GdaServerProviderAsyncCallback async_cb, G_GNUC_UNUSED gpointer cb_data) { GdaQuarkList *m_params; g_return_val_if_fail (GDA_IS_VPROVIDER_DA...
false
false
false
false
false
0
ReadBondBlock(istream& ifs,OBMol& mol, OBConversion* pConv) { for(;;) { if(!ReadV3000Line(ifs,vs)) return false; if(vs[2]=="END") break; unsigned flag=0; int order = ReadUIntField(vs[3].c_str()); if(order==4) order=5; int obstart = indexmap[ReadUIntField(vs...
false
false
false
false
false
0
add_bond (const LLINT x1, const LLINT y1, const LLINT x2, const LLINT y2, const int type, struct Bond **list, const int options) { struct Bond *current, *new; current = *list; new = current; if (current != NULL) do { if ((IS_SMALL (current->x1 - x1) && IS_SMALL (current->x2 - x2) && IS_S...
false
false
false
false
false
0
search_spec_child_rek( ED4_level level ) //recursive search for level { return spec->level&level ? this : (ED4_base*)NULL; }
false
false
false
false
false
0
pptp_err_code_print(const u_int8_t *err_code) { printf(" ERR_CODE(%u", *err_code); if (vflag) { switch (*err_code) { case 0: printf(":None"); break; case 1: printf(":Not-Connected"); break; case 2: printf(":Bad-Format"); break; case 3: printf(":Bad-Valude"); break; case 4: print...
false
false
false
false
false
0
gc_clearweak(GCobj *o) { while (o) { GCtab *t = gco2tab(o); lua_assert((t->marked & LJ_GC_WEAK)); if ((t->marked & LJ_GC_WEAKVAL)) { MSize i, asize = t->asize; for (i = 0; i < asize; i++) { /* Clear array slot when value is about to be collected. */ TValue *tv = arrayslot(t, i); if (gc_mayc...
false
false
false
false
false
0
Useable(const Phrase &phrase) const { if (phrase.GetSize()==0) return false; // whether phrase contains all factors in this LM const Word &word = phrase.GetWord(0); for (size_t currFactor = 0 ; currFactor < MAX_NUM_FACTORS ; ++currFactor) { if (m_factorTypes[currFactor] && word[currFactor] == NULL) ...
false
false
false
false
false
0
AsnOidSize(AsnOid *oid) { int n, size; for(n = 1, size = 2; n < oid->octetLen; n++) if(!(oid->octs[n] & 0x80)) size++; return size; }
false
false
false
false
false
0
gt_pch_nx_cgraph_edge (void *x_p) { struct cgraph_edge * x = (struct cgraph_edge *)x_p; struct cgraph_edge * xlimit = x; while (gt_pch_note_object (xlimit, xlimit, gt_pch_p_11cgraph_edge)) xlimit = ((*xlimit).next_caller); if (x != xlimit) for (;;) { struct cgraph_edge * const xprev = ((*x)...
false
false
false
true
false
1
webauth_token_encrypt(struct webauth_context *ctx, const void *input, size_t len, void **output, size_t *output_len, const struct webauth_keyring *ring) { const struct webauth_key *key; size_t elen, plen, i; int s; unsigned char *result, *p, *hmac; AES_KEY...
false
true
false
false
false
1
camlidl_abstract0_ap_abstract0_expand_with( value _v_man, value _v_a, value _v_v1, value _v_v2) { ap_manager_ptr man; /*in*/ ap_abstract0_ptr a; /*in*/ ap_dim_t v1; /*in*/ int v2; /*in*/ struct camlidl_ctx_struct _ctxs = { CAMLIDL_TRANSIENT, NULL }; camlidl_ctx _ctx = &_ctxs; camlidl_ml2c_manager_ap_m...
false
false
false
false
false
0
provider_info_free (gpointer data) { ProviderInfo *info = data; if (data == NULL) { return; } g_object_unref (info->completion_provider); g_queue_free_full (info->proposals, (GDestroyNotify)proposal_info_free); g_slice_free (ProviderInfo, data); }
false
false
false
false
false
0
fillbuf(int n) /* Shift bitbuf n bits left, read n bits */ { bitbuf <<= n; while (n > bitcount) { bitbuf |= subbitbuf << (n -= bitcount); if (compsize != 0) { compsize--; subbitbuf = *in_buf++; } else subbitbuf = 0; bitcount = CHAR_BIT; } bitbuf |= subbitbuf >> (bitcount -= n); }
false
false
false
false
false
0
ftdi_elan_exit(void) { struct usb_ftdi *ftdi; struct usb_ftdi *temp; usb_deregister(&ftdi_elan_driver); pr_info("ftdi_u132 driver deregistered\n"); list_for_each_entry_safe(ftdi, temp, &ftdi_static_list, ftdi_list) { ftdi_status_cancel_work(ftdi); ftdi_command_cancel_work(ftdi); ftdi_response_cancel_work(ftd...
false
false
false
false
false
0
gst_audio_base_sink_event (GstBaseSink * bsink, GstEvent * event) { GstAudioBaseSink *sink = GST_AUDIO_BASE_SINK (bsink); switch (GST_EVENT_TYPE (event)) { case GST_EVENT_FLUSH_START: if (sink->ringbuffer) gst_audio_ring_buffer_set_flushing (sink->ringbuffer, TRUE); break; case GST_EVEN...
false
false
false
false
false
0
my_output_message (j_common_ptr cinfo) { char buffer[JMSG_LENGTH_MAX]; (*cinfo->err->format_message) (cinfo, buffer); if (verbose_mode) printf(" (%s) ",buffer); global_error_counter++; }
false
false
false
false
false
0
submodule_is_config_only( checkout_data *data, const char *path) { git_submodule *sm = NULL; unsigned int sm_loc = 0; if (git_submodule_lookup(&sm, data->repo, path) < 0 || git_submodule_location(&sm_loc, sm) < 0 || sm_loc == GIT_SUBMODULE_STATUS_IN_CONFIG) return true; return false; }
false
false
false
false
false
0
on_buttonType_clicked() { FractalTypeDialog dialog( this, m_model ); if ( dialog.exec() == QDialog::Accepted ) m_model->setParameters( dialog.fractalType(), dialog.position() ); }
false
false
false
false
false
0
cps1_find_last_sprite(void) /* Find the offset of last sprite */ { int offset=0; /* Locate the end of table marker */ while (offset < cps1_obj_size/2) { int colour=cps1_buffered_obj[offset+3]; if (colour == 0xff00) { /* Marker found. This is the last sprite. */ cps1_las...
false
false
false
false
false
0
write_other(Picklerobject *self, const char *s, Py_ssize_t n) { PyObject *py_str = 0, *junk = 0; if (s == NULL) { if (!( self->buf_size )) return 0; py_str = PyString_FromStringAndSize(self->write_buf, self->buf_size); if (!py_str) ...
false
true
false
false
false
1
run(FILE *f) { // divide into columns int which_col, ncol; parse_columns(_main_attrs["column"], which_col, ncol); create_entries(); int per_col = ((_entries.size() - 1) / ncol) + 1; int first = (which_col - 1) * per_col; int last = which_col * per_col; if (which_col == ncol || last > _en...
false
false
false
false
false
0
is_gimple_reg_rhs_or_call (tree t) { return (get_gimple_rhs_class (TREE_CODE (t)) != GIMPLE_INVALID_RHS || TREE_CODE (t) == CALL_EXPR); }
false
false
false
false
false
0
performShlCombine(SDNode *N, DAGCombinerInfo &DCI) const { if (N->getValueType(0) != MVT::i64) return SDValue(); // i64 (shl x, 32) -> (build_pair 0, x) // Doing this with moves theoretically helps MI optimizations that understand // copies. 2 v_mov_b32_e32 ...
false
false
false
false
false
0
print_objects_symbol_counts(const Symbol_table* symtab, FILE* f, const Objects* objects) const { for (Objects::const_iterator p = objects->begin(); p != objects->end(); ++p) this->print_object_symbol_counts(symtab, f, *p); }
false
false
false
false
false
0
gnibbles_worm_reduce_tail (GnibblesWorm *worm, gint erasesize) { gint i; gfloat x,y; ClutterActor *tmp = NULL; ClutterActor *group = clutter_group_new (); GError *error = NULL; if (erasesize) { if (g_list_length (worm->list) <= erasesize) { gnibbles_worm_reset (worm); return; } for...
false
false
false
false
false
0
pdf_parse_bf_range_array(fz_context *ctx, pdf_cmap *cmap, fz_stream *file, pdf_lexbuf *buf, int lo, int hi) { int tok; int dst[256]; int i; while (1) { tok = pdf_lex_cmap(file, buf); if (tok == PDF_TOK_CLOSE_ARRAY) return; /* Note: does not handle [ /Name /Name ... ] */ else if (tok != PDF_TOK_STRING...
false
false
false
false
false
0
reorder (void) { List_Node *ptr = 0; for (ptr = head; ptr; ptr = ptr->next) ptr->occurrence = occurrence (ptr); // Switch to sorting by occurrence. hash_sort = 0; occurrence_sort = 1; for (ptr = head = merge_sort (head); ptr->next; ptr = ptr->next) { determined (ptr); if (already_det...
false
false
false
false
false
0
askremotedate(const char *host) { uint32_t nett; int fd; /* Add a timeout for dead or inaccessible servers */ alarm(10); signal(SIGALRM, socket_timeout); fd = create_and_connect_stream_or_die(host, bb_lookup_port("time", "tcp", 37)); if (safe_read(fd, (void *)&nett, 4) != 4) /* read time from server */ b...
false
false
false
false
false
0
do_server( struct server_ctx *ctx, int fd ) { struct sockaddr_storage peer_ss; socklen_t peerlen; struct sctp_sndrcvinfo info; int ret,flags; while( ! close_req ) { memset( &peer_ss, 0, sizeof( peer_ss )); memset( &info, 0, sizeof( peer_ss )); ...
false
false
false
false
false
0
init_crc32(void) { int rc1, rc2, rc; rc1 = crc32init_le(); rc2 = crc32init_be(); rc = rc1 || rc2; return rc; }
false
false
false
false
false
0
finalize_domain_objects (DomainFinalizationReq *req) { MonoDomain *domain = req->domain; #if HAVE_SGEN_GC #define NUM_FOBJECTS 64 MonoObject *to_finalize [NUM_FOBJECTS]; int count; #endif /* Process finalizers which are already in the queue */ mono_gc_invoke_finalizers (); #ifdef HAVE_BOEHM_GC while (g_hash_ta...
false
false
false
false
false
0
RCMatVecVec(void* A, double x[], int n, double *v){ rcmat*RC=(rcmat*)A; int i; double vv=0; const double *val=RC->val; for (i=0;i<n;i++){ vv+=val[i]*x[i];} *v=2*vv*x[RC->rc]; return 0; }
false
false
false
false
false
0
i40e_clear_pxe_mode(struct i40e_hw *hw) { u32 reg; if (i40e_check_asq_alive(hw)) i40e_aq_clear_pxe_mode(hw, NULL); /* Clear single descriptor fetch/write-back mode */ reg = rd32(hw, I40E_GLLAN_RCTL_0); if (hw->revision_id == 0) { /* As a work around clear PXE_MODE instead of setting it */ wr32(hw, I40E_GL...
false
false
false
false
false
0
save_config_vars(struct pine *ps, int allow_hard_to_config_remotely) { struct variable *vreal; SAVED_CONFIG_S *vsave, *v; vsave = (SAVED_CONFIG_S *)fs_get((V_LAST_VAR+1)*sizeof(SAVED_CONFIG_S)); memset((void *)vsave, 0, (V_LAST_VAR+1)*sizeof(SAVED_CONFIG_S)); v = vsave; for(vreal = ps->vars; vr...
false
false
false
false
false
0
ath10k_wmi_10_2_op_gen_peer_assoc(struct ath10k *ar, const struct wmi_peer_assoc_complete_arg *arg) { size_t len = sizeof(struct wmi_10_2_peer_assoc_complete_cmd); struct sk_buff *skb; int ret; ret = ath10k_wmi_peer_assoc_check_arg(arg); if (ret) return ERR_PTR(ret); skb = ath10k_wmi_alloc_skb(ar, len);...
false
false
false
false
false
0
gui_entry_get_cutbuffer(GUI_ENTRY_REC *entry) { char *buf; int i; g_return_val_if_fail(entry != NULL, NULL); if (entry->cutbuffer == NULL) return NULL; if (entry->utf8) buf = g_ucs4_to_utf8(entry->cutbuffer, -1, NULL, NULL, NULL); else { buf = g_malloc(entry->cutbuffer_len*6 + 1); ...
false
false
false
false
false
0
enum_model_real_unref_node (GtkTreeModel* base, GtkTreeIter* iter) { EnumModel * self; GtkTreeIter _tmp0_; SchemaValue* _tmp1_ = NULL; SchemaValue* _tmp2_; self = (EnumModel*) base; g_return_if_fail (iter != NULL); _tmp0_ = *iter; _tmp1_ = enum_model_get_enum_value (self, &_tmp0_); _tmp2_ = _tmp1_; g_object_u...
false
false
false
false
false
0
screw_wrap(x,y,wrap) REAL *x; /* original coordinates */ REAL *y; /* wrapped coordinates */ WRAPTYPE wrap; /* encoded symmetry group element */ { REAL angle,lift; if ( screw_stamp < reset_timestamp ) { if ((lift_var = lookup_global(LIFTNAME)) < 0) { lift_var = add_global(LIFTNAME); globals(l...
false
false
false
false
false
0
resize_chunks(struct r5conf *conf, int new_disks, int new_sectors) { unsigned long cpu; int err = 0; /* * Never shrink. And mddev_suspend() could deadlock if this is called * from raid5d. In that case, scribble_disks and scribble_sectors * should equal to new_disks and new_sectors */ if (conf->scribble_dis...
false
false
false
false
false
0
cd_plugin_config_enabled_sane_devices(CdPluginPrivate *priv) { const gchar *argv[] = {COLORD_SANE_BINARY, NULL}; GError *error = NULL; GPid colord_sane_pid; if (priv->scan_in_progress) return; g_spawn_async (NULL, (gchar **) argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD, NULL, ...
false
false
false
false
false
0
config_setting_get_string_elem(const config_setting_t *vector, int idx) { config_setting_t *element = config_setting_get_elem(vector, idx); if(! element) return(NULL); if(element->type != CONFIG_TYPE_STRING) return(NULL); return(element->value.sval); }
false
false
false
false
false
0
rtl_make_smps_action(struct ieee80211_hw *hw, enum ieee80211_smps_mode smps, u8 *da, u8 *bssid) { struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); struct sk_buff *skb; struct ieee80211_mgmt *action_frame; /* 27 = header + category + action + smps mode */ skb = dev_alloc_skb(27 + hw->extra_t...
false
false
false
false
false
0
LoadIcon(int id, const wxString &file) { wxStaticBitmap *pStatBmp = reinterpret_cast<wxStaticBitmap *>(FindWindow(id)); if (!pStatBmp) return; wxSize size = CThemeProvider::GetIconSize(iconSizeNormal); pStatBmp->SetInitialSize(size); pStatBmp->InvalidateBestSize(); pStatBmp->SetBitmap(CThemeProvider::GetBitmap...
false
false
false
false
false
0
MV_GetNextWAVBlock ( VoiceNode *voice ) { if ( voice->BlockLength <= 0 ) { if ( voice->LoopStart == NULL ) { voice->Playing = FALSE; return( NoMoreData ); } voice->BlockLength = voice->LoopSize; voice->NextBlock = voice->LoopStart; voi...
false
false
false
false
false
0
elements_op (GelCtx *ctx, GelETree * * a, gboolean *exception) { if (a[0]->type == GEL_NULL_NODE) return gel_makenum_ui (0); if G_UNLIKELY ( ! check_argument_matrix (a, 0, "elements")) return NULL; return gel_makenum_ui (gel_matrixw_width (a[0]->mat.matrix) * gel_matrixw_height (a[0]->mat.matrix)); }
false
false
false
false
false
0
replace_first_of(std::string &s, const std::string &p, const std::string &r) { size_t result = 1; // Locate the pattern. unsigned int index = 0; for(index=0; (index <= s.length() - p.length()) && result; index++) result = p.compare(s.substr(index, p.length())); // The pattern was not matched. if(res...
false
false
false
false
false
0
check_valid_entries(void) { rb_dlink_node *ptr, *xptr; conf_t *conf; confentry_t *entry; valid_block_t *vt; int ret = 0; RB_DLINK_FOREACH(ptr, conflist.head) { conf = ptr->data; vt = find_valid_block(conf->confname); if(vt == NULL) { conf_report_warning_nl("Invalid block: %s at %s:%d", conf->confname,...
false
false
false
false
false
0
closeAccessor(string inName){ if(gMutex){ gMutex->lock(); } CContent::iterator lFound=mContent.find(inName); cout << __FILE__ << ":" << __LINE__ << "PID:" << getpid() << "OpenCloseCounter[" << inName << "]" << (mContent[inName].mOpenCloseCounter) << endl; //this is ...
false
false
false
false
false
0
vidioc_try_fmt_vid_out_overlay(struct file *file, void *priv, struct v4l2_format *f) { struct vivid_dev *dev = video_drvdata(file); const struct v4l2_rect *compose = &dev->compose_out; struct v4l2_window *win = &f->fmt.win; int i, j; if (!dev->has_fb) return -EINVAL; win->w.left = clamp_t(int, win->w.left...
false
false
false
false
false
0
proxy_write(int fd, unsigned char *buf, size_t len) { size_t count; for (count = 0; count < len; ) { int i = write(fd, buf + count, len - count); if (i < 0) return -errno; count += i; } return 0; }
false
false
false
false
false
0
acl_form_query(char *body, char *err_msg) { PRECOND(acl_ok); char temp[1024],err[1024]; sprintf(temp,XML_DECL "<propfind xmlns='DAV:'><prop>" "<%s xmlns='DAV:'/></prop></propfind>",body); sprintf(err,"ACL - Retrieving %s element. %s",body,err_msg); return report_returns_wellformed(err,temp,"PROPFIND"); ...
true
true
false
false
true
1
huawei_read_quality(const char *cmd) { char *buf; buf = huawei_send_receive(cmd); if (strncmp(buf, "+CSQ: ", 6) == 0) { /* Returns relative signal strength (RSSI) and ber (not supported by modems). * * +CSQ: 14,99 * rssi,ber * * 0 <= -113 dBm * 1 -111 dBm * 2 to 30 -109 dBm to -53 d...
false
false
false
false
false
0
stopDecompress() { #ifndef OPENEXIF_NO_IJG if (setjmp(myErrorMgr.setjmp_buffer)) { /* If we get here, the JPEG code has signaled an error. * We need to clean up the JPEG object and return. */ openexif_jpeg_abort_decompress(gIJGDecompInfo); return myErrorMgr.jpegStatus; ...
false
false
false
false
false
0
monitor_dominance(char *str, u_long32 mask) { switch (mask & DOMINANT_LAYER_MASK) { case DOMINANT_LAYER_GLOBAL: *str++ = 'g'; break; case DOMINANT_LAYER_HOST: *str++ = 'h'; break; case DOMINANT_LAYER_QUEUE: *str++ = 'q'; break; default: *str++ = '?'; ...
false
false
false
false
false
0
GossipSelect_npc_innkeeper(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) { switch (uiAction) { case GOSSIP_ACTION_INFO_DEF+1: pPlayer->SEND_GOSSIP_MENU(TEXT_ID_WHAT_TO_DO, pCreature->GetObjectGuid()); break; case GOSSIP_ACTION_INFO_DEF+2: ...
false
false
false
false
false
0
pdf14_decode_color(gx_device * dev, gx_color_index color, gx_color_value * out) { int i; int ncomp = dev->color_info.num_components; for (i = 0; i < ncomp; i++) { out[ncomp - i - 1] = (gx_color_value) ((color & 0xff) * 0x101); color >>= 8; } return 0; }
false
false
false
false
false
0
EvaluateFunction(double x[3]) { vtkDataArray *scalars; int ijk[3]; vtkIdType numPts, i; double pcoords[3], weights[8], s; // See if a volume is defined if ( !this->Volume || !(scalars = this->Volume->GetPointData()->GetScalars()) ) { vtkErrorMacro(<<"Can't evaluate volume!"); return this->Out...
false
false
false
false
false
0
parse_get_nul_string(ParseContext *context) { Octstr *result; long pos; gw_assert(context != NULL); pos = octstr_search_char(context->data, 0, context->pos); if (pos < 0 || pos >= context->limit) { context->error = 1; return NULL; } result = octstr_copy(context->data, cont...
false
false
false
true
false
1
groupForDate(QDate date, int groupby) { switch(groupby) { case LTM_WEEK: { // must start from 1 not zero! return 1 + ((date.toJulianDay() - settings->start.date().toJulianDay()) / 7); } case LTM_MONTH: return (date.year()*12) + date.month(); case LTM_YEAR: return date.ye...
false
false
false
false
false
0