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
afr_sh_find_fresh_parents (call_frame_t *frame, xlator_t *this, int32_t op_ret, int32_t op_errno) { afr_self_heal_t *sh = NULL; afr_private_t *priv = NULL; afr_local_t *local = NULL; int enoent_count = 0; int nsources = 0;...
false
false
false
false
false
0
show_ce_entry(const char *tag, struct cache_entry *ce) { int len = prefix_len; int offset = prefix_offset; if (len >= ce_namelen(ce)) die("git-ls-files: internal error - cache entry not superset of prefix"); if (pathspec && !match(pathspec, ps_matched, ce->name, len)) return; if (tag && *tag && show_valid_b...
false
false
false
false
false
0
crypto_cipher_encrypt_init_cipher(crypto_cipher_t *env) { tor_assert(env); aes_set_key(env->cipher, env->key, CIPHER_KEY_LEN*8); return 0; }
false
false
false
false
false
0
CVectorRemoveElement(const CVectorHandle vectorhandle, const size_t index) { if ((vectorhandle==NULL)) { return CVECTOR_BAD_ARGUMENT; } if ((vectorhandle->flags&CVECTOR_FLAGS_NO_RELOCATION)) { return CVECTOR_NO_RELOCATION; } if (index >= vectorhandle->size || index < 0...
false
false
false
false
false
0
test_empty_SDSs() { int32 sd_id, sds_id, sds_index; int32 dimsizes[RANK]; HDF_CHUNK_DEF c_def; /* Chunking definitions */ int32 flag; uintn info_count = 0; comp_coder_t comp_type; /* Compression flag */ comp_info c_info; /* Compression structure */ int ii, jj; intn status; int nu...
false
false
false
false
false
0
ad2s1200_probe(struct spi_device *spi) { struct ad2s1200_state *st; struct iio_dev *indio_dev; int pn, ret = 0; unsigned short *pins = spi->dev.platform_data; for (pn = 0; pn < AD2S1200_PN; pn++) { ret = devm_gpio_request_one(&spi->dev, pins[pn], GPIOF_DIR_OUT, DRV_NAME); if (ret) { dev_err(&spi->...
false
false
false
false
false
0
poppler_document_new_from_file (const char *uri, const char *password, GError **error) { PDFDoc *newDoc; GooString *filename_g; GooString *password_g; char *filename; if (!globalParams) { globalParams = new GlobalParams(); } filename = g_filename_from_uri (uri, NULL, error); if (!fil...
false
false
false
false
false
0
isValid() const { return d->status != Invalid && !d->area.isValid(); }
false
false
false
false
false
0
cx88_reset(struct cx88_core *core) { dprintk(1,"%s\n",__func__); cx88_shutdown(core); /* clear irq status */ cx_write(MO_VID_INTSTAT, 0xFFFFFFFF); // Clear PIV int cx_write(MO_PCI_INTSTAT, 0xFFFFFFFF); // Clear PCI int cx_write(MO_INT1_STAT, 0xFFFFFFFF); // Clear RISC int /* wait a bit */ msleep(100); /* ...
false
false
false
false
false
0
Get_Prio () { const char *data; long length; Atom atom, type; thunk *thunks; int size, fsize; const char *prop="_NET_WM_PID"; const char *format = NULL; const char *dformat = NULL; atom = XInternAtom(dpy, prop, True); if (atom == None) { printf(": no such atom on any windo...
false
false
false
false
false
0
is_proc(void) { PATTERN pattern; int i; if (!EVAL->pattern) return FALSE; for (i = 0;; i++) { pattern = EVAL->pattern[i]; if (PATTERN_is_end(pattern)) return FALSE; if (PATTERN_is(pattern, RS_PRIVATE) || PATTERN_is(pattern, RS_PUBLIC) || PATTERN_is(pattern, RS_STATIC)) continue;...
false
false
false
false
false
0
bad_zone(int i) { char buffer[1024]; if (MINIX_BLOCK_SIZE*i != lseek(IN, MINIX_BLOCK_SIZE*i, SEEK_SET)) die(_("seek failed in bad_zone")); return (MINIX_BLOCK_SIZE != read(IN, buffer, MINIX_BLOCK_SIZE)); }
false
false
false
false
false
0
pt_config(struct perf_event *event) { u64 reg; if (!event->hw.itrace_started) { event->hw.itrace_started = 1; wrmsrl(MSR_IA32_RTIT_STATUS, 0); } reg = RTIT_CTL_TOPA | RTIT_CTL_BRANCH_EN | RTIT_CTL_TRACEEN; if (!event->attr.exclude_kernel) reg |= RTIT_CTL_OS; if (!event->attr.exclude_user) reg |= RTIT_C...
false
false
false
false
false
0
new_queue_mem (guint size, gint pos) { GstAQueueMem *mem; mem = g_new (GstAQueueMem, 1); /* we keep the size as a mask for performance */ mem->size = clp2 (MAX (size, 16)) - 1; mem->array = g_new0 (gpointer, mem->size + 1); mem->head = pos; mem->tail_write = pos; mem->tail_read = pos; mem->next = NU...
false
false
false
false
false
0
loadTwoImagesAsRGBA(DataStreamPtr& rgbStream, DataStreamPtr& alphaStream, PixelFormat fmt, const String& rgbType, const String& alphaType) { Image rgb, alpha; rgb.load(rgbStream, rgbType); alpha.load(alphaStream, alphaType); return combineTwoImagesAsRGBA(rgb, alpha, fmt); ...
false
false
false
false
false
0
decode_prefix6(const u_char *pd, u_int itemlen, char *buf, u_int buflen) { struct in6_addr addr; u_int plen, plenbytes; TCHECK(pd[0]); ITEMCHECK(1); plen = pd[0]; if (128 < plen) return -1; itemlen -= 1; memset(&addr, 0, sizeof(addr)); plenbytes = (plen + 7) / 8; TCHECK2(pd[1], plenbytes); ITEMCHECK(plen...
false
false
false
false
false
0
save_cc_config_out_data(krb5_context context, krb5_ccache ccache, krb5_init_creds_context ctx) { krb5_data config; char *encoded; krb5_error_code code; if (ctx->cc_config_out == NULL || k5_json_object_count(ctx->cc_config_out) == 0) return 0; code = k5_json_e...
false
false
false
false
false
0
initialize(void) { int i, j; natb = 0; for (i = 0; i < window.rows; i++) { for (j = 0; j < window.cols; j++) { av(i, j) = window.ns_res * window.ew_res; if (IScvNULL(i, j)) { natb++; G_set_d_null_value(&atbv(i, j), 1); } else { atbv(i, j) = -10.0; } } } }
false
false
false
false
false
0
r100_cs_packet_parse_vline(struct radeon_cs_parser *p) { struct drm_crtc *crtc; struct radeon_crtc *radeon_crtc; struct radeon_cs_packet p3reloc, waitreloc; int crtc_id; int r; uint32_t header, h_idx, reg; volatile uint32_t *ib; ib = p->ib.ptr; /* parse the wait until */ r = radeon_cs_packet_parse(p, &waitr...
false
false
false
false
false
0
seedrandom() { unsigned char readbuf[INIT_SEED_SIZE]; hash_state hs; /* initialise so that things won't warn about * hashing an undefined buffer */ if (!donerandinit) { m_burn(hashpool, sizeof(hashpool)); } /* get the seed data */ readrand(readbuf, sizeof(readbuf)); /* hash in the new seed data */ s...
true
true
false
false
false
1
do_make_slave(struct mount *mnt) { struct mount *peer_mnt = mnt, *master = mnt->mnt_master; struct mount *slave_mnt; /* * slave 'mnt' to a peer mount that has the * same root dentry. If none is available then * slave it to anything that is available. */ while ((peer_mnt = next_peer(peer_mnt)) != mnt && ...
false
false
false
false
false
0
zend_replace_error_handling(zend_error_handling_t error_handling, zend_class_entry *exception_class, zend_error_handling *current TSRMLS_DC) /* {{{ */ { if (current) { zend_save_error_handling(current TSRMLS_CC); if (error_handling != EH_NORMAL && EG(user_error_handler)) { zval_ptr_dtor(&EG(user_error_handler))...
false
false
false
false
false
0
write(hsStream* S, plResManager* mgr) { plSwimRegionInterface::write(S, mgr); S->writeFloat(fNearDist); S->writeFloat(fNearVel); S->writeFloat(fFarDist); S->writeFloat(fFarVel); mgr->writeKey(S, fCurrentObj); }
false
false
false
false
false
0
gs_pop_string(gs_main_instance * minst, gs_string * result) { i_ctx_t *i_ctx_p = minst->i_ctx_p; ref vref; int code = pop_value(i_ctx_p, &vref); if (code < 0) return code; switch (r_type(&vref)) { case t_name: name_string_ref(minst->heap, &vref, &vref); code ...
false
false
false
false
false
0
IoObject_become(IoObject *self, IoObject *locals, IoMessage *m) { IoObject *v = IoMessage_locals_valueArgAt_(m, locals, 0); if(self == v || IoObject_deref(v) == IoObject_deref(self)) return self; //IOASSERT(!IoObject_isSymbol(self), "Symbols cannot become new values"); IOASSERT(ISOBJECT(self), "Primitives cannot ...
false
false
false
false
false
0
nm_settings_add_connection (NMSettings *self, NMConnection *connection, DBusGMethodInvocation *context, NMSettingsAddCallback callback, gpointer user_data) { NMSettingsPrivate *priv = NM_SETTINGS_GET_PRIVATE...
false
false
false
false
false
0
cloud_on() const { string value; if (file_.get_value("cloud", value)) { return value == "on"; } // default value is true return true; }
false
false
false
false
false
0
CanTurnIntoImplicitDef(MachineInstr *MI, unsigned Reg, unsigned OpIdx, SmallSet<unsigned, 8> &ImpDefRegs) { switch(OpIdx) { case 1: return MI->isCopy() && (MI->getOperand(0).getSubReg() == 0 || Im...
false
false
false
false
false
0
output_asm_label (x) rtx x; { char buf[256]; if (GET_CODE (x) == LABEL_REF) x = XEXP (x, 0); if (GET_CODE (x) == CODE_LABEL || (GET_CODE (x) == NOTE && NOTE_LINE_NUMBER (x) == NOTE_INSN_DELETED_LABEL)) ASM_GENERATE_INTERNAL_LABEL (buf, "L", CODE_LABEL_NUMBER (x)); else output_operand_...
false
false
false
false
true
1
threadDone() { modified = true; QGLE::setEnabled(rootButton, true); QGLE::setEnabled(searchButton, true); QGLE::setEnabled(locButton, true); QGLE::setEnabled(abortButton, true); if (mainWin != NULL) { string gsloc = getGLEInterface()->getGhostScriptLocation(); QString loc = QString::fromUtf8(gsloc.c_str()); ...
false
false
false
false
false
0
gtt_interval_split (GttInterval *ivl, GttTask *newtask) { int is_running = 0; gint idx; GttProject *prj; GttTask *prnt; GList *node; GttInterval *first_ivl; if (!ivl || !newtask) return; prnt = ivl->parent; if (!prnt) return; prj = prnt->parent; if (!prj) return; node = g_list_find (prnt->interval_list, iv...
false
false
false
false
false
0
quicksearch_show(QuickSearch *quicksearch) { MainWindow *mainwin = mainwindow_get_mainwindow(); GtkWidget *ctree = NULL; gtk_widget_show(quicksearch->hbox_search); update_extended_buttons(quicksearch); gtk_widget_grab_focus( GTK_WIDGET(gtk_bin_get_child(GTK_BIN((quicksearch->search_string_entry))))); if (!main...
false
false
false
false
false
0
unindex_hint(Topform c) { if (clist_member(c, Redundant_hints)) { clist_remove(c, Redundant_hints); Redundant_hints_count--; } else { lindex_update(Hints_idx, c, DELETE); if (Back_demod_hints) index_clause_back_demod(c, Back_demod_idx, DELETE); Active_hints_count--; } }
false
false
false
false
false
0
think_use_cash_to_capture() { if( !nation_array[nation_recno]->should_use_cash_to_capture() ) return 0; //-------------------------------------// Town* townPtr; for( int i=0 ; i<linked_town_count ; i++ ) { townPtr = town_array[ linked_town_array[i] ]; if( townPtr->nation_recno == nation_recno ) contin...
false
false
false
false
false
0
state_cl_httpresult0(char ch) { if (ch == ' ' || ch == '\t') { return; } else if (std::isdigit(ch)) { value = (ch - '0'); state = &HeaderParser::state_cl_httpresult; return; } else { log_warn(...
false
false
false
false
false
0
_wapi_handle_timedwait_signal_handle (gpointer handle, struct timespec *timeout, gboolean alertable, gboolean poll) { DEBUG ("%s: waiting for %p (type %s)", __func__, handle, _wapi_handle_typename[_wapi_handle_type (handle)]); if (_WAPI_SHARED_HANDLE (_wapi_handle_type (handle))) { if (WAPI_SHARE...
false
false
false
false
false
0
propdict_foreach( const char* key, xmmsv_t *pair, void* userdata ) { Xmms::PropDict::ForEachFunc* func = static_cast< Xmms::PropDict::ForEachFunc* >( userdata ); Xmms::PropDict::ForEachData fedata( key, func ); xmmsv_dict_foreach( pair, &propdict_foreach_inner, static_cast< void* >( &f...
false
false
false
false
false
0
acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc) { ACPI_FUNCTION_ENTRY(); /* * Object must be a valid number and we must be executing * a control method. Object could be NS node for AML_INT_NAMEPATH_OP. */ if ((!obj_desc) || (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) != ACPI_DESC_TYPE_OPERA...
false
false
false
false
false
0
read_line(int fd, size_t res_len, char *buf) { size_t i = 0; char c = 0; do { if(read(fd, &c, sizeof(char)) != sizeof(char)) return -1; buf[i++] = c; } while(c != '\n' && i < res_len); buf[i - 1] = 0; /* eliminates '\n' */ return 0; }
false
false
false
false
false
0
cleanup_mapped_device(struct mapped_device *md) { if (md->wq) destroy_workqueue(md->wq); if (md->kworker_task) kthread_stop(md->kworker_task); mempool_destroy(md->io_pool); mempool_destroy(md->rq_pool); if (md->bs) bioset_free(md->bs); if (md->disk) { spin_lock(&_minor_lock); md->disk->private_data = N...
false
true
false
false
false
1
GetLevel(Slice* input, int* level) { uint32_t v; if (GetVarint32(input, &v) && v < config::kNumLevels) { *level = v; return true; } else { return false; } }
false
false
false
false
false
0
training_mission_page_in() { int i; for ( i = 0; i < NUM_DIRECTIVE_GAUGES; i++ ) { bm_page_in_aabitmap( Directive_gauge[i].first_frame, Directive_gauge[i].num_frames ); } }
false
false
false
false
false
0
ex_diffoff(eap) exarg_T *eap; { win_T *wp; win_T *old_curwin = curwin; #ifdef FEAT_SCROLLBIND int diffwin = FALSE; #endif for (wp = firstwin; wp != NULL; wp = wp->w_next) { if (wp == curwin || eap->forceit) { /* Set 'diff', 'scrollbind' off and 'wrap' on. */ wp->w_p_diff = FALSE; ...
false
false
false
false
false
0
generic_make_request_checks(struct bio *bio) { struct request_queue *q; int nr_sectors = bio_sectors(bio); int err = -EIO; char b[BDEVNAME_SIZE]; struct hd_struct *part; might_sleep(); if (bio_check_eod(bio, nr_sectors)) goto end_io; q = bdev_get_queue(bio->bi_bdev); if (unlikely(!q)) { printk(KERN_ERR ...
false
false
false
false
false
0
safelist_sendq_exceeded(struct Client *client_p) { if (rb_linebuf_len(&client_p->localClient->buf_sendq) > (get_sendq(client_p) / 2)) return YES; else return NO; }
false
false
false
false
false
0
compute_argument_block_size (int reg_parm_stack_space, struct args_size *args_size, int preferred_stack_boundary ATTRIBUTE_UNUSED) { int unadjusted_args_size = args_size->constant; /* For accumulate outgoing args mode we don't need to align, since the frame will be already aligned. Align to S...
false
false
false
false
false
0
standard_options(struct transport *t) { char buf[16]; int n; int v = t->verbose; set_helper_option(t, "progress", t->progress ? "true" : "false"); n = snprintf(buf, sizeof(buf), "%d", v + 1); if (n >= sizeof(buf)) die("impossibly large verbosity value"); set_helper_option(t, "verbosity", buf); }
false
false
false
false
false
0
tour_realloc_up (GGobiData *d, gint nc) { g_return_if_fail(GGOBI_IS_GGOBI(d->gg)); ggobid *gg = d->gg; displayd *dsp; GList *l; for (l=gg->displays; l; l=l->next) { GGobiExtendedDisplayClass *klass; dsp = (displayd *) l->data; if(!GGOBI_IS_EXTENDED_DISPLAY(dsp)) continue; klass = GGOB...
false
false
false
true
false
1
_pvmove_is_exclusive(struct cmd_context *cmd, struct volume_group *vg) { if (vg_is_clustered(vg)) if (!_pvmove_target_present(cmd, 1)) return 1; return 0; }
false
false
false
false
false
0
main(int argc, char** argv){ char* boot_file = BOOTFILE; if (((argc >= 2) && (strcmp(argv[1], "-h") == 0)) || ((argc == 2) && (strcmp(argv[1], "-b") == 0))) { ikarus_usage(); exit(0); } if ((argc >= 3) && (strcmp(argv[1], "-b") == 0)){ boot_file = argv[2]; int i; for(i=3; i<=argc; i++...
false
false
false
false
false
0
cs_sprealloc (cs *A, int nzmax) { int ok, oki, okj = 1, okx = 1 ; if (!A) return (0) ; if (nzmax <= 0) nzmax = (CS_CSC (A)) ? (A->p [A->n]) : A->nz ; A->i = cs_realloc (A->i, nzmax, sizeof (int), &oki) ; if (CS_TRIPLET (A)) A->p = cs_realloc (A->p, nzmax, sizeof (int), &okj) ; if (A->x) A->x = c...
false
false
false
false
false
0
stmmac_config_sub_second_increment(void __iomem *ioaddr) { u32 value = readl(ioaddr + PTP_TCR); unsigned long data; /* Convert the ptp_clock to nano second * formula = (1/ptp_clock) * 1000000000 * where, ptp_clock = 50MHz. */ data = (1000000000ULL / 50000000); /* 0.465ns accuracy */ if (!(value & PTP_TCR_...
false
false
false
false
false
0
pixMultiplyByColor(PIX *pixd, PIX *pixs, BOX *box, l_uint32 color) { l_int32 i, j, bx, by, w, h, wpl; l_int32 red, green, blue, rval, gval, bval, nrval, ngval, nbval; l_float32 frval, fgval, fbval; l_uint32 *data, *line; PIX *pix...
false
false
false
false
false
0
cmsPipelineGetPtrToLastStage(const cmsPipeline* lut) { cmsStage *mpe, *Anterior = NULL; for (mpe = lut ->Elements; mpe != NULL; mpe = mpe ->Next) Anterior = mpe; return Anterior; }
false
false
false
false
false
0
get_boot_info(struct boot_context *context, char *rootdir, char *subsys) { char initiator_dir[FILENAMESZ]; int rc = ENODEV; int nic_idx = -1, tgt_idx = -1; memset(&initiator_dir, 0 , FILENAMESZ); snprintf(initiator_dir, FILENAMESZ, "%sinitiator", rootdir); nic_cnt = 0; tgt_cnt = 0; if (file_exist(initiato...
false
false
false
false
false
0
ensAssemblymapperMapToSeqregion( EnsPAssemblymapper am, const EnsPSeqregion sr, ajint srstart, ajint srend, ajint srstrand, const EnsPSeqregion optsr, AjBool fastmap, AjPList mrs) { if (!am) return ajFalse; if (!sr) return ajFalse; if (!mrs) return a...
false
false
false
false
false
0
read_offset_tree(LHAPM2Decoder *decoder, unsigned int num_offsets) { uint8_t offset_lengths[8]; unsigned int off; unsigned int single_offset, num_codes; int len; if (!decoder->need_offset_tree) { return 1; } // Read 'num_offsets' 3-bit length values. For each offset // value 'of...
false
false
false
false
false
0
ooh323c_stop_stack_thread(void) { if(ooh323c_thread != AST_PTHREADT_NULL) { ooStopMonitor(); pthread_join(ooh323c_thread, NULL); ooh323c_thread = AST_PTHREADT_NULL; pthread_join(ooh323cmd_thread, NULL); ooh323cmd_thread = AST_PTHREADT_NULL; } return 0; }
false
false
false
false
false
0
freeRotationAllowed(Qt::KeyboardModifiers modifiers) { if ((modifiers & altOrMetaModifier()) == 0) return false; if (!isSelected()) return false; return true; }
false
false
false
false
false
0
acpi_db_match_argument(char *user_argument, struct acpi_db_argument_info *arguments) { u32 i; if (!user_argument || user_argument[0] == 0) { return (ACPI_TYPE_NOT_FOUND); } for (i = 0; arguments[i].name; i++) { if (strstr(arguments[i].name, user_argument) == arguments[i].name) { return (i); ...
false
false
false
false
false
0
_no_gres_conf(uint32_t cpu_cnt) { int i, rc = SLURM_SUCCESS; gres_slurmd_conf_t *p; slurm_mutex_lock(&gres_context_lock); FREE_NULL_LIST(gres_conf_list); gres_conf_list = list_create(_destroy_gres_slurmd_conf); for (i = 0; ((i < gres_context_cnt) && (rc == SLURM_SUCCESS)); i++) { p = xmalloc(sizeof(gres_slurmd...
false
false
false
false
false
0
remove_active_transaction(GtkTreeView *treeview) { GtkTreeModel *model; GList *list; model = gtk_tree_view_get_model(treeview); list = gtk_tree_selection_get_selected_rows(gtk_tree_view_get_selection(treeview), &model); if(list != NULL) { GtkTreeIter iter; gtk_tree_model_get_iter(model, &iter, list->data); ...
false
false
false
false
false
0
Shell_Init(void) { int i; struct Shell *sh; Boolean fullSpec; for (i = 0; shells_init[i] != NULL; i++) { sh = ShellParseSpec(shells_init[i], &fullSpec); TAILQ_INSERT_TAIL(&shells, sh, link); if (strcmp(sh->name, DEFSHELLNAME) == 0) commandShell = sh; } }
false
false
false
false
false
0
PrintSelf(ostream& os, vtkIndent indent) { this->Superclass::PrintSelf(os,indent); os << indent << "AutoCenter: (" << this->AutoCenter << ")\n"; os << indent << "EnableDistanceLOD: (" << this->EnableDistanceLOD << ")\n"; os << indent << "DistanceLODThreshold: (" << this->DistanceLODThreshold << ")...
false
false
false
false
false
0
key_or_joy_ready (void) { int i; int ct = read_htimer (demo_trigger_htimer); if ((in_jokebox == 0)) { if (ct >= 30 || check_what == check_demo) demo_ready = 1; else demo_ready = 0; if (ct >= 60) { if (in_menu) event_sfx (118 + (rand () & 1)); reset_htimer (demo_trigger_htimer...
false
false
false
false
false
0
f_filereadable(argvars, rettv) typval_T *argvars; typval_T *rettv; { int fd; char_u *p; int n; #ifndef O_NONBLOCK # define O_NONBLOCK 0 #endif p = get_tv_string(&argvars[0]); if (*p && !mch_isdir(p) && (fd = mch_open((char *)p, O_RDONLY | O_NONBLOCK, 0)) >= 0) { n = TRUE; ...
false
false
false
false
false
0
_ssll_it2cont(ssll_iterator *it) { if(NULL == it) { netsnmp_assert(NULL != it); return NULL; } if(NULL == it->base.container) { netsnmp_assert(NULL != it->base.container); return NULL; } if(it->base.container->sync != it->base.sync) { DEBUGMSGTL(("container:...
false
false
false
false
false
0
construct_virtual_base (tree vbase, tree arguments) { tree inner_if_stmt; tree compound_stmt; tree exp; tree flag; /* If there are virtual base classes with destructors, we need to emit cleanups to destroy them if an exception is thrown during the construction process. These exception regions (i...
false
false
false
false
false
0
initialize(const QStringList &arguments, QString *errorString) { if (Utils::Log::warnPluginsCreation()) qWarning() << "GirPlugin::initialize"; Q_UNUSED(arguments); Q_UNUSED(errorString); m_Factory = new GirWidgetFactory(this); addObject(m_Factory); return true; }
false
false
false
false
false
0
Key_StringToKeynum (char *str) { keyname_t *kn; if (!str || !str[0]) return -1; if (!str[1]) return str[0]; for (kn=keynames ; kn->name ; kn++) { if (!Q_strcasecmp(str,kn->name)) return kn->keynum; } return -1; }
false
false
false
false
false
0
deletefile (char *filename, int fh) { if (fh >= 0) close(fh); if( remove( (const char* )filename) == -1 ) { printf("Error in deleting %s, errno value is %d\n", filename, errno); } }
false
false
false
false
false
0
collectPropsMap(QString & family, QMap<QString, QString> & propsMap) { QHash<QString, QString> properties; properties = m_modelPart->properties(); family = properties.value("family", ""); foreach (QString key, properties.keys()) { if (key.compare("family") == 0) continue; if (key.compare("id") == 0) continue; ...
false
false
false
false
false
0
obj_delfamily_find_by_familyid(TSS_HOBJECT hObject, UINT32 familyID, TSS_HDELFAMILY *hFamily) { TSS_HCONTEXT hContext; struct tsp_object *obj; struct obj_list *list = &delfamily_list; struct tr_delfamily_obj *delfamily; pthread_mutex_lock(&list->lock); *hFamily = NULL_HDELFAMILY; if (obj_is_tpm(hObject)) { ...
false
false
false
false
false
0
FcStrBufDone (FcStrBuf *buf) { FcChar8 *ret; if (buf->failed) ret = NULL; else ret = malloc (buf->len + 1); if (ret) { memcpy (ret, buf->buf, buf->len); ret[buf->len] = '\0'; } FcStrBufDestroy (buf); return ret; }
false
false
false
false
false
0
lock_front_buffer(struct gbm_surface *_surf) { struct gbm_dri_surface *surf = (struct gbm_dri_surface *) _surf; struct dri2_egl_surface *dri2_surf = surf->dri_private; struct gbm_bo *bo; if (dri2_surf->current == NULL) { _eglError(EGL_BAD_SURFACE, "no front buffer"); return NULL; } bo = ...
false
false
false
false
false
0
igb_init_hw_82575(struct e1000_hw *hw) { struct e1000_mac_info *mac = &hw->mac; s32 ret_val; u16 i, rar_count = mac->rar_entry_count; DEBUGFUNC("igb_init_hw_82575"); /* Initialize identification LED */ ret_val = mac->ops.id_led_init(hw); if (ret_val) { DEBUGOUT("Error initializing identification LED\n"); /...
false
false
false
false
false
0
af9015_download_firmware(struct dvb_usb_device *d, const struct firmware *fw) { struct af9015_state *state = d_to_priv(d); int i, len, remaining, ret; struct req_t req = {DOWNLOAD_FIRMWARE, 0, 0, 0, 0, 0, NULL}; u16 checksum = 0; dev_dbg(&d->udev->dev, "%s:\n", __func__); /* calc checksum */ for (i = 0; i < fw...
false
false
false
false
false
0
Init() { // already done ? if (m_IsInit) { return; } m_IsInit = true; // init image(s) wxImageList* images = new wxImageList(16, 16); images->Add(wxBitmap(amuleSpecial(1))); images->Add(wxBitmap(amuleSpecial(2))); // Gives wxTreeCtrl ownership of the list AssignImageList(images); // Create an empty roo...
false
false
false
false
false
0
do_host_cloak_ip(const char *inbuf, char *outbuf) { char *tptr; unsigned int accum = get_string_weighted_entropy(inbuf); char buf[HOSTLEN]; int ipv6 = 0; strncpy(buf, inbuf, HOSTLEN); tptr = strrchr(buf, '.'); if (tptr == NULL) { tptr = strrchr(buf, ':'); ipv6 = 1; } if (tptr == NULL) { strncpy(outb...
true
true
false
false
false
1
z_get_prop( zword_t obj, zword_t prop ) { zword_t prop_addr; zword_t wprop_val; zbyte_t bprop_val; zbyte_t value; #ifdef STRICTZ if ( obj == 0 ) { report_strictz_error( STRZERR_GET_PROP, "@get_prop called with object 0" ); store_operand( 0 ); return; } #endif /* Load address ...
false
false
false
false
false
0
count_dir( const char * dirname ) { DIR * d = NULL; struct dirent * f = NULL; int ctotal = 0; if ( (d = opendir(dirname)) == NULL ) { return(-1); } while ( (f = readdir(d)) ) { if ( f->d_name[0] != '.' ) ++ctotal; } closedir(d); return(ctotal); }
false
false
false
false
false
0
read_router_string(String text, const String &landmark, bool empty_ok, ErrorHandler *errh) { // check for archive Vector<ArchiveElement> archive; if (text.length() && text[0] == '!') { ArchiveElement::parse(text, archive, errh); if (ArchiveElement *ae = ArchiveElement::find(archive, "config")) t...
false
false
false
false
false
0
main() { struct soap *soap = soap_new(); struct methodCall m; struct methodResponse r; struct param p[2]; /* Set up method call */ m.methodName = "weblogUpdates.ping"; /* two parameters with string content */ m.params.__size = 2; m.params.param = p; memset(p, 0, sizeof(p)); p[0].value.__type = SOAP_...
false
false
false
false
false
0
xsh_model_first_anneal_save( const cpl_table* out_table, xsh_instrument* instr, cpl_parameterlist* parlist, cpl_frameset* set) { char name_o[512] ; cpl_propertylist* plist=NULL ; cpl_frame* product_frame=NULL ; cpl_frameset* raws=NULL; cpl_frame* r...
false
false
false
false
false
0
gst_amr_parse_parse_header (GstAmrParse * amrparse, const guint8 * data, gint * skipsize) { GST_DEBUG_OBJECT (amrparse, "Parsing header data"); if (!memcmp (data, "#!AMR-WB\n", 9)) { GST_DEBUG_OBJECT (amrparse, "AMR-WB detected"); amrparse->block_size = block_size_wb; amrparse->wide = TRUE; *sk...
false
false
false
false
false
0
gst_disparity_chain_left (GstPad * pad, GstObject * parent, GstBuffer * buffer) { GstDisparity *fs; GstMapInfo info; fs = GST_DISPARITY (parent); GST_DEBUG_OBJECT (pad, "processing frame from left"); g_mutex_lock (&fs->lock); if (fs->flushing) { g_mutex_unlock (&fs->lock); return GST_FLOW_FLUSHING;...
false
false
false
false
false
0
acpi_ex_release_all_mutexes(struct acpi_thread_state *thread) { union acpi_operand_object *next = thread->acquired_mutex_list; union acpi_operand_object *obj_desc; ACPI_FUNCTION_NAME(ex_release_all_mutexes); /* Traverse the list of owned mutexes, releasing each one */ while (next) { obj_desc = next; next = ...
false
false
false
false
false
0
unity_protocol_scope_service_proxy_open_channel_async (UnityProtocolScopeService* self, guint channel_type, GHashTable* hints, GCancellable* cancellable, const char* sender, GAsyncReadyCallback _callback_, gpointer _user_data_) { GDBusMessage *_message; GVariant *_arguments; GVariantBuilder _arguments_builder; GVar...
false
false
false
false
false
0
operator+=(int delta) { if (_modulus > 1) { if (delta < 0) delta += ((-delta)/_modulus + 1) * _modulus; _offset = (_offset + delta) % _modulus; } return *this; }
false
false
false
false
false
0
fl_push_matrix() { if (sptr==32) Fl::error("fl_push_matrix(): matrix stack overflow."); else stack[sptr++] = m; }
false
false
false
false
false
0
keyPressEvent ( QKeyEvent * event ) { if (mIsStorageModeOn) return; int key = event->key(); if ( ( key == Qt::Key_Left ) || ( key == Qt::Key_Right ) || ( key == Qt::Key_Down ) || ( key == Qt::Key_Up ) ) { int dx = 0 , dy = 0; switch (key) { case Qt::Key_Left: dx = -KEY_ITEM_MOVE; dy = 0; break; cas...
false
false
false
false
false
0
read_values (t_algo_state& state) { int nb_values = 0; std::cin >> nb_values; for (t_activity_id id = 0; id < nb_values; ++id) { // Read the name. std::string name; char c; std::cin >> c; while (c != ' ') { if (c != '\n' || c != '\r') name += c; std::cin >> c; } // R...
false
false
false
false
false
0
git_stash_list_command_init (GitStashListCommand *self) { self->priv = g_new0 (GitStashListCommandPriv, 1); self->priv->stash_regex = g_regex_new (STASH_REGEX, 0, 0, NULL); self->priv->output = g_queue_new (); }
false
false
false
false
false
0
cmsMLUsetASCII(cmsMLU* mlu, const char LanguageCode[3], const char CountryCode[3], const char* ASCIIString) { cmsUInt32Number i, len = (cmsUInt32Number) strlen(ASCIIString)+1; wchar_t* WStr; cmsBool rc; cmsUInt16Number Lang = _cmsAdjustEndianess16(*(cmsUInt16Number*) LanguageCode); cmsUInt16Number...
false
false
false
false
false
0
conf_reinit(void) { struct conf_binding *cb = 0; int fd, trans; unsigned int i; size_t sz; char *new_conf_addr = 0; if ((fd = monitor_open(conf_path, O_RDONLY, 0)) != -1) { if (check_file_secrecy_fd(fd, conf_path, &sz)) goto fail; new_conf_addr = malloc(sz); if (!new_conf_addr) { log_error("conf_r...
false
true
false
false
true
1
sigint_restore(void) { if (!_handler_installed) return; if (_handler_installed > 1) { _handler_installed--; return; } /* Nesting count went down to 0. */ _handler_installed = 0; if (_oldmasked) { sigset_t sigs; sigprocmask(0, NULL, &sigs); sigaddset(&sigs, SIGINT); sigprocmask(SIG_SETMASK, &sigs,...
false
false
false
false
false
0
RecordRegionAddition(const void* start, size_t size) { // Record start/end info about this memory acquisition call in a new region: Region region; region.Create(start, size); // First get the call stack info into the local varible 'region': const int depth = max_stack_depth_ > 0 ? MallocHook::GetCalle...
false
false
false
false
false
0
net80211_set_rate_idx ( struct net80211_device *dev, int rate ) { assert ( dev->netdev->state & NETDEV_OPEN ); if ( rate >= 0 && rate < dev->nr_rates && rate != dev->rate ) { DBGC2 ( dev, "802.11 %p changing rate from %d->%d Mbps\n", dev, dev->rates[dev->rate] / 10, dev->rates[rate] / 10 ); dev->rate = ra...
false
false
false
false
false
0
main(argc, argv) char **argv; { int n; char *p; char *name; int pagf; progname = argv[0]; if (p = argv[1]) { name = (char *) malloc((n = strlen(p)) + 5); strcpy(name, p); strcpy(name + n, ".pag"); if ((pagf = open(name, O_RDONLY)) < 0) oops("cannot open %s.", name); sdump(pagf); } else oops("...
false
false
false
false
false
0
_parse_ep_map_stream(BITSTREAM *bits, CLPI_EP_MAP_ENTRY *ee) { uint32_t fine_start; int ii; CLPI_EP_COARSE * coarse; CLPI_EP_FINE * fine; bs_seek_byte(bits, ee->ep_map_stream_start_addr); fine_start = bs_read(bits, 32); coarse = malloc(ee->num_ep_coarse * sizeo...
false
false
false
false
false
0