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
gst_tag_demux_element_find (GstTagDemux * demux) { GstTagDemuxClass *klass; GstTypeFindProbability probability = 0; GstFlowReturn ret = GST_FLOW_OK; GstTagList *start_tags = NULL; GstTagList *end_tags = NULL; gboolean e_tag_ok, s_tag_ok; GstCaps *caps = NULL; /* Look for tags at start and end of file *...
false
false
false
false
false
0
dfb_system_core_initialize( CoreDFB *core, DFBSystemCore *data, DFBSystemCoreShared *shared ) { DFBResult ret; D_DEBUG_AT( Core_System, "dfb_system_core_initialize( %p, %p, %p )\n", core, data, shared ); D_ASSERT( data != NULL );...
false
false
false
false
false
0
_gcr_pkcs11_import_interaction_supplement (GcrImportInteraction *interaction, GckBuilder *builder, GCancellable *cancellable, GError **error) { GcrPkcs11ImportInteraction *self = GCR_PKCS11_...
false
false
false
false
false
0
atk_object_factory_get_type (void) { static GType type = 0; if (!type) { GTypeInfo tinfo = { sizeof (AtkObjectFactoryClass), (GBaseInitFunc) NULL, /* base init */ (GBaseFinalizeFunc) NULL, /* base finalize */ (GClassInitFunc) atk_object_factory_class_init, /* class init */ (GC...
false
false
false
false
false
0
ds2482_w1_write_byte(void *data, u8 byte) { struct ds2482_w1_chan *pchan = data; struct ds2482_data *pdev = pchan->pdev; mutex_lock(&pdev->access_lock); /* Select the channel */ ds2482_wait_1wire_idle(pdev); if (pdev->w1_count > 1) ds2482_set_channel(pdev, pchan->channel); /* Send the write byte command ...
false
false
false
false
false
0
tarPrintf(ArchiveHandle *AH, TAR_MEMBER *th, const char *fmt,...) { char *p; size_t len = 128; /* initial assumption about buffer size */ size_t cnt; for (;;) { va_list args; /* Allocate work buffer. */ p = (char *) pg_malloc(len); /* Try to format the data. */ va_start(args, fmt); cnt = pvsn...
false
false
false
false
false
0
childRemove(MSWidget *widget_) { NotebookEntry *entry=getEntry(widget_); if (entry!=0) { removeChild(widget_); adjustSize(); } }
false
false
false
false
false
0
m6809_reset(void *param) { m6809.int_state = 0; m6809.nmi_state = CLEAR_LINE; m6809.irq_state[0] = CLEAR_LINE; m6809.irq_state[0] = CLEAR_LINE; DPD = 0; /* Reset direct page register */ CC |= CC_II; /* IRQ disabled */ CC |= CC_IF; /* FIRQ disabled */ PCD = RM16(0xfffe); CH...
false
false
false
false
false
0
pref_init(void) { int i; /* Determine whether locale supports am/pm time formats */ # ifdef HAVE_LANGINFO_H t_fmt_ampm = strcmp(nl_langinfo(T_FMT_AMPM), ""); # endif for (i=0; i<NUM_PREFS; i++) { switch (i) { case PREF_PORT: glob_prefs[i].svalue=strdup("usb:"); glob_pre...
false
false
false
false
false
0
brush_once_and_redraw (gboolean binningp, splotd * sp, displayd * display, ggobid * gg) { cpaneld *cpanel = &display->cpanel; gboolean changed = false; if (cpanel->br.brush_on_p) { changed = brush_once (!binningp, sp, gg); if (binningp && binning_permitted (display, gg)) { i...
false
false
false
false
false
0
data_sets_update_model(tb_math_t * tb_math) { GtkTreeIter iter; GtkTreeModel * model; GtkTreeSelection *selection; GList * data_sets; GList * temp_data_sets; gint count; /* update data set 1 */ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tb_math->list_ds1)); model = gtk_tree_view_get_mod...
false
false
false
false
false
0
ff_mlp_restart_checksum(const uint8_t *buf, unsigned int bit_size) { int i; int num_bytes = (bit_size + 2) / 8; int crc = crc_1D[buf[0] & 0x3f]; crc = av_crc(crc_1D, crc, buf + 1, num_bytes - 2); crc ^= buf[num_bytes - 1]; for (i = 0; i < ((bit_size + 2) & 7); i++) { crc <<= 1; ...
false
false
false
false
false
0
adjustLayout(){ fhor=(width>barsize) ? (10000*splitx+(width-barsize-1))/(width-barsize) : 0; fver=(height>barsize) ? (10000*splity+(height-barsize-1))/(height-barsize) : 0; recalc(); }
false
false
false
false
false
0
techAvailable ( const Technology* tech ) const { if ( techResearched( tech->id )) return Researched; if ( isBlocked( tech )) return NeverAvailable; if ( tech->techDependency.available( *this ) ) { return Available; } else return UnavailableNow; }
false
false
false
false
false
0
sci_tx_dma_release(struct sci_port *s, bool enable_pio) { struct dma_chan *chan = s->chan_tx; struct uart_port *port = &s->port; unsigned long flags; spin_lock_irqsave(&port->lock, flags); s->chan_tx = NULL; s->cookie_tx = -EINVAL; spin_unlock_irqrestore(&port->lock, flags); dmaengine_terminate_all(chan); dma...
false
false
false
false
false
0
scan_summand (void) { header *hd=(header *)newram,*hd1; scan_space(); scan_factor(); if (error) return; while (1) { hd1=(header *)newram; scan_space(); if ((*next=='*' && *(next+1)!='*') || (*next=='.' && *(next+1)=='*')) { if (*next=='*') next++; else next+=2; scan_factor(); if (!error) dotmult...
false
false
false
false
false
0
fsck_dtDeleteUp(struct dinode *ip, struct btpage *fbp, struct btstack *btstack) { int rc = 0; struct btpage *bp; dtpage_t *fp, *p = 0; int32_t index, nextindex; int64_t xaddr; int32_t xlen; struct btframe *parent; /* get page to delete */ fp = FSCK_BT_PAGE(ip, fbp, dtpage_t); /* * keep the root...
false
false
false
false
false
0
cancel_loop_tree (struct loops *loops, struct loop *loop) { while (loop->inner) cancel_loop_tree (loops, loop->inner); cancel_loop (loops, loop); }
false
false
false
false
false
0
create_reuc_extension_data(git_buf *reuc_buf, git_index_reuc_entry *reuc) { int i; int error = 0; if ((error = git_buf_put(reuc_buf, reuc->path, strlen(reuc->path) + 1)) < 0) return error; for (i = 0; i < 3; i++) { if ((error = git_buf_printf(reuc_buf, "%o", reuc->mode[i])) < 0 || (error = git_buf_put(reuc...
false
false
false
false
false
0
SPF_dns_cache_lookup(SPF_dns_server_t *spf_dns_server, const char *domain, ns_type rr_type, int should_cache) { SPF_dns_cache_config_t *spfhook; SPF_dns_cache_bucket_t *bucket; SPF_dns_rr_t *cached_rr; SPF_dns_rr_t *rr; int idx; spfhook = SPF_voidp2spfhook(spf_dns_server->hook); /* max_hash...
false
false
false
false
false
0
map_load_owner(struct section_file *file, const char *savefile_options) { /* Owner and ownership source are stored as plain numbers */ if (has_capability("new_owner_map", savefile_options)) { int x, y; struct player *owner = NULL; struct tile *claimer = NULL; for (y = 0; ...
false
false
false
false
false
0
mission_goal_fail_all() { int i; for (i=0; i<Num_goals; i++) { Mission_goals[i].satisfied = GOAL_FAILED; mission_log_add_entry( LOG_GOAL_FAILED, Mission_goals[i].name, NULL, i ); } }
false
false
false
false
false
0
infopopup_show (const char * filename, const Tuple * tuple, const char * title) { if (infopopup) gtk_widget_destroy (infopopup); str_unref (current_file); current_file = str_get (filename); infopopup_create (); infopopup_set_fields (tuple, title); infopopup_display_image (filename); ...
false
false
false
false
false
0
print_model_iter_info (const MODEL *pmod, PRN *prn) { int iters = gretl_model_get_int(pmod, "iters"); if (iters > 0) { pputc(prn, '\n'); pprintf(prn, A_("Convergence achieved after %d iterations\n"), iters); } else { int fncount = gretl_model_get_int(pmod, "fncount"); int grcount = gretl_model_get_int(...
false
false
false
false
false
0
_slurm_cgroup_stick_stepd(uint64_t id, pid_t pid) { if (*job_cgroup_path == '\0') return SLURM_ERROR; return xcgroup_add_pids(&job_freezer_cg, &pid, 1); }
false
false
false
false
false
0
operator==(const COMMON_COMPONENT& x)const { const EVAL_BM_COND* p = dynamic_cast<const EVAL_BM_COND*>(&x); bool rv = p && EVAL_BM_BASE::operator==(x); if (rv) {untested(); incomplete(); } return rv; }
false
false
false
false
false
0
setRange(const QString& range) { int sep = range.indexOf('-'); if(sep != -1) { m_start = range.left(sep).toInt() - 1; m_end = range.mid(sep + 1).toInt() - 1; } else { m_start = m_end = range.toInt() - 1; } if(m_end < 0) { m_end = m_database->count(); ...
false
false
false
false
false
0
selectRightTriangleRenderer() { ETriangleRenderer renderer = ETR_FLAT; if (Texture) { if (!Material.GouraudShading) renderer = (!Material.Wireframe) ? ETR_TEXTURE_FLAT : ETR_TEXTURE_FLAT_WIRE; else { if (Material.Wireframe) renderer = ETR_TEXTURE_GOURAUD_WIRE; else { if (Ma...
false
false
false
false
false
0
valuematch(vpat, value) char *vpat, *value; { glob *vg; int result; if (vpat == NULL) return (0); /*XXX: ?need to do international string check here */ if ((vg = glob_init(vpat, 0)) == NULL) return (-1); result = GLOB_TEST(vg, value); glob_free(&vg); return (result >= 0 ? 0...
false
false
false
false
false
0
marshal_collection_ptrarray (DBusMessageIter *iter, const GValue *value) { GType coltype; GType elt_gtype; DBusGValueCollectionMarshalData data; DBusMessageIter subiter; char *elt_sig; coltype = G_VALUE_TYPE (value); elt_gtype = dbus_g_type_get_collection_specialization (colt...
false
false
false
false
false
0
like_escape(PG_FUNCTION_ARGS) { text *pat = PG_GETARG_TEXT_PP(0); text *esc = PG_GETARG_TEXT_PP(1); text *result; if (pg_database_encoding_max_length() == 1) result = SB_do_like_escape(pat, esc); else result = MB_do_like_escape(pat, esc); PG_RETURN_TEXT_P(result); }
false
false
false
false
false
0
x86_event_sysfs_show(char *page, u64 config, u64 event) { u64 umask = (config & ARCH_PERFMON_EVENTSEL_UMASK) >> 8; u64 cmask = (config & ARCH_PERFMON_EVENTSEL_CMASK) >> 24; bool edge = (config & ARCH_PERFMON_EVENTSEL_EDGE); bool pc = (config & ARCH_PERFMON_EVENTSEL_PIN_CONTROL); bool any = (config & ARCH_P...
false
false
false
false
false
0
cd_get_track(Cd *cd, int i) { if ((0 < i) && (i <= cd->ntrack) && (cd != NULL)) return cd->track[i - 1]; else return NULL; }
false
false
false
false
false
0
loadScriptEngine(const QString &language, DataEngine *dataEngine) { DataEngineScript *engine = static_cast<DataEngineScript*>(loadEngine(language, DataEngineComponent, dataEngine)); if (engine) { engine->setDataEngine(dataEngine); } return engine; }
false
false
false
false
false
0
selinux_ipc_permission(struct kern_ipc_perm *ipcp, short flag) { u32 av = 0; av = 0; if (flag & S_IRUGO) av |= IPC__UNIX_READ; if (flag & S_IWUGO) av |= IPC__UNIX_WRITE; if (av == 0) return 0; return ipc_has_perm(ipcp, av); }
false
false
false
false
false
0
bytes2hex(uint8_t *bytes, size_t length) { char buf[3]; std::string space; space.reserve(length*2 + 1); for (size_t i = 0; i < length; i++) { snprintf(buf, sizeof(buf), "%02x", bytes[i]); space.append(buf); } return space; }
false
false
false
false
false
0
cloog_program_extract_scalars(CloogProgram *program, CloogScatteringList *scattering, CloogOptions *options) { int i, j, scalar, current, nb_scaldims=0 ; CloogScatteringList *start; CloogScattering *old; CloogLoop *loop; CloogBlock * block ; start = scattering ; for (i=0;i<program->nb_scattdims;i++) ...
false
true
false
true
false
1
trigger_cb(void) { GP<DjVuFile> life_saver=this; DEBUG_MSG("DjVuFile::trigger_cb(): got data for '" << url << "'\n"); DEBUG_MAKE_INDENT(3); file_size=data_pool->get_length(); flags|=DATA_PRESENT; get_portcaster()->notify_file_flags_changed(this, DATA_PRESENT, 0); if (!are_incl_files_created()) ...
false
false
false
false
false
0
check_for_backing_up (ds, state) int ds; int state[]; { if ((reject && !dfaacc[ds].dfaacc_set) || (!reject && !dfaacc[ds].dfaacc_state)) { /* state is non-accepting */ ++num_backing_up; if (backing_up_report) { fprintf (backing_up_file, _("State #%d is non-accepting -\n"), ds); /* identify t...
false
false
false
false
false
0
gt_pch_nx_eh_status (void *x_p) { struct eh_status * const x = (struct eh_status *)x_p; if (gt_pch_note_object (x, x, gt_pch_p_9eh_status)) { gt_pch_n_11eh_region_d ((*x).region_tree); gt_pch_n_20vec_eh_region_va_gc_ ((*x).region_array); gt_pch_n_25vec_eh_landing_pad_va_gc_ ((*x).lp_array); ...
false
false
false
false
false
0
skip_back_repeat_test(char *arg) { int go_back = simple_strtol(arg, NULL, 10); repeat_test--; if (repeat_test <= 0) ts.idx++; else ts.idx -= go_back; fill_get_buf(ts.tst[ts.idx].get); }
false
false
false
false
false
0
BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) { int max,min,dif; register BN_ULONG t1,t2,*ap,*bp,*rp; int i,carry; #if defined(IRIX_CC_BUG) && !defined(LINT) int dummy; #endif bn_check_top(a); bn_check_top(b); max = a->top; min = b->top; dif = max - min; if (dif < 0) /* hmm... should not be happeni...
false
false
false
false
false
0
x264_lookahead_get_frames( x264_t *h ) { if( h->param.i_sync_lookahead ) { /* We have a lookahead thread, so get frames from there */ x264_pthread_mutex_lock( &h->lookahead->ofbuf.mutex ); while( !h->lookahead->ofbuf.i_size && h->lookahead->b_thread_active ) x264_pthread_cond_wait(...
false
false
false
false
false
0
SetNoise( vtkTextureObject * noise ) { vtkSetObjectBodyMacro( Noise, vtkTextureObject, noise ); }
false
false
false
false
false
0
Perl_sv_sethek(pTHX_ SV *const sv, const HEK *const hek) { dVAR; PERL_ARGS_ASSERT_SV_SETHEK; if (!hek) { return; } if (HEK_LEN(hek) == HEf_SVKEY) { sv_setsv(sv, *(SV**)HEK_KEY(hek)); return; } else { const int flags = HEK_FLAGS(hek); if (flags & HVhek_WASUTF8) { STRLEN utf8_l...
false
false
false
false
false
0
saa6752hs_get_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_format *format) { struct v4l2_mbus_framefmt *f = &format->format; struct saa6752hs_state *h = to_state(sd); if (format->pad) return -EINVAL; if (h->video_format == SAA6752HS_VF_UNKNOWN) h->video_format = SAA67...
false
false
false
false
false
0
egg_list_box_accessible_is_child_selected (AtkSelection *selection, gint idx) { GtkWidget *box; GtkWidget *widget; GList *children; GtkWidget *child; box = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection)); if (box == NULL) return FALSE; widge...
false
false
false
false
false
0
wlan_check_if_moved (void) { gdouble lat_lr, lon_lr; gdouble lat_ul, lon_ul; if (wlan_lat_lr == 0 && wlan_lon_lr == 0 && wlan_lat_ul == 0 && wlan_lon_ul == 0) return 1; calcxytopos (SCREEN_X, SCREEN_Y, &lat_lr, &lon_lr, current.zoom); calcxytopos (0, 0, &lat_ul, &lon_ul, current.zoom); if (wlan...
false
false
false
false
false
0
mNUM_3DIGIT(bool _createToken) { int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); _ttype = NUM_3DIGIT; ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; { matchRange('0','9'); } { if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9'...
false
false
false
false
false
0
isLoadTypeLegal(Type *Ty, MVT &VT) { if (isTypeLegal(Ty, VT)) return true; // We will extend this in a later patch: // If this is a type than can be sign or zero-extended to a basic operation // go ahead and accept it now. if (VT == MVT::i8 || VT == MVT::i16) return true; return false; }
false
false
false
false
false
0
setVisible(bool yes) { QGraphicsLineItem::setVisible(yes); guideLine->setVisible(m_showGuideLine? yes : false); }
false
false
false
false
false
0
uci_close(uci_t * uci) { int i; option_t * opt; ASSERT(uci_is_ok(uci)); engine_close(uci->engine); uci->engine = NULL; my_string_clear(&uci->name); my_string_clear(&uci->author); for (i = 0; i < uci->option_nb; i++) { opt = &uci->option[i]; my_string_clear(&opt->name); my_...
false
false
false
false
false
0
_internal_reinit(const char *file_name) { char *name = (char *)file_name; int rc = SLURM_SUCCESS; if (name == NULL) { name = getenv("SLURM_CONF"); if (name == NULL) name = default_slurm_config_file; } if (conf_initialized) { /* could check modified time on slurm.conf here */ _destroy_slurm_conf(); } ...
false
false
false
false
true
1
adv_voice_restore_config(dword Id, PLCI *plci, byte Rc) { DIVA_CAPI_ADAPTER *a; word Info; dbug(1, dprintf("[%06lx] %s,%d: adv_voice_restore_config %02x %d", UnMapId(Id), (char *)(FILE_), __LINE__, Rc, plci->adjust_b_state)); Info = GOOD; a = plci->adapter; if ((plci->B1_facilities & B1_FACILITY_VOICE) ...
false
false
false
false
false
0
getDatumCopy(BuildAccumulator *accum, Datum value) { Form_pg_attribute *att = accum->ginstate->tupdesc->attrs; Datum res; if (att[0]->attbyval) res = value; else { Size realSize; char *s; realSize = datumGetSize(value, false, att[0]->attlen); s = (char *) palloc(realSize); accum->allocatedMemor...
false
false
false
false
false
0
smack_sk_alloc_security(struct sock *sk, int family, gfp_t gfp_flags) { struct smack_known *skp = smk_of_current(); struct socket_smack *ssp; ssp = kzalloc(sizeof(struct socket_smack), gfp_flags); if (ssp == NULL) return -ENOMEM; ssp->smk_in = skp; ssp->smk_out = skp; ssp->smk_packet = NULL; sk->sk_securit...
false
false
false
false
false
0
bignorm(VALUE x) { if (!FIXNUM_P(x) && TYPE(x) == T_BIGNUM) { x = bigfixize(bigtrunc(x)); } return x; }
false
false
false
false
false
0
Seqtype(char *seq) { int saw; /* how many non-gap characters I saw */ char c; int po = 0; /* count of protein-only */ int nt = 0; /* count of t's */ int nu = 0; /* count of u's */ int na = 0; /* count of nucleotides */ int aa = 0; /* count of amino acids */ int no = 0; /* count of o...
false
false
false
false
false
0
afr_build_parent_loc (loc_t *parent, loc_t *child) { char *tmp = NULL; if (!child->parent) { //this should never be called with root as the child GF_ASSERT (0); loc_copy (parent, child); return; } tmp = gf_strdup (child->p...
false
false
false
false
false
0
Command_PyLoad(char *filename) { PyObject *plugin; RELEASE_XCHAT_LOCK(); plugin = Plugin_New(filename, xchatout); ACQUIRE_XCHAT_LOCK(); if (plugin) plugin_list = g_slist_append(plugin_list, plugin); }
false
false
false
false
false
0
info_get(cchar *file, cchar **keys, int nkeys) { char *pp; static char *keyvals[10]; int contx = 0, err, ii; uint cc; if (nkeys < 1 || nkeys > 9) zappcrash("info_get nkeys: %d",nkeys); cc = 10 * sizeof(char *); // ...
false
false
false
false
false
0
merge_dup_record (const glMergeRecord *record) { glMergeRecord *dest_record; GList *p; glMergeField *dest_field, *field; gl_debug (DEBUG_MERGE, "START"); dest_record = g_new0 (glMergeRecord, 1); dest_record->select_flag = record->select_flag; for (p = record->field_list; p != NULL; p = p->next) { f...
false
false
false
false
false
0
gth_folder_tree_start_editing (GthFolderTree *folder_tree, GFile *file) { GtkTreeIter iter; GtkTreePath *tree_path; GtkTreeViewColumn *tree_column; if (! gth_folder_tree_get_iter (folder_tree, file, &iter, NULL)) return; g_object_set (folder_tree->priv->text_renderer, "ed...
false
false
false
false
false
0
qr_random_cost(const Operand* op0) { if (!is_float(op0->tbl.v->type) || op0->tbl.v->type == TYPE_LOGICAL) { ERROR_TYPE_MISMATCH("RANDOM"); } mark_register(op0, 0, TYPE_REAL); return frandom_cost(); }
false
false
false
false
false
0
iTargaSize(void) { ILuint Size, Bpp; ILubyte IDLen = 0; const char *ID = iGetString(IL_TGA_ID_STRING); const char *AuthName = iGetString(IL_TGA_AUTHNAME_STRING); const char *AuthComment = iGetString(IL_TGA_AUTHCOMMENT_STRING); //@TODO: Support color indexed images. if (iGetInt(IL_TGA_RLE) == IL_TRUE || iCurImag...
false
false
false
false
false
0
send_scsi_command_sync (gint fd, guint8 *cdb, gsize cdb_len, GError **error) { struct sg_io_v4 io_v4; uint8_t sense[32]; gboolean ret = FALSE; gint rc; gint timeout_msec = 30000; /* 30 seconds */ g_return_val_if_fail (fd !=...
false
false
false
false
false
0
reference_queue_proccess (MonoReferenceQueue *queue) { RefQueueEntry **iter = &queue->queue; RefQueueEntry *entry; while ((entry = *iter)) { #ifdef HAVE_SGEN_GC if (queue->should_be_deleted || !mono_gc_weak_link_get (&entry->dis_link)) { mono_gc_weak_link_remove (&entry->dis_link, TRUE); #else if (queue->shou...
false
false
false
false
false
0
stream_write (GMimeStream *stream, const char *buf, size_t len) { GMimeStreamGIO *gio = (GMimeStreamGIO *) stream; size_t nwritten = 0; GError *err = NULL; if (gio->file == NULL) { errno = EBADF; return -1; } if (gio->ostream == NULL) { /* try opening an output stream */ if (!(gio->ostream = (GOutputS...
false
false
false
false
false
0
script_wrapper_stream_free(GtNodeStream *ns) { GtScriptWrapperStream *script_wrapper_stream; if (!ns) return; script_wrapper_stream = script_wrapper_stream_cast(ns); if (script_wrapper_stream->free_func) script_wrapper_stream->free_func(NULL); }
false
false
false
false
false
0
param(std::string name, float init, float minVal, float maxVal, int decs) { OpParam par; par._name = name; par._gimpType.type = GIMP_PDB_FLOAT; par._gimpType.data.d_float = init; par._guiType = OpParam::FloatSlider; par._minFloat = minVal; par._maxFloat = maxVal; par._numDecimals = decs; _params.push_...
false
false
false
false
false
0
parse_set_clear(int *argcp, const char **argv) { int i, j; int argc_out = 0; const char **argv_out = (const char **) Malloc((*argcp + 1) * sizeof(char *)); argv_out[argc_out++] = argv[0]; for (i = 1; i < *argcp; i++) { Boolean is_set = False; if (!strcmp(argv[i], OptSet)) is_set = True; else if (s...
false
false
false
false
false
0
active_toggled_cb (GtkCellRendererToggle *cell, gchar *path_str, PluginDialog *pm) { GtkTreeIter iter; GtkTreePath *path; GtkTreeModel *model; gphpedit_debug(DEBUG_PLUGINS); path = gtk_tree_path_new_from_string (path_str); model = gtk_tree_view_get_model (GTK_TREE_VIEW (pm->priv->t...
false
false
false
false
false
0
newRegisNode(RegisNode *prev, int len) { RegisNode *ptr; ptr = (RegisNode *) palloc0(RNHDRSZ + len + 1); if (prev) prev->next = ptr; return ptr; }
false
false
false
false
false
0
SetStackSize(SQInteger n) { SQInteger size=_vlocals.size(); while(size>n){ size--; SQLocalVarInfo lvi=_vlocals.back(); if(type(lvi._name)!=OT_NULL){ lvi._end_op=GetCurrentPos(); _localvarinfos.push_back(lvi); } _vlocals.pop_back(); } }
false
false
false
false
false
0
hist_save(const char *cmd, int failed) { int i; FLAG new; HIST_ENTRY *x, *top; hist_reset_index(); new = 1; for (top = history[0], i = 0; i < hs_alloc; i++) { x = history[i]; history[i] = top; top = x; if (i == hs_cnt) { hs_cnt++; break; } if (strcmp(USTR(top->cmd),cmd) == 0) { /* avoid dup...
false
false
false
false
false
0
printxml( FILE * stream, size_t len ) { fprintf(fout, "\n" ); fprintf(fout, "Data:\n" ); for( ; len != 0; --len ) { int val = fgetc(stream); //if( isascii( val ) ) /* remove ^M */ /*if( !iscntrl( val ) ) */ /* it does not look like the tool is consistant BTW */ if( val != 0xd ) f...
false
false
false
false
false
0
fusion_hash_replace (FusionHash *hash, void * key, void * value, void **old_key, void **old_value) { FusionHashNode **node; D_MAGIC_ASSERT( hash, FusionHash ); node = fusion_hash_lookup_node (hash, key); if (*...
false
false
false
false
false
0
calc_load(struct mosquitto_db *db, char *buf, const char *topic, double exponent, double interval, double *current) { double new_value; new_value = interval + exponent*((*current) - interval); if(fabs(new_value - (*current)) >= 0.01){ snprintf(buf, BUFLEN, "%.2f", new_value); mqtt3_db_messages_easy_queue(db, NU...
false
false
false
false
false
0
plot_histogram(GtkWidget *darea, GdkRectangle *area, int dskip, double *rbh, int dbins) { int firstx, lcx, hcx; int i, h; GdkGC *fgc, *redgc; GdkColor red; GdkColormap *cmap; cmap = gdk_colormap_get_system(); red.red = 65535; red.green = 0; red.blue = 0; gdk_color_alloc(cmap, &red); redgc = gdk_gc_ne...
false
false
false
false
false
0
pwm_backlight_power_on(struct pwm_bl_data *pb, int brightness) { int err; if (pb->enabled) return; err = regulator_enable(pb->power_supply); if (err < 0) dev_err(pb->dev, "failed to enable power supply\n"); if (pb->enable_gpio) gpiod_set_value(pb->enable_gpio, 1); pwm_enable(pb->pwm); pb->enabled = tru...
false
false
false
false
false
0
gst_tag_list_get_scope (const GstTagList * list) { g_return_val_if_fail (GST_IS_TAG_LIST (list), GST_TAG_SCOPE_STREAM); return GST_TAG_LIST_SCOPE (list); }
false
false
false
false
false
0
ProcessPhanUndead(Unit *u,AString *o, OrdersCheck *pCheck) { CastIntOrder *order = new CastIntOrder; order->spell = S_CREATE_PHANTASMAL_UNDEAD; order->level = 0; order->target = 1; AString *token = o->gettoken(); if (!token) { u->Error("CAST: Must specify which illusion to summon."); delete order; return;...
false
false
false
false
false
0
read_heading(FILE *fp, int output_format) { char line[BUF_MAX], *s; /* the first BUF_MAX-1 chars of the line */ String_buf sb = get_string_buf(); int i = 0; s = fgets(line, BUF_MAX, fp); while (s && !substring("= end of head =", s)) { if (i != 0) { if (output_format == IVY) sb_append(sb, ";; "); ...
true
true
false
false
false
1
charconv_iconv_setup(char *fromcode, char *tocode, boolean *enable_conv) { /* clear already allocated descriptor */ if (cd != (iconv_t)-1) { if (iconv_close(cd) < 0) { perror("j_prinf_set_iconv"); return FALSE; } cd = (iconv_t)-1; } if (tocode == NULL) { /* disable conversion */ ...
false
false
false
false
false
0
img_hash_write_via_dma_stop(struct img_hash_dev *hdev) { struct img_hash_request_ctx *ctx = ahash_request_ctx(hdev->req); if (ctx->flags & DRIVER_FLAGS_SG) dma_unmap_sg(hdev->dev, ctx->sg, ctx->dma_ct, DMA_TO_DEVICE); return 0; }
false
false
false
false
false
0
mono_disasm_code (MonoDisHelper *dh, MonoMethod *method, const guchar *ip, const guchar* end) { char *result; GString *res = g_string_new (""); if (!dh) dh = &default_dh; while (ip < end) { ip = dis_one (res, dh, method, ip, end); } result = res->str; g_string_free (res, FALSE); return result; }
false
false
false
false
false
0
changeEvent(QEvent *event) { if (event->type() == QEvent::LanguageChange) { setWindowTitle(tr("Application Configurator Wizard")); } QWizard::changeEvent(event); }
false
false
false
false
false
0
vlistClearFlag(int vlistID) { int varID, levID; vlist_t *vlistptr; vlistptr = vlist_to_pointer(vlistID); for ( varID = 0; varID < vlistptr->nvars; varID++ ) { vlistptr->vars[varID].flag = FALSE; for ( levID = 0; levID < vlistptr->vars[varID].nlevs; levID++ ) { vlistptr->vars[...
false
false
false
false
false
0
gst_cutter_class_init (GstCutterClass * klass) { GObjectClass *gobject_class; gobject_class = (GObjectClass *) klass; gobject_class->set_property = gst_cutter_set_property; gobject_class->get_property = gst_cutter_get_property; g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_THRESHOLD, ...
false
false
false
false
false
0
bchannel_get_rxbuf(struct bchannel *bch, int reqlen) { int len; if (bch->rx_skb) { len = skb_tailroom(bch->rx_skb); if (len < reqlen) { pr_warning("B%d no space for %d (only %d) bytes\n", bch->nr, reqlen, len); if (test_bit(FLG_TRANSPARENT, &bch->Flags)) { /* send what we have now and try a new ...
false
false
false
false
false
0
NextTokenx(struct lex_record *p) { register int c, state = STATE_INITIAL; #ifndef HAVE_STDLIB_H #ifndef linux extern double atof(const char *); #endif #endif token_length = 0; while ((c = input(p)) != EOF) { switch (state) { case STATE_INITIAL: if (isspace(c)) { continue; } else if (isdigit(c...
false
false
false
false
true
1
dtmfActionsToXmlnode(void){ xmlnode *psNode = NULL; xmlnode *psChild = NULL; GList *psCurrent = NULL; psNode = xmlnode_new( "dtmf" ); xmlnode_set_attrib( psNode, "version", "1.0" ); for ( psCurrent = getDtmfActions(); psCurrent != NULL && psCurrent -> data != NULL; psCurrent = psCurrent -> next ) { psChild = ...
false
false
false
false
false
0
remove(ArSyncTask *proc) { std::multimap<int, ArSyncTask *>::iterator it; for (it = myMultiMap.begin(); it != myMultiMap.end(); it++) { if ((*it).second == proc) { myMultiMap.erase(it); return; } } }
false
false
false
false
false
0
add_match_entry(char *match) { match_list_t *entry = NULL; char *mirror_path = NULL; char *ptr = match; /* Split "Foo=/mirror/foo" into its components */ while (*ptr) { if ('=' == *ptr) { *ptr = 0; ptr++; mirror_path = ptr; break; ...
false
false
false
false
false
0
define_attr_by_text(HSCPRC * hp, STRPTR attr_text, STRPTR default_value, ULONG unmasked_flags) { /* NOTE: this functions works a bit strange */ EXPSTR *define_text = init_estr(0); INFILE *old_inpf = hp->inpf; HSCATTR *attr = NULL; /* create attribute definition */ set_estr(define_text, attr_text);...
false
false
false
false
false
0
sys_task_urandom( long* seed /*!< Pointer to seed value to use and store new information to */ ) { PROFILE(SYS_TASK_URANDOM); unsigned long result; if( seed != NULL ) { random_seed = *seed; } result = sys_task_dist_uniform( &random_seed, INT_MIN, INT_MAX ) - INT_MIN; if( seed != NULL ) { *seed ...
false
false
false
false
false
0
leased_l4l3(struct PStack *st, int pr, void *arg) { struct Channel *chanp = (struct Channel *) st->lli.userdata; struct sk_buff *skb = arg; switch (pr) { case (DL_DATA | REQUEST): link_debug(chanp, 0, "leased line d-channel DATA"); dev_kfree_skb(skb); break; case (DL_ESTABLISH | REQUEST): st->l2.l2l1(st, ...
false
false
false
false
false
0
set_car(uint32_t args) { TWO_ARGS(arg1, arg2); if (TYPE(arg1) != T_PAIR) return 0; SET_CAR(arg1, arg2); return C_UNSPEC; }
false
false
false
false
false
0
tok_version(void) { static time_t last_generated = 0; static char *toklevel = NULL; time_t now = tm_time(); /* * We don't generate a new token each time, but only every TOKEN_LIFE * seconds. The clock skew threshold must be greater than twice that * amount, of course. */ g_assert(TOKEN_CLOCK_SKEW > 2 * ...
false
false
false
false
false
0
librxrxmatch_num_matches(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_) { ScmObj match_scm; ScmObj match; ScmObj SCM_SUBRARGS[1]; int SCM_i; SCM_ENTER_SUBR("rxmatch-num-matches"); for (SCM_i=0; SCM_i<1; SCM_i++) { SCM_SUBRARGS[SCM_i] = SCM_ARGREF(SCM_i); } match_scm = SCM_SUBRARGS[0]; match = (match...
false
false
false
false
false
0