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
mono_test_empty_struct (int a, EmptyStruct es, int b) { // printf ("mono_test_empty_struct %d %d\n", a, b); // Intel icc on ia64 passes 'es' in 2 registers #if defined(__ia64) && defined(__INTEL_COMPILER) return 0; #else if (a == 1 && b == 2) return 0; return 1; #endif }
false
false
false
false
false
0
stb6100_get_frequency(struct dvb_frontend *fe, u32 *frequency) { int rc; u32 nint, nfrac, fvco; int psd2, odiv; struct stb6100_state *state = fe->tuner_priv; u8 regs[STB6100_NUMREGS]; rc = stb6100_read_regs(state, regs); if (rc < 0) return rc; odiv = (regs[STB6100_VCO] & STB6100_VCO_ODIV) >> STB6100_VCO_ODI...
false
false
false
false
false
0
cr_utils_ucs1_str_to_utf8 (const guchar * a_in, gulong * a_in_len, guchar ** a_out, gulong * a_out_len) { gulong in_len = 0, out_len = 0; enum CRStatus status = CR_OK; g_return_val_if_fail (a_in && a_in_len && a_out ...
false
false
false
false
false
0
TclWeb_VarNumber(Tcl_Obj *result, int source, TclWebRequest *req) { apr_array_header_t *parmsarray = (apr_array_header_t *) apr_table_elts(req->apachereq->parms); if (source == VAR_SRC_QUERYSTRING) { Tcl_SetIntObj(result, req->apachereq->nargs); } else if (source == VAR_SRC_POST) { Tcl_SetIntObj(...
false
false
false
false
false
0
activate_cb (GtkWidget *menuitem, gpointer data) { MenuData *md; g_return_if_fail (GTK_IS_WIDGET (menuitem)); md = data; meta_frames_notify_menu_hide (md->menu->frames); (* md->menu->func) (md->menu, GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), md->menu...
false
false
false
false
false
0
write_gmon (void) { int fd = -1; char *env; #ifndef O_NOFOLLOW # define O_NOFOLLOW 0 #endif env = getenv ("GMON_OUT_PREFIX"); if (env != NULL && !__libc_enable_secure) { size_t len = strlen (env); char buf[len + 20]; __snprintf (buf, sizeof (buf), "%s.%u", env, __getpid ()); fd = open_not_ca...
true
true
false
false
true
1
tower_read (struct file *file, char __user *buffer, size_t count, loff_t *ppos) { struct lego_usb_tower *dev; size_t bytes_to_read; int i; int retval = 0; unsigned long timeout = 0; dev = file->private_data; /* lock this object */ if (mutex_lock_interruptible(&dev->lock)) { retval = -ERESTARTSYS; goto exi...
false
false
false
false
false
0
GetMTime() { unsigned long mtime,result; result = vtkWarpTransform::GetMTime(); if (this->Coefficients) { this->Coefficients->UpdateInformation(); mtime = this->Coefficients->GetPipelineMTime(); result = ( mtime > result ? mtime : result ); mtime = this->Coefficients->GetMTime(); result ...
false
false
false
false
false
0
dwrite(const void* b, size_t size) { const char* buffer = (const char*) b; if (m_lfd < 0) { if (m_lfd == -12345) { if (getenv("WRITE_ASF")) { // check if recording is requested char tmpfilename[256]; char* tmpdir = getenv("TMPDIR"); strncpy(tmpfilename, (tmpdir) ? tmpdir : "/tmp", 240); ...
false
false
false
false
false
0
lremove(line1, line2) register LinePtr line1, line2; { LinePtr next = line1->l_next; if (line1 == line2) return; line1->l_next = line2->l_next; if (line1->l_next) line1->l_next->l_prev = line1; else curbuf->b_last = line1; lfreereg(next, line2); /* Put region at end of free line list. */ }
false
false
false
false
false
0
mymalloc(unsigned size, Memory_Type type) { char *memptr; char msg[100]; int offs; if (size == 0) /* For queasy systems */ size = 1; offs = refcount_overhead(type); memptr = (char *) malloc(size + offs); if (!memptr) { sprintf(msg, "memory allocation (size %u) failed!", size); panic(ms...
false
false
false
false
false
0
zl10036_set_params(struct dvb_frontend *fe) { struct dtv_frontend_properties *p = &fe->dtv_property_cache; struct zl10036_state *state = fe->tuner_priv; int ret = 0; u32 frequency = p->frequency; u32 fbw; int i; u8 c; /* ensure correct values * maybe redundant as core already checks this */ if ((frequency <...
false
false
false
false
false
0
abraca_filter_view_set_sorting (AbracaFilterView* self, AbracaFilterViewSorting* value) { AbracaFilterViewSorting _tmp0_; g_return_if_fail (self != NULL); _tmp0_ = *value; self->priv->_sorting = _tmp0_; g_object_notify ((GObject *) self, "sorting"); }
false
false
false
false
false
0
GNUNET_log_setup (const char *comp, const char *loglevel, const char *logfile) { FILE *altlog; int dirwarn; char *fn; const char *env_logfile = NULL; int altlog_fd; min_level = get_type (loglevel); #if !defined(GNUNET_CULL_LOGGING) parse_all_definitions (); #endif #ifdef WINDOWS QueryPerformanceFrequen...
false
false
false
false
false
0
change_array_subscript_qr(Quadruple *qr_head, const int entry, SemTree *offset[], const int cdim, Operand *slot_op) { Quadruple *qr; int i; for (qr = qr_head; qr != NULL; qr = qr->next) { if (qr->ope == OPE_DTU_KICK || qr->ope == OPE_DTU_KICK_PRV) { change_arra...
false
false
false
false
false
0
pathSegList() const { if (!m_pathSegList) m_pathSegList = SVGPathSegList::create(SVGNames::dAttr); return m_pathSegList.get(); }
false
false
false
false
false
0
dcc_close (struct DCC *dcc, int dccstat, int destroy) { if (dcc->wiotag) { fe_input_remove (dcc->wiotag); dcc->wiotag = 0; } if (dcc->iotag) { fe_input_remove (dcc->iotag); dcc->iotag = 0; } if (dcc->sok != -1) { closesocket (dcc->sok); dcc->sok = -1; } dcc_remove_from_sum (dcc); if (dcc->fp ...
false
false
false
false
false
0
transaction_strong_get_child_transfer(Transaction *src) { GList *list; DB( g_print("\n[transaction] transaction_strong_get_child_transfer\n") ); DB( g_print(" - search: %d %s %f %d=>%d\n", src->date, src->wording, src->amount, src->kacc, src->kxferacc) ); list = g_list_first(GLOBALS->ope_list); while (list != NU...
false
false
false
false
false
0
pn533_acr122_poweron_rdr(struct pn533 *dev) { /* Power on th reader (CCID cmd) */ u8 cmd[10] = {PN533_ACR122_PC_TO_RDR_ICCPOWERON, 0, 0, 0, 0, 0, 0, 3, 0, 0}; u8 buf[255]; int rc; void *cntx; struct pn533_acr122_poweron_rdr_arg arg; dev_dbg(&dev->interface->dev, "%s\n", __func__); init_completion(&arg...
false
false
false
false
false
0
ipmi_auth_special(struct ipmi_session * s) { #ifdef HAVE_CRYPTO_MD5 MD5_CTX ctx; static uint8_t md[16]; uint8_t challenge[16]; int i; memset(challenge, 0, 16); memset(md, 0, 16); memset(&ctx, 0, sizeof(MD5_CTX)); MD5_Init(&ctx); MD5_Update(&ctx, (const uint8_t *)s->authcode, strlen((const char *)s->authcode)...
false
false
false
false
false
0
smc_write_phy_register(int ioaddr, byte phyaddr, byte phyreg, word phydata) { int oldBank; unsigned int i; word mask; word mii_reg; byte bits[65]; int clk_idx = 0; // 32 consecutive ones on MDO to establish sync for (i = 0; i < 32; ++i) bits[cl...
false
false
false
false
false
0
find_sock(const char *name) { Sock *sock; /* It is possible to (briefly) have multiple sockets with the same name, * if at most one is alive. The alive socket is the most interesting, * and it will be closer to the tail, so we search backwards. */ for (sock = tsock; sock; sock = sock->prev)...
false
false
false
false
false
0
client_recovery_lock_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, struct gf_flock *lock, dict_t *xdata) { clnt_local_t *local = NULL; ...
false
false
false
false
false
0
symtable_implicit_arg(struct symtable *st, int pos) { PyObject *id = PyUnicode_FromFormat(".%d", pos); if (id == NULL) return 0; if (!symtable_add_def(st, id, DEF_PARAM)) { Py_DECREF(id); return 0; } Py_DECREF(id); return 1; }
false
false
false
false
false
0
setup (Test *test, gconstpointer unused) { GckModule *module; GError *err = NULL; /* Successful load */ module = gck_module_initialize (BUILDDIR "/.libs/libmock-test-module.so", NULL, &err); g_assert_no_error (err); g_assert (GCK_IS_MODULE (module)); test->modules = g_list_append (NULL, module); }
false
false
false
false
false
0
da9030_charger_check_state(struct da9030_charger *charger) { da9030_charger_update_state(charger); /* we wake or boot with external power on */ if (!charger->is_on) { if ((charger->chdet) && (charger->adc.vbat_res < charger->thresholds.vbat_charge_start)) { da9030_set_charge(charger, 1); } } el...
false
false
false
false
false
0
xorFill(SplashPath *path, GBool eo) { SplashPipe pipe; SplashXPath *xPath; SplashXPathScanner *scanner; int xMinI, yMinI, xMaxI, yMaxI, x0, x1, y; SplashClipResult clipRes, clipRes2; SplashBlendFunc origBlendFunc; if (path->length == 0) { return splashErrEmptyPath; } xPath = new SplashXPath(path,...
false
false
false
false
false
0
gli_putchar_utf8(glui32 val, FILE *fl) { if (val < 0x80) { putc(val, fl); } else if (val < 0x800) { putc((0xC0 | ((val & 0x7C0) >> 6)), fl); putc((0x80 | (val & 0x03F) ), fl); } else if (val < 0x10000) { putc((0xE0 | ((val & 0xF000) >> 1...
false
true
false
false
true
1
_name_has_owner (DBusGConnection *bus, const char *name) { DBusGProxy *proxy; gboolean has_owner = FALSE; g_return_val_if_fail (name != NULL, FALSE); proxy = dbus_g_proxy_new_for_name (bus, "org.freedesktop.DBus", "/org/freedesktop/DBus", ...
false
false
false
false
false
0
NCONF_dump_bio(const CONF *conf, BIO *out) { if (conf == NULL) { CONFerr(CONF_F_NCONF_DUMP_BIO,CONF_R_NO_CONF); return 0; } return conf->meth->dump(conf, out); }
false
false
false
false
false
0
addCable(string t1, string n1, string p1, string t2, string n2, string p2, IBLinkWidth width, IBLinkSpeed speed) { // make sure the nodes exists: IBSystem *p_sys1 = makeSystem(n1,t1); IBSystem *p_sys2 = makeSystem(n2,t2); // check please: if (! (p_sys1 && p_sys2)) { ...
false
false
false
false
false
0
area(double P1x, double P1y, double P2x, double P2y) { return ( fabs(P1x-P2x)*( (P1y>P2y ? P1y : P2y) - fabs(P1y-P2y)/2) ); }
false
false
false
false
false
0
dJointGetSliderPositionRate ( dJointID j ) { dxJointSlider* joint = ( dxJointSlider* ) j; dUASSERT ( joint, "bad joint argument" ); checktype ( joint, Slider ); // get axis1 in global coordinates dVector3 ax1; dMULTIPLY0_331 ( ax1, joint->node[0].body->posr.R, joint->axis1 ); if ( joint->n...
false
false
false
false
false
0
v_unity3(axis, v_result) b_axis axis; hvec3_t *v_result; { v_result = gm_ALLOC(hvec3_t, v_result, "v_unity3()"); switch(axis) { case X_AXIS : v_x(*v_result) = 1.0; v_y(*v_result) = v_z(*v_result) = 0.0; break; case Y_AXIS : v_y(*v_result) = 1.0; ...
false
false
false
true
true
1
ixgbe_macvlan_set_rx_mode(struct net_device *dev, unsigned int pool, struct ixgbe_adapter *adapter) { struct ixgbe_hw *hw = &adapter->hw; u32 vmolr; /* No unicast promiscuous support for VMDQ devices. */ vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(pool)); vmolr |= (IXGBE_VMOLR_ROMPE | IXGBE_VMOLR_BAM | IXGBE...
false
false
false
false
false
0
gst_buffer_ensure_priv (GstBuffer * buf) { GstBufferPrivate *priv = buf->priv; if (priv != NULL) return priv; priv = buf->priv = G_TYPE_INSTANCE_GET_PRIVATE (buf, GST_TYPE_BUFFER, GstBufferPrivate); return priv; }
false
false
false
false
false
0
PyErr_ProgramTextObject(PyObject *filename, int lineno) { FILE *fp; if (filename == NULL || lineno <= 0) return NULL; fp = _Py_fopen_obj(filename, "r" PY_STDIOTEXTMODE); return err_programtext(fp, lineno); }
false
false
false
false
false
0
CollectDepends() { // Allocate the dependency graph adjacency lists. this->InitialGraph.resize(this->Targets.size()); // Compute each dependency list. for(unsigned int i=0; i < this->Targets.size(); ++i) { this->CollectTargetDepends(i); } }
false
false
false
false
false
0
insert_stm_after_label( Pe_statement *pe_stm, Statement *ins_stm ) { Statement *stm; for( stm = pe_stm->stm_head; stm != NULL; stm = stm->next ){ if( stm->ope != OPE_LABEL ) break; } if( stm != NULL ) insert_stm( pe_stm, stm->prev, ins_stm ); else ...
false
false
false
false
false
0
find_waypoint_list_at_index(int index) { Assert(index >= 0); int i = 0; SCP_list<waypoint_list>::iterator ii; for (ii = Waypoint_lists.begin(); ii != Waypoint_lists.end(); ++i, ++ii) { if (i == index) return &(*ii); } return NULL; }
false
false
false
false
false
0
latLonViewport() { QPolygonF view; QGeoBoundingBox viewport = md->viewport(); QGeoCoordinate c, c2; double offset = 0.0; c = viewport.bottomLeft(); view << QPointF(c.longitude() * 3600.0, c.latitude() * 3600.0); c2 = viewport.bottomRight(); if (c2.longitude() < c.longitude()) of...
false
false
false
false
false
0
CallDebugHook(SQInteger type,SQInteger forcedline) { // C::B patch: Avoid compiler warnings about shadowing params SQObjectPtr tmp_reg; SQInteger nparams=5; SQFunctionProto *func=_funcproto(_closure(ci->_closure)->_function); Push(_roottable); Push(type); Push(func->_sourcename); Push(forcedline?forcedline:func...
false
false
false
false
false
0
lakai_get_miscdata(LHANDLE handle, unsigned char *data) { unsigned char finalbuf[1024]; int i, finallen, numvals; static unsigned char cmdblk1[] = { 0xf0, 0x47, 0x00, LC_RMDATA, 0x48, 0xf7}; /* SysEx: "request misc data" */ if (fhandles[handle] == -1 || handle < 0 || handle > MAX_OPEN) { fprintf(stderr, "lak...
true
true
false
false
false
1
pk_button_selection_changed_cb (GtkTreeSelection *selection, gpointer user_data) { CEPolkitButton *button = user_data; NMConnectionList *list = g_object_get_data (G_OBJECT (button), "NMConnectionList"); GtkTreeIter iter; GtkTreeModel *model; NMRemoteConnection *connection; NMSettingConnection *s_con; gboolean se...
false
false
false
false
false
0
chise_ds_open_ccs_table (CHISE_DS *ds, const char *ccs) { CHISE_CCS_Table* table; size_t len = strlen (ccs); if (ds == NULL) return NULL; table = (CHISE_CCS_Table*)malloc (sizeof (CHISE_CCS_Table)); if (table == NULL) return NULL; table->ds = ds; table->db = NULL; table->access = 0; table->...
false
false
false
false
false
0
display_span () { float fract = (adjustment.get_upper() - adjustment.get_value ()) / ((adjustment.get_upper() - adjustment.get_lower())); return (_orien == VERT) ? (int)floor (span * (1.0 - fract)) : (int)floor (span * fract); }
false
false
false
false
false
0
get_file_name(int tname) { const char *result = ""; switch (arglex_token) { case arglex_token_string: case arglex_token_number: result = arglex_value.alv_string; arglex(); break; case arglex_token_stdio: result = "-"; arglex(); break; default: option_needs_file(tname, usage); // NO...
false
false
false
false
false
0
email_field_details_tests_test_im_field_details_equality (EmailFieldDetailsTests* self) { FolksImFieldDetails* details_a_1 = NULL; FolksImFieldDetails* _tmp0_ = NULL; FolksImFieldDetails* details_a_2 = NULL; FolksImFieldDetails* _tmp1_ = NULL; FolksImFieldDetails* details_b_1 = NULL; FolksImFieldDetails* _tmp2_ =...
false
false
false
false
false
0
_iq_last_pkt_user(mod_instance_t mi, user_t user, pkt_t pkt) { char lasttime[10]; time_t t; os_t os; os_object_t o; st_ret_t ret; /* we only want to play with iq:last gets */ if(pkt->type != pkt_IQ || pkt->ns != ns_LAST) return mod_PASS; /* make sure they're allowed */ if(!...
true
true
false
false
false
1
gennvm_submit_io(struct nvm_dev *dev, struct nvm_rq *rqd) { if (!dev->ops->submit_io) return -ENODEV; /* Convert address space */ nvm_generic_to_addr_mode(dev, rqd); rqd->dev = dev; rqd->end_io = gennvm_end_io; return dev->ops->submit_io(dev, rqd); }
false
false
false
false
false
0
UpdateMapPointersInObject(Heap* heap, HeapObject* obj) { ASSERT(!obj->IsMarked()); Map* map = obj->map(); ASSERT(heap->map_space()->Contains(map)); MapWord map_word = map->map_word(); ASSERT(!map_word.IsMarked()); if (map_word.IsOverflowed()) { Map* new_map = GetForwardedMap(map_word); ...
false
false
false
false
false
0
ProcessEvent(wxEvent& event) { wxPropertyGrid* propGrid = (wxPropertyGrid*) GetParent()->GetParent(); wxASSERT( propGrid->IsKindOf(CLASSINFO(wxPropertyGrid)) ); if ( event.GetEventType() == wxEVT_NAVIGATION_KEY ) { //wxLogDebug(wxT("wxEVT_NAVIGATION_KEY")); //SetFocusFromKbd(); ...
false
false
false
false
false
0
ak4104_spi_probe(struct spi_device *spi) { struct device_node *np = spi->dev.of_node; struct ak4104_private *ak4104; unsigned int val; int ret; spi->bits_per_word = 8; spi->mode = SPI_MODE_0; ret = spi_setup(spi); if (ret < 0) return ret; ak4104 = devm_kzalloc(&spi->dev, sizeof(struct ak4104_private), ...
false
false
false
false
false
0
brasero_cli_burning_device (const gchar *option_name, const gchar *value, gpointer data, GError **error) { BraseroDrive *burner; BraseroMediumMonitor *monitor; if (!value) return FALSE; /* Wait for the libbrasero-media to be rea...
false
false
false
false
false
0
ConClear() { TDrawBuffer B; MoveCh(B, ' ', 0x07, ScreenCols); return ConPutLine(0, 0, ScreenCols, ScreenRows, B); }
false
false
false
false
false
0
SetSize(size_t len) { char *tbuf; if( len > BUF_MAX_SIZ ) return -1; // buffer too long if( p > len) len = p; if( len == n ) return 0; tbuf = new char[len]; #ifndef WINDOWS if( !tbuf ) return -1; #endif if(p) memcpy(tbuf, b, p); delete []b; b = tbuf; n = len; return 0; }
false
false
false
false
false
0
SetLeafContentValue ( XMP_StringPtr newValue ) { XML_Node * valueNode; if ( ! this->content.empty() ) { valueNode = this->content[0]; } else { valueNode = new XML_Node ( this, "", kCDataNode ); this->content.push_back ( valueNode ); } valueNode->value = newValue; }
false
false
false
false
false
0
genFC(int vert, int* FC, int FC_size, Graph* graph, int* satur_degree, int upper_bound){ int i; int* color_around = graph[vert].color_around; for(i=0; i <= FC_size; ++i){ if (color_around[i]>0) FC[i]=0; else FC[i]=1;//lookahead(vert,i,upper_bound,graph,satur_degree); }...
false
false
false
false
false
0
getRawInfo( const char *fileName ) { // Use the system call "stat" to determine the file length. struct stat filestat; if ( stat(fileName, &filestat) == -1 ) { errorString_ << "FileRead: Could not stat RAW file (" << fileName << ")."; return false; } // STK rawwave files have no header and are assume...
false
false
false
false
false
0
folder_disconnect(struct storage_ref_info * ref_info, struct mailfolder * folder) { struct folder_ref_info * folder_ref_info; folder_ref_info = storage_get_folder_ref(ref_info, folder); /* folder is disconnected, session is lost */ folder_ref_info->lost_session = 1; mailfolder_disconnect(folder); ...
false
false
false
false
false
0
PlayerMayJoin( const ePlayerNetID* player ) const { int i; // AI players are always allowed to join, the logic that tries to put the AI into // this team is responsible for checking if ( !player->IsHuman() ) return true; // suspended players cannot join if ( player->GetSuspended() > 0 ...
false
false
false
false
false
0
getByMultiIDs( const vector<TFeatureID> &IDs, vector<CFeaturePtr> &out, vector<int> &outIndex ) const { out.clear(); outIndex.clear(); out.reserve( IDs.size() ); outIndex.reserve( IDs.size() ); for( int k = 0; k < int(IDs.size()); ++k ) { int idx; CFeaturePtr f = getByID( IDs[k]...
false
false
false
false
false
0
mono_domain_assembly_search (MonoAssemblyName *aname, gpointer user_data) { MonoDomain *domain = mono_domain_get (); GSList *tmp; MonoAssembly *ass; gboolean refonly = GPOINTER_TO_UINT (user_data); mono_domain_assemblies_lock (domain); for (tmp = domain->domain_assemblies; tmp; tmp = tmp->next) { ass =...
false
false
false
false
false
0
server_create_address_tag(const char *address) { const char *start, *end; g_return_val_if_fail(address != NULL, NULL); /* try to generate a reasonable server tag */ if (strchr(address, '.') == NULL) { start = end = NULL; } else if (g_ascii_strncasecmp(address, "irc", 3) == 0 || g_ascii_strncasecmp(address...
false
false
false
false
true
1
execute_new_code(TSRMLS_D) /* {{{ */ { zend_op *opline, *end; zend_op *ret_opline; int orig_interactive; if (!(CG(active_op_array)->fn_flags & ZEND_ACC_INTERACTIVE) || CG(active_op_array)->backpatch_count>0 || CG(active_op_array)->function_name || CG(active_op_array)->type!=ZEND_USER_FUNCTION) { return; }...
false
false
false
false
false
0
row_changed (ETreeModelGenerator *tree_model_generator, GtkTreePath *path) { GtkTreeIter iter; g_assert (path); if (gtk_tree_model_get_iter (GTK_TREE_MODEL (tree_model_generator), &iter, path)) { ETMG_DEBUG (g_print ("row_changed emitting\n")); gtk_tree_model_row_changed (GTK_TREE_MODEL (tree_mode...
false
false
false
false
false
0
almanah_calendar_select_date (AlmanahCalendar *self, GDate *date) { g_return_if_fail (ALMANAH_IS_CALENDAR (self)); g_return_if_fail (date != NULL); gtk_calendar_select_month (GTK_CALENDAR (self), g_date_get_month (date) - 1, g_date_get_year (date)); gtk_calendar_select_day (GTK_CALENDAR (self), g_date_get_day (dat...
false
false
false
false
false
0
fldrms(field_t field, field_t field2, field_t *field3) { size_t i; size_t len; int rnmiss = 0; int grid1 = field.grid; // int nmiss1 = field.nmiss; double *array1 = field.ptr; int grid2 = field2.grid; // int nmiss2 = field2.nmiss; double *array2 = field2.ptr; const dou...
false
false
false
false
false
0
SearchForPivot( MatrixPtr Matrix, int Step, BOOLEAN DiagPivoting ) { register ElementPtr ChosenPivot; /* Begin `SearchForPivot'. */ /* If singletons exist, look for an acceptable one to use as pivot. */ if (Matrix->Singletons) { ChosenPivot = SearchForSingleton( Matrix, Step ); if (Chos...
false
false
false
false
false
0
equalizer_get(v22bis_state_t *s) { int i; int p; complexf_t z; complexf_t z1; /* Get the next equalized value. */ z = complex_setf(0.0f, 0.0f); p = s->rx.eq_step - 1; for (i = 0; i < 2*V22BIS_EQUALIZER_LEN + 1; i++) { p = (p - 1) & V22BIS_EQUALIZER_MASK; z1 = compl...
false
false
false
false
false
0
Perl_sv_nv(pTHX_ SV *sv) { PERL_ARGS_ASSERT_SV_NV; if (SvNOK(sv)) return SvNVX(sv); return sv_2nv(sv); }
false
false
false
false
false
0
SphereBSPTree(Sphere *sphere, BSPTree *bsptree, int action) { /* no need to do stuff if we cannot be translucent */ if (never_translucent((Geom *)sphere)) { return sphere; } /* the mesh is generated lazily on demand, so do it now if necessary */ if (action == BSPTREE_ADDGEOM && (sphere->geomflags & SPHER...
false
false
false
false
false
0
gtt_xml_write_file (const char * filename) { char * tmpfilename; xmlNodePtr topnode; FILE *fh; int rc; tmpfilename = g_strconcat (filename, ".tmp", NULL); fh = fopen (tmpfilename, "w"); g_free (tmpfilename); if (!fh) { gtt_err_set_code (GTT_CANT_OPEN_FILE); return; } topnode = gtt_to_dom_tree(); fprintf(fh...
false
false
false
false
true
1
Save() { if (!opened || !dirty) return; avm::string tempfile = filename; avm::string::size_type pos; const char* dname = tempfile.c_str(); const char* bname = ""; if ((pos = tempfile.rfind('/')) != avm::string::npos) { tempfile[pos] = 0; bname = &tempfile[pos] + 1; } char* ...
false
false
false
false
false
0
rev_follow_branch(CvsFileRevision * rev, const char * branch) { struct list_head * next; /* check for 'main line of inheritance' */ if (strcmp(rev->branch, branch) == 0) return rev->pre_psm ? rev->pre_psm->post_rev : NULL; /* look down branches */ for (next = rev->branch_children.next; next != &r...
false
false
false
false
false
0
menu_fullname(const char *menu) { struct entry *item = firstitem; while (item != NULL) { if (item->item->type == MENU_SUBMENU && !strcmp(menu, item->item->shortname)) { return (item->item->name); } item = item->next; } return NULL; }
false
false
false
false
false
0
src_filesel_ok(struct w *widgets) { /* Adds source directory to the treeview */ gchar *utf8 = NULL; G_CONST_RETURN gchar *path = gtk_file_selection_get_filename(GTK_FILE_SELECTION(widgets->src_filesel)); utf8 = g_locale_to_utf8(path, strlen(path), NULL, NULL, NULL); /* Insert the backup source in t...
false
false
false
false
false
0
kmo_add_bad_pix_border(const cpl_image *data, int reject) { int nx_old = 0, ny_old = 0, nx_new = 0, ny_new = 0, ix_old = 0, iy_old = 0; const float *pdata = NUL...
false
false
false
false
false
0
setupthread (Thread *thread) { Thread *parent; /* Save the thread's ID number and put in threads list so we can look it up. * Set state to disable checkpointing so checkpointer won't race between * adding to list and setting up handler */ thread -> tid = mtcp_sys_kernel_gettid (); thread -> origina...
false
false
false
false
false
0
ldns_key_list_filter_for_non_dnskey(ldns_key_list *key_list) { int saw_zsk = 0; size_t i; for(i=0; i<ldns_key_list_key_count(key_list); i++) if(!(ldns_key_flags(ldns_key_list_key(key_list, i))&LDNS_KEY_SEP_KEY)) { saw_zsk = 1; break; } if(!saw_zsk) return; /* else filter all KSKs */ for(i=0; i<ldns_ke...
false
false
false
false
false
0
value_resolver(asn1p_value_t *value, void *rarg) { asn1p_value_t *cval; asn1p_expr_t *tmpexpr; asn1p_expr_t *target; asn1p_ref_t *ref; struct { asn1p_expr_t *(*expr_resolve)(asn1p_expr_t *, void *arg); } *varg = rarg; if(!value || value->type != ATV_REFERENCED) { errno = ESRCH; return NULL; } ref = val...
false
false
false
false
false
0
AcpiDsInitAmlWalk ( ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Op, ACPI_NAMESPACE_NODE *MethodNode, UINT8 *AmlStart, UINT32 AmlLength, ACPI_EVALUATE_INFO *Info, UINT8 PassNumber) { ACPI_STATUS Sta...
false
false
false
false
false
0
free_EncKDCRepPart(EncKDCRepPart *data) { free_EncryptionKey(&(data)->key); free_LastReq(&(data)->last_req); free_krb5int32(&(data)->nonce); if((data)->key_expiration) { free_KerberosTime((data)->key_expiration); free((data)->key_expiration); (data)->key_expiration = NULL; } free_TicketFlags(&(data)->flags); free_Kerbe...
false
false
false
false
false
0
managerParameters() const { Q_D(const QLandmarkManager); if (!d->engine) { return QMap<QString, QString>(); } d->errorCode = QLandmarkManager::NoError; d->errorString = ""; d->errorMap.clear(); return d->engine->managerParameters(); }
false
false
false
false
false
0
string_cookie(char *s, int length) { int i; for(i = 0; i < length; i++) { s[i] = rand() % 26 + 'a'; } s[length - 1] = 0; }
false
true
false
false
false
1
Describe(PkgIterator Pkg,ostream &out,bool Current,bool Candidate) { VerIterator Ver(Sim); out << Pkg.FullName(true); if (Current == true) { Ver = Pkg.CurrentVer(); if (Ver.end() == false) out << " [" << Ver.VerStr() << ']'; } if (Candidate == true) { Ver = Sim[Pkg].C...
false
false
false
false
false
0
getSectionContents(DataRefImpl DRI, StringRef &Result) const { if (is64BitLoadCommand(MachOObj, DRI)) { InMemoryStruct<macho::Section64> Sect; getSection64(DRI, Sect); Result = MachOObj->getData(Sect->Offset, Sect->Size); } else { InMemoryStruct<macho::...
false
false
false
false
false
0
search_result_find_row(SearchData *sd, FileData *fd, GtkTreeIter *iter) { GtkTreeModel *store; gboolean valid; gint n = 0; store = gtk_tree_view_get_model(GTK_TREE_VIEW(sd->result_view)); valid = gtk_tree_model_get_iter_first(store, iter); while (valid) { MatchFileData *mfd; n++; gtk_tree_model_get(stor...
false
false
false
false
false
0
stv0299_read_ber(struct dvb_frontend* fe, u32* ber) { struct stv0299_state* state = fe->demodulator_priv; if (state->errmode != STATUS_BER) return -ENOSYS; *ber = stv0299_readreg(state, 0x1e) | (stv0299_readreg(state, 0x1d) << 8); return 0; }
false
false
false
false
false
0
test_connect_object (Test *test, gconstpointer unused) { GkmCredential *cred; CK_RV rv; rv = gkm_credential_create (test->module, NULL, NULL, (guchar*)"mock", 4, &cred); g_assert (rv == CKR_OK); g_assert (cred); gkm_credential_connect (cred, test->object); g_assert (gkm_credential_get_object (cred) == test->ob...
false
false
false
false
false
0
ioeventfd_write(struct kvm_vcpu *vcpu, struct kvm_io_device *this, gpa_t addr, int len, const void *val) { struct _ioeventfd *p = to_ioeventfd(this); if (!ioeventfd_in_range(p, addr, len, val)) return -EOPNOTSUPP; eventfd_signal(p->eventfd, 1); return 0; }
false
false
false
false
false
0
print_script (script, hunkfun, printfun) struct change *script; struct change * (*hunkfun) PARAMS((struct change *)); void (*printfun) PARAMS((struct change *)); { struct change *next = script; while (next) { struct change *this, *end; /* Find a set of changes that belong together. ...
false
false
false
false
false
0
set_hl_attr(idx) int idx; /* index in array */ { attrentry_T at_en; struct hl_group *sgp = HL_TABLE() + idx; /* The "Normal" group doesn't need an attribute number */ if (sgp->sg_name_u != NULL && STRCMP(sgp->sg_name_u, "NORMAL") == 0) return; #ifdef FEAT_GUI /* * For the GUI mode:...
false
false
false
false
false
0
_nrrdDataFNNumber(NrrdIoState *nio) { unsigned int ret; int ii; if (nio->dataFNFormat) { /* datafiles given in iterator form; count number of values */ ret = 0; for (ii = nio->dataFNMin; ((nio->dataFNStep > 0 && ii <= nio->dataFNMax) || (nio->dataFNStep < 0 && ii >= nio->dataFNMax)...
false
false
false
false
false
0
isStatementEnd (const statementInfo *const st) { const tokenInfo *const token = activeToken (st); boolean isEnd; if (isType (token, TOKEN_SEMICOLON)) isEnd = TRUE; else if (isType (token, TOKEN_BRACE_CLOSE)) /* Java, D, C#, Vala do not require semicolons to end a block. Neither do * C++ namespaces. All othe...
false
false
false
false
false
0
syvalion_draw_sprites(struct mame_bitmap *bitmap,const struct rectangle *cliprect) { /* Y chain size is 16/32?/64/64? pixels. X chain size is always 64 pixels. */ int size[] = { 1, 2, 4, 4 }; int x0, y0, x, y, dx, ex, zx; int ysize; int j, k; int offs; /* sprite RAM offset */ int tile_offs; ...
false
false
false
false
false
0
mp3_type_frame_length_from_header (GstMpegAudioParse * mp3parse, guint32 header, guint * put_version, guint * put_layer, guint * put_channels, guint * put_bitrate, guint * put_samplerate, guint * put_mode, guint * put_crc) { guint length; gulong mode, samplerate, bitrate, layer, channels, padding, crc; ...
false
false
false
false
false
0
sb_stemmer_new(const char * algorithm, const char * charenc) { stemmer_encoding enc; struct stemmer_modules * module; struct sb_stemmer * stemmer = (struct sb_stemmer *) malloc(sizeof(struct sb_stemmer)); if (stemmer == NULL) return NULL; enc = sb_getenc(charenc); if (enc == ENC_UNKNOWN) re...
false
false
false
false
false
0
labelPath(NodeAllocator& na, BestNode* curBest, int c_d, int a_d) { if (na.hasLabel(this)) { // clear labels on path to root VisualNode* p = this; while (p) { na.clearLabel(p); p = p->getParent(na); } } else { // set labels on path to root ...
false
false
false
false
false
0
ce_string_get_length_inrange(CeString *self, CeInt begin, CeInt end) { CE_RANGE_INITIAL(begin, end, self->len); return (end - begin + 1); }
false
false
false
false
false
0