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
createPlaza(int x1, int y1, int x2, int y2) { bool park = randbool(); bool style = randbool(); for (int j = y1; j <= y2; ++j) { for (int i = x1; i <= x2; ++i) { Tile tile(ground); if (park) tile = randint(6) ? grass : tree; else if (style) tile = plaza; tiles[j][i] = tile; } } }
false
false
false
false
false
0
hashindex (TObject *ref) { long int h; switch (ttype(ref)) { case LUA_T_NUMBER: h = (long int)nvalue(ref); break; case LUA_T_STRING: case LUA_T_USERDATA: h = tsvalue(ref)->hash; break; case LUA_T_FUNCTION: h = (IntPoint)ref->value.tf; break; case LUA_T_CFUNCTION: h = (IntPoin...
false
false
false
false
false
0
get_attsp(vlist_t *vlistptr, int varID) { cdi_atts_t *attsp = NULL; if ( varID == CDI_GLOBAL ) { attsp = &vlistptr->atts; } else { if ( varID >= 0 && varID < vlistptr->nvars ) attsp = &(vlistptr->vars[varID].atts); } return (attsp); }
false
false
false
false
false
0
tracker_indexing_tree_file_is_root (TrackerIndexingTree *tree, GFile *file) { TrackerIndexingTreePrivate *priv; GNode *node; g_return_val_if_fail (TRACKER_IS_INDEXING_TREE (tree), FALSE); g_return_val_if_fail (G_IS_FILE (file), FALSE); priv = tree->priv; node = ...
false
false
false
false
false
0
magnet_parse_exact_source(const char *uri, const char **error_str) { clear_error_str(&error_str); g_return_val_if_fail(uri, NULL); /* TODO: This should be handled elsewhere e.g., downloads.c in * a generic way. */ if (is_strcaseprefix(uri, "http://")) { return magnet_parse_http_source(uri, error_str); } els...
false
false
false
false
false
0
ecp_check_privkey( const ecp_group *grp, const mpi *d ) { #if defined(POLARSSL_ECP_MONTGOMERY) if( ecp_get_type( grp ) == POLARSSL_ECP_TYPE_MONTGOMERY ) { /* see [M255] page 5 */ if( mpi_get_bit( d, 0 ) != 0 || mpi_get_bit( d, 1 ) != 0 || mpi_get_bit( d, 2 ) != 0 || ...
false
false
false
false
false
0
lib3ds_lin3_track_setup(Lib3dsLin3Track *track) { Lib3dsLin3Key *pp,*pc,*pn,*pl; ASSERT(track); pc=track->keyL; if (!pc) { return; } if (!pc->next) { lib3ds_vector_zero(pc->ds); lib3ds_vector_zero(pc->dd); return; } if (track->flags&LIB3DS_SMOOTH) { for (pl=track->keyL; pl->next->n...
false
false
false
false
false
0
globus_scheduler_event_generator_set_fault_handler( globus_scheduler_event_generator_fault_handler_t fault_handler, void * user_arg) { globus_result_t result = GLOBUS_SUCCESS; globus_mutex_lock(&globus_l_seg_mutex)...
false
false
false
false
false
0
compareVersions(int major1, int minor1, int major2, int minor2) const { if (major1 < major2) { return -1; } else if (major1 > major2) { return 1; } else if (minor1 < minor2) { return -1; } else if (minor1 > minor2) { return 1; } else { return 0; } ...
false
false
false
false
false
0
same_succ_hash (const_same_succ e) { hashval_t hashval = bitmap_hash (e->succs); int flags; unsigned int i; unsigned int first = bitmap_first_set_bit (e->bbs); basic_block bb = BASIC_BLOCK (first); int size = 0; gimple_stmt_iterator gsi; gimple stmt; tree arg; unsigned int s; bitmap_iterator bs; ...
false
false
false
false
false
0
SiS_WriteDAC(struct SiS_Private *SiS_Pr, SISIOADDRESS DACData, unsigned short shiftflag, unsigned short dl, unsigned short ah, unsigned short al, unsigned short dh) { unsigned short d1, d2, d3; switch(dl) { case 0: d1 = dh; d2 = ah; d3 = al; break; case 1: d1 = ah; d2 = al; d3 = dh; break; ...
false
false
false
false
false
0
evbuffer_copyout(struct evbuffer *buf, void *data_out, size_t datlen) { /*XXX fails badly on sendfile case. */ struct evbuffer_chain *chain; char *data = data_out; size_t nread; ev_ssize_t result = 0; EVBUFFER_LOCK(buf); chain = buf->first; if (datlen >= buf->total_len) datlen = buf->total_len; if (datle...
false
true
false
false
false
1
NetadrToSockadr (netadr_t *a, struct sockaddr_in *s) { memset (s, 0, sizeof(*s)); if (a->type == NA_BROADCAST) { s->sin_family = AF_INET; s->sin_port = a->port; *(int *)&s->sin_addr = -1; } else if (a->type == NA_IP) { s->sin_family = AF_INET; *(int *)&s->sin_addr = *(int *)&a->ip; ...
false
false
false
false
false
0
erbtree_foreach(erbtree_t *tree, data_fn_t cb, void *data) { erbtree_check(tree); /* * Since there is no tree modification during traversal, we can hardwire * the descent to be more efficient than the non-recursive traversal we * do in erbtree_foreach_remove(). */ if (tree->root != NULL) { struct erbtree...
false
false
false
false
false
0
update_link(link_id_t* link_id, link_t * link, gpointer delete_list_ptr) { double diffms; g_assert(delete_list_ptr); /* update stats - returns true if there are active packets */ if (traffic_stats_update(&link->link_stats, pref.averaging_time, pref.proto_link_timeout_time)) { ...
false
false
false
false
false
0
fs_tlist_next_value(fs_tlist *l, void *out) { if (!l) { fs_error(LOG_ERR, "cannot read from null list"); return 0; } int ret = read(l->fd, out, WIDTH); if (ret == -1) { fs_error(LOG_ERR, "error reading entry from list: %s\n", strerror(errno)); return 0; } else if (r...
false
true
false
false
true
1
__kernfs_setattr(struct kernfs_node *kn, const struct iattr *iattr) { struct kernfs_iattrs *attrs; struct iattr *iattrs; unsigned int ia_valid = iattr->ia_valid; attrs = kernfs_iattrs(kn); if (!attrs) return -ENOMEM; iattrs = &attrs->ia_iattr; if (ia_valid & ATTR_UID) iattrs->ia_uid = iattr->ia_uid; if (...
false
false
false
false
false
0
mul (const pol2& u, const pol2& v) { return pol2(u.c0*v.c0+u.c1*v.c1*a, u.c0*v.c1+u.c1*v.c0); }
false
false
false
false
false
0
format_match_fraction (char const *text, int *denlen, gboolean mixed_only) { char sign = 0; gnm_float whole, num, den, f; char const *start; gunichar uc; SKIP_SPACES (text); uc = g_utf8_get_char (text); DO_SIGN (sign, uc, { text = g_utf8_next_char (text); }); if (*text == 0 || !g_ascii_isdigit (*text)) ret...
false
false
false
false
false
0
set_kbd_clock_enable(Bit8u value) { bx_bool prev_kbd_clock_enabled; if (value==0) { BX_KEY_THIS s.kbd_controller.kbd_clock_enabled = 0; } else { /* is another byte waiting to be sent from the keyboard ? */ prev_kbd_clock_enabled = BX_KEY_THIS s.kbd_controller.kbd_clock_enabled; BX_KEY_THIS s.kb...
false
false
false
false
false
0
delete_disk(struct aac_dev *dev, void __user *arg) { struct aac_delete_disk dd; struct fsa_dev_info *fsa_dev_ptr; fsa_dev_ptr = dev->fsa_dev; if (!fsa_dev_ptr) return -EBUSY; if (copy_from_user(&dd, arg, sizeof (struct aac_delete_disk))) return -EFAULT; if (dd.cnum >= dev->maximum_num_containers) return ...
false
false
false
false
false
0
TrimTrailingZeros(char *str) { int len = strlen(str); while (len > 1 && *(str + len - 1) == '0' && *(str + len - 2) != '.') { len--; *(str + len) = '\0'; } }
false
false
false
false
false
0
HandleData(const char* aBuf, unsigned int aLen) { nsProbingState st; unsigned int i; char *newBuf1 = 0; unsigned int newLen1 = 0; //apply filter to original buffer, and we got new buffer back //depend on what script it is, we will feed them the new buffer //we got after applying proper filter //this i...
false
false
false
false
false
0
UpdateFileSize ( LFA_FileRef fileRef ) { if ( fileRef == 0 ) return false; XMP_Uns64 posCurrent = LFA_Seek ( fileRef, 0, SEEK_CUR ); XMP_Uns64 newSizeLE = MakeUns64LE ( LFA_Measure ( fileRef ) ); if ( this->posFileSizeInfo != 0 ) { LFA_Seek ( fileRef, this->posFileSizeInfo, SEEK_SET ); } else { // The p...
false
false
false
false
false
0
quantize_fs_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows) /* General case, with Floyd-Steinberg dithering */ { my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; register LOCFSERROR cur; /* current error or pixel value */ LOCFSERROR belowerr; /* e...
false
false
false
false
false
0
xml_processattrib( char *p, xml_attrib **ap, int *type ) { xml_attrib *a = NULL; char quote_character = '\"'; int inquotes = 0; newstr aname, aval; newstr_init( &aname ); newstr_init( &aval ); while ( *p && !xml_terminator(p,type) ) { /* get attribute name */ while ( *p==' ' || *p=='\t' ) p++; while ( *p &...
false
false
false
false
false
0
setResizeHandleCorners(ResizeCorners corners) { if ((d->resizeCorners != corners) && (aspectRatioMode() != FixedSize)) { d->resizeCorners = corners; d->updateResizeCorners(); } }
false
false
false
false
false
0
changeUrl( int index, const QIcon& icon, const KUrl& url ) { QComboBox::setItemIcon( index, icon ); QComboBox::setItemText( index, url.prettyUrl() ); }
false
false
false
false
false
0
IMAGE_get_pixel_format(GB_IMG *image) { if ((image->format == GB_IMAGE_RGBA) || (image->format == GB_IMAGE_RGBX)) return GL_RGBA; // is it good ? else if ((image->format == GB_IMAGE_BGRA) || (image->format == GB_IMAGE_BGRX)) return GL_BGRA; else if (image->format == GB_IMAGE_RGB) return GL_RGB; else if (imag...
false
false
false
false
false
0
gnucash_register_set_moved_cb (GnucashRegister *reg, GFunc cb, gpointer cb_data) { GnucashSheet *sheet; if (!reg || !reg->sheet) return; sheet = GNUCASH_SHEET(reg->sheet); sheet->moved_cb = cb; sheet->moved_cb_data = cb_data; }
false
false
false
false
false
0
WidgetActivated( Widget *widget, Window *win ) { switch ( widget->ID() ) { case B_ID_SFX: Audio::ToggleSfxState(); if ( Audio::GetSfxState() ) sfxvol->Enable(); else sfxvol->Disable(); break; case S_ID_VOL_SFX: Audio::SetSfxVolume( sfxvol->Level() ); break; case B_ID_MUSIC: Audio...
false
false
false
false
false
0
snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) { if (snac->subtype == 0x0002) return parsepopup(sess, mod, rx, snac, bs); return 0; }
false
false
false
false
false
0
ath10k_mem_value_read(struct file *file, char __user *user_buf, size_t count, loff_t *ppos) { struct ath10k *ar = file->private_data; u8 *buf; int ret; if (*ppos < 0) return -EINVAL; if (!count) return 0; mutex_lock(&ar->conf_mutex); buf = vmalloc(count); if (!buf) { ret = -ENOMEM; ...
false
false
false
false
false
0
goa_provider_factory_get_providers_finish (GoaProviderFactory *factory, GList **out_providers, GAsyncResult *result, GError **error) { GoaProviderFactoryCla...
false
false
false
true
false
1
debug_print_task (sc_gameref_t game, sc_int task) { const sc_prop_setref_t bundle = gs_get_bundle (game); sc_vartype_t vt_key[4]; sc_char buffer[32]; const sc_char *command; if_print_debug ("Task "); if (task < 0 || task >= gs_task_count (game)) { sprintf (buffer, "%ld ", task); if_print_de...
false
true
false
false
false
1
DtsSetProgressive( HANDLE hDevice, uint32_t resv1 ) { uint32_t RegVal; DTS_LIB_CONTEXT *Ctx = NULL; DTS_GET_CTX(hDevice,Ctx); if(Ctx->DevId != BC_PCI_DEVID_LINK && Ctx->DevId != BC_PCI_DEVID_DOZER) { return BC_STS_SUCCESS; } // Set the FPGA up in Progressive mode - i.e. 1 vsync/frame DtsFPGARegisterRe...
false
false
false
false
true
1
HeapProfilerInit() { // Everything after this point is for setting up the profiler based on envvar char fname[PATH_MAX]; if (!GetUniquePathFromEnv("HEAPPROFILE", fname)) { return; } // We do a uid check so we don't write out files in a setuid executable. #ifdef HAVE_GETEUID if (getuid() != geteuid()) { ...
false
false
false
false
false
0
genbank_in(fp) FILE_BUFFER fp; { char line[LINENUM], key[TOKENNUM] /*, temp[LINENUM]*/; const char *eof; char eoen; /* char *Fgetline(); */ /* char *genbank_one_entry_in(); */ /* char *genbank_source(), *genbank_reference(); */ /* char *genbank_comments(), ...
false
false
false
false
false
0
loose_guess_rtype(const char *full_path) { gitfo_buf ref_file = GITFO_BUF_INIT; git_rtype type; type = GIT_REF_INVALID; if (gitfo_read_file(&ref_file, full_path) == GIT_SUCCESS) { if (git__prefixcmp((const char *)(ref_file.data), GIT_SYMREF) == 0) type = GIT_REF_SYMBOLIC; else type = GIT_REF_OID; } g...
false
false
false
false
false
0
rsync_transport_push(struct transport *transport, int refspec_nr, const char **refspec, int flags) { struct strbuf buf = STRBUF_INIT, temp_dir = STRBUF_INIT; int result = 0, i; struct child_process rsync; const char *args[10]; if (flags & TRANSPORT_PUSH_MIRROR) return error("rsync transport does not support m...
false
false
false
false
false
0
unparse_something (int num, const struct units *units, char *s, size_t len, int (*print) (char *, size_t, int, const char *, int), int (*update) (int, unsigned), const char *zero_string) { const struct units *u; int ret = 0, tmp; if (num == 0) return snprintf (s, len, "%s", zero_string); ...
false
false
false
false
false
0
knot_dnssec_sign_new(knot_dnssec_sign_context_t *context) { if (!context) { return KNOT_EINVAL; } destroy_digest_context(&context->digest_context); return create_digest_context(context->key, &context->digest_context); }
false
false
false
false
false
0
__grant_blocked_entry_locks (xlator_t *this, pl_inode_t *pl_inode, pl_dom_list_t *dom, struct list_head *granted) { int bl_ret = 0; pl_entry_lock_t *bl = NULL; pl_entry_lock_t *tmp = NULL; struct list_head blocked_list; INIT_LIST_HEA...
false
false
false
false
false
0
sge_stramemncpy(const char *cp, char **cpp, int n) { while (*cpp) { if (!memcmp(*cpp, cp, n)) { return cpp; } cpp++; } return NULL; }
false
false
false
false
false
0
PyVTKMutableObject_CompatibleObject(PyObject *opn) { PyNumberMethods *nb = opn->ob_type->tp_as_number; if (PyFloat_Check(opn) || PyLong_Check(opn) || PyInt_Check(opn) || #ifdef Py_USING_UNICODE PyUnicode_Check(opn) || #endif PyString_Check(opn)) { Py_INCREF(opn); } else if (Py...
false
false
false
false
false
0
sc_for_req_method_by_id(request_rec *r) { int method_id = r->method_number; if (method_id < 0 || method_id > M_INVALID) { return UNKNOWN_METHOD; } else if (r->header_only) { return SC_M_HEAD; } else { return sc_for_req_method_table[method_id] ? sc_for_req_m...
false
false
false
false
false
0
FcParsePriority (FcConfigParse *parse) { FcVStack *v; FcObject *priority_order; int n; int i; n = FcVStackElements (parse); priority_order = (FcObject *) malloc (n * sizeof (FcObject *)); if (priority_order == NULL) { FcConfigMessage (parse, FcSevereError, "out of memory"); } else { ...
false
false
false
false
false
0
on_unstaged_motion (GtkWidget *widget, GdkEventMotion *event, GitgCommitView *view) { if (column_icon_test (view->priv->tree_view_unstaged, event->x, event->y, NULL)) { gdk_window_set_cursor (gtk_widget...
false
false
false
false
false
0
process_debug_options(char *arg) { const char *p; char *token_context = NULL; const char delimiters[] = ","; boolean empty = true; size_t i; p = strtok_r(arg, delimiters, &token_context); while (p) { empty = false; for (i=0; i<N_DEBUGASSOC; ++i) { if (0 == strcmp(debugassoc[i].name...
false
false
false
false
false
0
PKIX_PL_CollectionCertStore_Create( PKIX_PL_String *storeDir, PKIX_CertStore **pCertStore, void *plContext) { PKIX_PL_CollectionCertStoreContext *colCertStoreContext = NULL; PKIX_CertStore *certStore = NULL; PKIX_ENTER(CERTSTORE, "PKIX_PL_CollectionCertStore_Create"); ...
false
false
false
false
false
0
bam_circbuf_create_staged(const int size) { bam_circbuf * cbuf = bam_circbuf_create(size); if(cbuf == NULL) return NULL; cbuf->stage = malloc(size); if(cbuf->stage == NULL) { bam_circbuf_destroy(&cbuf); return NULL; } return cbuf; }
false
false
false
false
false
0
g15daemon_cfg_write_string(config_section_t *section, char *key, char *val){ config_items_t *new = NULL; if(section==NULL) return -1; if((uf_search_confitem(section, key))){ free(new); new=uf_search_confitem(section, key); new->value=strdup(val); }else{ ...
false
false
false
false
false
0
ValidateBlowfish() { cout << "\nBlowfish validation suite running...\n\n"; HexEncoder output(new FileSink(cout)); const char *key[]={"abcdefghijklmnopqrstuvwxyz", "Who is John Galt?"}; byte *plain[]={(byte *)"BLOWFISH", (byte *)"\xfe\xdc\xba\x98\x76\x54\x32\x10"}; byte *cipher[]={(byte *)"\x32\x4e\xd0\xfe\xf4\x13...
false
false
false
false
false
0
sync_slaves(struct link_master *master, int old_val, int new_val) { struct link_slave *slave; struct snd_ctl_elem_value *uval; uval = kmalloc(sizeof(*uval), GFP_KERNEL); if (!uval) return -ENOMEM; list_for_each_entry(slave, &master->slaves, list) { master->val = old_val; uval->id = slave->slave.id; slave_...
false
false
false
false
false
0
xen_find_pfn_range(unsigned long *min_pfn) { const struct e820entry *entry = xen_e820_map; unsigned int i; unsigned long done = 0; for (i = 0; i < xen_e820_map_entries; i++, entry++) { unsigned long s_pfn; unsigned long e_pfn; if (entry->type != E820_RAM) continue; e_pfn = PFN_DOWN(entry->addr + entry...
false
false
false
false
false
0
do_truncate (GVfsBackend *backend, GVfsJobTruncate *job, GVfsBackendHandle _handle, goffset size) { GError *error; GFileOutputStream *stream = _handle; g_print ("(II) truncate (handle = '%lx', size = %ld) \n", (long int)_handle, (long int)size); g_assert (stream != NULL)...
false
false
false
false
false
0
mtdchar_readoob(struct file *file, struct mtd_info *mtd, uint64_t start, uint32_t length, void __user *ptr, uint32_t __user *retp) { struct mtd_file_info *mfi = file->private_data; struct mtd_oob_ops ops; int ret = 0; if (length > 4096) return -EINVAL; if (!access_ok(VERIFY_WRITE, ptr, length)) return -EFA...
false
false
false
false
false
0
mkd_line(char *bfr, int size, char **res, int flags) { MMIOT f; int len; mkd_parse_line(bfr, size, &f, flags); if ( len = S(f.out) ) { /* kludge alert; we know that T(f.out) is malloced memory, * so we can just steal it away. This is awful -- there * should be an opaque method that transpa...
false
false
false
false
false
0
excel_read_SST (BiffQuery *q, GnmXLImporter *importer) { guint32 offset; unsigned i; XL_CHECK_CONDITION (q->length >= 8); d (4, { g_printerr ("SST total = %u, sst = %u\n", GSF_LE_GET_GUINT32 (q->data + 0), GSF_LE_GET_GUINT32 (q->data + 4)); gsf_mem_dump (q->data, q->length); }); importer...
false
false
false
false
false
0
R_DrawColumnInCache(column_t * patch, byte * cache, int originy, int cacheheight) { int count, position; byte *source; while (patch->topdelta != 0xff) { source = (byte *) patch + 3; count = patch->length; position = originy + patch->topdelta; if ...
false
false
false
false
false
0
colorMessCallback(void *data, t_symbol *, int argc, t_atom *argv) { float alpha = 1; switch(argc) { case(4): alpha = atom_getfloat(&argv[3]); case(3): GetMyClass(data)->colorMess(atom_getfloat(&argv[0]), atom_getfloat(&argv[1]), atom_getfloat(&argv[2]), alpha); break...
false
false
false
false
false
0
bcTruelen(BpChar *arg) { char *s = VARDATA(arg); int i; int len; len = VARSIZE(arg) - VARHDRSZ; for (i = len - 1; i >= 0; i--) { if (s[i] != ' ') break; } return i + 1; }
false
false
false
false
false
0
cz_send_msg_to_smc(struct amdgpu_device *adev, u16 msg) { int i; u32 content = 0, tmp = 0; if (cz_send_msg_to_smc_async(adev, msg)) return -EINVAL; for (i = 0; i < adev->usec_timeout; i++) { tmp = REG_GET_FIELD(RREG32(mmSMU_MP1_SRBM2P_RESP_0), SMU_MP1_SRBM2P_RESP_0, CONTENT); if (content != tmp) brea...
false
false
false
false
false
0
_PLfuse_releasedir(const char *file, struct fuse_file_info *fi) { int rv; FUSE_CONTEXT_PRE; DEBUGf("releasedir begin\n"); ENTER; SAVETMPS; PUSHMARK(SP); XPUSHs(file ? sv_2mortal(newSVpv(file,0)) : &PL_sv_undef); XPUSHs(FH_GETHANDLE(fi)); PUTBACK; rv = call_sv(MY_CXT.callback[27], G_SCALAR); SPAGAIN; rv = (r...
false
false
false
false
false
0
gsb_bank_list_set_bank ( GtkWidget *combobox, gint bank_number, gint number_for_func ) { GtkTreeIter iter; if (!combobox) return FALSE; if (!gtk_tree_model_get_iter_first ( GTK_TREE_MODEL (bank_list_model), &iter )) return FALSE; /* Block hook a...
false
false
false
false
false
0
gnc_search_dialog_close_cb (GtkDialog *dialog, GNCSearchWindow *sw) { g_return_val_if_fail (sw, TRUE); /* Unregister callback on book option changes originally registered * if searching for splits */ if (strcmp (sw->search_for, GNC_ID_SPLIT) == 0) gnc_book_option_remove_cb(OPTION_NAME_NUM_FIEL...
false
false
false
false
false
0
ast_get_txt(struct ast_channel *chan, const char *number, char *txt, int txtlen, char *suffix) { struct txt_context context; char tmp[259 + 512]; int pos = strlen(number) - 1; int newpos = 0; int ret = -1; ast_debug(4, "ast_get_txt: Number = '%s', suffix = '%s'\n", number, suffix); if (chan && ast_autoservice_...
true
true
false
false
false
1
gnc_split_register_get_vnotes_entry (VirtualLocation virt_loc, gboolean translate, gboolean *conditionally_changed, gpointer user_data) { SplitRegister *reg = user_data; Transaction *trans; Split *...
false
false
false
false
false
0
pci_check_pme_status(struct pci_dev *dev) { int pmcsr_pos; u16 pmcsr; bool ret = false; if (!dev->pm_cap) return false; pmcsr_pos = dev->pm_cap + PCI_PM_CTRL; pci_read_config_word(dev, pmcsr_pos, &pmcsr); if (!(pmcsr & PCI_PM_CTRL_PME_STATUS)) return false; /* Clear PME status. */ pmcsr |= PCI_PM_CTRL_P...
false
false
false
false
false
0
intel_fbc_cleanup_cfb(struct drm_i915_private *dev_priv) { struct intel_fbc *fbc = &dev_priv->fbc; if (!fbc_supported(dev_priv)) return; mutex_lock(&fbc->lock); __intel_fbc_cleanup_cfb(dev_priv); mutex_unlock(&fbc->lock); }
false
false
false
false
false
0
A_SendSMSMessage(gpointer data) { D_SMSMessage *d = (D_SMSMessage *) data; gn_error error = GN_ERR_UNKNOWN; gn_data gdat; if (!d) return error; gn_data_clear(&gdat); gdat.sms = d->sms; pthread_mutex_lock(&sendSMSMutex); error = d->status = gn_sms_send(&gdat, statemachine); /* we do not use sms reference n...
false
false
false
false
false
0
GMT_corrcoeff (double *x, double *y, GMT_LONG n, GMT_LONG mode) { /* Returns plain correlation coefficient, r. * If mode = 1 we assume mean(x) = mean(y) = 0. */ GMT_LONG i, n_use; double xmean = 0.0, ymean = 0.0, dx, dy, vx, vy, vxy, r; if (mode == 0) { for (i = n_use = 0; i < n; i++) { if (GMT_is_dnan (...
false
false
false
false
false
0
printFile(raw_ostream &O, StringRef Filename, StringRef Directory, unsigned Line = 0) { if (Filename.empty()) return; O << " from "; if (!Directory.empty()) O << Directory << "/"; O << Filename; if (Line) O << ":" << Line; }
false
false
false
false
false
0
evd_dbus_agent_on_object_connection_closed (GDBusConnection *conn, gboolean remote_peer_vanished, GError *error, gpointer user_data) { ObjectData *data = (Object...
false
false
false
false
false
0
PolyInt_Origin(int n_verts, Point3 *verts, Point3 *origin) { int bi, ci; float pz = 0, pw; /* Find the first vertex different from the 0th vertex */ for (bi = 0; bi < n_verts && !memcmp(&verts[0], &verts[bi], sizeof(Point3)); bi++); if (bi >= n_verts) { Pt3Copy(&verts[0], origin); return 0; ...
false
false
false
false
false
0
cb_dialog_so_size_name_changed (GtkEntry *entry, GdkEventFocus *event, SOSizeState *state) { char const *name = gtk_entry_get_text (entry); if (name == NULL) name = ""; state->so_name_changed = (strcmp (name, state->old_name) != 0); dialog_so_size_button_sensitivity (state); return FALSE; }
false
false
false
false
false
0
ToObject(Context* global_context) { if (IsNumber()) { return CreateJSValue(global_context->number_function(), this); } else if (IsBoolean()) { return CreateJSValue(global_context->boolean_function(), this); } else if (IsString()) { return CreateJSValue(global_context->string_function(), this); } A...
false
false
false
false
false
0
dot_init_edge(edge_t * e) { char *tailgroup, *headgroup; common_init_edge(e); ED_weight(e) = late_double(e, E_weight, 1.0, 0.0); tailgroup = late_string(agtail(e), N_group, ""); headgroup = late_string(aghead(e), N_group, ""); ED_count(e) = ED_xpenalty(e) = 1; /* FIX: does new ranking and m...
false
false
false
false
false
0
make_new_name_gunzip(char *filename, const char *expected_ext UNUSED_PARAM) { char *extension = strrchr(filename, '.'); if (!extension) return NULL; extension++; if (strcmp(extension, "tgz" + 1) == 0 #if ENABLE_FEATURE_SEAMLESS_Z || (extension[0] == 'Z' && extension[1] == '\0') #endif ) { extension[-1] = '...
false
false
false
false
false
0
_unpack_license_info_msg(license_info_msg_t **msg, Buf buffer, uint16_t protocol_version) { int i; uint32_t zz; xassert(msg != NULL); *msg = xmalloc(sizeof(license_info_msg_t)); /* load buffer's header (data structure version and time) */ if (protocol_version ...
false
false
false
false
false
0
UT_go_url_simplify (const char *uri) { char *simp, *p; g_return_val_if_fail (uri != NULL, NULL); if (g_ascii_strncasecmp (uri, "file:///", 8) == 0) { char *filename = UT_go_filename_from_uri (uri); simp = filename ? UT_go_filename_to_uri (filename) : NULL; g_free (filename); return simp; } if (g_ascii_s...
false
false
false
false
false
0
get_random_binary_data(void) { int len; bin_data *ret; len = get_random_int_in_range(20, 100); ret = g_new(bin_data, 1); ret->data = g_new(guchar, len); ret->len = len; for (len--; len >= 0; len--) { ret->data[len] = (guchar)get_random_int_in_range(0, 255); } return re...
false
false
false
false
false
0
AlterTableNamespace(RangeVar *relation, const char *newschema, ObjectType stmttype, LOCKMODE lockmode) { Relation rel; Oid relid; Oid oldNspOid; Oid nspOid; Relation classRel; rel = relation_openrv(relation, lockmode); relid = RelationGetRelid(rel); oldNspOid = RelationGetNamespace(rel); ...
false
false
false
false
false
0
pnginput_get_scanline( pnginput_t *pnginput, int num ) { uint8_t *in = png_get_rows( pnginput->png_ptr, pnginput->info_ptr )[ num ]; if( pnginput->channels == 1 ) { int w = pnginput_get_width( pnginput ); uint8_t *cur = pnginput->inscanline; while( w-- ) { *cur++ = *in; ...
false
false
false
false
false
0
WriteMolecule(OBBase* pOb, OBConversion* pConv) { OBMol* pmol = dynamic_cast<OBMol*>(pOb); if(pmol==NULL) return false; //Define some references so we can use the old parameter names ostream &ofs = *pConv->GetOutStream(); OBMol &mol = *pmol; // unsigned int i; char buffer[BUFF_S...
false
false
false
false
false
0
mlx5e_dma_unmap_wqe_err(struct mlx5e_sq *sq, struct sk_buff *skb) { int i; for (i = 0; i < MLX5E_TX_SKB_CB(skb)->num_dma; i++) { struct mlx5e_sq_dma *last_pushed_dma = mlx5e_dma_get(sq, --sq->dma_fifo_pc); mlx5e_tx_dma_unmap(sq->pdev, last_pushed_dma); } }
false
false
false
false
false
0
list_to_vec(ikptr x){ int n = list_length(x); char** vec = malloc((n+1) * sizeof(char*)); if (vec == NULL) exit(-1); int i; for(i=0; i<n; i++){ vec[i] = (char*)(long)ref(x, off_car) + off_bytevector_data; x = ref(x, off_cdr); } vec[n] = 0; return vec; }
false
false
false
false
false
0
DrawPoint(wxDC & dc, const wxRect & r, int x, int y, bool top) { if (y >= 0 && y <= r.height) { wxRect circle(r.x + x, r.y + (top ? y - 1: y - 2), 4, 4); dc.DrawEllipse(circle); } }
false
false
false
false
false
0
burn_disc(DvdRwDevice *self) { gint status; char *burn_argv[] = {NULL, "-use-the-force-luke", "-Z", self->dvdrw_device, "-J", "-R", "-pad", "-quiet", self->cache_dir, NULL}; if (self->growisofs_command == NULL) { burn_argv[0] = "growisofs"; } else { burn_argv[0] = self->growisofs_command; } ...
false
false
false
false
false
0
modify_view_get_current_filter(struct modify_view *mv) { GtkTreeSelection *selection = gtk_tree_view_get_selection(mv->filter_view); GtkTreeIter iter; seaudit_filter_t *filter; if (!gtk_tree_selection_get_selected(selection, NULL, &iter)) { return NULL; } gtk_tree_model_get(GTK_TREE_MODEL(mv->filter_store), &it...
false
false
false
false
false
0
doHyperaktiv(const SDL_keysym & key, int taste) { switch (taste) { case SDLK_RIGHT: doPfeil(1); break; case SDLK_LEFT: doPfeil(-1); break; default: MenuEintragSubmenu::doHyperaktiv(key,taste); break; } }
false
false
false
false
false
0
tree_solve_multi(S,B,x,rk) struct linsys *S; /* factored system */ REAL **B; /* incoming right hand side */ REAL **x; /* solution, may be rhs */ int rk; /* number of right sides */ { int k; for ( k = 0 ; k < rk ; k++ ) tree_solve(S,B[k],x[k]); }
false
false
false
false
false
0
NamespaceCreate(const char *nspName, Oid ownerId) { Relation nspdesc; HeapTuple tup; Oid nspoid; bool nulls[Natts_pg_namespace]; Datum values[Natts_pg_namespace]; NameData nname; TupleDesc tupDesc; int i; /* sanity checks */ if (!nspName) elog(ERROR, "no namespace name supplied"); /* make sure ther...
false
false
false
false
false
0
vwp_pollspace(struct vwp *vwp, unsigned fd) { struct pollfd *newpollfd = vwp->pollfd; unsigned newnpoll; if (fd < vwp->npoll) return; newnpoll = vwp->npoll; if (newnpoll == 0) newnpoll = 1; while (fd >= newnpoll) newnpoll = newnpoll * 2; VSL(SLT_Debug, 0, "Acceptor poll space increased to %u", newnpoll); ...
false
false
false
true
false
1
CreateAnimated(size_t index) { float* _values[4] = { &values[index].x, &values[index].y, &values[index].z, &values[index].w }; return new FCDAnimated((FCDObject*) GetParent(), 4, FCDAnimatedStandardQualifiers::XYZW, _values); }
false
false
false
false
false
0
existingEdge(VertInf *i, VertInf *j) { VertInf *selected = NULL; // Look through poly-line visibility edges. selected = (i->visListSize <= j->visListSize) ? i : j; EdgeInfList& visList = selected->visList; EdgeInfList::const_iterator finish = visList.end(); for (EdgeInfList::const_iterator edge...
false
false
false
false
false
0
e_update_init(void) { if (ecore_con_url_init()) { handlers = eina_list_append (handlers, ecore_event_handler_add (ECORE_CON_EVENT_URL_DATA, _upload_data_cb, NULL)); handlers = eina_list_append (handlers, ecore_event_handler_add (ECORE_CON_EVENT_URL...
false
false
false
false
false
0
FindFontName(FState *fs, unichar_t *name, enum font_type *ft) { int ch; struct font_name *fn; extern struct fontabbrev _gdraw_fontabbrev[]; int i; ch = *name; if ( isupper(ch)) ch = tolower(ch); if ( ch<'a' ) ch = 'q'; else if ( ch>'z' ) ch='z'; ch -= 'a'; for ( fn = fs->font_names...
false
false
false
false
false
0
render_string(char *result, int maxlen) { assert(maxlen); maxlen--; int Len = MIN(len, maxlen); if (Len) Len--; memcpy(result, string, Len); result[Len]=0; }
false
false
false
false
false
0
mark_life (regno, mode, life) int regno; enum machine_mode mode; int life; { int j = HARD_REGNO_NREGS (regno, mode); if (life) while (--j >= 0) SET_HARD_REG_BIT (regs_live, regno + j); else while (--j >= 0) CLEAR_HARD_REG_BIT (regs_live, regno + j); }
false
false
false
false
false
0