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
ParseBoundingBox( CPLXMLNode *psBoundingBox, CPLString &osCRS, double &dfLowerX, double &dfLowerY, double &dfUpperX, double &dfUpperY ) { int nRet = TRUE; osCRS = CPLGetXMLValue( psBoundingBox, "crs", "" ); char **papszLC = CSLTokenizeStringComp...
false
false
false
false
false
0
insert_metainfo(char *key, char *value) { MetaInfo *mi; MetaInfo *mi_new; for (mi = mi_store; mi; mi = mi->next) { if (StrEquals(mi->key, key)) { /* We already have an entry in the list with that key, so * update the value of it only. */ free (mi->value); CopyString(&mi->value, value); ret...
false
false
false
false
false
0
validation_rebuild_validation (FormatState *state) { ValidationType type; if (!state->enable_edit) return; state->validation.changed = FALSE; type = gtk_combo_box_get_active ( state->validation.constraint_type); if (type != GNM_VALIDATION_TYPE_ANY) { ValidationStyle style = gtk_combo_box_get_active (state...
false
false
false
false
false
0
SetInterpolationType(int type) { type = (type < INTERPOLATION_TYPE_LINEAR ? INTERPOLATION_TYPE_LINEAR : (type > INTERPOLATION_TYPE_SPLINE ? INTERPOLATION_TYPE_SPLINE : type)); if ( type != this->InterpolationType ) { this->Initialize(); //wipe out data this->InterpolationType = type; this-...
false
false
false
false
false
0
epoint2_comp(_MIPD_ epoint *a,epoint *b) { int ia,ib; #ifdef MR_OS_THREADS miracl *mr_mip=get_mip(); #endif if (mr_mip->ERNUM) return FALSE; if (a==b) return TRUE; if (a->marker==MR_EPOINT_INFINITY) { if (b->marker==MR_EPOINT_INFINITY) return TRUE; else return FALSE; } ...
false
false
false
false
false
0
sensor_specific_event_enable_commit (const char *section_name, const struct config_keyvalue *kv, void *arg) { ipmi_sensors_config_state_data_t *state_data; struct sensor_event_enable_data data; uint16_t bits = 0; uint8_t bitposition = 0; ...
false
false
false
false
false
0
EffectPlayerPull(SpellEffectIndex eff_idx) { if (!unitTarget) return; float dist = unitTarget->GetDistance2d(m_caster); if (damage && dist > damage) dist = float(damage); unitTarget->KnockBackFrom(m_caster, -dist, float(m_spellInfo->EffectMiscValue[eff_idx]) / 10); }
false
false
false
false
false
0
insn_default_length (rtx insn ATTRIBUTE_UNUSED) { switch (recog_memoized (insn)) { case 724: /* *aarch64_simd_movv2df */ case 723: /* *aarch64_simd_movv4sf */ case 722: /* *aarch64_simd_movv2di */ case 721: /* *aarch64_simd_movv4si */ case 720: /* *aarch64_simd_movv8hi */ case 719: /...
false
false
false
false
false
0
visprintf_alloc (char **buf, const char *fmt, va_list ap) { char ibuf[4096]; int bl, size; va_list tmp; /* PPC doesn't like you re-using a va_list... and it might not be * supposed to work at all */ va_copy(tmp, ap); size = sizeof (ibuf); bl = vsnprintf (ibuf, sizeof (ibuf), fmt, tmp); if (bl > -1 &&...
false
false
false
false
false
0
CleanPath(char *entry) { char *p, *q; size_t len; // wash out any '//' in entry while ( (p = strstr(entry, "//")) != NULL ) { p++; q = p+1; // q points to first char after '//' while ( *p ) *p++ = *q++; } // remove trailing '/' len = strlen(entry); if ( entry[len-1] == '/' ) entry[len-1] = '\0'; //...
false
false
false
false
false
0
tre_match(const tre_tnfa_t *tnfa, const void *string, size_t len, tre_str_type_t type, size_t nmatch, regmatch_t pmatch[], int eflags) { reg_errcode_t status; int *tags = NULL, eo; if (tnfa->num_tags > 0 && nmatch > 0) { #ifdef TRE_USE_ALLOCA tags = alloca(sizeof(*tags) * tnfa->num_tags); #else /*...
false
false
false
false
false
0
ReadChan_Ascii(Scene& /*out*/, LineSplitter& splitter, const ChunkInfo& nfo) { if(nfo.version > 8) { return UnsupportedChunk_Ascii(splitter,nfo,"Chan"); } }
false
false
false
false
false
0
StoreHuffmanTreeOfHuffmanTreeToBitMask( VP8LBitWriter* const bw, const uint8_t* code_length_bitdepth) { // RFC 1951 will calm you down if you are worried about this funny sequence. // This sequence is tuned from that, but more weighted for lower symbol count, // and more spiking histograms. static const uin...
false
false
false
false
false
0
parse_crashkernel_mem(char *cmdline, unsigned long long system_ram, unsigned long long *crash_size, unsigned long long *crash_base) { char *cur = cmdline, *tmp; /* for each entry of the comma-separated list */ do { unsigned long long start, end = ULLONG_MAX, size; /* get the start of the range *...
false
false
false
false
false
0
xhci_reserve_host_control_ep_resources(struct xhci_hcd *xhci) { if (xhci->num_active_eps + 1 > xhci->limit_active_eps) { xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, "Not enough ep ctxs: " "%u active, need to add 1, limit is %u.", xhci->num_active_eps, xhci->limit_active_eps); return -ENOMEM; } xhci->...
false
false
false
false
false
0
Access_mmap (int *fd, size_t *len, char *filename, size_t eltsize, bool randomp) { off_t length; #ifdef HAVE_CADDR_T caddr_t memory; #else void *memory; #endif if ((*len = length = Access_filesize(filename)) == 0U) { fprintf(stderr,"Error: file %s is empty\n",filename); exit(9); } if ((*fd = open...
false
false
false
false
false
0
make_pipe (int p[2], DBusError *error) { int retval; #ifdef HAVE_PIPE2 dbus_bool_t cloexec_done; retval = pipe2 (p, O_CLOEXEC); cloexec_done = retval >= 0; /* Check if kernel seems to be too old to know pipe2(). We assume that if pipe2 is available, O_CLOEXEC is too. */ if (retv...
false
false
false
false
false
0
FreeIdentifier(struct Identifier * id) { if(id->badID) FreeIdentifier(id->badID); (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0); if(id->_class) FreeSpecifier(id->_class); ((id ? (__ecereClass_Identifier->Destructor ? __ecereClass_Identifier->Destructor(id) : 0, __ecereNameSpace__ecere__com_...
false
false
false
false
false
0
build_descriptor_table_initializer (tree type, tree entries) { vec<constructor_elt, va_gc> *inits = NULL; do { vec<constructor_elt, va_gc> *elts = NULL; CONSTRUCTOR_APPEND_ELT (elts, NULL_TREE, build_selector (METHOD_SEL_NAME (entries))); CONSTRUCTOR_APPEND_ELT (elts, NULL_TREE, ...
false
false
false
false
false
0
wm9712_set_bias_level(struct snd_soc_codec *codec, enum snd_soc_bias_level level) { switch (level) { case SND_SOC_BIAS_ON: case SND_SOC_BIAS_PREPARE: break; case SND_SOC_BIAS_STANDBY: ac97_write(codec, AC97_POWERDOWN, 0x0000); break; case SND_SOC_BIAS_OFF: /* disable everything including AC link */ ...
false
false
false
false
false
0
writecache_be_word(offs_t offset, data16_t data) { offset &= 0x1fffffff; if (offset * 4 < r3000.cache_size) *(data16_t *)&r3000.cache[WORD_XOR_BE(offset)] = data; }
false
false
false
false
false
0
create_hello_message(const char *uuid, const char *client_name, const char *major_version, const char *minor_version) { xmlNode *hello_node = NULL; xmlNode *hello = NULL; if (uuid == NULL || strlen(uuid) == 0 || client_name == NULL || strlen(client_name) == 0 || major_v...
false
false
false
false
false
0
ComputeGlobalTarget(Handle<GlobalObject> global, LookupResult* lookup) { target_ = Handle<JSFunction>::null(); cell_ = Handle<JSGlobalPropertyCell>::null(); ASSERT(lookup->IsProperty() && lookup->type() == NORMAL && lookup->holder() == *global); cell_ = Handle<JS...
false
false
false
false
false
0
swapon_all(void) { FILE *fp; struct mntent *fstab; int status = 0; read_proc_swaps(); fp = setmntent(_PATH_MNTTAB, "r"); if (fp == NULL) err(2, _("%s: open failed"), _PATH_MNTTAB); while ((fstab = getmntent(fp)) != NULL) { const char *special; int skip = 0, nofail = ifexists; int pri = priority, dsc =...
false
false
false
false
false
0
adau17x1_pll_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); struct adau *adau = snd_soc_codec_get_drvdata(codec); int ret; if (SND_SOC_DAPM_EVENT_ON(event)) { adau->pll_regs[5] = 1; } else { adau->pll_regs[5] = 0;...
false
false
false
false
false
0
get_tp_c_level (void) { uae_u8 v = (sbcp == 1 ? 0 : (1 << 0)) | (scor == 1 ? 0 : (1 << 1)) | (stch == 1 ? 0 : (1 << 2)) | (sten == 1 ? 0 : (1 << 3)) | (1 << 4); if (sten == 1) sten = -1; if (scor == 1) scor = -1; if (sbcp == 1) sbcp = -1; return v; }
false
false
false
false
false
0
AaffWriteSegment (t_pAaff pAaff, const char *pName, unsigned int Argument, const unsigned char *pData, unsigned int DataLen) { unsigned int NameLen0 = strlen(pName); pAaff->SegmentHeader.NameLen = htonl(NameLen0); pAaff->SegmentHeader.DataLen = htonl(DataLen); pAaff->SegmentHeader.Argument = htonl(...
false
false
false
false
false
0
maildir_filter_ruledown(struct maildirfilter *r, struct maildirfilterrule *p) { struct maildirfilterrule *q; q=p->next; if (!q) return; q->prev=p->prev; if (q->prev) q->prev->next=q; else r->first=q; if ((p->next=q->next) != 0) p->next->prev=p; else r->last=p; p->prev=q; q->next=p; }
false
false
false
false
false
0
compute_stays(struct diff_queue_struct *q, struct diff_filespec *one) { int i; for (i = 0; i < q->nr; i++) { struct diff_filepair *p = q->queue[i]; if (strcmp(one->path, p->two->path)) continue; if (DIFF_PAIR_RENAME(p)) { return 0; /* something else is renamed into this */ } } return 1; }
false
false
false
false
false
0
sock_error(int x) { if(isOpen()) { resetConnection(); setError(ErrRead); } else { resetConnection(true); if(x == BSocket::ErrHostNotFound) setError(ErrProxyConnect); else if(x == BSocket::ErrConnectionRefused) setError(ErrProxyConnect); else if(x == BSocket::ErrRead) setError(ErrProxyNeg); } }
false
false
false
false
false
0
GC_process_togglerefs (void) { int i, w; int toggle_ref_counts [3] = { 0, 0, 0 }; for (i = w = 0; i < GC_toggleref_array_size; ++i) { GC_ToggleRefStatus res; GCToggleRef r = GC_toggleref_array [i]; GC_PTR obj; if (r.strong_ref) obj = r.strong_ref; else if (r.weak_ref) obj = REVEAL_POINTER (r.weak_...
false
false
false
false
false
0
forkAndRedirectToTee(char *filename) { pid_t pid; int p[2]; if (pipe(p) == -1) { // Signal error condition. *filename = '\0'; return; } pid = asyncFork(); if (pid == 0) { close(p[1]); dup2(p[0], STDIN_FILENO); execlp("tee", "tee", filename, (const char * const) 0); execlp("/usr/bin/tee", "tee", fi...
false
false
false
false
false
0
setupSampling() { // Find maximum = value of cross section. sigmaNw = sigmaProcessPtr->sigmaHatWrap(); sigmaMx = sigmaNw; // Squared and outgoing masses of particles. s1 = mA * mA; s2 = mB * mB; m3 = mA; m4 = mB; // Elastic slope. bSlope = sigmaTotPtr->bS...
false
false
false
false
false
0
clocks_timer_main_panel_pause (ClocksTimerMainPanel* self) { GTimer* _tmp0_ = NULL; gdouble _tmp1_ = 0.0; GTimer* _tmp2_ = NULL; gdouble _tmp3_ = 0.0; ClocksTimerCountdownFrame* _tmp4_ = NULL; GtkLabel* _tmp5_ = NULL; GtkStyleContext* _tmp6_ = NULL; g_return_if_fail (self != NULL); self->priv->state = CLOCKS_T...
false
false
false
false
false
0
fcode_end_err_check( void) { bool stack_imbal = BOOLVAL( stackdepth() != 0 ); if ( stack_imbal ) { tokenization_error( WARNING, "Stack imbalance before end of tokenization.\n"); } clear_stack(); clear_control_structs("End of tokenization"); }
false
false
false
false
false
0
w83877f_wdt_init(void) { int rc = -EBUSY; if (timeout < 1 || timeout > 3600) { /* arbitrary upper limit */ timeout = WATCHDOG_TIMEOUT; pr_info("timeout value must be 1 <= x <= 3600, using %d\n", timeout); } if (!request_region(ENABLE_W83877F_PORT, 2, "W83877F WDT")) { pr_err("I/O address 0x%04x already i...
false
false
false
false
false
0
VertexCache_getVertex ( const u32 sourceIndex ) { for ( s32 i = 0; i < VERTEXCACHE_ELEMENT; ++i ) { if ( VertexCache.info[ i ].index == sourceIndex ) { return (s4DVertex *) ( (u8*) VertexCache.mem.data + ( i << ( SIZEOF_SVERTEX_LOG2 + 1 ) ) ); } } return 0; }
false
false
false
false
false
0
m88rs2000_set_tone(struct dvb_frontend *fe, enum fe_sec_tone_mode tone) { struct m88rs2000_state *state = fe->demodulator_priv; u8 reg0, reg1; m88rs2000_writereg(state, 0x9a, 0x30); reg0 = m88rs2000_readreg(state, 0xb1); reg1 = m88rs2000_readreg(state, 0xb2); reg1 &= 0x3f; switch (tone) { case SEC_TO...
false
false
false
false
false
0
e_attachment_view_drag_source_set (EAttachmentView *view) { EAttachmentViewInterface *interface; GtkTargetEntry *targets; GtkTargetList *list; gint n_targets; g_return_if_fail (E_IS_ATTACHMENT_VIEW (view)); interface = E_ATTACHMENT_VIEW_GET_INTERFACE (view); if (interface->drag_source_set == NULL) return; ...
false
false
false
false
false
0
mono_loader_set_error_assembly_load (const char *assembly_name, gboolean ref_only) { MonoLoaderError *error; if (mono_loader_get_last_error ()) return; error = g_new0 (MonoLoaderError, 1); error->exception_type = MONO_EXCEPTION_FILE_NOT_FOUND; error->assembly_name = g_strdup (assembly_name); error->ref_only ...
false
false
false
false
false
0
send_path_orders(struct unit *punit, struct pf_path *path, bool repeat, bool vigilant, struct unit_order *final_order) { struct packet_unit_orders p; int i; struct tile *old_tile; memset(&p, 0, sizeof(p)); p.unit_id = punit->id; p.src_tile = tile_index(unit_tile(punit)); p.repeat = repeat...
false
false
false
true
false
1
Rd_In_Code_Check(WamWord start_word) { int c; c = Rd_Integer_Check(start_word); if (c != -1 && !Is_Valid_Code(c)) Pl_Err_Representation(representation_in_character_code); return c; }
false
false
false
false
false
0
read(hsStream* S, plResManager* mgr) { plMessage::read(S, mgr); fCloneKey = mgr->readKey(S); fRequestorKey = mgr->readKey(S); fOriginatingPlayerID = S->readInt(); fUserData = S->readInt(); fValidMsg = S->readByte(); fIsLoading = S->readByte(); setTriggerMsg(plMessage::Convert(mgr->ReadC...
false
false
false
false
false
0
activate_activation_uris_ready_callback (GList *files_ignore, gpointer callback_data) { ActivateParameters *parameters = callback_data; GList *l, *next, *files; NautilusFile *file; LaunchLocation *location; parameters->files_handle = NULL; for (l = parameters->locations; l != NULL; l = next) { location...
false
false
false
false
false
0
ply_get_other_properties( PlyFile *plyfile, const char *elem_name, int offset ) { int i; PlyElement *elem; PlyOtherProp *other; PlyProperty *prop; int nprops; /* find information about the element */ elem = find_element (plyfile, elem_name); if (elem == NULL) { vtkGenericWarningMacro("ply_get...
false
false
false
false
false
0
getShoot() { if (m_sea->turn() == m_player) { Coord c = m_ai->getMove(); emit shoot(m_player, c); } }
false
false
false
false
false
0
unqlite_kv_store_fmt(unqlite *pDb,const void *pKey,int nKeyLen,const char *zFormat,...) { unqlite_kv_engine *pEngine; int rc; if( UNQLITE_DB_MISUSE(pDb) ){ return UNQLITE_CORRUPT; } #if defined(UNQLITE_ENABLE_THREADS) /* Acquire DB mutex */ SyMutexEnter(sUnqlMPGlobal.pMutexMethods, pDb->pMutex); /* NO-OP if s...
false
false
false
false
false
0
hsep_notify_shared(uint64 own_files, uint64 own_kibibytes) { /* check for change */ if ( own_files != hsep_own[HSEP_IDX_FILES] || own_kibibytes != hsep_own[HSEP_IDX_KIB] ) { if (GNET_PROPERTY(hsep_debug)) { g_debug("HSEP: Shared files changed to %s (%s KiB)", uint64_to_string(own_files), uint64_to_s...
false
false
false
false
false
0
Detect_Stack(WamWord *adr, char **stack_name) { int i; for (i = 0; i < NB_OF_STACKS; i++) if (adr >= stk_tbl[i].stack && adr < stk_tbl[i].stack + stk_tbl[i].size) { *stack_name = stk_tbl[i].name; return stk_tbl[i].stack; } return NULL; }
false
false
false
false
false
0
eventRun(void) { struct ev_entry *event = NULL; EVH *func; void *arg; int weight = 0; if (NULL == tasks) return; if (tasks->when > current_dtime) return; run_id++; debug(41, 5) ("eventRun: RUN ID %d\n", run_id); while ((event = tasks)) { int valid = 1; if (event->when > current_d...
false
false
false
false
false
0
item_queue_is_blocked_by_file (TrackerMinerFS *fs, GFile *file) { g_return_val_if_fail (G_IS_FILE (file), FALSE); if (fs->priv->item_queue_blocker != NULL && (fs->priv->item_queue_blocker == file || g_file_equal (fs->priv->item_queue_blocker, file))) { return TRUE; } re...
false
false
false
false
false
0
dirname_eq (const void *p, const void *q) { struct dirname_entry *e = (struct dirname_entry *)p; struct dirname_entry *f = (struct dirname_entry *)q; return (e->dirname_len == f->dirname_len && memcmp (e->dirname, f->dirname, e->dirname_len) == 0); }
false
false
false
false
false
0
GlobusRecoverProxyOpenSSL(void) { #ifdef HAVE_OPENSSL_PROXY // No harm even if not needed - shall trun proxies on for code // which was written with no proxies in mind SetEnv("OPENSSL_ALLOW_PROXY_CERTS","1"); return true; // Following algorithm is unsafe because if mixes callbacks // meant to work with...
false
false
false
false
false
0
find_constant_term_loc (p) rtx *p; { rtx *tem; enum rtx_code code = GET_CODE (*p); /* If *P IS such a constant term, P is its location. */ if (code == CONST_INT || code == SYMBOL_REF || code == LABEL_REF || code == CONST) return p; /* Otherwise, if not a sum, it has no constant term. */ ...
false
false
false
false
false
0
store( QDomNode & node, QDomDocument & document ) const { Q_D( const CaretAnnotation ); // recurse to parent objects storing properties Annotation::store( node, document ); // create [caret] element QDomElement caretElement = document.createElement( "caret" ); node.appendChild( caretElement );...
false
false
false
false
false
0
remove_cached_list (xmmsc_result_t *matching, cli_infos_t *infos) { /* FIXME: w00t at code copy-paste, please modularize */ xmmsc_result_t *rmres; guint plid; gint32 id; gint plsize; GArray *playlist; gint i; const gchar *err; xmmsv_t *val; val = xmmsc_result_get_value (matching); plsize = infos->cache->a...
false
false
false
false
false
0
gamgi_engine_copy_shape (gamgi_shape *shape) { gamgi_dlist *dlist; gamgi_text *text_new; gamgi_shape *shape_new; shape_new = gamgi_engine_create_shape (); static_start (GAMGI_CAST_OBJECT shape_new); gamgi_engine_copy_out_shape (shape, shape_new); shape_new->object.number = gamgi_engine_number_shape_get (); dlist = sh...
false
false
false
false
false
0
ucol_inv_getNext(UColTokenParser *src, UColTokListHeader *lh, uint32_t strength) { uint32_t CE = lh->baseCE; uint32_t SecondCE = lh->baseContCE; uint32_t *CETable = (uint32_t *)((uint8_t *)src->invUCA+src->invUCA->table); uint32_t nextCE, nextContCE; int32_t iCE; iCE = ucol_inv_findCE(src, CE,...
false
false
false
false
false
0
propval_copy(struct propval *pv) { struct propval *pv_copy; size_t size; if (!pv) { return NULL; } pv_copy = fc_calloc(1, sizeof(*pv)); pv_copy->valtype = pv->valtype; switch (pv->valtype) { case VALTYPE_NONE: return pv_copy; case VALTYPE_INT: pv_copy->data.v_int = pv->data.v_int; r...
false
false
false
false
false
0
setZoomFactor (int percent) { // ### zooming under 100% is majorly botched, // so disable that for now. if (percent < 100) percent = 100; // ### if (percent < minZoom) percent = minZoom; if (percent > maxZoom) percent = maxZoom; if (d->m_zoomFactor == percent) return; d->m_zoomFactor = percent; up...
false
false
false
false
false
0
mv_port_intr(struct ata_port *ap, u32 port_cause) { struct mv_port_priv *pp; int edma_was_enabled; /* * Grab a snapshot of the EDMA_EN flag setting, * so that we have a consistent view for this port, * even if something we call of our routines changes it. */ pp = ap->private_data; edma_was_enabled = (pp->...
false
false
false
false
false
0
findAll(RefAST target) { ANTLR_USE_NAMESPACE(std)vector<RefAST> roots; // the empty tree cannot result in an enumeration if (target) { doWorkForFindAll(roots,target,false); // find all matches recursively } return roots; }
false
false
false
false
false
0
improveOrthogonalRoutes(Router *router) { router->timers.Register(tmOrthogNudge, timerStart); for (size_t dimension = 0; dimension < 2; ++dimension) { // Build nudging info. // XXX: We need to build the point orders separately in each // dimension since things move. There is pr...
false
false
false
false
false
0
closedir(DIR *dir) { int err, fd; struct statfs stfs; struct rdu *p; err = -1; if (LibAuTestFunc(Rdu_READDIR) || LibAuTestFunc(Rdu_READDIR_R) || LibAuTestFunc(closedir)) { errno = EBADF; fd = dirfd(dir); if (fd < 0) goto out; err = fstatfs(fd, &stfs); if (err) goto out; if (stfs.f_typ...
false
false
false
false
false
0
ok_to_close_gtkpod(void) { gint result = GTK_RESPONSE_OK; if (!files_are_saved()) { const gchar *str = _("Data has been changed and not been saved. If you quit gtkpod, all unsaved changes will be lost.\n\nDo you want to save your changes first?"); result...
false
false
false
false
false
0
get_uint64(char *in_value, uint64_t *out_value, char *type) { char *ptr = NULL, *meat = NULL; long long num; if (!(meat = strip_quotes(in_value, NULL, 1))) { error("Problem with strip_quotes"); return SLURM_ERROR; } num = strtoll(meat, &ptr, 10); if ((num == 0) && ptr && ptr[0]) { error("Invalid value for...
false
false
false
false
false
0
Seeder_WordHood_traverse(gchar *word, gint score, gpointer user_data){ register Seeder_TraverseData *traverse_data = user_data; register Seeder *seeder = traverse_data->seeder; register Seeder_WordInfo *word_info; g_assert(seeder); word_info = Seeder_add_WordInfo(traverse_data->seed...
false
false
false
false
false
0
createWidget(QWidget* parent, const QString& className, const QString& name) { UiLoader loader; QWidget* widget = loader.createWidget(className, parent, name); if( parent && parent->layout() ) parent->layout()->addWidget(widget); return widget; }
false
false
false
false
false
0
handler_to_async (SCM handler, int signum) { if (scm_is_false (handler)) return SCM_BOOL_F; else { SCM async = scm_primitive_eval_x (scm_list_3 (scm_sym_lambda, SCM_EOL, scm_list_2 (handler, scm_from_int (signum)))); #if !SCM_USE_PTHREAD_THREADS async = scm_cons (async, SCM_BOO...
false
false
false
false
false
0
element_is_valid_filter (GstElement * element, gboolean * isdynamic) { GstElementFactory *factory; const GList *templates; gboolean havesink = FALSE; gboolean havesrc = FALSE; gboolean done = FALSE; GstIterator *pads; gpointer res; if (isdynamic) *isdynamic = FALSE; pads = gst_element_iterate_pa...
false
false
false
false
false
0
init_group (GstPlayBin * playbin, GstSourceGroup * group) { int n; /* store the array for the different channels */ group->video_channels = g_ptr_array_new (); group->audio_channels = g_ptr_array_new (); group->text_channels = g_ptr_array_new (); group->lock = g_mutex_new (); /* init selectors. The selec...
false
false
false
false
false
0
i2c_av_read(struct i2c_adapter *i2c, u16 reg) { int ret; u8 buf[2]; struct i2c_msg msg = { .addr = 0x88 >> 1, .flags = 0, .buf = buf, .len = 2 }; buf[0] = reg >> 8; buf[1] = reg & 0xff; ret = i2c_transfer(i2c, &msg, 1); if (ret != 1) printk(KERN_ERR "%s: i2c write error!\n", __func__); msg.flags ...
false
false
false
false
false
0
s48_external_event_pendingPUunsafe(void) { { if ((NULL == (Spending_event_types_readyS))) { return 0;} else { Spending_event_types_readyS = ((Spending_event_types_readyS)->next); return 1;}} }
false
false
false
false
false
0
addpreorder(node *p, node *item_, node *nufork_, double *place) { /* traverses a binary tree, calling PROCEDURE tryadd at a node before calling tryadd at its descendants */ node *item, *nufork, *q; item = item_; nufork = nufork_; if (p == NULL) return; tryadd(p,&item,&nufork,place); if (!p->tip)...
false
false
false
false
false
0
userAgentForApplication( const QString &appName, const QString& appVersion, const QStringList& extraInfo ) { QString systemName, systemVersion, machine, info; if (getSystemNameVersionAndMachine( systemName, systemVersion, machine )) { info += systemName; info += QL1C('/'); info += systemVersion; ...
false
false
false
false
false
0
custom_log(struct ast_cdr *cdr) { struct ast_channel *dummy; struct ast_str *str; struct cdr_config *config; /* Batching saves memory management here. Otherwise, it's the same as doing an allocation and free each time. */ if (!(str = ast_str_thread_get(&custom_buf, 16))) { return -1; } dummy = ast_dummy_cha...
false
false
false
false
true
1
append_character( char c ) { size_t length = strlen( text ); if( length < 23 ) { text[ length ] = c; text[ length + 1 ] = '\0'; } }
false
false
false
false
false
0
SetInt(int value) { delete [] _value; _value = new char[MAX_CHARS_FOR_NUMBER]; sprintf( _value, "%i", value); }
false
false
false
false
false
0
start_intl_transfers(struct isp1362_hcd *isp1362_hcd) { int ptd_count = 0; struct isp1362_ep_queue *epq = &isp1362_hcd->intl_queue; struct isp1362_ep *ep; if (atomic_read(&epq->finishing)) { DBG(1, "%s: finish_transfers is active for %s\n", __func__, epq->name); return; } list_for_each_entry(ep, &isp1362_hc...
false
false
false
false
false
0
print_session(struct l2tp_data *data) { struct l2tp_parm *p = &data->config; printf("Session %u in tunnel %u\n", p->session_id, p->tunnel_id); printf(" Peer session %u, tunnel %u\n", p->peer_session_id, p->peer_tunnel_id); if (p->ifname != NULL) { printf(" interface name: %s\n", p->ifname); }...
false
false
false
false
false
0
chdir_yield(struct chdir_data *args) { dir_chdir(args->new_path); args->done = TRUE; chdir_blocking++; if (chdir_thread == Qnil) chdir_thread = rb_thread_current(); return rb_yield(args->new_path); }
false
false
false
false
false
0
eq_new(slapi_eq_fn_t fn, void *arg, time_t when, unsigned long interval) { slapi_eq_context *retptr = (slapi_eq_context *)slapi_ch_calloc(1, sizeof(slapi_eq_context)); time_t now; retptr->ec_fn = fn; retptr->ec_arg = arg; now = current_time(); retptr->ec_when = when < now ? now : when; retptr->ec_interval = int...
false
false
false
false
false
0
queue_init(queue* q, int size){ int i; /* user specified size or default */ if(size>0) { q->maxSize = size; } else { q->maxSize = QUEUEMAXSIZE; } /* malloc array */ q->array = malloc(sizeof(queue_node) * (q->maxSize)); if(!(q->array)){ perror("Error on queue Malloc"); ret...
false
true
false
false
false
1
saf_get_stream(GF_SAFMuxer *mux, u32 stream_id) { GF_SAFStream *str; u32 i=0; while ( (str = (GF_SAFStream *)gf_list_enum(mux->streams, &i)) ) { if (str->stream_id==stream_id) return str; } return NULL; }
false
false
false
false
false
0
compactElements(const Uint32 maxLength) { DcmStack stack; DcmObject *object = NULL; /* iterate over all elements */ while (nextObject(stack, OFTrue).good()) { object = stack.top(); // compact element if maximum length is exceeded if (object->isLeaf() && (object->getLength() >...
false
false
false
false
false
0
build_source_filenames (GdictSourceLoader *loader) { GSList *retval, *d; g_assert (GDICT_IS_SOURCE_LOADER (loader)); if (!loader->priv->paths) return NULL; retval = NULL; for (d = loader->priv->paths; d != NULL; d = d->next) { gchar *path = (gchar *) d->data; const gchar *filename...
false
false
false
false
false
0
max8997_i2c_parse_dt_pdata( struct device *dev) { struct max8997_platform_data *pd; pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL); if (!pd) { dev_err(dev, "could not allocate memory for pdata\n"); return ERR_PTR(-ENOMEM); } pd->ono = irq_of_parse_and_map(dev->of_node, 1); /* * ToDo: the 'wakeup' m...
false
false
false
false
false
0
GetObjectArrayStatus( int otyp, int i ) { std::map<int,std::vector<ArrayInfoType> >::iterator it = this->ArrayInfo.find( otyp ); if ( it != this->ArrayInfo.end() ) { int N = (int) it->second.size(); if ( i < 0 || i >= N ) { vtkDebugMacro( "You requested array " << i << " in a collection of o...
false
false
false
false
false
0
_hdf_hash_level(HDF *hdf) { NEOERR *err; HDF *child; err = ne_hash_init(&(hdf->hash), hash_hdf_hash, hash_hdf_comp); if (err) return nerr_pass(err); child = hdf->child; while (child) { err = ne_hash_insert(hdf->hash, child, child); if (err) return nerr_pass(err); child = child->next; } r...
false
false
false
false
false
0
MOV_SwEw(bxInstruction_c *i) { Bit16u op2_16; /* Attempt to load CS or nonexisting segment register */ if (i->nnn() >= 6 || i->nnn() == BX_SEG_REG_CS) { BX_INFO(("MOV_EwSw: can't use this segment register %d", i->nnn())); exception(BX_UD_EXCEPTION, 0, 0); } if (i->modC0()) { op2_16 = BX_READ_16B...
false
false
false
false
false
0
gst_adapter_copy (GstAdapter * adapter, gpointer dest, gsize offset, gsize size) { g_return_if_fail (GST_IS_ADAPTER (adapter)); g_return_if_fail (size > 0); g_return_if_fail (offset + size <= adapter->size); copy_into_unchecked (adapter, dest, offset + adapter->skip, size); }
false
false
false
false
false
0
free_gallivm_state(struct gallivm_state *gallivm) { #if HAVE_LLVM >= 0x207 /* XXX or 0x208? */ /* This leads to crashes w/ some versions of LLVM */ LLVMModuleRef mod; char *error; if (gallivm->engine && gallivm->provider) LLVMRemoveModuleProvider(gallivm->engine, gallivm->provider, ...
false
false
false
false
false
0
player_has_trade_route_with_city(struct player *pplayer, struct city *pcity) { int i; for (i = 0; i < NUM_TRADE_ROUTES; i++) { struct city *other = game_city_by_number(pcity->trade[i]); if (other && city_owner(other) == pplayer) { return TRUE; } } ...
false
false
false
false
false
0
delrdsins( Figure, Name ) rdsfig_list *Figure; char *Name; { rdsins_list **Previous; rdsins_list *Instance; rdsrec_list *Rectangle; void *Save; int Layer; Name = namealloc( Name ); Previous = &Figure->INSTANCE; for ( Instance = Figure->INSTANCE; Instance ...
false
false
false
false
false
0
list_check( List *list, void *item ) { int pos = -1; List_Entry *cur = list->head.next; while ( cur != &list->tail ) { pos++; if ( cur->item == item ) break; cur = cur->next; } return pos; }
false
false
false
false
false
0
merge_lists(int *nl, const double *restrict l1, const double *restrict l2, long *idx) { /* This routine writes to idx a list of indices relative to *l11 and *l12 --> l1, and l2 need to be allocated in a signle block of memory The order is thus, that (I) l1[idx[i]]<=l1[idx[i+1]] wh...
false
false
false
false
false
0
queueMoveUp( const quint64 id ) { const int idx = m_queue.indexOf( id ); if ( idx < 1 ) return false; quint64 temp = m_queue[ idx - 1 ]; m_queue[ idx - 1 ] = m_queue[ idx ]; m_queue[ idx ] = temp; return true; }
false
false
false
false
false
0
sig_window_changed(WINDOW_REC *window, WINDOW_REC *oldwindow) { XMPP_SERVER_REC *server; g_return_if_fail(window != NULL); if ((server = XMPP_SERVER(window->active_server)) == NULL) return; update_nick_statusbar(server, MUC(window->active), FALSE); }
false
false
false
false
false
0
scif_rb_get_next(struct scif_rb *rb, void *msg, u32 size) { void *header = NULL; int read_size = 0; header = scif_rb_get(rb, size); if (header) { u32 next_cmd_offset = (rb->current_read_offset + size) & (rb->size - 1); read_size = size; rb->current_read_offset = next_cmd_offset; memcpy_fromrb(rb, heade...
false
false
false
false
false
0
substitute_div( __isl_take isl_qpolynomial *qp, int div, __isl_take struct isl_upoly *s) { int i; int total; int *reordering; if (!qp || !s) goto error; qp = isl_qpolynomial_cow(qp); if (!qp) goto error; total = isl_space_dim(qp->dim, isl_dim_all); qp->upoly = isl_upoly_subs(qp->upoly, total + div, 1, ...
false
false
false
false
false
0