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
tsc200x_set_reset(struct tsc200x *ts, bool enable) { if (ts->reset_gpio) gpiod_set_value_cansleep(ts->reset_gpio, enable); else if (ts->set_reset) ts->set_reset(enable); }
false
false
false
false
false
0
rb_thread_interrupt() { rb_thread_critical = 0; rb_thread_ready(main_thread); if (curr_thread == main_thread) { rb_interrupt(); } if (!rb_thread_dead(curr_thread)) { if (THREAD_SAVE_CONTEXT(curr_thread)) { return; } } curr_thread = main_thread; rb_thread_restore_context(curr_thre...
false
false
false
false
false
0
Clear() { delete []data; data = 0; delete []codes; codes = 0; delete []colours; colours = 0; delete []lines; lines = 0; }
false
false
false
false
false
0
csnset_get_csn_of_type(const CSNSet *csnset, CSNType t) { const CSN *csn= NULL; const CSNSet *f= csnset_get_csnset_node_from_type(csnset, t); if(f!=NULL) { csn= &f->csn; } return csn; }
false
false
false
false
false
0
mbox_send_message(struct mbox_chan *chan, void *mssg) { int t; if (!chan || !chan->cl) return -EINVAL; t = add_to_rbuf(chan, mssg); if (t < 0) { dev_err(chan->mbox->dev, "Try increasing MBOX_TX_QUEUE_LEN\n"); return t; } msg_submit(chan); if (chan->cl->tx_block) { unsigned long wait; int ret; if...
false
false
false
false
false
0
OnThreadFinished(wxCommandEvent &event) { if( m_migrate_thread_created ) { m_status->SetLabel(_W("Waiting for thread...")); void *junk; pthread_join(m_migrate_thread, &junk); m_migrate_thread_created = false; } if( m_abort_flag ) { // user cancelled in some way, restore GUI EnableControls(true); m_sta...
false
false
false
false
false
0
checkDir( string &rootDir ) { if( !isDirectory( rootDir.c_str() )) { cerr << autosprintf(_("directory %s does not exist.\n"), rootDir.c_str()); return false; } if(rootDir[ rootDir.length()-1 ] != '/') rootDir.append("/"); return true; }
false
false
false
false
false
0
lockFile (const char *fileName) { char buff [20] ; char tmpName [PATH_MAX], realName [PATH_MAX] ; char *p ; int fd, i ; pid_t pid = getpid () ; strlcpy (realName,fileName,sizeof (realName)) ; if ((p = strrchr (realName, '/')) != NULL) { *p = '\0' ; snprintf (tmpName, sizeof(tmpName), "%s/...
true
true
false
false
true
1
saveRules() { #if defined(ADBLOCKSUBSCRIPTION_DEBUG) qDebug() << "AdBlockSubscription::" << __FUNCTION__ << rulesFileName() << m_rules.count(); #endif QString fileName = rulesFileName(); if (fileName.isEmpty()) return; QFile file(fileName); if (!file.open(QFile::ReadWrite | QIODevice::Trunc...
false
false
false
false
false
0
transitive_closure_omega(__isl_take isl_map *map, int *exact) { int i, j; int exact_i; isl_map *app; if (!map) return NULL; if (map->n == 1) return box_closure_with_check(map, exact); for (i = 0; i < map->n; ++i) { int ok; isl_map *qc, *tc; ok = can_be_split_off(map, i, &tc, &qc); if (ok < 0) go...
false
false
false
false
false
0
_st_db_add_type(st_driver_t drv, const char *type) { drvdata_t data = (drvdata_t) drv->private; dbdata_t dbd; int err; dbd = (dbdata_t) calloc(1, sizeof(struct dbdata_st)); dbd->data = data; if((err = db_create(&(dbd->db), data->env, 0)) != 0) { log_write(drv->st->log, LOG_ERR, "d...
false
false
false
false
false
0
generic_compare_and_swap(volatile uint32_t *p, uint32_t oldval, uint32_t newval) { uint32_t result; lock.lock(); // Do the compare-and-swap. result = *p; if (oldval == result) *p = newval; lock.unlock(); return result; }
false
false
false
false
false
0
alias_precompute_res(World *world) { GSList *aliasptr = world->aliases; Alias *alias; while (aliasptr) { alias = (Alias *) aliasptr->data; /* Aliases loaded from a script file already have the precomputed RE */ if (!alias->pattern_re) { alias->pattern_re = precompute_re(world->perl_interprete...
false
false
false
false
false
0
send_noop_message(void *cb, struct gru_message_queue_desc *mqd, void *mesg) { const struct message_header noop_header = { .present = MQS_NOOP, .lines = 1}; unsigned long m; int substatus, ret; struct message_header save_mhdr, *mhdr = mesg; STAT(mesq_noop); save_mhdr = *mhdr; *mhdr = noop_header; gru_m...
false
false
false
false
false
0
firesend (qdaemon) struct sdaemon *qdaemon; { int iseq; char *zhdr; size_t clen; iseq = INEXTSEQ (iIremote_ack); if (iseq == iIsendseq) { /* Everything has been ACKed and there is nothing to resend. */ return TRUE; } DEBUG_MESSAGE1 (DEBUG_PROTO | DEBUG_ABNORMAL, "firesend: Re...
false
false
false
false
false
0
CTR_CreateContext(void *context, freeblCipherFunc cipher, const unsigned char *param, unsigned int blocksize) { CTRContext *ctr; SECStatus rv; /* first fill in the Counter context */ ctr = PORT_ZNew(CTRContext); if (ctr == NULL) { return NULL; } rv = CTR_InitContext(ctr, context, ciphe...
false
false
false
false
false
0
rbd_dev_device_release(struct rbd_device *rbd_dev) { rbd_free_disk(rbd_dev); clear_bit(RBD_DEV_FLAG_EXISTS, &rbd_dev->flags); device_del(&rbd_dev->dev); rbd_dev_mapping_clear(rbd_dev); if (!single_major) unregister_blkdev(rbd_dev->major, rbd_dev->name); rbd_dev_id_put(rbd_dev); }
false
false
false
false
false
0
qsfp_read(struct hfi1_pportdata *ppd, u32 target, int addr, void *bp, int len) { int count = 0; int offset; int nread; int ret; u8 page; ret = mutex_lock_interruptible(&ppd->dd->qsfp_i2c_mutex); if (ret) return ret; while (count < len) { /* * Set the qsfp page based on a zero-based address * ...
false
false
false
false
false
0
saveAs() { QAction *a = qobject_cast<QAction *>(sender()); QString title; if (!a) title = tkTr(Trans::Constants::EDITORMENU_TEXT); else title = a->text(); QStringList filters; filters << tkTr(Trans::Constants::FILE_FILTER_HTML) << tkTr(Trans::Constants::FILE_FILTER_TX...
false
false
false
false
false
0
__irq_set_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained, const char *name) { unsigned long flags; struct irq_desc *desc = irq_get_desc_buslock(irq, &flags, 0); if (!desc) return; __irq_do_set_handler(desc, handle, is_chained, name); irq_put_desc_busunlock(desc, flags); }
false
false
false
false
false
0
vty_save_cwd(void) { char cwd[MAXPATHLEN]; char *c; int retval; char *retpath; c = getcwd(cwd, MAXPATHLEN); if (!c) { retval = chdir(SYSCONFDIR); if (!retval) return; retpath = getcwd(cwd, MAXPATHLEN); if (!retpath) return; } vty_cwd = MALLOC(strlen(cwd) + 1); strcpy(vty_cwd, cwd); }
false
false
false
false
false
0
GetOrigin (const wfa_t *wfa, tlist_t **state_list, int searchstate) /* * Get origin of the root state of the LCTree in the wfa-tree * (only makes sense if the LCTree is a real subtree of the wfa-tree). * the path from the root of the wfa-tree to the root of the LCTree * is stored in a descending ordered tlist_t...
false
false
false
false
false
0
Curl_resolv(struct connectdata *conn, const char *hostname, int port, struct Curl_dns_entry **entry) { struct Curl_dns_entry *dns = NULL; struct SessionHandle *data = conn->data; CURLcode result; int stale, rc = CURLRESOLV_ERROR; /* default to failure */ *entry...
false
false
false
false
true
1
e_book_backend_summary_finalize (GObject *object) { EBookBackendSummaryPrivate *priv; priv = E_BOOK_BACKEND_SUMMARY_GET_PRIVATE (object); if (priv->fp) fclose (priv->fp); if (priv->dirty) e_book_backend_summary_save (E_BOOK_BACKEND_SUMMARY (object)); else utime (priv->summary_path, NULL); if (priv->flush...
false
false
false
false
false
0
gsf_output_stdio_close (GsfOutput *output) { GsfOutputStdio *stdio = GSF_OUTPUT_STDIO (output); gboolean res; char *backup_filename = NULL; GDateTime *modtime; if (stdio->file == NULL) return FALSE; if (gsf_output_error (output)) { res = TRUE; if (!stdio->keep_open && !close_file_helper (stdio, FALSE)) ...
false
false
false
false
false
0
clearCompletionHistory(const QString& name) { if (!d->formCompletions) { d->formCompletions = new KConfig(KStandardDirs::locateLocal("data", "khtml/formcompletions")); } d->formCompletions->group("").writeEntry(name, ""); d->formCompletions->sync(); }
false
false
false
false
false
0
gl847_set_fe (Genesys_Device * dev, uint8_t set) { SANE_Status status; uint8_t val; DBG (DBG_proc, "gl847_set_fe (%s)\n", set == AFE_INIT ? "init" : set == AFE_SET ? "set" : set == AFE_POWER_SAVE ? "powersave" : "huh?"); RIE (sanei_genesys_read_register (dev, REG04, &val)); /* route to AD dev...
false
false
false
false
false
0
warn_control (char *arg) { static struct warn_tab { char *name; int flag; } warn_tab[] = { { "none", CPIO_WARN_ALL }, { "truncate", CPIO_WARN_TRUNCATE }, { "all", CPIO_WARN_ALL }, { "interdir", CPIO_WARN_INTERDIR }, { NULL } }; struct warn_tab *wt; in...
false
false
false
false
false
0
usage() { fprintf(stderr, "\ Usage: jlint {option|java_class_file}\n\ Options:\n\ -help : print this text\n\ -source <source_path> : path to directory with .java files\n\ -history <file_name> : use history file to avoid repeated messages\n\ -max_shown_paths <number> : max. shown paths between two sync. method...
false
false
false
false
false
0
ssl_free(BIO *a) { BIO_SSL *bs; if (a == NULL) return(0); bs=(BIO_SSL *)a->ptr; if (bs->ssl != NULL) SSL_shutdown(bs->ssl); if (a->shutdown) { if (a->init && (bs->ssl != NULL)) SSL_free(bs->ssl); a->init=0; a->flags=0; } if (a->ptr != NULL) OPENSSL_free(a->ptr); return(1); }
false
false
false
false
false
0
_launch_handler(message_thread_state_t *mts, slurm_msg_t *resp) { launch_tasks_response_msg_t *msg = resp->data; int i; pthread_mutex_lock(&mts->lock); for (i = 0; i < msg->count_of_pids; i++) { bit_set(mts->tasks_started, msg->task_ids[i]); } pthread_cond_signal(&mts->cond); pthread_mutex_unlock(&mts->lock...
false
false
false
false
false
0
msg_print_text(const struct printk_log *msg, enum log_flags prev, bool syslog, char *buf, size_t size) { const char *text = log_text(msg); size_t text_size = msg->text_len; bool prefix = true; bool newline = true; size_t len = 0; if ((prev & LOG_CONT) && !(msg->flags & LOG_PREFIX)) prefix = false; if...
false
false
false
false
false
0
BrushRadialGradient(GB_BRUSH *brush, float cx, float cy, float r, float fx, float fy, int nstop, double *positions, GB_COLOR *colors, int extend) { QRadialGradient gradient; int i; gradient.setCenter((qreal)cx, (qreal)cy); gradient.setRadius((qreal)r); gradient.setFocalPoint((qreal)fx, (qreal)fy); for (i = 0;...
false
false
false
false
false
0
PushBackPacket( Packet *packet, bool pushAtHead) { if (packet==0) return; unsigned i; for (i=0; i < pluginListTS.Size(); i++) pluginListTS[i]->OnPushBackPacket((const char*) packet->data, packet->bitSize, packet->systemAddress); for (i=0; i < pluginListNTS.Size(); i++) pluginListNTS[i]->OnPushBackPa...
false
false
false
false
false
0
panel_widget_get_cursorloc (PanelWidget *panel) { int x, y; gboolean rtl; GdkDevice *device; g_return_val_if_fail (PANEL_IS_WIDGET (panel), -1); device = gdk_device_manager_get_client_pointer (gdk_display_get_device_manager (gtk_widget_get_display (GTK_WIDGET (panel)))); gdk_window_get_d...
false
false
false
false
false
0
restoreOptions() { if ( !w || thread ) return; IconsetSystemUI *d = (IconsetSystemUI *)w; d->iss_system->clear(); QStringList loaded; d->setCursor(Qt::WaitCursor); QPalette customPal = d->palette(); customPal.setDisabled(customPal.inactive()); d->iss_system->setEnabled(false); d->iss_system->setPalette(cu...
false
false
false
false
false
0
svm_free_model_content(svm_model* model_ptr) { if(model_ptr->free_sv && model_ptr->l > 0 && model_ptr->SV != NULL) free((void *)(model_ptr->SV[0])); if(model_ptr->sv_coef) { for(int i=0;i<model_ptr->nr_class-1;i++) free(model_ptr->sv_coef[i]); } free(model_ptr->SV); model_ptr->SV = NULL; free(model_ptr-...
false
false
false
false
false
0
stpui_curve_size_graph (StpuiCurve *curve) { gint width, height; gfloat aspect; GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (curve)); width = (curve->max_x - curve->min_x) + 1; height = (curve->max_y - curve->min_y) + 1; aspect = width / (gfloat) height; if (width > gdk_screen_get_width (scree...
false
false
false
false
false
0
IsConnect() { int i,err; struct timeval tv; fd_set rset,wset,eset; if ( iHandle == INVALID_SOCKET ) { return -1; } FD_ZERO(&rset); FD_ZERO(&wset); FD_ZERO(&eset); FD_SET(iHandle, &rset); FD_SET(iHandle, &wset); FD_SET(iHandle, &eset); tv.tv_sec = 0; tv.tv_usec = 1; err = -1; i = select(FD_SETSIZ...
false
false
false
false
false
0
mlxsw_sp_port_attr_stp_state_set(struct mlxsw_sp_port *mlxsw_sp_port, struct switchdev_trans *trans, u8 state) { if (switchdev_trans_ph_prepare(trans)) return 0; mlxsw_sp_port->stp_state = state; return mlxsw_sp_port_stp_state_set(mlxsw_sp_port, state); }
false
false
false
false
false
0
parse_v_d(struct parser *p) { struct vault *v = parser_priv(p); if (!v) return PARSE_ERROR_MISSING_RECORD_HEADER; v->text = string_append(v->text, parser_getstr(p, "text")); return PARSE_ERROR_NONE; }
false
false
false
false
false
0
i915_gem_context_destroy_ioctl(struct drm_device *dev, void *data, struct drm_file *file) { struct drm_i915_gem_context_destroy *args = data; struct drm_i915_file_private *file_priv = file->driver_priv; struct intel_context *ctx; int ret; if (args->pad != 0) return -EINVAL; if (args->ctx_id == DEFAULT_...
false
false
false
false
false
0
conv_rgbaF_gaF (unsigned char *src, unsigned char *dst, long samples) { long n = samples; while (n--) { int c; float sum = 0; for (c = 0; c < 3; c++) { sum += (*(float *) src); src += 4; } (*(float *) dst) = sum / 3; dst += 4; ...
false
false
false
false
false
0
byteswap_test_exec ( void ) { uint16_t test16; uint32_t test32; uint64_t test64; ok ( test_bswap16 ( 0x1234 ) == 0x3412 ); ok ( test_bswap32 ( 0x12345678UL ) == 0x78563412UL ); ok ( test_bswap64 ( 0x123456789abcdef0ULL ) == 0xf0debc9a78563412ULL ); test16 = 0xabcd; test_bswap16s ( &test16 ); ok ( test16 == 0...
false
false
false
false
false
0
ReadDir( const char *pszDirname, int* pbGotFileList ) { CPLString osDirname(pszDirname); while (osDirname[strlen(osDirname) - 1] == '/') osDirname.erase(strlen(osDirname) - 1); const char* pszUpDir = strstr(osDirname, "/.."); if (pszUpDir != NULL) { int pos = pszUpDir - osDirname.c_...
false
false
false
false
false
0
cleanString(char *s) { char *o; o = s; for (; *s != '\0'; s++) { if ((*s != '\'') && (*s != '\"')) *o++ = *s; } *o = '\0'; }
false
false
false
false
false
0
gnumeric_ssmedian_calc (gnm_float const *sorted_data, int len, gnm_float mid_val, gnm_float interval) { gnm_float L_lower = mid_val - interval / 2; gnm_float L_upper = mid_val + interval / 2; int f_below = 0; int f_within = 0; int i; for (i = 0; i < len; i++) { if (*sorted_data < L_lower) f_below++; el...
false
false
false
false
false
0
ath10k_wow_vif_cleanup(struct ath10k_vif *arvif) { struct ath10k *ar = arvif->ar; int i, ret; for (i = 0; i < WOW_EVENT_MAX; i++) { ret = ath10k_wmi_wow_add_wakeup_event(ar, arvif->vdev_id, i, 0); if (ret) { ath10k_warn(ar, "failed to issue wow wakeup for event %s on vdev %i: %d\n", wow_wakeup_event(...
false
false
false
false
false
0
glade_widget_set_name (GladeWidget *widget, const gchar *name) { g_return_if_fail (GLADE_IS_WIDGET (widget)); if (widget->name != name) { if (widget->name) g_free (widget->name); widget->name = g_strdup (name); g_object_notify (G_OBJECT (widget), "name"); } }
false
false
false
false
false
0
new_peer(isrv_state_t *state, int fd) { int peer; identd_buf_t *buf = xzalloc(sizeof(*buf)); peer = isrv_register_peer(state, buf); if (peer < 0) return 0; /* failure */ if (isrv_register_fd(state, peer, fd) < 0) return peer; /* failure, unregister peer */ buf->fd_flag = fcntl(fd, F_GETFL) | O_NONBLOCK; is...
false
false
false
false
false
0
save_dictgroup() { char filename[512]; xmlDoc *doc; xmlNode *xdictgroup; xmlNode *xgroup; xmlNode *xdict; gchar buff[512]; gchar *title; gboolean active; BOOK_INFO *binfo; gchar *fg, *bg; GtkTreeIter parent_iter; GtkTreeIter child_iter; LOG(LOG_DEBUG, "IN : save_dictgroup()"); sprintf(filename, ...
true
true
true
false
false
1
ParseAssignStatement() { SyntaxNode* left = ParseRelationalExpr(); if (left == NULL) return NULL; if (scan.GetToken().GetValue() != TOK_ASSIGN) return new StmtExpression(left); Token op = scan.GetToken(); scan.NextToken(); SyntaxNode* right = ParseRelationalExpr(); if (right == NULL)...
false
false
false
false
false
0
eap_server_timeout(arg) void *arg; { eap_state *esp = (eap_state *) arg; if (!eap_server_active(esp)) return; /* EAP ID number must not change on timeout. */ eap_send_request(esp); }
false
false
false
false
false
0
getControlMessage(int mode, struct vsp_node *node) { asciiMessage *aM = NULL; int rc; int pass = 0; int queueID; if( node == NULL ) { queueID = 0; }else{ queueID = node->queueID; } while(1){ m_lock(&bindLock); rc = queueGetMessage(queueID, &aM); if((rc == 0) || ( ((!queueID ) || (mode == MAYBE)) &&...
false
false
false
false
false
0
simplify_with_current_value_aux (rtx exp) { int i; rtx cond; switch (GET_CODE (exp)) { case EQ_ATTR: if (ATTR_EQ_ATTR_P (exp)) return false_rtx; else return true_rtx; case CONST_STRING: case CONST_INT: return exp; case IF_THEN_ELSE: cond = simplify_with_current_valu...
false
false
false
false
false
0
tee_tg_save(const void *ip, const struct xt_entry_target *target) { const struct xt_tee_tginfo *info = (const void *)target->data; printf(" --gateway %s", xtables_ipaddr_to_numeric(&info->gw.in)); if (*info->oif != '\0') printf(" --oif %s", info->oif); }
false
false
false
false
false
0
Print_Bank_Name_Offset(char *prefix, char *bank_name, int offset) { char str[80]; int lg = strlen(prefix); if (lg) Stream_Printf(pstm_o, "%s", prefix); sprintf(str, "%s[%d]", bank_name, offset); lg += strlen(str); if (lg > BANK_NAME_OFFSET_LENGTH) lg = BANK_NAME_OFFSET_LENGTH; Stream_Printf(ps...
false
false
false
false
false
0
intel_dp_link_training_channel_equalization(struct intel_dp *intel_dp) { bool channel_eq = false; int tries, cr_tries; u32 training_pattern; training_pattern = intel_dp_training_pattern(intel_dp); /* channel equalization */ if (!intel_dp_set_link_train(intel_dp, training_pattern | DP_LINK_SCRA...
false
false
false
false
false
0
xputs_raw(str, len, fp) const char *str; int len; FILE *fp; { int outlen = 0; int len1 = len; int wlen; while (outlen < len) { wlen = fwrite(str, 1, len1, fp); if (wlen == 0) break; outlen += wlen; len1 -= wlen; str += wlen; } return outlen; }
false
false
false
false
false
0
statistic(char *name, long value) { if (!value) return; fprintf(stderr, "%8ld %s\n", value, name); }
false
false
false
false
false
0
ri_OneKeyEqual(Relation rel, int column, HeapTuple oldtup, HeapTuple newtup, RI_QueryKey *key, int pairidx) { Oid typeid; Datum oldvalue; Datum newvalue; bool isnull; /* * Get one attributes oldvalue. If it is NULL - they're not equal. */ oldvalue = SPI_getbinval(oldtup, rel->rd_att, key->...
false
false
false
false
false
0
tex_coeff_table_start (const char **cols, gretlopt opt, PRN *prn) { char pt = get_local_decpoint(); int i, mcols, binary = (opt & OPT_B); int ncols = 1; if (use_custom) { return tex_custom_coeff_table_start(cols, opt, prn); } if (!(opt & OPT_U)) { /* not a user-defined model */ pputs(prn, "...
false
false
false
false
false
0
finished_typing_passwd (saver_info *si, passwd_dialog_data *pw) { if (si->unlock_state == ul_read) { update_passwd_window (si, "Checking...", pw->ratio); XSync (si->dpy, False); si->unlock_state = ul_finished; update_passwd_window (si, "", pw->ratio); } }
false
false
false
false
false
0
sexy_tooltip_position_to_rect(SexyTooltip *tooltip, GdkRectangle *rect, GdkScreen *screen) { /* This uses the simplified tooltip placement algorithm in VMware's * libview. The comments here are also thanks to them (plangdale) */ GtkRequisition requisition; GdkRectangle monitor; int monitor_num; int x, y, w, h...
false
false
false
false
false
0
pch_spi_handler(int irq, void *dev_id) { u32 reg_spsr_val; void __iomem *spsr; void __iomem *io_remap_addr; irqreturn_t ret = IRQ_NONE; struct pch_spi_data *data = dev_id; struct pch_spi_board_data *board_dat = data->board_dat; if (board_dat->suspend_sts) { dev_dbg(&board_dat->pdev->dev, "%s returning due ...
false
false
false
false
false
0
mime_part_add_header (CamelMedium *medium, const gchar *name, gconstpointer value) { CamelMimePart *part = CAMEL_MIME_PART (medium); /* Try to parse the header pair. If it corresponds to something */ /* known, the job is done in the parsing routine. If not, */ ...
false
false
false
false
false
0
wordlist_pref_conf_to_widget (GOConfNode *node, G_GNUC_UNUSED char const *key, GtkListStore *store) { /* We can't use the getter here since the main preferences */ /* may be notified after us */ GSList *l, *list = go_conf_get_str_list (node, NULL); GtkTreeIter iter; gtk_list_store_clear (store); for (l = l...
false
false
false
false
false
0
m_emit_decl (pIIR_FileDeclaration f, int l) { // A file. The file name is in the INITIAL_VALUE slot. printf ("%s", spaces(l)); emit (f->subtype); printf (" "); emit_id( f); if (f->file_logical_name) { printf (" = open ("); emit (f->file_logical_name); if (f->file_open_expression) { ...
false
false
false
false
false
0
wi_mutable_dictionary_remove_data_for_key(wi_mutable_dictionary_t *dictionary, void *key) { WI_RUNTIME_ASSERT_MUTABLE(dictionary); if(dictionary->key_callbacks.release == wi_release) { WI_ASSERT(key != NULL, "attempt to remove data for NULL key in %@", dictionary); } _wi_dictionary_remove_data_for_key(d...
false
false
false
false
false
0
xaccTransScrubCurrency (Transaction *trans) { SplitList *node; gnc_commodity *currency; if (!trans) return; /* If there are any orphaned splits in a transaction, then the * this routine will fail. Therefore, we want to make sure that * there are no orphans (splits without parent account). ...
false
false
false
false
false
0
escape_special_chars(const char *string, const char *escape_chars) { char *result = NULL; const char *p; if(NULL == escape_chars) { escape_chars = default_escape_chars; } for(p = string; p && *p; p++) ...
false
false
false
false
false
0
fz_paint_affine_N_lerp(byte *dp, byte *sp, int sw, int sh, int u, int v, int fa, int fb, int w, int n, byte *hp) { int k; int n1 = n-1; while (w--) { int ui = u >> 16; int vi = v >> 16; if (ui >= 0 && ui < sw && vi >= 0 && vi < sh) { int uf = u & 0xffff; int vf = v & 0xffff; byte *a = sample_neare...
false
false
false
false
false
0
is_writable() { return access((path_name + "/" + file_name).c_str(), W_OK) == 0; }
false
false
false
false
false
0
getAreaFromCharacter(const wchar_t c) const { core::map<wchar_t, s32>::Node* n = CharacterMap.find(c); if (n) return n->getValue(); else return WrongCharacter; }
false
false
false
false
false
0
next_token(char *code, int *start, int *end) { int c; *start = *end; while (code[*start] && (skip_spaces(code, start) || skip_comments(code, start))) ; *end = *start + 1; c = code[*start]; if (c == '(') return TK_PAREN_OPEN; else if (c == ')') return TK_PAREN_CLOSE;...
false
false
false
false
false
0
folder_switch_cb( FL_OBJECT * ob, long data ) { FD_attrib *ui = ob->form->fdui; int active = fl_get_active_folder_number( ui->attrib_folder ); if ( active == 1 ) { if ( data != -1 ) /* -1 indicates manual call */ fl_call_object_callback( fd_attrib->re...
false
false
false
false
false
0
cx24117_read_signal_strength(struct dvb_frontend *fe, u16 *signal_strength) { struct cx24117_state *state = fe->demodulator_priv; struct cx24117_cmd cmd; int ret; u16 sig_reading; u8 buf[2]; u8 reg = (state->demod == 0) ? CX24117_REG_SSTATUS0 : CX24117_REG_SSTATUS1; /* Read AGC accumulator register */ cmd.a...
false
false
false
false
false
0
ucb1400_gpio_probe(struct platform_device *dev) { struct ucb1400_gpio *ucb = dev_get_platdata(&dev->dev); int err = 0; if (!(ucb && ucb->gpio_offset)) { err = -EINVAL; goto err; } platform_set_drvdata(dev, ucb); ucb->gc.label = "ucb1400_gpio"; ucb->gc.base = ucb->gpio_offset; ucb->gc.ngpio = 10; ucb->gc...
false
false
false
false
false
0
awe_calc_rate_offset(int Hz) { if (Hz == 44100) return 0; return (short)(log((double)Hz / 44100) / log(2.0) * 4096.0); }
false
false
false
false
false
0
gwy_tool_stats_init(GwyToolStats *tool) { GwyPlainTool *plain_tool; GwyContainer *settings; plain_tool = GWY_PLAIN_TOOL(tool); tool->layer_type_rect = gwy_plain_tool_check_layer_type(plain_tool, "GwyLayerRectangle"); if (!tool->layer_type_r...
false
false
false
false
false
0
stp_mxmlSaveString(stp_mxml_node_t *node, /* I - Node to write */ char *buffer, /* I - String buffer */ int bufsize, /* I - Size of string buffer */ int (*cb)(stp_mxml_node_t *, int)) /* I - Whitespace callback or STP_MXML_NO_CALLBACK */ { int c...
false
false
false
false
false
0
machine_matches( tFixDesc* p_fixd ) { char const ** papz_machs = p_fixd->papz_machs; int have_match = BOOL_FALSE; for (;;) { char const * pz_mpat = *(papz_machs++); if (pz_mpat == NULL) break; if (fnmatch(pz_mpat, pz_machine, 0) == 0) { have_match = BOOL_TRUE; ...
false
false
false
false
false
0
net2272_rdk2_probe(struct pci_dev *pdev, struct net2272 *dev) { unsigned long resource, len; void __iomem *mem_mapped_addr[2]; int ret, i; /* * BAR 0 holds FGPA config registers * BAR 1 holds NET2272 registers */ /* Find and map all address spaces, bar2-3 unused in rdk 2 */ for (i = 0; i < 2; ++i) { res...
false
false
false
false
false
0
unix_convert_itimer(struct itimerval *tp) { #define Get_timeval(tv) (double) tv.tv_sec + (double) tv.tv_usec / 1e6 value res = alloc_small(Double_wosize * 2, Double_array_tag); Store_double_field(res, 0, Get_timeval(tp->it_interval)); Store_double_field(res, 1, Get_timeval(tp->it_value)); return res; #undef Get...
false
false
false
false
false
0
agent_sendfd(struct hf_agent *agent, int fd, DBusPendingCallNotifyFunction notify, void *data) { struct audio_device *dev = data; struct gateway *gw = dev->gateway; DBusMessage *msg; DBusPendingCall *call; msg = dbus_message_new_method_call(agent->name, agent->path, "org.bluez.HandsfreeAgent", "NewConnection...
false
false
false
false
false
0
error_mark(struct grp *grp, int grplen, int hostid) { int i; int errcnt; /* firewall */ if (grp == NULL) die("internal error #11: grp is NULL"); /* loop thru groups, looking for error groups from a given host */ errcnt = 0; for (i=0; i < grplen; ++i) { /* skip if not from hostid ...
false
false
false
false
false
0
ns_add(struct nodeset *ns, struct tree *node, struct state *state) { for (int i=0; i < ns->used; i++) if (ns->nodes[i] == node) return; if (ns->used >= ns->size) { size_t size = 2 * ns->size; if (size < 10) size = 10; if (REALLOC_N(ns->nodes, size) ...
false
false
false
false
false
0
position(Agraph_t * g, int childCount, int length, nodelist_t * path, block_t * sn, double min_dist) { nodelistitem_t *item; Agnode_t *n; posstate state; int i, counter = 0; double maxRadius = 0.0; double angle; double theta = 0.0; posinfo_t* parents = N_NEW(childCount, posinfo_t); ...
false
false
false
false
false
0
mmo_read_CObjRoute(mmo_data_t* data) { #ifdef MMO_DBG const char* sobj = "CObjRoute"; #endif int rtept; route_head* rte; char buf[16]; int ux; DBG((sobj, ":-----------------------------------------------------\n")); DBG((sobj, "name = \"%s\" [ visible=%s, id=0x%04X ]\n", data->name, data->visible ...
false
false
false
false
false
0
obj_freshness_lifetime(struct mem_obj *obj) { if ( obj->flags & ANSW_HAS_MAX_AGE ) return(obj->times.max_age); if ( obj->flags & ANSW_HAS_EXPIRES ) return(MAX(0,obj->times.expires - obj->times.date)); return(-24*3600); }
false
false
false
false
false
0
duplicatePacket(ArBasePacket *packet) { myLength = packet->getLength(); myReadLength = packet->getReadLength(); // KMC Added this because otherwise... If myMaxLength < packet->getMaxLength(), // then this will overwrite memory. // if (myMaxLength < myLength) { setMaxLength(myLength); } memcpy(myBu...
false
false
false
false
false
0
symbols_allocate_arrays(void) { symbs = my_calloc(sizeof(char *), MAX_SYMBOLS, "symbols"); svals = my_calloc(sizeof(int32), MAX_SYMBOLS, "symbol values"); if (glulx_mode) smarks = my_calloc(sizeof(int), MAX_SYMBOLS, "symbol markers"); slines = my_calloc(sizeof(int32), MAX_...
false
false
false
false
false
0
large_scroll(DimensionName d) const { Coord s = impl_->info_[d].large_; if (Math::equal(s, float(0), float(1e-4))) { s = cur_length(d) - 1; } return s; }
false
false
false
false
false
0
apply( wstring const & in ) { // First, strip diacritics and apply ws/punctuation removal wstring withoutDiacritics; withoutDiacritics.reserve( in.size() ); wchar const * nextChar = in.data(); size_t consumed; for( size_t left = in.size(); left; ) { wchar ch = foldDiacritic( nextChar, left, consu...
false
false
false
false
false
0
free_vp_solution(vp_solution_t vp_soln) { int i; for (i = 0; i < vp_soln->prob->num_bins; i++) { free(vp_soln->capacities[i]); } free(vp_soln->capacities); free(vp_soln->mapping); free(vp_soln); return; }
false
false
false
false
false
0
mga_vram_init(struct mga_device *mdev) { void __iomem *mem; struct apertures_struct *aper = alloc_apertures(1); if (!aper) return -ENOMEM; /* BAR 0 is VRAM */ mdev->mc.vram_base = pci_resource_start(mdev->dev->pdev, 0); mdev->mc.vram_window = pci_resource_len(mdev->dev->pdev, 0); aper->ranges[0].base = mdev-...
false
false
false
false
false
0
nfsd_lookup_dentry(struct svc_rqst *rqstp, struct svc_fh *fhp, const char *name, unsigned int len, struct svc_export **exp_ret, struct dentry **dentry_ret) { struct svc_export *exp; struct dentry *dparent; struct dentry *dentry; int host_err; dprintk("nfsd: nfsd_lookup(fh %s, %.*s)\n", SVCFH_fmt(fhp...
false
false
false
false
false
0
getPortalPoints(dtPolyRef from, dtPolyRef to, float* left, float* right, unsigned char& fromType, unsigned char& toType) const { dtAssert(m_nav); const dtMeshTile* fromTile = 0; const dtPoly* fromPoly = 0; if (m_nav->getTileAndPolyByRef(from, &fromTile, &fromPoly) != DT_SUCCESS) return DT_FAILURE; f...
false
false
false
false
false
0
print_time(struct directory *dir) { char am_pm; int hour = DOS_HOUR(dir); if(!mtools_twenty_four_hour_clock) { am_pm = (hour >= 12) ? 'p' : 'a'; if (hour > 12) hour = hour - 12; if (hour == 0) hour = 12; } else am_pm = ' '; printf("%2d:%02d%c", hour, DOS_MINUTE(dir), am_pm); }
false
false
false
false
false
0
filter_buffer(int in, int out, void *data) { /* * Spawn cmd and feed the buffer contents through its stdin. */ struct child_process child_process; struct filter_params *params = (struct filter_params *)data; int write_err, status; const char *argv[] = { NULL, NULL }; argv[0] = params->cmd; memset(&child_pr...
false
false
false
false
false
0