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
onPaint(FXObject*,FXSelector,void* ptr){ FXEvent *ev=(FXEvent*)ptr; FXDCWindow dc(canvas,ev); dc.setForeground(canvas->getBackColor()); dc.fillRectangle(ev->rect.x,ev->rect.y,ev->rect.w,ev->rect.h); return 1; }
false
false
false
false
false
0
execute( Chuck_VM * vm, Chuck_VM_Shred * shred ) { // reg stack pointer t_CKUINT *& sp = (t_CKUINT *&)shred->reg->sp; // UNUSED: t_CKUINT *& reg_sp = sp; t_CKINT i = 0; t_CKUINT val = 0; t_CKFLOAT fval = 0; // pop pop_( sp, 2 ); // check pointer if( !(*sp) ) goto null_pointer; ...
false
false
false
false
false
0
fs_exists(Vfs_handle *handle, char *key) { int st; char *path; path = getpath(handle, key); if ((st = access(path, R_OK)) == -1) { if (errno == ENOENT) return(0); handle->error_num = errno; handle->error_msg = strdup(strerror(errno)); free(path); return(-1); } free(path); return(1); }
false
false
false
false
false
0
hmm_Q0(const hmm_par_t *hp, hmm_exp_t *he) { int k, l, b; FLOAT sum = 0.0; for (k = 0; k != hp->n; ++k) { FLOAT tmp; for (b = 0, tmp = 0.0; b != hp->m; ++b) tmp += he->E[b][k]; for (b = 0; b != hp->m; ++b) sum += he->E[b][k] * log(he->E[b][k] / tmp); } for (k = 0; k != hp->n; ++k) { FLOAT tmp, *A = he->...
false
false
false
false
false
0
set(const char* name, const void* v){ int found = 0; for(unsigned int i=0; i<n && !found; i++){ if(strcmp(name, p[i]->fullname()) == 0 || strcmp(name, p[i]->shrtname()) == 0){ p[i]->value(v); found = 1; } } return found ? 0 : -1; }
false
false
false
false
false
0
load_cmdrow(const XmlNode *node, gpointer user) { CmdSeq *cs = user; CmdRow *row; const XmlNode *data; CRType type = CRTP_BUILTIN; const gchar *def = NULL, *tname = NULL; guint32 flags = 0UL; if(xml_get_text(node, "type", &tname)) type = csq_cmdrow_string_to_type(tname); xml_get_text(node, "def", &def); ...
false
false
false
false
false
0
nokia_isi_isi_unsolicited_handler_onRegistrationStatusUpdate (NokiaIsiIsiUnsolicitedHandler* self, GIsiCommNetworkISI_RegStatus* istatus) { GIsiCommNetworkISI_RegStatus _tmp0_ = {0}; guint8 _tmp1_ = 0; const gchar* _tmp2_ = NULL; gchar* _tmp3_ = NULL; gchar* _tmp4_ = NULL; GIsiCommNetworkISI_RegStatus _tmp5_ = {0...
false
false
false
false
false
0
mlx4_free_ownership(struct mlx4_dev *dev) { void __iomem *owner; if (pci_channel_offline(dev->persist->pdev)) return; owner = ioremap(pci_resource_start(dev->persist->pdev, 0) + MLX4_OWNER_BASE, MLX4_OWNER_SIZE); if (!owner) { mlx4_err(dev, "Failed to obtain ownership bit\n"); return; } writel(0, ow...
false
false
false
false
false
0
updateParents() { QList<ContactListItem*> items(items_); for (int i = 0; i < items.size(); ++i) { items.at(i)->updateParents(); } updateParent(); }
false
false
false
false
false
0
super_init(PyObject *self, PyObject *args, PyObject *kwds) { superobject *su = (superobject *)self; PyTypeObject *type; PyObject *obj = NULL; PyTypeObject *obj_type = NULL; if (!_PyArg_NoKeywords("super", kwds)) return -1; if (!PyArg_ParseTuple(args, "O!|O:super", &PyType_Type, &type, &...
false
false
false
false
false
0
_e_winlist_deactivate(void) { E_Winlist_Win *ww; if (!_win_selected) return; ww = _win_selected->data; if (ww->was_shaded) { if (!ww->border->lock_user_shade) e_border_shade(ww->border, ww->border->shade.dir); } if (ww->was_iconified) { if (!ww->border->lock_user...
false
false
false
false
false
0
print_progress(const char *filename, ulong current) { int n, progress; time_t tm; struct node_table *nt; static time_t last_time = 0; static ulong total_pages = 0; if (!total_pages) { for (n = 0; n < vt->numnodes; n++) { nt = &vt->node_table[n]; tot...
false
false
false
false
false
0
rmconn( struct CONN * prev_ring ) /* removes from the linked-list and deallocates a connection * prev_ring */ { struct CONN * curr = prev_ring->next; struct CONN * conn; prev_ring->next = curr->next; if( curr->next == NULL ) last_conn = prev_ring; free_desc( &(curr->client), 1, curr); if (flags.writer.ty...
false
false
false
false
false
0
xen_hyper_cmd_domain(void) { struct xen_hyper_cmd_args da; struct xen_hyper_domain_context *dc; ulong val; int c, cnt, type, bogus; BZERO(&da, sizeof(struct xen_hyper_cmd_args)); while ((c = getopt(argcnt, args, "")) != EOF) { switch(c) { default: ...
false
true
false
false
true
1
init_tty_driver(struct pine *ps) { #ifdef MOUSE if(F_ON(F_ENABLE_MOUSE, ps_global)) init_mouse(); #endif /* MOUSE */ /* turn off talk permission by default */ if(F_ON(F_ALLOW_TALK, ps)) allow_talk(ps); else disallow_talk(ps); return(PineRaw(1)); }
false
false
false
false
false
0
fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct fsl_ssi_private *ssi_private = snd_soc_dai_get_drvdata(rtd->cpu_dai); struct regmap *regs = ssi_private->regs; switch (cmd) { case SNDRV_PCM_TRIGGER_STAR...
false
false
false
false
false
0
xgpio_index(struct xgpio_instance *chip, int gpio) { if (gpio >= chip->gpio_width[0]) return 1; return 0; }
false
false
false
false
false
0
cs_house (double *x, double *beta, csi n) { double s, sigma = 0 ; csi i ; if (!x || !beta) return (-1) ; /* check inputs */ for (i = 1 ; i < n ; i++) sigma += x [i] * x [i] ; if (sigma == 0) { s = fabs (x [0]) ; /* s = |x(0)| */ (*beta) = (x [0] <= 0) ? ...
false
false
false
false
false
0
brasero_dvd_author_read_stderr (BraseroProcess *process, const gchar *line) { gint percent = 0; if (sscanf (line, "STAT: fixing VOBU at %*s (%*d/%*d, %d%%)", &percent) == 1) { brasero_job_start_progress (BRASERO_JOB (process), FALSE); brasero_job_set_progress (BRASERO_JOB (process), (gdouble) ((gdoubl...
false
false
false
false
false
0
maybe_convert_old_settings (GSettings *settings) { GVariant *sources; gchar **options; gchar *stamp_dir_path = NULL; gchar *stamp_file_path = NULL; GError *error = NULL; stamp_dir_path = g_build_filename (g_get_user_data_dir (), PACKAGE_NAME, NULL); if (g_mkdir_w...
false
false
false
false
false
0
log_in_clicked (GtkWidget *button, gpointer user_data) { BishoPaneFlickr *pane = BISHO_PANE_FLICKR (user_data); BishoPaneFlickrPrivate *priv = pane->priv; char *frob, *url; RestProxyCall *call; RestXmlNode *root; update_widgets (pane, WORKING); call = rest_proxy_new_call (priv->proxy); rest_proxy_call...
false
false
false
false
false
0
slurmdb_pack_step_rec(slurmdb_step_rec_t *step, uint16_t rpc_version, Buf buffer) { if (rpc_version >= SLURMDBD_2_5_VERSION) { pack32(step->elapsed, buffer); pack_time(step->end, buffer); pack32((uint32_t)step->exitcode, buffer); /* the job_ptr is set up on the client side so does * not need to be pac...
false
false
false
false
false
0
do_calloc(size_t n, size_t elem_size) { // Overflow check const size_t size = n * elem_size; if (elem_size != 0 && size / elem_size != n) return NULL; void* result = do_malloc_no_errno_or_cpp_alloc(size); if (result == NULL) { errno = ENOMEM; } else { memset(result, 0, size); } return result; }
false
false
false
false
false
0
yaws_sendfile_drv_start(ErlDrvPort port, char* buf) { Desc* d = (Desc*)driver_alloc(sizeof(Desc)); if (d == NULL) return (ErlDrvData) -1; d->port = port; d->xfer_table = create_hashtable(8192, fdhash, fdeq); if (d->xfer_table == NULL) { driver_free(d); return (ErlDrvData) -1; } ...
false
false
false
false
false
0
checkForTwoFollowingSemicolons() { if (BinaryFormat) return true; for (u32 k=0; k<2; ++k) { if (getNextToken() != ";") { --P; return false; } } return true; }
false
false
false
false
false
0
simplify(void) const { Polygon simplified = *this; std::vector<Point>::iterator it = simplified.ps.begin(); if (it != simplified.ps.end()) ++it; // Combine collinear line segments into single segments: for (size_t j = 2; j < simplified.size(); ) { if (vecDir(simplified.ps[j - 2], simpli...
false
false
false
false
false
0
hdrvc_get_channel_access_param(struct hdrvc_channel_params *par) { struct hdlcdrv_ioctl hi; int ret; struct usersmmsg msg; #ifdef HDRVC_KERNEL if (kernel_mode) { if ((ret = hdrvc_hdlcdrv_ioctl(HDLCDRVCTL_GETCHANNELPAR, &hi)) < 0) return ret; if (!par) { errno = EINVAL; return -1; } par->tx_delay =...
false
false
false
false
false
0
closeAll() { while (!bstore.empty()) release(bstore.front()); }
false
false
false
false
false
0
withoutDuplicate( int position, const Meta::TrackList& playlist, const Dynamic::TrackSet& oldSet ) { Dynamic::TrackSet result = Dynamic::TrackSet( oldSet ); for( int i = 0; i < playlist.count(); i++ ) if( i != position && playlist[i] ) result.subtract( playlist[...
false
false
false
false
false
0
xdl_recs_copy(xdfenv_t *xe, int i, int count, int add_nl, char *dest) { xrecord_t **recs = xe->xdf2.recs + i; int size = 0; if (count < 1) return 0; for (i = 0; i < count; size += recs[i++]->size) if (dest) memcpy(dest + size, recs[i]->ptr, recs[i]->size); if (add_nl) { i = recs[count - 1]->size; if (...
false
false
false
false
false
0
profile_remove_node(struct profile_node *node) { CHECK_MAGIC(node); if (node->parent == 0) return PROF_EINVAL; /* Can't remove the root! */ node->deleted = 1; return 0; }
false
false
false
false
false
0
pop( int idx ) { if ( idx < 0 || idx >= Arrays.size() ) Arrays.pop_back(); else Arrays.removeAt(idx); }
false
false
false
false
false
0
visitClassDefStart(const ClassDefPtr& p) { string scoped = fixKwd(p->scoped()); C << sp; C << nl << "#ifndef ICEE_PURE_CLIENT"; C << nl << "::Ice::Object* IceInternal::upCast(" << scoped << "* p) { return p; }"; C << nl << "#endif // ICEE_PURE_CLIENT"; C << nl << "::IceProxy::Ice::Object* I...
false
false
false
false
false
0
is_depayloader (GstElementFactory *factory) { const gchar *klass = gst_element_factory_get_klass (factory); return (klass_contains (klass, "Network") && (klass_contains (klass, "Depayloader") || klass_contains (klass, "Depayr"))); }
false
false
false
false
false
0
tcp_accept(worker_t *worker) { apr_status_t status = APR_SUCCESS; worker_log(worker, LOG_DEBUG, "--- accept"); if (!worker->listener) { worker_log(worker, LOG_ERR, "Server down"); return APR_EGENERAL; } if ((status = apr_socket_accept(&worker->socket->socket, worker->listener, ...
false
false
false
false
false
0
g_arrowline(double x2, double y2, int flag, int can_fillpath) throw(ParserError) { double x1,y1; GLECore* core = g_get_core(); if (core->isComputingLength()) { core->addToLength(g_get_xy().distance(GLEPoint(x2, y2))); } GLEWithoutUpdates noUpdates; if ((flag & 3) == 0) { g_line(x2,y2); return; } g_get_xy(...
false
false
false
false
false
0
getdigit(sxlongreal *val, int *cnt) { sxlongreal d; int digit; if( (*cnt)++ >= 16 ){ return '0'; } digit = (int)*val; d = digit; *val = (*val - d)*10.0; return digit + '0' ; }
false
false
false
false
false
0
find_entry(const UniqueString& name) { StyleAttributeTableEntry* e; if (table_ != nil) { /* avoid && to workaround cfront bug */ if (table_->find(e, name)) { return e; } } return nil; }
false
false
false
false
false
0
ms_escher_opt_add_bool (GString *buf, gsize marker, guint16 pid, gboolean b) { int N = ms_escher_get_inst (buf, marker); guint16 gid = pid | 0xf; guint8 shift = gid - pid; guint32 val = (b ? 0x00010001 : 0x00010000) << shift; if (N > 0 && GSF_LE_GET_GUINT16 (buf->str + buf->len - 6) == gid) { val |= GSF_LE_G...
false
false
false
false
false
0
print_version() { struct jpeg_error_mgr jcerr, *err; printf(PROGRAMNAME " v%s %s\n",VERSIO,HOST_TYPE); printf(COPYRIGHT "\n"); if (!(err=jpeg_std_error(&jcerr))) fatal("jpeg_std_error() failed"); printf("\nlibjpeg version: %s\n%s\n", err->jpeg_message_table[JMSG_VERSION], err->jpeg_message_tab...
false
false
false
true
false
1
atl1e_clean_rx_ring(struct atl1e_adapter *adapter) { struct atl1e_rx_ring *rx_ring = (struct atl1e_rx_ring *)&adapter->rx_ring; struct atl1e_rx_page_desc *rx_page_desc = &rx_ring->rx_page_desc; u16 j; if (adapter->ring_vir_addr == NULL) return; /* Zero out the descriptor ring */ for (j = 0; j < AT_PAGE_NUM_...
false
false
false
false
false
0
gdm_wait_on_and_disown_pid (int pid, int timeout) { int status; int ret; int num_tries; int flags; gboolean already_reaped; if (timeout > 0) { flags = WNOHANG; num_tries = 10 * timeout; } else { ...
false
false
false
false
false
0
mf_puttext(VPoint vp, char *s, int len, int font, TextMatrix *tm, int underline, int overline, int kerning) { int i; mf_setpen(); fprintf(prstream, "PutText {\n"); fprintf(prstream, "\t( %.4f , %.4f )\n", vp.x, vp.y); fprintf(prstream, "\t %d %.4f %.4f %.4f %.4f %d %d %d %d \"", ...
false
false
false
false
false
0
tei_assign_req(struct FsmInst *fi, int event, void *arg) { struct teimgr *tm = fi->userdata; u_char *dp = arg; if (tm->l2->tei == GROUP_TEI) { tm->tei_m.printdebug(&tm->tei_m, "net tei assign request without tei"); return; } tm->ri = ((unsigned int) *dp++ << 8); tm->ri += *dp++; if (*debug & DEBUG_...
false
false
false
false
false
0
gpk_prefs_get_repo_list_cb (GObject *object, GAsyncResult *res, GpkPrefsPrivate *priv) { gboolean enabled; gchar *description; gchar *repo_id; GError *error = NULL; GPtrArray *array = NULL; GtkTreeIter iter; GtkTreeModel *model; GtkTreeView *treeview; GtkWindow *window; guint i; PkClient *client = PK_CLIENT ...
false
false
false
false
false
0
na(callback &cb) { cb.fail("Not implemented."); }
false
false
false
false
false
0
printing_instance_new (void) { PrintingInstance * pi = g_new0 (PrintingInstance,1); pi->hfi = hf_render_info_new (); pi->cancel = FALSE; pi->hfi->pages = -1; return pi; }
false
false
false
false
false
0
LUKS_verify_volume_key(const struct luks_phdr *hdr, const struct volume_key *vk) { char checkHashBuf[LUKS_DIGESTSIZE]; if (crypt_pbkdf("pbkdf2", hdr->hashSpec, vk->key, vk->keylength, hdr->mkDigestSalt, LUKS_SALTSIZE, checkHashBuf, LUKS_DIGESTSIZE, hdr->mkDigestIterations) < 0) return -EINVAL; if ...
false
false
false
false
false
0
utf16be_to_utf8(int flags) const { const unsigned char *s = ubegin(), *ends = uend(); if ((ends - s) & 1) --ends; if ((flags & utf_strip_bom) && s != ends && s[0] == 0xFE && s[1] == 0xFF) s += 2; StringAccum sa; sa.reserve((ends - s) / 2); for (; s != ends; s += 2) { ...
false
false
false
false
false
0
row_expanded_callback (GtkTreeView *treeview, GtkTreeIter *iter, GtkTreePath *path, gpointer callback_data) { NautilusListView *view; NautilusDirectory *directory; char *uri; view = NAUTILUS_LIST_VIEW (callback_data); if (!nautilus_list_model_load_subdirectory (view->details->model, pa...
false
false
false
false
false
0
generate_sequence(const std::string & sequence, OBMol * pmol, unsigned long chain_no, const HelixParameters & helix, const char * IUPAC_codes, ResidueRecord * Residues, double & offset_x, double & offset_Theta, unsigned long & serial_no, bool create_bonds, bool bond_orders) { unsigned long residue_num = 1; OB...
false
false
false
false
false
0
omega_var_to_str (int variable) { if (0 <= variable && variable <= 20) return wild_name[variable]; if (-20 < variable && variable < 0) return wild_name[40 + variable]; /* Collapse all the entries that would have overflowed. */ return wild_name[21]; }
false
false
false
false
false
0
VerifyDevice(ALCdevice *device) { ALCdevice *tmpDevice; if(!device) return NULL; LockLists(); tmpDevice = DeviceList; while(tmpDevice && tmpDevice != device) tmpDevice = tmpDevice->next; if(tmpDevice) ALCdevice_IncRef(tmpDevice); UnlockLists(); return tmpDevice...
false
false
false
false
false
0
create_krb5_trustedCertifiers(krb5_context context, pkinit_plg_crypto_context plg_cryptoctx, pkinit_req_crypto_context req_cryptoctx, pkinit_identity_crypto_context id_cryptoctx, krb5_external_princip...
false
false
false
false
false
0
sg_dwiter_is_at_end(struct sg_mapping_iter *miter) { return miter->length == miter->consumed && !sg_dwiter_next(miter); }
false
false
false
false
false
0
nvkm_pstate_work(struct work_struct *work) { struct nvkm_clk *clk = container_of(work, typeof(*clk), work); struct nvkm_subdev *subdev = &clk->subdev; int pstate; if (!atomic_xchg(&clk->waiting, 0)) return; clk->pwrsrc = power_supply_is_system_supplied(); nvkm_trace(subdev, "P %d PWR %d U(AC) %d U(DC) %d A %d...
false
false
false
false
false
0
tp_channel_get_chat_state (TpChannel *self, TpHandle contact) { gpointer value; g_return_val_if_fail (TP_IS_CHANNEL (self), 0); if (self->priv->chat_states != NULL && g_hash_table_lookup_extended (self->priv->chat_states, GUINT_TO_POINTER (contact), NULL, &value)) { return GPOINTER_T...
false
false
false
false
false
0
update_cur_time() { struct tm *tm_ptr; time_t cur_time; unsigned int secs, secs2; cur_time = time(0); /* Figure out the timezone (effectively) by diffing two times. */ /* this is probably not right for a few hours around daylight savings*/ /* time transition */ secs2 = mktime(gmtime(&cur_time)); tm_ptr = lo...
false
false
false
false
false
0
midgard_error_string(GQuark domain, gint errcode) { switch(errcode){ case MGD_ERR_OK: return _("MGD_ERR_OK"); break; case MGD_ERR_ACCESS_DENIED: return _("Access Denied."); break; case MGD_ERR_NO_METADATA: return _("Metadata class not defined."); break; case MGD_ERR_NOT_OBJECT: retur...
false
false
false
false
false
0
restore_registered_pragmas (cpp_reader *pfile, struct pragma_entry *pe, char **sd) { for (; pe != NULL; pe = pe->next) { if (pe->is_nspace) sd = restore_registered_pragmas (pfile, pe->u.space, sd); pe->pragma = cpp_lookup (pfile, U *sd, strlen (*sd)); free (*sd); sd++; } retu...
false
false
false
false
false
0
adv_voice_save_config(dword Id, PLCI *plci, byte Rc) { dbug(1, dprintf("[%06lx] %s,%d: adv_voice_save_config %02x %d", UnMapId(Id), (char *)(FILE_), __LINE__, Rc, plci->adjust_b_state)); return (GOOD); }
false
false
false
false
false
0
_clearReferenceCounters(FWObject *o) { o->clearRefCounter(); for (FWObject::iterator i=o->begin(); i!=o->end(); ++i) { _clearReferenceCounters(*i); } }
false
false
false
false
false
0
handle_cr(struct kvm_vcpu *vcpu) { unsigned long exit_qualification, val; int cr; int reg; int err; exit_qualification = vmcs_readl(EXIT_QUALIFICATION); cr = exit_qualification & 15; reg = (exit_qualification >> 8) & 15; switch ((exit_qualification >> 4) & 3) { case 0: /* mov to cr */ val = kvm_register_rea...
false
false
false
false
false
0
delete_slot(DELETE_SLOT *slot) { DELETE_SLOT *nslot; nslot = slot->next; if (slot->prev) slot->prev->next = slot->next; if (slot->next) slot->next->prev = slot->prev; GB.Free(POINTER(&slot)); return nslot; }
false
false
false
false
false
0
tb_project_to_sphere(float r, float x, float y) { float d, t, z; d = sqrt(x*x + y*y); if (d < r * 0.70710678118654752440f) { /* Inside sphere */ z = sqrt(r*r - d*d); } else { /* On hyperbola */ t = r / 1.41421356237309504880f; z = t*t / d; } return z; }
false
false
false
false
false
0
gStock_parse(char *vl, const char **result) { static const char *parse[] = { "device/cdrom", GTK_STOCK_CDROM, "device/floppy", GTK_STOCK_FLOPPY, "device/harddisk", GTK_STOCK_HARDDISK, "device/printer", GTK_STOCK_PRINT, "device/network", GTK_STOCK_NETWORK, // (*) "dialog/auth", GTK_...
false
false
false
false
false
0
ab8500_audio_init_audioblock(struct snd_soc_codec *codec) { int status; dev_dbg(codec->dev, "%s: Enter.\n", __func__); /* Reset audio-registers and disable 32kHz-clock output 2 */ status = ab8500_sysctrl_write(AB8500_STW4500CTRL3, AB8500_STW4500CTRL3_CLK32KOUT2DIS | AB8500_STW4500CTRL3_RESETAUDN, AB8...
false
false
false
false
false
0
FKB_Read(int w, uint8 ret) { //printf("$%04x, %d, %d\n",w+0x4016,ksindex,ksmode&1); if(w) { int x; ret&=~0x1E; for(x=0;x<4;x++) if(bufit[ matrix[ksindex][ksmode&1][x]&0xFF ] || bufit[ matrix[ksindex][ksmode&1][x]>>8]) { ret|=1<<(x+1); } ret^=0x1E; } return(ret); }
false
false
false
false
false
0
CreateLogFile_ (char *log_file_nameP) { static FILE *fileP; static char *env_valueP; char path_nameA[STRINGSIZE]; int n; /* The first attempt: */ if ((fileP = fopen (log_file_nameP, "w")) != NULL) return fileP; /* If this point is reached, the first attempt failed! */ /* Prepare the file name pointer. If the first...
false
false
false
false
false
0
any(void *item) { void *x; x = item; if ((down && !left(x) && right(x)) || (!down && right(x))) { /* Move down to right one */ down = true; x = right(x); /* Then all the way down left */ while (left(x)) { x = left(x); } return x; } ...
false
false
false
false
false
0
kill() { d->fadeInTimer.stop(); if (d->state == FlashingLabelPrivate::Visible) { fadeOut(); } }
false
false
false
false
false
0
SaveCommand( void *theEnv) { #if (! BLOAD_ONLY) && (! RUN_TIME) char *theFileName; if (EnvArgCountCheck(theEnv,"save",EXACTLY,1) == -1) return(FALSE); if ((theFileName = GetFileName(theEnv,"save",1)) == NULL) return(FALSE); if (EnvSave(theEnv,theFileName) == FALSE) { OpenErrorMessage(theEnv...
false
false
false
false
false
0
coerce1D (SV* arg, LONGLONG n) { AV* array; I32 i; if (is_scalar_ref(arg)) return (AV*)NULL; if (SvTYPE(arg)==SVt_PVGV) array = GvAVn((GV*)arg); else if (SvROK(arg) && SvTYPE(SvRV(arg))==SVt_PVAV) array = (AV *) SvRV(arg); else { array = (AV*)sv_2mortal((SV*)newAV()); sv_setsv(arg, sv_...
false
false
false
false
false
0
modify_link_hash_table (NemoFile *file, ModifyListFunction modify_function) { char *target_uri; gboolean found; gpointer original_key; GList **list_ptr; /* Check if there is a symlink name. If none, we are OK. */ if (file->details->symlink_name == NULL) { return; } /* Create the hash table first time thr...
false
false
false
false
false
0
cache_wstr(FILE * fp, const char *s) { INTsys i; char buff[256 + 4]; i = (s != NULL) ? ((INTsys) strlen(s)) : 0; sprintf(buff, INTsysP "\n", i); if (fwrite(buff, 1, strlen(buff), fp) != strlen(buff)) return -1; if (i > 0 && fwrite(s, 1, i, fp) != i) return -1; return 0; }
false
false
false
false
false
0
thitm(tlev, mon, obj, d_override, nocorpse) int tlev; struct monst *mon; struct obj *obj; int d_override; boolean nocorpse; { int strike; boolean trapkilled = FALSE; if (d_override) strike = 1; else if (obj) strike = (find_mac(mon) + tlev + obj->spe <= rnd(20)); else strike = (find_mac(mon) + tlev <= rnd(20)); ...
false
false
false
false
false
0
gconf_engine_set_pair (GConfEngine* conf, const gchar* key, GConfValueType car_type, GConfValueType cdr_type, gconstpointer address_of_car, gconstpointer address_of_cdr, GError** err) { GConfValue* pair; GErro...
false
false
false
false
false
0
fetchSuite(const char *suiteName, int suiteVersion, bool optional = false) { const void *suite = gHost->fetchSuite(gHost->host, suiteName, suiteVersion); if(optional) OFX::logWarning(suite == 0, "Could not fetch the optional suite '%s' version %d;", suiteName, suiteVersion); else OFX::logError(suite == 0,...
false
false
false
false
false
0
gettype() { if (header.packed) return std::string("BoomTracker 4, packed"); else return std::string("BoomTracker 4"); }
false
false
false
false
false
0
AcpiHwProcessPciList ( ACPI_PCI_ID *PciId, ACPI_PCI_DEVICE *ListHead) { ACPI_STATUS Status = AE_OK; ACPI_PCI_DEVICE *Info; UINT16 BusNumber; BOOLEAN IsBridge = TRUE; ACPI_FUNCTION_NAME (HwProcessPciList); ACPI_D...
false
false
false
false
false
0
get_packetheader(NUTContext *nut, ByteIOContext *bc, int calculate_checksum, uint64_t startcode) { int64_t size; // start= url_ftell(bc) - 8; startcode= be2me_64(startcode); startcode= ff_crc04C11DB7_update(0, &startcode, 8); init_checksum(bc, ff_crc04C11DB7_update, startcode); size= ff_get_v(b...
false
false
false
false
false
0
copy_in_error_callback(void *arg) { CopyState cstate = (CopyState) arg; if (cstate->binary) { /* can't usefully display the data */ if (cstate->cur_attname) errcontext("COPY %s, line %d, column %s", cstate->cur_relname, cstate->cur_lineno, cstate->cur_attname); else errcontext("COPY %s, ...
false
true
false
false
false
1
dstrreplace(dstr_t *ds, const char *find, const char *repl, int start) { char *p; dstr_t *copy = create_dstr(); int end = -1; dstrcpy(copy, ds->data); if ((p = strstr(&copy->data[start], find))) { dstrncpy(ds, copy->data, p - copy->data); dstrcatf(ds, "%s", repl); end =...
false
false
false
false
false
0
sx9500_suspend(struct device *dev) { struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); struct sx9500_data *data = iio_priv(indio_dev); int ret; mutex_lock(&data->mutex); ret = regmap_read(data->regmap, SX9500_REG_PROX_CTRL0, &data->suspend_ctrl0); if (ret < 0) goto out; /* * Scan per...
false
false
false
false
false
0
ast_sip_api_provider_register(const struct ast_sip_api_tech *provider) { if (api_provider) { ast_log(LOG_WARNING, "SIP provider %s has already registered. Not registering provider %s\n", api_provider->name, provider->name); return -1; } if (provider->version != AST_SIP_API_VERSION) { ast_log(LOG_WARNING, ...
false
false
false
false
false
0
snd_pcm_substream_proc_status_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer) { struct snd_pcm_substream *substream = entry->private_data; struct snd_pcm_runtime *runtime; struct snd_pcm_status status; int err; mutex_lock(&substream->pcm->open_mutex); runtime = substream->runtime; ...
false
false
false
false
false
0
AHB_DTAUS__ToDTA(int c) { if (isdigit(c)) return c; if (c>='A' && c<='Z') return c; if (c>='a' && c<='z') return toupper(c); if (strchr(" .,&-+*%/$", c)) return c; switch(c) { case 0xc4 : return 0x5b; // A umlaut case 0xd6 : return 0x5c; // O umlaut case 0xdc : return 0x5d; // U umlaut ...
false
false
false
false
false
0
oid_rt_wireless_mode_hdl(struct oid_par_priv *poid_par_priv) { uint status = RNDIS_STATUS_SUCCESS; struct _adapter *Adapter = (struct _adapter *) (poid_par_priv->adapter_context); if (poid_par_priv->type_of_oid == SET_OID) { if (poid_par_priv->information_buf_len >= sizeof(u8)) Adapter->registrypriv.wir...
false
false
false
false
false
0
netAddressMatch(int fd, NetAddressPtr list) { int rc; unsigned int len; struct sockaddr_in sain; #ifdef HAVE_IPv6 struct sockaddr_in6 sain6; #endif len = sizeof(sain); rc = getpeername(fd, (struct sockaddr*)&sain, &len); if(rc < 0) { do_log_error(L_ERROR, errno, "Couldn't get peer n...
false
false
false
false
false
0
keyPressEvent(QKeyEvent *e) { switch (e->key()) { case Qt::Key_Return: case Qt::Key_Enter: case Qt::Key_Escape: e->ignore(); break; case Qt::Key_Backspace: case Qt::Key_Delete: case 0x7f: // Delete if (e->modifiers() & (Qt::ControlModifier | Qt::AltModifier)) e->ignore(); else if (m...
false
false
false
false
false
0
Level08(void) { NODE *Root; Root = Level09(); while (Token == T_OPERATOR && (Operator == O_ADD || Operator == O_SUB || Operator == O_CAT)) { Root = NewNode(Root); Parse(); LinkNode(Root, Level09()); } return Root; }
false
false
false
false
false
0
max_lex_val(void) { Ilist a = syms_with_lex_val(); Ilist p; int max = INT_MIN; for (p = a; p; p = p->next) { int x = sn_to_lex_val(p->i); max = IMAX(max, x); } zap_ilist(a); return max; }
false
false
false
false
false
0
pop3_perform_authentication(struct connectdata *conn) { CURLcode result = CURLE_OK; struct pop3_conn *pop3c = &conn->proto.pop3c; const char *mech = NULL; char *initresp = NULL; size_t len = 0; pop3state state1 = POP3_STOP; pop3state state2 = POP3_STOP; /* Check we have a username and password to authe...
false
false
false
false
false
0
read_next_word(FILE *fp, char *dest, size_t len, const char *delims) { int key; int i; i = 0; do { key = fgetc(fp); if (key == EOF) { return false; } } while (strchr(delims, key)); do { if (key == EOF) { dest[i] = '\0'; return true; } dest[i] = key; i++; key = fgetc(fp); } while (!str...
false
false
false
false
false
0
getColumnCount(int32_t len){ int32_t columnCount = 80; int32_t maxLines = 3000; int32_t adjustedLen = len*5; /* assume that every codepoint is represented in \uXXXX format*/ /* * calculate the number of lines that * may be required if column count is 80 */ if (maxLines < (adjustedLen...
false
false
false
false
false
0
osm_way(const char* args, const char** attrv) { const char** avp = &attrv[0]; rte = route_head_alloc(); while (*avp) { if (strcmp(avp[0], "id") == 0) { xasprintf(&rte->rte_desc, "osm-id %s", avp[1]); } avp += 2; } }
false
false
false
false
false
0
set_fop(int v) { fop.set_byte(0, v && 0xFF); fop.set_byte(1, (v>>8) && 0xFF); fop.set_byte(2, (v>>16) && 0xFF); fop.set_byte(3, (v>>24) && 0xFF); attmenu.set_bit(12); }
false
false
false
false
false
0
showEvent(QShowEvent * event) { // can't get QHLayout to work, so shoving widgets into place here // because widths aren't set at constructor time QFrame::showEvent(event); if (m_firstTime) { m_firstTime = false; int soFar = 0; m_lineEdit->move(soFar, -2); soFar += m_lineEdit->width(); m_suffix->move(soF...
false
false
false
false
false
0
read_metadata_areas(struct lib_context *lc, struct dev_info *di, size_t * sz, uint64_t * offset, union read_info *info) { struct ddf1 *ddf1; if (!(ddf1 = try_to_find_ddf1(lc, di, sz, offset, info, DDF1_CONFIGOFFSET))) { if ((ddf1 = try_to_find_ddf1(lc, di, sz, offset, info, DDF1_CONFIGOFF...
false
false
false
false
false
0
cyttsp4_report_slot_liftoff(struct cyttsp4_mt_data *md, int max_slots) { int t; if (md->num_prv_tch == 0) return; for (t = 0; t < max_slots; t++) { input_mt_slot(md->input, t); input_mt_report_slot_state(md->input, MT_TOOL_FINGER, false); } }
false
false
false
false
false
0