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
isFrameIndexOp(SDValue Op) { if (Op.getOpcode() == ISD::AssertZext) Op = Op.getOperand(0); return isa<FrameIndexSDNode>(Op); }
false
false
false
false
false
0
snd_make_stkrev(int rev_type, sound_type s1, time_type trev, double mix, rate_type sr) { register stkrev_susp_type susp; /* sr specified as input parameter */ time_type t0 = s1->t0; int interp_desc = 0; sample_type scale_factor = 1.0F; time_type t0_min = t0; falloc_generic(susp, stkrev_susp_...
false
false
false
false
false
0
dvb_channel_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) { GObject * obj; GObjectClass * parent_class; DVBChannel * self; GeeArrayList* _tmp0_ = NULL; GeeArrayList* _tmp1_ = NULL; parent_class = G_OBJECT_CLASS (dvb_channel_parent_class); obj = parent_class-...
false
false
false
false
false
0
gf_rdma_connect_qp (rpc_transport_t *this) { gf_rdma_private_t *priv = this->private; gf_rdma_options_t *options = &priv->options; struct ibv_qp_attr attr = { .qp_state = IBV_QPS_RTR, .path_mtu = options->mtu, .dest_qp_n...
false
false
false
false
false
0
__ecereMethod___ecereNameSpace__ecere__gfx__drivers__OpenGLDisplayDriver_SetTransform(struct __ecereNameSpace__ecere__com__Instance * display, struct __ecereNameSpace__ecere__gfx3D__Matrix * transMatrix, unsigned int viewSpace, unsigned int useCamera) { struct __ecereNameSpace__ecere__gfx3D__Matrix matrix = *transMatri...
false
false
false
false
false
0
IsOld_ (char *stringP) { char string_copyA[SHORTSTRINGSIZE]; char *P; int n; /* Copy the input string: */ strncpy (string_copyA, stringP, SHORTSTRINGSIZE - 1); string_copyA[SHORTSTRINGSIZE - 1] = '\0'; /* Convert the string copy to uppercase: */ P = string_copyA; while ((n = *P++) != '\0') *(P - 1) = toupper (n); ...
false
false
false
false
false
0
RemoveAssociatedWatches(CheatEntry * entry) { int i; for(i = watchListLength - 1; i >= 0; i--) { WatchInfo * info = &watchList[i]; if(info->linkedCheat == entry) DeleteWatchAt(i); } }
false
false
false
false
false
0
gretl_list_to_lags_string (const int *list, int *err) { char *buf; char numstr[8]; int len, i; len = 4 * (list[0] + 1) + 2; if (len > MAXLINE - 32) { *err = E_DATA; return NULL; } buf = malloc(len); if (buf == NULL) { *err = E_ALLOC; return NULL; } *buf = '\0'; for (...
false
false
false
false
false
0
next_master(const char *caller, isc_sockaddr_t *addr, isc_result_t eresult) { char addrbuf[ISC_SOCKADDR_FORMATSIZE]; isc_sockaddr_format(addr, addrbuf, sizeof(addrbuf)); fprintf(stderr, "; Communication with %s failed: %s\n", addrbuf, isc_result_totext(eresult)); if (++master_inuse >= master_total) return (ISC...
true
true
false
false
false
1
emitRegistration() { // Don't do this for Darwin. compiler-rt uses linker magic. if (Triple(M->getTargetTriple()).isOSDarwin()) return; // Use linker script magic to get data/cnts/name start/end. if (Triple(M->getTargetTriple()).isOSLinux() || Triple(M->getTargetTriple()).isOSFreeBSD()) return; ...
false
false
false
false
false
0
clear_reload_reg_in_use (unsigned int regno, int opnum, enum reload_type type, enum machine_mode mode) { unsigned int nregs = hard_regno_nregs[regno][mode]; unsigned int start_regno, end_regno, r; int i; /* A complication is that for some reload types, inheritance might allow multiple reloads of the sa...
false
false
false
false
false
0
swan_read_md5sum(int pkg_fd, char *md5sum) { int ret; ret = lseek(pkg_fd, MEMBER_OFFSET(struct swan_file_info, md5sum), SEEK_SET); if (ret < 0) { print_error("lseek"); return ret; } return ffile_read(pkg_fd, md5sum, MD5SUM_LEN); }
false
false
false
false
false
0
statusDraw(icp, data) IMIC *icp; OCCPreeditDrawArg *data; { IMConnection *conn = icp->im->connection; int offset; unsigned int status; if (icp->state & IC_RESETTING) return; statusStart(icp); TRACE(("imlib:statusDraw()\n")); offset = IMPutHeader(conn, XIM_STATUS_DRAW, 0, 0); IMPutC16...
false
false
false
false
false
0
free_static_shapers (void) { if (unlikely (static_shapers != all_shapers)) free ((void *) static_shapers); }
false
false
false
false
false
0
ho_dimentions_line_fill (ho_bitmap * m, const ho_bitmap * m_line_map) { ho_bitmap *m_temp; int avg_line_fill; int com_line_fill; int *line_fill; int *line_fill_hist; int counter; int x, y; int line_height; int cell_size_for_common_fill_hist = 3; /* get line_height */ x = m_line_map->width / 2; ...
false
false
false
false
false
0
qib7322_create_send_bufs ( struct qib7322 *qib7322, unsigned long base, unsigned int size, unsigned int start, unsigned int count ) { struct qib7322_send_buffers *send_bufs; unsigned int i; /* Allocate send buffer set */ send_bufs = zalloc ( sizeof ( *send_bufs ) + ( count * sizeof ( send_bufs-...
false
false
false
false
false
0
gen_wrapped_array (ostream &out, CObjectInfo *obj) { assert (obj->TypeInfo ()->TypeArray ()); CTypeArray *t_array = obj->TypeInfo ()->TypeArray (); out << endl; out << " struct "; // generate name to satisfy VC++ 2002 out << "__ac_wrapper_" << obj->Name (); out << " {" << endl; out << " typedef ";...
false
false
false
false
false
0
start_track_( int track ) { RETURN_ERR( Music_Emu::start_track_( track ) ); pos = data; loop_remain = GET_LE32( header_.loop_start ); prev_dac_count = 0; dac_enabled = false; dac_amp = -1; fm.reset(); apu.reset(); blip_buf.clear(); Dual_Resampler::clear(); return 0; }
false
false
false
false
false
0
test_refs_revparse__issue_994(void) { git_repository *repo; git_reference *head, *with_at; git_object *target; repo = cl_git_sandbox_init("testrepo.git"); cl_assert_equal_i(GIT_ENOTFOUND, git_revparse_single(&target, repo, "origin/bim_with_3d@11296")); cl_assert_equal_i(GIT_ENOTFOUND, git_revparse_single(...
false
false
false
false
false
0
alps_bsrv2_tuner_set_params(struct dvb_frontend *fe) { struct dtv_frontend_properties *p = &fe->dtv_property_cache; struct av7110* av7110 = fe->dvb->priv; u8 pwr = 0; u8 buf[4]; struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = buf, .len = sizeof(buf) }; u32 div = (p->frequency + 479500) / 125; if (p->fre...
false
false
false
false
false
0
getPSLForLid(unsigned int lid) { if (PSL.empty()) return 0; if (PSL.size() < lid+1) return IB_SLT_UNASSIGNED; return PSL[lid]; }
false
false
false
false
false
0
parse(XML_PARSER& xp) { present = false; bus_id = device_id = domain_id = 0; while (!xp.get_tag()) { if (xp.match_tag("/pci_info")) { return 0; } if (xp.parse_int("bus_id", bus_id)) continue; if (xp.parse_int("device_id", device_id)) continue; if (xp.parse...
false
false
false
false
false
0
setGlyphSubstTable(const Vector<ConstPtr<GlyphSubstTable> > &tables) { if (tables.size() == 0) { ics_ << " glyph-subst-table=" << quot << quot; return; } static const char idPrefix[] = "gst"; ics_ << " glyph-subst-table=" << quot; for (size_t i = 0; i < tables.size(); i++) { unsigned long n = tabl...
false
false
false
false
false
0
ensTranscriptadaptorFetchAllbyGene( EnsPTranscriptadaptor tca, EnsPGene gene, AjPList transcripts) { AjBool circular = AJFALSE; AjPList list = NULL; AjPStr constraint = NULL; EnsPDatabaseadaptor dba = NULL; EnsPFeature gfeature = NULL; EnsPSlice gslice = NULL; EnsPSlice ...
false
false
false
false
false
0
getVMEnv(PyObject *self) { if (env->vm != NULL) { t_jccenv *jccenv = (t_jccenv *) PY_TYPE(JCCEnv).tp_alloc(&PY_TYPE(JCCEnv), 0); jccenv->env = env; return (PyObject *) jccenv; } Py_RETURN_NONE; }
false
false
false
false
false
0
ensTranscriptLoadCanonical( EnsPTranscript transcript) { AjBool canonical = AJFALSE; if (!transcript) return NULL; if (transcript->Canonical) return transcript->Canonical; if (!transcript->Canonical) { ajDebug("ensTranscriptLoadCanonical cannot fetch " ...
false
false
false
false
false
0
mergeChildLists(const CAlgorithm& inAlgorithm){ if(&inAlgorithm){ //merge child lists copy(inAlgorithm.child_list_begin(), inAlgorithm.child_list_end(), inserter(mChildren, child_list_end())); } }
false
false
false
false
false
0
free_rdg (struct graph *rdg) { int i; for (i = 0; i < rdg->n_vertices; i++) { struct vertex *v = &(rdg->vertices[i]); struct graph_edge *e; for (e = v->succ; e; e = e->succ_next) free (e->data); gimple_set_uid (RDGV_STMT (v), -1); free_data_refs (RDGV_DATAREFS (v)); free ...
false
false
false
false
false
0
_GD_DoString(gd_entry_t *E, size_t num_samp, char *data_out) { dtrace("%p, %zu, %p", E, num_samp, data_out); if (num_samp > 0 && data_out != NULL) strncpy(data_out, E->e->u.string, num_samp); dreturn("%zu", strlen(E->e->u.string) + 1); return strlen(E->e->u.string) + 1; }
false
false
false
false
false
0
be_parse_stats(struct be_adapter *adapter) { struct be_erx_stats_v2 *erx = be_erx_stats_from_cmd(adapter); struct be_rx_obj *rxo; int i; u32 erx_stat; if (lancer_chip(adapter)) { populate_lancer_stats(adapter); } else { if (BE2_chip(adapter)) populate_be_v0_stats(adapter); else if (BE3_chip(adapter)) ...
false
false
false
false
false
0
avc_bridgeco_get_plug_section_type(struct fw_unit *unit, u8 addr[AVC_BRIDGECO_ADDR_BYTES], unsigned int id, u8 *type) { u8 *buf; int err; /* section info includes charactors but this module don't need it */ buf = kzalloc(12, GFP_KERNEL); if (buf == NULL) return -ENOMEM; /* Info type is '...
false
false
false
false
false
0
nsslowcert_FindTrustByIssuerAndSN(NSSLOWCERTCertDBHandle *handle, NSSLOWCERTIssuerAndSN *issuerAndSN) { SECItem certKey; SECItem *sn = &issuerAndSN->serialNumber; SECItem *issuer = &issuerAndSN->derIssuer; NSSLOWCERTTrust *trust; unsigned char keyBuf[512]; int data_left = sn->len-1; in...
true
true
false
false
false
1
elm_calendar_selected_time_set(Evas_Object *obj, struct tm *selected_time) { ELM_CALENDAR_CHECK(obj); ELM_CALENDAR_DATA_GET(obj, sd); EINA_SAFETY_ON_NULL_RETURN(selected_time); sd->selected_time = *selected_time; if (!sd->selected) sd->selected = EINA_TRUE; if (sd-...
false
false
false
false
false
0
soup_message_body_flatten (SoupMessageBody *body) { SoupMessageBodyPrivate *priv = (SoupMessageBodyPrivate *)body; char *buf, *ptr; GSList *iter; SoupBuffer *chunk; g_return_val_if_fail (priv->accumulate == TRUE, NULL); if (!priv->flattened) { #if GLIB_SIZEOF_SIZE_T < 8 g_return_val_if_fail (body->length < G_...
false
false
false
false
false
0
dump_model(std::ostream& os) const { // endogenous variable declaration os << "var"; for (int i = 0; i < (int)atoms.get_endovars().size(); i++) os << " " << atoms.get_endovars()[i]; os << ";\n\n"; // exogenous variables os << "varexo"; for (int i = 0; i < (int)atoms.get_exovars().size(); i++) os << " " << a...
false
false
false
false
false
0
ExtractIntData( const char * pachSourceData, int nMaxBytes, int * pnConsumedBytes ) { switch( pszFormatString[0] ) { case 'A': case 'I': case 'R': case 'S': case 'C': return atoi(ExtractStringData(pachSourceData, nMaxBytes, ...
false
false
false
false
false
0
Uncompress(void* OutputBuffer, void* InputBuffer, ULONG InputLength, PULONG OutputLength) /* * FUNCTION: Uncompresses data in a buffer * ARGUMENTS: * OutputBuffer = Pointer to buffer to place uncompressed data * InputB...
false
false
false
false
false
0
amphibious_behaviour(const struct tile *ptile, enum known_type known, const struct pf_parameter *param) { struct pft_amphibious *amphibious = param->data; const bool ferry_move = is_native_tile_to_class(amphibious->sea.uclass, ptile); /* Simply a wrapper for the sea or land tile_behavior cal...
false
false
false
false
false
0
figColorResolve(int *new, int r, int g, int b) { #define maxColors 256 static int top = 0; static short red[maxColors], green[maxColors], blue[maxColors]; int c; int ct = -1; long rd, gd, bd, dist; long mindist = 3 * 255 * 255; /* init to max poss dist */ *new = 0; /...
false
false
false
false
false
0
sha1_file( const char *path, unsigned char output[20] ) { FILE *f; size_t n; sha1_context ctx; unsigned char buf[1024]; if( ( f = fopen( path, "rb" ) ) == NULL ) return( 1 ); sha1_starts( &ctx ); while( ( n = fread( buf, 1, sizeof( buf ), f ) ) > 0 ) sha1_update( &ctx, buf...
false
false
false
false
true
1
getThisAppSeg() { if ( mAppSeg && (mAppSeg->isRaw())) { // If we have an appseg and haven't tried converting it already, then // try to convert // Try to get an implementation from the factory std::string id ; ExifAppSegment::createAppId(mAppSeg->getAppSegmentMar...
false
false
false
false
false
0
dfb_window_destroy( CoreWindow *window ) { DFBWindowEvent evt; CoreWindowStack *stack; BoundWindow *bound, *next; D_ASSERT( window != NULL ); D_ASSERT( DFB_WINDOW_INITIALIZED( window ) ); D_DEBUG_AT( Core_Windows, "dfb_window_destroy (%p) [%4d,%4d - %4dx%4d]\n", wi...
false
false
false
false
false
0
SetCategoryNames( char ** papszNewNames ) { PamInitialize(); if( psPam ) { CSLDestroy( psPam->papszCategoryNames ); psPam->papszCategoryNames = CSLDuplicate( papszNewNames ); psPam->poParentDS->MarkPamDirty(); return CE_None; } else return GDALRasterBand::...
false
false
false
false
false
0
kb_incr(kb_t * k, squid_off_t v) { k->bytes += v; k->kb += (k->bytes >> 10); k->bytes &= 0x3FF; if (k->kb < 0) { /* * If kb overflows and becomes negative then add powers of * 2 until it becomes positive again. */ kb_t x; x.kb = 1L << 31; while (x.kb && ((k->kb + x.kb) < 0)) { x.kb <<= 1;...
false
false
false
false
false
0
gnibbles_worm_handle_keypress (GnibblesWorm * worm, guint keyval) { GnibblesWormProps *props; guint propsUp, propsLeft, propsDown, propsRight, keyvalUpper; if (worm->lives <= 0) return FALSE; props = properties->wormprops[worm->number]; propsUp = toupper(props->up); propsLeft = toupper(props->left); ...
false
false
false
false
false
0
ssh_pki_import_pubkey_base64(const char *b64_key, enum ssh_keytypes_e type, ssh_key *pkey) { ssh_buffer buffer; ssh_string type_s; int rc; if (b64_key == NULL || pkey == NULL) { return SSH_ERROR; } buffer = base64_to_bin...
false
false
false
false
false
0
w1_DS18S20_convert_temp(u8 rom[9]) { int t, h; if (!rom[7]) return 0; if (rom[1] == 0) t = ((s32)rom[0] >> 1)*1000; else t = 1000*(-1*(s32)(0x100-rom[0]) >> 1); t -= 250; h = 1000*((s32)rom[7] - (s32)rom[6]); h /= (s32)rom[7]; t += h; return t; }
false
false
false
false
false
0
UnRegisterScriptMenu(cb_unused const wxString& menuPath) { // TODO: not implemented Manager::Get()->GetLogManager()->DebugLog(_T("ScriptingManager::UnRegisterScriptMenu() not implemented")); return false; }
false
false
false
false
false
0
ParseHello( const CString & sContent ) { CMessageHello * msg = new CMessageHello(); msg->m_sNick = m_pRemoteToLocal->encode(sContent); return msg; }
false
false
false
false
false
0
i2c_nuvoton_get_burstcount(struct i2c_client *client, struct tpm_chip *chip) { unsigned long stop = jiffies + chip->vendor.timeout_d; s32 status; int burst_count = -1; u8 data; /* wait for burstcount to be non-zero */ do { /* in I2C burstCount is 1 byte */ status = i2c_nuvoton_read_buf(client, TPM_...
false
false
false
false
false
0
delword(Word *w) { Word *v; while(v = w){ w = w->next; if(v->s) free(v->s); free(v); } }
false
false
false
false
false
0
get_tmpf( char * obuf ) { static int k, seq; static char buf[ 15 ][ 256 ]; int fd = -1, tries = 0; char *name; k = ( k + 1 ) % 15; name = obuf ? obuf : buf[ k ]; do { if ( ( fd = mkstemp( name ) ) >= 0 ) /* empty */ ; else { ...
false
false
false
false
false
0
Scm_ExportSymbols(ScmModule *module, ScmObj list) { ScmObj lp, syms, badsym = SCM_FALSE; int error = FALSE; ScmSymbol *s; ScmDictEntry *e; ScmGloc *g; /* We used to do something like * (set! (module-exports module) * (delete-duplicates (union (module-exports module) list))) ...
false
false
false
false
false
0
main (int argc, char** argv) { if (argc > 1) { run_tests(); } else { t_algo_state state; read_events (state); simplify_state (state); print_state (state); } return 0; }
false
false
false
false
false
0
qlcnic_83xx_init_mailbox_work(struct qlcnic_adapter *adapter) { struct qlcnic_hardware_context *ahw = adapter->ahw; struct qlcnic_mailbox *mbx; ahw->mailbox = kzalloc(sizeof(*mbx), GFP_KERNEL); if (!ahw->mailbox) return -ENOMEM; mbx = ahw->mailbox; mbx->ops = &qlcnic_83xx_mbx_ops; mbx->adapter = adapter; s...
false
false
false
false
false
0
RPC_DSAP_TP(struct host_table_entry *hte, TPM_ENTITY_TYPE entityType, /* in */ TCS_KEY_HANDLE keyHandle, /* in */ TPM_NONCE *nonceOddDSAP, /* in */ UINT32 entityValueSize, /* in */ BYTE * entityValue, /* in */ TCS_AUTHHANDLE *authHandle, /* out */ TPM_NONCE *nonceEven, /* out */ ...
false
false
false
false
false
0
camel_object_bag_get (CamelObjectBag *bag, gconstpointer key) { KeyReservation *reservation; ObjRef *ref; gpointer object = NULL; g_return_val_if_fail (bag != NULL, NULL); g_return_val_if_fail (key != NULL, NULL); g_mutex_lock (&bag->mutex); /* Look for the key in the bag. */ ref = g_ha...
false
false
false
false
false
0
cob_cmp_sign_numdisp (const unsigned char *data, const size_t size, const int n) { const unsigned char *p; int val = 0; size_t inc; p = data; for (inc = 0; inc < size - 1; inc++, p++) { val = (val * 10) + (*p - (unsigned char)'0'); } val *= 10; if (*p >= '0' && *p <= '9') { val += (*p - (unsigned char)...
false
false
false
false
false
0
check_assign_lhs_rhs(ast_node* lhs, ast_expr* rhs, int l, int c) { int summary_lhs; int summary_rhs; ast_typedecl* lhs_typedecl = NULL; gm_symtab_entry* l_sym = NULL; if (lhs->get_nodetype() == AST_ID) { ast_id* l = (ast_id*) lhs; summary_lhs = l->getType...
false
false
false
false
false
0
bfd_elf_discard_info (bfd *output_bfd, struct bfd_link_info *info) { struct elf_reloc_cookie cookie; asection *stab, *eh; const struct elf_backend_data *bed; bfd *abfd; bfd_boolean ret = FALSE; if (info->traditional_format || !is_elf_hash_table (info->hash)) return FALSE; _bfd_elf_begin_eh_fra...
false
false
false
false
false
0
expandBuf8( FreeImageIO *io, fi_handle handle, int width, int bpp, BYTE* dst ) { switch (bpp) { case 8: io->read_proc( dst, width, 1, handle ); break; case 4: for (int i = 0; i < width; i++) { WORD src = Read8( io, handle ); *dst = (src >> 4) & 15; *(dst+1) = (src & 15); dst += 2; } ...
false
false
false
false
false
0
r8712_xmit_direct(struct _adapter *padapter, struct xmit_frame *pxmitframe) { int res = _SUCCESS; res = r8712_xmitframe_coalesce(padapter, pxmitframe->pkt, pxmitframe); pxmitframe->pkt = NULL; if (res == _SUCCESS) dump_xframe(padapter, pxmitframe); return res; }
false
false
false
false
false
0
screenshot_select_area_async (SelectAreaCallback callback, gpointer callback_data) { GdkCursor *cursor; select_area_filter_data data; CallbackData *cb_data; GdkDeviceManager *manager; GdkDevice *pointer, *keyboard; GdkGrabStatus res; data.rect.x = 0; data.rect.y = 0; da...
false
false
false
false
false
0
strrev(char *str) { int i,len; char c; len = sstrlen(str); for (i=0; i<len/2; i++) { c = str[i]; str[i] = str[len-i]; str[len-i] = c; } return str; }
false
false
false
false
false
0
vidioc_s_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *fmt) { struct go7007 *go = video_drvdata(file); if (vb2_is_busy(&go->vidq)) return -EBUSY; return set_capture_size(go, fmt, 0); }
false
false
false
false
false
0
expandJNILrefs(ExecEnv *ee, JNIFrame *frame, int incr) { JNIFrame *new_frame = (JNIFrame*)((Object**)frame + incr); if((char*)(new_frame + 1) > ee->stack_end) return NULL; memcpy(new_frame, frame, sizeof(JNIFrame)); new_frame->ostack = (uintptr_t*)(new_frame + 1); ee->last_frame = (Frame*)...
false
false
false
false
false
0
Ns_RegisterFilter(char *server, char *method, char *url, Ns_FilterProc *proc, int when, void *arg) { NsServer *servPtr = NsGetServer(server); Filter *fPtr, **fPtrPtr; if (servPtr == NULL) { return NULL; } fPtr = ns_malloc(sizeof(Filter)); fPtr->proc = proc; fPtr->method = ns_strdup(met...
false
false
false
false
false
0
radix_tree_remove(struct radix_tree *tree, unsigned long key) { struct radix_tree_node *node = tree->root; int i; for (i = 0; i < level_count(tree) - 1; i++) { int index = get_index(tree, key, i); if (node->slots[index] == NULL) return; /* no mapping exists */ node = node->slots[index]; } free_slot(tr...
false
false
false
false
false
0
t3b_intr_napi(int irq, void *cookie) { u32 map; struct adapter *adap = cookie; struct sge_qset *qs0 = &adap->sge.qs[0]; struct sge_rspq *q0 = &qs0->rspq; t3_write_reg(adap, A_PL_CLI, 0); map = t3_read_reg(adap, A_SG_DATA_INTR); if (unlikely(!map)) /* shared interrupt, most likely */ return IRQ_NONE; spin_l...
false
false
false
false
false
0
getdosname(buf, name, ext) char *buf; CONST u_char *name, *ext; { int i, len; for (i = 0; i < 8 && name[i] != ' '; i++) buf[i] = name[i]; len = i; if (*ext != ' ') { buf[len++] = '.'; for (i = 0; i < 3 && ext[i] != ' '; i++) buf[len + i] = ext[i]; len += i; } buf[len] = '\0'; if (buf[0] == 0x05) ((u_char ...
false
false
false
false
false
0
vmci_handle_arr_has_entry(const struct vmci_handle_arr *array, struct vmci_handle entry_handle) { size_t i; for (i = 0; i < array->size; i++) if (vmci_handle_is_equal(array->entries[i], entry_handle)) return true; return false; }
false
false
false
false
false
0
vader_btl_first_time_init(mca_btl_vader_t *vader_btl, int n) { mca_btl_vader_component_t *component = &mca_btl_vader_component; int rc; /* generate the endpoints */ component->endpoints = (struct mca_btl_base_endpoint_t *) calloc (n + 1, sizeof (struct mca_btl_base_endpoint_t)); component->endpoint...
false
false
false
false
false
0
dbslayer_log_request(dbslayer_log_manager_t *manager, apr_pool_t *mpool, apr_socket_t *conn, const char *request_line, int response_code, int nbytes_sent, apr_int64_t time_toservice) { //generate data char dstring[1024]; apr_int64_t current_time = apr_time_now(); apr_size_t result_size; apr_time_exp_t ltime; ...
false
false
false
false
false
0
elvin_close (Elvin *elvin) { alloc_message (disconn_rqst); alloc_message (disconn_rply); bool socket_opened = elvin->router_socket != -1; if (socket_opened) { avis_message_init (disconn_rqst, MESSAGE_ID_DISCONN_RQST); send_and_receive (elvin, disconn_rqst, disconn_rply, MESSAGE_ID_DISCONN_RPL...
false
false
false
false
false
0
get_resize_decor_gravities_one_axis( frame_decor_gravities_type *ret_grav, direction_t title_dir, frame_move_resize_mode axis_mode, direction_t neg_dir, direction_t pos_dir, int is_moving) { int title_grav; int neg_grav; int pos_grav; title_grav = gravity_dir_to_grav(title_dir); neg_grav = gravity_dir_to_grav...
false
false
false
false
true
1
odf_write_gog_style_text (GnmOOExport *state, GOStyle const *style) { if (style != NULL) { PangoFontDescription const *desc = style->font.font->desc; PangoFontMask mask = pango_font_description_get_set_fields (desc); int val = style->text_layout.angle; odf_add_angle (state->xml, STYLE "text-rotation-angle", v...
false
false
false
false
false
0
bnxt_gro_func_5730x(struct bnxt_tpa_info *tpa_info, int payload_off, int tcp_ts, struct sk_buff *skb) { #ifdef CONFIG_INET struct tcphdr *th; int len, nw_off, tcp_opt_len = 0; if (tcp_ts) tcp_opt_len = 12; if (tpa_info->gso_type == SKB_GSO_TCPV4) { struct iphdr *iph; nw_off = payload_off - ...
false
false
false
false
false
0
setlocal (void) { lua_Object func = lua_stackedfunction(luaL_check_int(1)); int numvar; luaL_arg_check(func != LUA_NOOBJECT, 1, "level out of range"); numvar = findlocal(func, 2); lua_pushobject(luaL_nonnullarg(3)); if (!lua_setlocal(func, numvar)) lua_error("no such local variable"); }
false
false
false
false
false
0
vmload_interception(struct vcpu_svm *svm) { struct vmcb *nested_vmcb; struct page *page; if (nested_svm_check_permissions(svm)) return 1; nested_vmcb = nested_svm_map(svm, svm->vmcb->save.rax, &page); if (!nested_vmcb) return 1; svm->next_rip = kvm_rip_read(&svm->vcpu) + 3; skip_emulated_instruction(&svm-...
false
false
false
false
false
0
b44_rx_refill(struct b44_private *bp, u32 pending) { u32 i; // skip pending for (i = pending + 1; i != bp->rx_cur; i = ring_next(i)) { if (bp->rx_iobuf[i] != NULL) continue; bp->rx_iobuf[i] = alloc_iob(RX_PKT_BUF_SZ); if (!bp->rx_iobuf[i]) { DBG("Refill rx ring failed!!\n"); break; } b44_popula...
false
false
false
false
false
0
isAllOnesValue() const { // Check out first element. const Constant *Elt = getOperand(0); const ConstantInt *CI = dyn_cast<ConstantInt>(Elt); if (!CI || !CI->isAllOnesValue()) return false; // Then make sure all remaining elements point to the same value. for (unsigned I = 1, E = getNumOperands(); I < E; ++...
false
false
false
false
false
0
dowield() { register struct obj *wep, *oldwep; int result; /* May we attempt this? */ multi = 0; if (cantwield(youmonst.data)) { pline("Don't be ridiculous!"); return(0); } /* Prompt for a new weapon */ if (!(wep = getobj(wield_objs, "wield"))) /* Cancelled */ return (0); else if (wep == uwep) { ...
false
false
false
false
false
0
do_statusbar_home(void) { size_t pww_save = statusbar_pww; #ifndef NANO_TINY if (ISSET(SMART_HOME)) { size_t statusbar_x_save = statusbar_x; statusbar_x = indent_length(answer); if (statusbar_x == statusbar_x_save || statusbar_x == strlen(answer)) statusbar_x = 0; statusbar_pww = statusbar_xplust...
false
false
false
false
false
0
__fmc_scan_sdb_tree(struct fmc_device *fmc, unsigned long sdb_addr, unsigned long reg_base, int level) { uint32_t onew; int i, j, n, convert = 0; struct sdb_array *arr, *sub; onew = fmc_readl(fmc, sdb_addr); if (onew == SDB_MAGIC) { /* Uh! If we are little-endian, we must convert */ if (SD...
false
false
false
false
false
0
xpc_system_die(struct notifier_block *nb, unsigned long event, void *_die_args) { #ifdef CONFIG_IA64 /* !!! temporary kludge */ switch (event) { case DIE_MACHINE_RESTART: case DIE_MACHINE_HALT: xpc_die_deactivate(); break; case DIE_KDEBUG_ENTER: /* Should lack of heartbeat be ignored by other partitions? */...
false
false
false
false
false
0
PS_calc_sums_for_nodepath( PS_NodeSet &_nodepath, ULSet &_sums ) { // iterate over nodes in path ULSet sums_for_node; ULSet temperatures; for ( PS_NodeSet::const_iterator node = _nodepath.begin(); node != _nodepath.end(); ++node ) { // iterate over probes of node su...
false
false
false
false
false
0
editor_list_get(void) { GList *editors_list = NULL; if (!editors_finished) return NULL; g_hash_table_foreach(editors, editor_list_add_cb, &editors_list); editors_list = g_list_sort(editors_list, editor_sort); return editors_list; }
false
false
false
false
false
0
yyrefill(void) { int yyn; while (yybuflen - yypos < 512) { yybuflen *= 2; yybuf= realloc(yybuf, yybuflen); } YY_INPUT((yybuf + yypos), yyn, (yybuflen - yypos)); if (!yyn) return 0; yylimit += yyn; return 1; }
false
false
false
false
false
0
ParseNumericString(struct Aoc *chanp, u_char *p, u_char *end, char *str) { INIT; print_msg(PRT_DEBUG_DECODE, " DEBUG> NumStr = "); while (len--) { CHECK_P; print_msg(PRT_DEBUG_DECODE, "%c", *p); *str++ = *p; p++; } print_msg(PRT_DEBUG_DECODE, "\n"); *str = 0; return p - beg; }
false
false
false
false
false
0
WriteField( uint32 offset, const ShapeField& field, PCIDSKBuffer& buffer ) { /* -------------------------------------------------------------------- */ /* How much space do we need for this value? */ /* -----...
false
false
false
false
false
0
ir_add_comma(TIntermTyped* left, TIntermTyped* right, TSourceLoc line) { if (left->getType().getQualifier() == EvqConst && right->getType().getQualifier() == EvqConst) { return right; } else { TIntermTyped *commaAggregate = ir_grow_aggregate(left, right, line); commaAggregate->getAsAggregate()->setOperator(E...
false
false
false
false
false
0
checkDataDir(void) { char path[MAXPGPATH]; FILE *fp; struct stat stat_buf; Assert(DataDir); if (stat(DataDir, &stat_buf) != 0) { if (errno == ENOENT) ereport(FATAL, (errcode_for_file_access(), errmsg("data directory \"%s\" does not exist", DataDir))); else ereport(FATAL, (er...
false
false
false
false
false
0
atoi_nonlocalized(const char *str) { int i=0, value=0, sign=1; while(str[i] == ' ') { i++; } if((str[i] == '+') || (str[i] == '-')) { if(str[i] == '-') { sign = -1; } i++; } for( ; ; i++) { if(str[i] == 0) { break; } if((str[i] < '0') || (str[i] > '...
false
false
false
false
false
0
startup(void) { if (!msInstance) { LogManager::getSingleton().logMessage( LML_NORMAL, "DDS codec registering"); msInstance = OGRE_NEW DDSCodec(); Codec::registerCodec(msInstance); } }
false
false
false
false
false
0
pk_backend_get_description (PkBackend *backend) { g_return_val_if_fail (PK_IS_BACKEND (backend), NULL); g_return_val_if_fail (backend->priv->desc != NULL, NULL); g_return_val_if_fail (backend->priv->loaded, NULL); return backend->priv->desc->description; }
false
false
false
false
false
0
o2hb_populate_slot_data(struct o2hb_region *reg) { int ret, i; struct o2hb_disk_slot *slot; struct o2hb_disk_heartbeat_block *hb_block; ret = o2hb_read_slots(reg, reg->hr_blocks); if (ret) goto out; /* We only want to get an idea of the values initially in each * slot, so we do no verification - o2hb_check_...
false
false
false
false
false
0
rtl8812ae_dm_check_txpower_tracking_thermalmeter( struct ieee80211_hw *hw) { struct rtl_priv *rtlpriv = rtl_priv(hw); if (!rtlpriv->dm.tm_trigger) { rtl_set_rfreg(hw, RF90_PATH_A, RF_T_METER_88E, BIT(17) | BIT(16), 0x03); RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "Trigger 8812 Thermal Meter...
false
false
false
false
false
0
unqliteOpenJournal(Pager *pPager) { unsigned char *zHeader; int rc = UNQLITE_OK; if( pPager->is_mem || pPager->no_jrnl ){ /* Journaling is omitted for this database */ goto finish; } if( pPager->iState >= PAGER_WRITER_CACHEMOD ){ /* Already opened */ return UNQLITE_OK; } /* Delete any previously journal ...
false
false
false
false
false
0
check_array(char *a, int len) { int n = 0; while (len--) { n = n*10 + a[len]; } if(is_prime(n)) { return n; } return 0; }
false
false
false
false
false
0
pivot3r(int *rr, int lo, int hi) { int c1, c2, c3; if (hi-lo > 256) { c1 = pivot3r(rr, lo, (6*lo+2*hi)/8); c2 = pivot3r(rr, (5*lo+3*hi)/8, (3*lo+5*hi)/8); c3 = pivot3r(rr, (2*lo+6*hi)/8, hi); } else { c1 = rr[posn[lo]]; c2 = rr[posn[(lo+hi)/2]]; c3 = rr[posn[hi]]; ...
false
false
false
false
false
0