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
fmap_dump_to_file(fmap_t *map, const char *tmpdir, char **outname, int *outfd) { char *tmpname; int tmpfd, ret; size_t pos = 0, len; cli_dbgmsg("fmap_dump_to_file: dumping fmap not backed by file...\n"); ret = cli_gentempfd(tmpdir, &tmpname, &tmpfd); if(ret != CL_SUCCESS) { cli_dbgmsg("...
false
false
false
false
false
0
GetGeneratorTarget(cmTarget* t) const { cmGeneratorTargetsType::const_iterator ti = this->GeneratorTargets.find(t); if(ti == this->GeneratorTargets.end()) { this->CMakeInstance->IssueMessage( cmake::INTERNAL_ERROR, "Missing cmGeneratorTarget instance!", cmListFileBacktrace()); return 0; ...
false
false
false
false
false
0
multi_version(Module_table *module_head, Lad_opt *lad_opt) { Module_table *mpt; for (mpt = module_head; mpt != NULL; mpt = mpt->next) { search_block_for_multi(mpt->block_head, NULL, 1, lad_opt); set_mt_num(mpt->block_head, 0); } }
false
false
false
false
false
0
plD_init_xw(PLStream *pls) { XwDev *dev; PLFLT pxlx, pxly; int xmin = 0; int xmax = PIXELS_X - 1; int ymin = 0; int ymax = PIXELS_Y - 1; dbug_enter("plD_init_xw"); pls->termin = 1; /* Is an interactive terminal */ pls->dev_flush = 1; /* Handle our own flushes */ pls->dev_fill...
false
false
false
false
false
0
read_stats(int curr) { DIR *dir; struct dirent *drp; unsigned int p = 0, q, pid, thr_nr; struct pid_stats *pst; struct stats_cpu *st_cpu; /* * Allocate two structures for CPU statistics. * No need to init them (done by read_stat_cpu() function). */ if ((st_cpu = (struct stats_cpu *) malloc(STATS_CPU_SIZE ...
false
false
false
false
true
1
unload_plugin_cb (char *word[], char *word_eol[], void *userdata) { RemoteObject *obj; obj = g_hash_table_find (clients, clients_find_filename_foreach, word[2]); if (obj != NULL) { g_signal_emit (obj, signals[UNLOAD_SIGNAL], 0); return HEXCHAT_EAT_ALL; } return HEXCHAT_EAT_NO...
false
false
false
false
false
0
ata_sas_scsi_ioctl(struct ata_port *ap, struct scsi_device *scsidev, int cmd, void __user *arg) { unsigned long val; int rc = -EINVAL; unsigned long flags; switch (cmd) { case HDIO_GET_32BIT: spin_lock_irqsave(ap->lock, flags); val = ata_ioc32(ap); spin_unlock_irqrestore(ap->lock, flags); return pu...
false
false
false
false
false
0
header_dlmodEntry(struct variable *vp, oid * name, size_t * length, int exact, size_t * var_len, WriteMethod ** write_method) { #define DLMODENTRY_NAME_LENGTH 12 oid newname[MAX_OID_LEN]; int result; struct dlmod *dlm = NULL; ...
false
false
false
false
false
0
getItemElement ( const stringc& key ) { const SItemElement *item = Quake3ItemElement; while ( item->key[0] ) { if ( 0 == strcmp ( key.c_str(), item->key ) ) return item; item += 1; } return 0; }
false
false
false
false
false
0
format(Area::size_type w, int /*halign*/ ) const { if (!items.get()) return 0; static ListFormat lf("MENU", 0, 0, 0, "2", "NO_BULLET"); int type = lf.get_type(attributes.get(), nesting, NO_BULLET); auto_ptr<Area> res; const list<auto_ptr<ListItem> > &il(*items); list<auto_ptr<ListItem> >:...
false
false
false
false
false
0
aliases(Objid oid) { Var value; db_prop_handle h; h = db_find_property(oid, "aliases", &value); if (!h.ptr || value.type != TYPE_LIST) { /* Simulate a pointer to an empty list */ return &zero; } else return value.v.list; }
false
false
false
false
false
0
main() { LpSolver::printList(Stderr); lpSetSolver("cddgmp"); FileParser P(Stdin); PolynomialRing theRing=P.parsePolynomialRing(); PolynomialSet a=P.parsePolynomialSet(theRing); PolynomialSet b=P.parsePolynomialSet(theRing); PolynomialSet ret(theRing); for(PolynomialSet::const_iterat...
false
false
false
false
false
0
vmw_surface_define_encode(const struct vmw_surface *srf, void *cmd_space) { struct vmw_surface_define *cmd = (struct vmw_surface_define *) cmd_space; struct drm_vmw_size *src_size; SVGA3dSize *cmd_size; uint32_t cmd_len; int i; cmd_len = sizeof(cmd->body) + srf->num_sizes * sizeof(SVGA3dSize); cmd-...
false
false
false
false
false
0
transaction_list_select_get ( void ) { CustomRecord *record; CustomList *custom_list; custom_list = transaction_model_get_model (); g_return_val_if_fail ( custom_list != NULL, FALSE ); record = custom_list -> selected_row; if (!record) return -1; return gsb_data_transaction_get_transact...
false
false
false
false
false
0
PredicateLockTuple(Relation relation, HeapTuple tuple, Snapshot snapshot) { PREDICATELOCKTARGETTAG tag; ItemPointer tid; TransactionId targetxmin; if (!SerializationNeededForRead(relation, snapshot)) return; /* * If it's a heap tuple, return if this xact wrote it. */ if (relation->rd_index == NULL) { T...
false
false
false
false
false
0
icalvalue_set_recur(icalvalue* value, struct icalrecurrencetype v) { struct icalvalue_impl* impl; icalerror_check_arg_rv( (value!=0),"value"); icalerror_check_value_type(value, ICAL_RECUR_VALUE); impl = (struct icalvalue_impl*)value; if (impl->data.v_recur != 0){ free(impl->data.v_recur); ...
false
false
false
false
false
0
RunTask(void*arg) { Thread* thread = static_cast<Thread*>(arg); ITask * task = thread->task_; if (task == NULL) return NULL; atomic_cas(&thread->busy_, 0, 1); pthread_setcancelstate(PTHREAD_CANCEL_ENABLE,NULL); task->Run(); atomic_cas(&thread->busy_, 1, 0); return task; }
false
false
false
false
false
0
u_strncmpNoCase(const UChar *s1, const UChar *s2, int32_t n) { if(n > 0) { int32_t rc; for(;;) { rc = (int32_t)u_tolower(*s1) - (int32_t)u_tolower(*s2); if(rc != 0 || *s1 == 0 || --n == 0) { return rc...
false
false
false
false
false
0
add (pIIR_TextLiteral id) { for (int i = 0; i < n_ids; i++) if (ids[i] == NULL) { ids[i] = id; return; } ids = (pIIR_TextLiteral *)vaul_xrealloc (ids, (n_ids+1)*sizeof(pIIR_TextLiteral *)); ids[n_ids++] = id; }
false
false
false
false
false
0
load_colors(name) char_u *name; { char_u *buf; int retval = FAIL; static int recursive = FALSE; /* When being called recursively, this is probably because setting * 'background' caused the highlighting to be reloaded. This means it is * working, thus we should return OK. */ if (recu...
false
false
false
false
false
0
gnl_composition_change_state (GstElement * element, GstStateChange transition) { GnlComposition *comp = (GnlComposition *) element; GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS; GST_DEBUG_OBJECT (comp, "%s => %s", gst_element_state_get_name (GST_STATE_TRANSITION_CURRENT (transition)), gst_elem...
false
false
false
false
false
0
Mask_Editor_List_Move_Down (void) { GtkTreeSelection *selection; GList *selectedRows; GList *l; GtkTreeIter currentFile; GtkTreeIter nextFile; GtkTreePath *currentPath; GtkTreeModel *treemodel; g_return_if_fail (MaskEditorList != NULL); selection = gtk_tree_view_get_selection(GTK_T...
false
false
false
false
false
0
readAttribute(size_t startLinePos) { size_t endLinePos = headerString.find_first_of("\r\n", startLinePos); if(endLinePos == std::string::npos) return std::string::npos; size_t pos = headerString.find(':', startLinePos); if(pos > endLinePos) // ignore bad attributes return nextLine(endLinePos); std::stri...
false
false
false
false
false
0
setUInt(unsigned int *v, char *arg) { char *p; unsigned int i; i = (unsigned int) strtol(arg, &p, 10); if (p == arg) { fprintf(stderr, "Error: bad value in flag -%s - ignored\n", arg - 1); return 1; } *v = i; return 0; }
false
false
false
false
false
0
mboxdriver_fetch_header(mailsession * session, uint32_t indx, char ** result, size_t * result_len) { int r; char * msg_content; size_t msg_length; struct mailmbox_folder * folder; folder = session_get_mbox_session(session); if (folder == NULL) return MAIL_ERROR_BAD_STATE; r = mailmbox_fetch_m...
false
false
false
false
false
0
readHduInfo () { // Read BITPIX and NAXIS keywords int status = 0; char* comment = 0; int htype = -1; if (fits_get_hdu_type(fitsPointer(),&htype,&status)) throw FitsError(status); HduType xtype = HduType(htype); if (xtype == ImageHdu) { // Do not try and read BITPIX or NAXIS directly. If...
false
false
false
false
false
0
i915_gem_object_fence_ok(struct drm_i915_gem_object *obj, int tiling_mode) { u32 size; if (tiling_mode == I915_TILING_NONE) return true; if (INTEL_INFO(obj->base.dev)->gen >= 4) return true; if (INTEL_INFO(obj->base.dev)->gen == 3) { if (i915_gem_obj_ggtt_offset(obj) & ~I915_FENCE_START_MASK) return fal...
false
false
false
false
false
0
_cfsml_write_menu_item_t(FILE *fh, menu_item_t* save_struc) { int min, max, i; fprintf(fh, "{\n"); fprintf(fh, "type = "); _cfsml_write_int(fh, (int*) &(save_struc->type)); fprintf(fh, "\n"); fprintf(fh, "keytext = "); _cfsml_write_string(fh, (char **) &(save_struc->keytext)); fprintf(fh, "\n")...
false
false
false
false
false
0
removeManagedTopLevelWidget( const QWidget *topLevel ) { if ( !topLevel->isTopLevel() ) return; d->m_managedTopLevelWidgets.removeAll( topLevel ); }
false
false
false
false
false
0
cyber5kDrawLine( void *drv, void *dev, DFBRegion *line ) { CyberDriverData *cdrv = (CyberDriverData*) drv; CyberDeviceData *cdev = (CyberDeviceData*) dev; volatile u8 *mmio = cdrv->mmio_base; u32 cmd = COP_LINE_DRAW | PAT_FIXFGD; int dx; int dy; dx = line->x2 - line->x1; d...
false
false
false
false
false
0
vivid_rds_gen_fill(struct vivid_rds_gen *rds, unsigned freq, bool alt) { /* Alternate PTY between Info and Weather */ if (rds->use_rbds) { rds->picode = 0x2e75; /* 'KLNX' call sign */ rds->pty = alt ? 29 : 2; } else { rds->picode = 0x8088; rds->pty = alt ? 16 : 3; } rds->mono_stereo = true; rds->art_...
false
false
false
false
false
0
NotifyStyleToNeeded(int endStyleNeeded) { #ifdef SCI_LEXER if (DocumentLexState()->lexLanguage != SCLEX_CONTAINER) { int lineEndStyled = pdoc->LineFromPosition(pdoc->GetEndStyled()); int endStyled = pdoc->LineStart(lineEndStyled); DocumentLexState()->Colourise(endStyled, endStyleNeeded); return; } #endif Edi...
false
false
false
false
false
0
rd_port_tchk(FILE *f, struct tcterm_t *tctp) { char pnam[IDLEN]; int32 i1, i2, eval, ettyp; tctp->ti1 = tctp->ti2 = -1; tctp->cndnam = NULL; tctp->cndi1 = tctp->cndi2 = -1; tctp->cnd_op = UNDEF; tctp->cnd_const = -1; tctp->eval = NOEDGE; if (__toktyp == LPAR) { /* collects ID (maybe strange edge) into ...
true
true
false
false
false
1
setData( const QModelIndex& index, const QVariant& value, int role ) { if( index.isValid() && index.column() == 0 && role == Qt::CheckStateRole ) { const QString path = filePath( index ); if( value.toInt() == Qt::Checked ) { // New path selected ...
false
false
false
false
false
0
vm_map_ram(struct page **pages, unsigned int count, int node, pgprot_t prot) { unsigned long size = count << PAGE_SHIFT; unsigned long addr; void *mem; if (likely(count <= VMAP_MAX_ALLOC)) { mem = vb_alloc(size, GFP_KERNEL); if (IS_ERR(mem)) return NULL; addr = (unsigned long)mem; } else { struct vmap_...
false
false
false
false
false
0
ig_decode_interactive(BITBUFFER *bb, BD_IG_INTERACTIVE *p) { BD_PG_SEQUENCE_DESCRIPTOR sd; pg_decode_video_descriptor(bb, &p->video_descriptor); pg_decode_composition_descriptor(bb, &p->composition_descriptor); pg_decode_sequence_descriptor(bb, &sd); if (!sd.first_in_seq) { BD_DEBUG(DBG_DE...
false
false
false
false
false
0
inverse(CPosePDF &o) const { ASSERT_(o.GetRuntimeClass() == CLASS_ID(CPosePDFGaussian)); CPosePDFGaussian *out = static_cast<CPosePDFGaussian*>( &o ); // The mean: out->mean = CPose2D(0,0,0) - mean; // The covariance: const double ccos = ::cos(mean.phi()); const double ssin = ::sin(mean.phi()); // jacobian: ...
false
false
false
false
false
0
check_flow(ushort childID, bool strict) { return check_block(childID, strict) || check_inline(childID, strict); }
false
false
false
false
false
0
sci_oem_parameters_validate(struct sci_oem_params *oem, u8 version) { int i; for (i = 0; i < SCI_MAX_PORTS; i++) if (oem->ports[i].phy_mask > SCIC_SDS_PARM_PHY_MASK_MAX) return -EINVAL; for (i = 0; i < SCI_MAX_PHYS; i++) if (oem->phys[i].sas_address.high == 0 && oem->phys[i].sas_address.low == 0) r...
false
false
false
false
false
0
basic_map_identity(__isl_take isl_space *dims) { struct isl_basic_map *bmap; unsigned nparam; unsigned dim; int i; if (!dims) return NULL; nparam = dims->nparam; dim = dims->n_out; bmap = isl_basic_map_alloc_space(dims, 0, dim, 0); if (!bmap) goto error; for (i = 0; i < dim; ++i) { int j = isl_basic_...
false
false
false
false
false
0
throwMagickException(JNIEnv *env, const char *mesg) { jclass magickExceptionClass; magickExceptionClass = (*env)->FindClass(env, "magick/MagickException"); if (magickExceptionClass == 0) { fprintf(stderr, "Cannot find MagickException class\n"); return; } (*env)->ThrowNew(env, magickExceptionClass...
false
false
false
false
false
0
update_file_list (DialogData *data, ReadyFunc ready_func) { UpdateData *update_data; update_data = g_new (UpdateData, 1); update_data->data = data; update_data->ready_func = ready_func; if (data->template_changed) { char *required_attributes; gboolean reload_required; required_attributes = get_...
false
false
false
false
false
0
editbar_add_mode_button(struct editbar *eb, enum editor_tool_mode etm) { GdkPixbuf *pixbuf; GtkWidget *image, *button, *hbox; struct sprite *sprite; const char *tooltip; if (!eb || !(0 <= etm && etm < NUM_EDITOR_TOOL_MODES)) { return; } button = gtk_toggle_button_...
false
false
false
false
false
0
handle_profile ( int argc, char * argv[]) { int i; char *profile_pathname = NULL; for (i = 1; i < argc; ++i) { if ((strcmp (argv[i], "-npro") == 0) || (strcmp (argv[i], "--ignore-profile") == 0) || (strcmp (argv[i], "+ignore-profile") == 0)) { ...
false
false
false
false
false
0
proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *auth) { #ifdef NETWORKACCESSMANAGER_DEBUG qDebug() << __FUNCTION__; #endif BrowserMainWindow *mainWindow = BrowserApplication::instance()->mainWindow(); QDialog dialog(mainWindow); dialog.setWindowFlags(Qt::Sheet); Ui::ProxyDi...
false
false
false
false
false
0
nvkm_ram_ctor(const struct nvkm_ram_func *func, struct nvkm_fb *fb, enum nvkm_ram_type type, u64 size, u32 tags, struct nvkm_ram *ram) { static const char *name[] = { [NVKM_RAM_TYPE_UNKNOWN] = "of unknown memory type", [NVKM_RAM_TYPE_STOLEN ] = "stolen system memory", [NVKM_RAM_TYPE_SGRAM ] = "SGR...
false
false
false
false
false
0
polkit_authority_enumerate_actions_finish (PolkitAuthority *authority, GAsyncResult *res, GError **error) { GList *ret; GVariant *value; GVariantIter iter; GVariant *child; GVariant *array; GAsyncResult *_res; ...
false
false
false
false
false
0
mono_error_set_field_load (MonoError *oerror, MonoClass *klass, const char *field_name, const char *msg_format, ...) { MonoErrorInternal *error = (MonoErrorInternal*)oerror; mono_error_prepare (error); error->error_code = MONO_ERROR_MISSING_FIELD; mono_error_set_class (oerror, klass); mono_error_set_member_name (...
false
false
false
false
false
0
IsIgnorable(PkgIterator const &/*Pkg*/) const { if (IsNegative() == false) return false; pkgCache::PkgIterator PP = ParentPkg(); pkgCache::PkgIterator PT = TargetPkg(); if (PP->Group != PT->Group) return false; // self-conflict if (PP == PT) return true; pkgCache::VerIterator PV ...
false
false
false
false
false
0
sleepcmd(FILE *input, BSOCK *UA_sock) { if (argc > 1) { sleep(atoi(argk[1])); } return 1; }
false
false
false
false
false
0
clist_init(gx_device * dev) { gx_device_clist_writer * const cdev = &((gx_device_clist *)dev)->writer; int code = clist_reset(dev); if (code >= 0) { cdev->image_enum_id = gs_no_id; cdev->error_is_retryable = 0; cdev->driver_call_nesting = 0; cdev->ignore_lo_mem_warni...
false
false
false
false
false
0
pysqlite_collation_callback( void* context, int text1_length, const void* text1_data, int text2_length, const void* text2_data) { PyObject* callback = (PyObject*)context; PyObject* string1 = 0; PyObject* string2 = 0; #ifdef WITH_THREAD PyGILState_STATE gilstate; #endif PyObje...
false
false
false
false
false
0
isl_printer_print_constraint(__isl_take isl_printer *p, __isl_keep isl_constraint *c) { isl_basic_map *bmap; if (!p || !c) goto error; bmap = isl_basic_map_from_constraint(isl_constraint_copy(c)); p = isl_printer_print_basic_map(p, bmap); isl_basic_map_free(bmap); return p; error: isl_printer_free(p); retu...
false
false
false
false
false
0
so_request(SO_HANDLE h, const char *reqstr, long *length){ string res=TKawariShioriFactory::GetFactory().RequestInstance( (int)h, string(reqstr, *length)); return string2cstr(res, length); }
false
false
false
false
false
0
php_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase) { zval **regex, /* Regular expression */ **array = NULL; /* Optional register array */ char *findin; /* String to apply expression to */ int findin_len; regex_t re; regmatch_t *subs; int err, match_len, string_len; uint i; int copts = 0; off_t start, end;...
false
true
false
false
false
1
pwr64 (gint64 op, int exp) { qofint128 tmp; if (exp == 0) return 1; if (exp % 2) { tmp = mult128 (op, pwr64 (op, exp - 1)); if (tmp.isbig) return 0; return tmp.lo; } tmp.lo = pwr64 (op, exp / 2); tmp = mult128 (tmp.lo, tmp.lo); if (tmp.isbig) return 0; return tmp.lo; }
false
false
false
false
false
0
cro_levelcell(FILE *outf, Outchoices *od, choice rep, int level) { if (level >= 1) fprintf(outf, "%d%s", level, od->compsep); }
false
false
false
false
false
0
sourceRowsRemoved(const QModelIndex &source_parent, int start, int end) { if (completeRemove) { completeRemove = false; // Source parent is already in the model. invokeRowsRemoved(source_parent, start, end); // fall through. After removing rows, we need to refresh things so that intermediates will b...
false
false
false
false
false
0
slot_tp_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { static PyObject *new_str; PyObject *func; PyObject *newargs, *x; Py_ssize_t i, n; if (new_str == NULL) { new_str = PyString_InternFromString("__new__"); if (new_str == NULL) return NULL; } func = P...
false
false
false
false
false
0
ajPatlistRegexRemoveCurrent (AjPPatlistRegex thys) { if (!thys->Iter) return; ajListIterRemove(thys->Iter); ajListIterGetBack(thys->Iter); return; }
false
false
false
false
false
0
IIT_fieldint (T this, char *fieldstring) { int i = 0; unsigned int start; while (i < this->nfields) { start = this->fieldpointers[i]; if (!strcmp(fieldstring,&(this->fieldstrings[start]))) { return i; } i++; } return -1; }
false
false
false
false
false
0
bc_push_arg (const struct buildcmd_control *ctl, struct buildcmd_state *state, const char *arg, size_t len, const char *prefix, size_t pfxlen, int initial_args) { if (!initial_args) { state->todo = 1; } if (arg) { /* XXX_SOC: if do_exec(...
false
true
false
false
false
1
Lock() const { int r = VideoRendererWithLock::Lock(); if (r == 0 && !dga && info.info.x11.lock_func) info.info.x11.lock_func(); return r; }
false
false
false
false
false
0
arch_early_irq_init(void) { init_legacy_irqs(); x86_vector_domain = irq_domain_add_tree(NULL, &x86_vector_domain_ops, NULL); BUG_ON(x86_vector_domain == NULL); irq_set_default_host(x86_vector_domain); arch_init_msi_domain(x86_vector_domain); arch_init_htirq_domain(x86_vector_domain); BUG_ON(!alloc_cpuma...
false
false
false
false
false
0
DrawRadioButton(struct XObj *xobj, XEvent *evp) { int i,j; j=xobj->height/2+3; i=16; /* Dessin du cercle arrondi */ XSetForeground(dpy,xobj->gc,xobj->TabColor[shad]); XDrawArc(dpy,xobj->win,xobj->gc,1,j-11,11,11,45*64,180*64); XSetForeground(dpy,xobj->gc,xobj->TabColor[hili]); XDrawArc(dpy,xobj->win,xobj->gc,1...
false
false
false
false
false
0
fr_socket_find(fr_packet_list_t *pl, int sockfd) { int i, start; i = start = SOCK2OFFSET(sockfd); do { /* make this hack slightly more efficient */ if (pl->sockets[i].sockfd == sockfd) return &pl->sockets[i]; i = (i + 1) & SOCKOFFSET_MASK; } while (i != start); return NULL; }
false
false
false
false
false
0
waitingblits (void) { static int warned = 10; bool waited = false; while (bltstate != BLT_done && dmaen (DMA_BLITTER)) { waited = true; x_do_cycles (8 * CYCLE_UNIT); } if (warned && waited) { warned--; write_log (_T("waiting_blits detected\n")); } if (bltstate == BLT_done) return true; return false; ...
false
false
false
false
false
0
~CoinWarmStartBasis() { delete[] structuralStatus_; }
false
false
false
false
false
0
_ecore_con_server_timer_update(Ecore_Con_Server *svr) { if (svr->disconnect_time) { if (svr->disconnect_time > 0) { if (svr->until_deletion) ecore_timer_interval_set(svr->until_deletion, svr->disconnect_time); else svr->until_deletion = e...
false
false
false
false
false
0
get_charset_table(void) { static CharsetTable *ctable = NULL; EncArray *encarray; gint i; if (!ctable) { ctable = g_malloc(sizeof(CharsetTable)); ctable->num = 0; ctable->charset[ctable->num] = get_default_charset(); ctable->str[ctable->num] = g_strdup_printf(_("Current Locale (%s)"), get_default_charset(...
false
false
false
false
false
0
example_labeling() { CamImage source; CamRLEImage encoded; CamBlobs results; int i; // Load picture small_ulp.pgm (example provided by ULP, which made labelling v1.0 fail) camLoadPGM(&source,"resources/small_ulp.pgm"); // Label the image camRLEAllocate(&encoded,10000); ...
false
false
false
false
false
0
getl3proc(struct PStack *st, int cr) { struct l3_process *p = st->l3.proc; while (p) if (p->callref == cr) return (p); else p = p->next; return (NULL); }
false
false
false
false
false
0
tgdb_is_busy(struct tgdb *tgdb, int *is_busy) { /* Validate parameters */ if (!tgdb || !is_busy) { logger_write_pos(logger, __FILE__, __LINE__, "tgdb_is_busy failed"); return -1; } if (tgdb_can_issue_command(tgdb) == 1) *is_busy = 0; else *is_busy = 1; return 0;...
false
false
false
false
false
0
tb_cfg_print_error(struct tb_ctl *ctl, const struct tb_cfg_result *res) { WARN_ON(res->err != 1); switch (res->tb_error) { case TB_CFG_ERROR_PORT_NOT_CONNECTED: /* Port is not connected. This can happen during surprise * removal. Do not warn. */ return; case TB_CFG_ERROR_INVALID_CONFIG_SPACE: /* ...
false
false
false
false
false
0
keywordDoStartsLoop(int pos, Accessor &styler) { char ch; int style; int lineStart = styler.GetLine(pos); int lineStartPosn = styler.LineStart(lineStart); styler.Flush(); while (--pos >= lineStartPosn) { style = actual_style(styler.StyleAt(pos)); if (style ...
false
false
false
false
false
0
caml_hash_mix_float(uint32 hash, float d) { union { float f; uint32 i; } u; uint32 n; /* Convert to int32 */ u.f = d; n = u.i; /* Normalize NaNs */ if ((n & 0x7F800000) == 0x7F800000 && (n & 0x007FFFFF) != 0) { n = 0x7F800001; } /* Normalize -0 into +0 */ else if (n == 0x80000000) { ...
false
false
false
false
false
0
syn_rule_class_state_size(const qpol_iterator_t * iter) { syn_rule_class_state_t *srcs = NULL; size_t count = 0; class_perm_node_t *cpn = NULL; if (!iter || !(srcs = (syn_rule_class_state_t *) qpol_iterator_state(iter))) { errno = EINVAL; return 0; } for (cpn = srcs->head; cpn; cpn = cpn->next) count++; ...
false
false
false
false
false
0
nic_nxt_avail_sqs(struct nicpf *nic) { int sqs; for (sqs = 0; sqs < nic->num_sqs_en; sqs++) { if (!nic->sqs_used[sqs]) nic->sqs_used[sqs] = true; else continue; return sqs + nic->num_vf_en; } return -1; }
false
false
false
false
false
0
compare_tlist_datatypes(List *tlist, List *colTypes, bool *differentTypes) { ListCell *l; ListCell *colType = list_head(colTypes); foreach(l, tlist) { TargetEntry *tle = (TargetEntry *) lfirst(l); if (tle->resjunk) continue; /* ignore resjunk columns */ if (colType == NULL) elog(ERROR, "wr...
false
false
false
false
false
0
ar_1d_ft (int PTS, Real* X, Real *Y) { // ARBITRARY RADIX ONE DIMENSIONAL FOURIER TRANSFORM REPORT int F,J,N,NF,P,PMAX,P_SYM,P_TWO,Q,R,TWO_GRP; // NP is maximum number of squared factors allows PTS up to 2**32 at least // NQ is number of not-squared factors - increase if we increase PMAX const int...
false
false
false
false
false
0
issinglepositioninseparatorViaequallength(GtEncseqReader *esr) { if (esr->currentpos != esr->nextseparatorpos) { return false; } singlepositioninseparatorViaequallength_updatestate(esr); return true; }
false
false
false
false
false
0
res_ourserver(const struct irc_ssaddr *inp) { #ifdef IPV6 const struct sockaddr_in6 *v6; const struct sockaddr_in6 *v6in = (const struct sockaddr_in6 *)inp; #endif const struct sockaddr_in *v4; const struct sockaddr_in *v4in = (const struct sockaddr_in *)inp; int ns; for (ns = 0; ns < irc_nscount; ns++) ...
false
false
false
false
false
0
io_stats_writev (call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, int32_t count, off_t offset, struct iobref *iobref) { int len = 0; if (fd->inode) frame->local = fd->inode; len = iov_length (...
false
false
false
false
false
0
postAttack( bool reactionFire, const Context& context ) { if ( !reactionFire ) { if ( typ->hasFunction( ContainerBaseType::MoveAfterAttack ) ) { int decrease = maxMovement() * attackmovecost / 100; if ( decrease ) (new ChangeUnitMovement( this, decrease, true ))->execute( context...
false
false
false
false
false
0
xg_apply_userdef_op_fn (OpType op, long a) { switch (op) { case OP_OPERAND_F32MINUS: return operand_function_F32MINUS (a); case OP_OPERAND_LOW8: return operand_function_LOW8 (a); case OP_OPERAND_HI24S: return operand_function_HI24S (a); case OP_OPERAND_LOW16U: return operan...
false
true
false
false
false
1
dstr_connect ( PIA *pi ) { pi->saved_r0 = r0(); pi->saved_r2 = r2(); w2(4); CCP(0xe0); w0(0xff); }
false
false
false
false
false
0
macvtap_get_vlan(struct macvtap_queue *q) { struct macvlan_dev *vlan; ASSERT_RTNL(); vlan = rtnl_dereference(q->vlan); if (vlan) dev_hold(vlan->dev); return vlan; }
false
false
false
false
false
0
deliver_remote(struct qitem *it) { struct mx_hostentry *hosts, *h; const char *host; int port; int error = 1, smarthost = 0; host = strrchr(it->addr, '@'); /* Should not happen */ if (host == NULL) { snprintf(errmsg, sizeof(errmsg), "Internal error: badly formed address %s", it->addr); return(-1); } ...
false
false
false
false
false
0
imSaveMap(int width, int height, int format, unsigned char *map, int palette_count, long *palette, char *filename) { int error; char* new_format = i_format_old2new[format & 0x00FF]; imFile* ifile = imFileNew(filename, new_format, &error); if (!ifile) return error; if (format & 0xFF00) imFileSetInfo(ifi...
false
false
false
false
false
0
getJS(int i) { Object obj; // getJSNameTree()->getValue(i) returns a shallow copy of the object so we // do not need to free it catalogLocker(); getJSNameTree()->getValue(i).fetch(xref, &obj); if (!obj.isDict()) { obj.free(); return 0; } Object obj2; if (!obj.dictLookup("S", &obj2)->isName())...
false
false
false
false
false
0
fgetc_ws(FILE *f) { int c; while (1) { c = fgetc(f); if (c=='#') { while (1) { c = fgetc(f); if (c=='\n' || c==EOF) { break; } } } /* space, tab, line feed, carriage return, form-feed */ if (c!=' ' && c!='\t' && c!='\r' && c!='\n' && c!=12) { return c; } } }
false
false
false
false
false
0
will_collide_pp(vec3d *p0, vec3d *p1, float radius, object *big_objp, vec3d *collision_point) { mc_info mc; polymodel *pm = model_get(Ship_info[Ships[big_objp->instance].ship_info_index].model_num); mc.model_instance_num = -1; mc.model_num = pm->id; // Fill in the model to check mc.orient = &big_objp->orient; ...
false
false
false
false
false
0
opal_dss_unpack_bool(opal_buffer_t *buffer, void *dest, int32_t *num_vals, opal_data_type_t type) { int ret; opal_data_type_t remote_type; if (OPAL_DSS_BUFFER_FULLY_DESC == buffer->type) { /* see what type was actually packed */ if (OPAL_SUCCESS != (ret = opal_dss_p...
false
false
false
false
false
0
getWhere(ImageWindow *iw, char *oldWhere) { Object where; if (oldWhere) { char buf[1024]; sprintf(buf, "%s[%s]", iw->where, oldWhere); where = (Object)DXNewString(buf); } else where = (Object)DXNewString(iw->where); return where; }
true
true
false
false
false
1
main(int argc, char **argv) { int status; try { fprintf(stdout, "*** %s version %s build at %s\n", APP_NAME, VERSION, __DATE__); application = new Application(); signal(SIGINT, sigint_handler); // Parse command line options status = application->parseCommandLine(argc, argv); if (status)...
false
false
false
false
false
0
es_unreadn (estream_t ES__RESTRICT stream, const unsigned char *ES__RESTRICT data, size_t data_n, size_t *ES__RESTRICT bytes_unread) { size_t space_left; space_left = stream->unread_buffer_size - stream->unread_data_len; if (data_n > space_left) data_n = space_left; if (! data_n) goto out; ...
false
false
false
false
false
0
encode_32bit(struct lwpb_buf *buf, u32_t value) { if (lwpb_buf_left(buf) < 4) return LWPB_ERR_END_OF_BUF; buf->pos[0] = (value) & 0xff; buf->pos[1] = (value >> 8) & 0xff; buf->pos[2] = (value >> 16) & 0xff; buf->pos[3] = (value >> 24) & 0xff; buf->pos += 4; return LWPB_ERR_...
false
false
false
false
false
0
error_msg_rpc(const char *msg) { int len; while (msg[0] == ' ' || msg[0] == ':') msg++; len = strlen(msg); while (len && msg[len-1] == '\n') len--; bb_error_msg("%.*s", len, msg); }
false
false
false
false
false
0
dumpRule(Archive *fout, RuleInfo *rinfo) { TableInfo *tbinfo = rinfo->ruletable; PQExpBuffer query; PQExpBuffer cmd; PQExpBuffer delcmd; PGresult *res; /* Skip if not to be dumped */ if (!rinfo->dobj.dump || dataOnly) return; /* * If it is an ON SELECT rule that is created implicitly by CREATE VIEW, ...
false
false
false
false
false
0
stab_new(void) { stab_t st = malloc(sizeof(*st)); if (!st) { pr_error("stab: failed to allocate memory\n"); return NULL; } st->sym = btree_alloc(&sym_table_def); if (!st->sym) { printc_err("stab: failed to allocate symbol table\n"); free(st); return NULL; } st->addr = btree_alloc(&addr_table_def); ...
false
false
false
false
false
0