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
removeLord( GenericLord * lord ) { _theLords.removeAll( lord ); if( _selectedLord == lord ) { _selectedLord = 0; } }
false
false
false
false
false
0
scm_end_input (SCM port) { long offset; scm_t_port *pt = SCM_PTAB_ENTRY (port); if (pt->read_buf == pt->putback_buf) { offset = pt->read_end - pt->read_pos; pt->read_buf = pt->saved_read_buf; pt->read_pos = pt->saved_read_pos; pt->read_end = pt->saved_read_end; pt->read_buf_size...
false
false
false
false
false
0
ulptx_intr_handler(struct adapter *adapter) { static const struct intr_info ulptx_intr_info[] = { {F_PBL_BOUND_ERR_CH0, "ULP TX channel 0 PBL out of bounds", STAT_ULP_CH0_PBL_OOB, 0}, {F_PBL_BOUND_ERR_CH1, "ULP TX channel 1 PBL out of bounds", STAT_ULP_CH1_PBL_OOB, 0}, {0xfc, "ULP TX parity error", -1, 1},...
false
false
false
false
false
0
cac_tautology(Literals lits) { if (C_symbols == NULL) return FALSE; else if (lits == NULL) return FALSE; else if (lits->sign && cac_redundant_atom(lits->atom)) return TRUE; else return cac_tautology(lits->next); }
false
false
false
false
false
0
ompi_osc_rdma_fence(int assert, ompi_win_t *win) { ompi_osc_rdma_module_t *module = GET_MODULE(win); uint32_t incoming_reqs; int ret = OMPI_SUCCESS; OPAL_OUTPUT_VERBOSE((25, ompi_osc_base_framework.framework_output, "osc rdma: fence start")); /* can't enter an active targe...
false
false
false
false
false
0
update_ctime(struct inode *inode) { struct timespec now = current_fs_time(inode->i_sb); if (inode_unhashed(inode) || !inode->i_nlink || timespec_equal(&inode->i_ctime, &now)) return; inode->i_ctime = CURRENT_TIME_SEC; mark_inode_dirty(inode); }
false
false
false
false
false
0
restoreState () { QString rFile = KStandardDirs::locateLocal ("appdata", "kubrick.save"); KConfig config (rFile, KConfig::SimpleConfig); if (config.hasGroup ("KubrickGame")) { loadPuzzle (config); } else { // No Kubrick game-file in this user's area, so save a default puzzle. newCube (option [opt...
false
false
false
false
false
0
_tenQGL_Rexp(double RThPhB[3], const double RThPhA[3], const double rlog[3]) { double bl, fo; rr1 = rr0 + rlog[0]; bl = _tenQGL_blah(rr0, rr1); ph1 = ph0 + (bl ? rlog[2]/bl : 0); fo = _tenQGL_fooo(ph0, ph1); th1 = th0 + (bl*fo ? rlog[1]/(bl*fo) : 0); return; }
false
false
false
false
false
0
URL_writeurls() /* * Prefix codes are: * 'u' - url * '@' - who said it: <nick> <uh> <time_caught> */ { FILE *f; urlrec *u; char webfile[256], tmpfile[256]; int x; /* bail if urllist is inactive (pending read) */ if(!(URL->flags & URL_ACTIVE)) { Log_write(LOG_MAIN,"*","URL list is not active. Ignori...
false
false
false
false
true
1
xlog_bread( struct xlog *log, xfs_daddr_t blk_no, int nbblks, struct xfs_buf *bp, char **offset) { int error; error = xlog_bread_noalign(log, blk_no, nbblks, bp); if (error) return error; *offset = xlog_align(log, blk_no, nbblks, bp); return 0; }
false
false
false
false
false
0
globus_range_list_copy( globus_range_list_t * dest, globus_range_list_t src) { int rc; globus_l_range_list_t * tmp_dst; globus_l_range_ent_t * prev = NULL; globus_l_range_ent_t * dst_ent; glob...
false
false
false
false
false
0
DF128(const u8 npub[16], const u8 C[], ull Clen, const u8 K[], u8 M[], u8 TE[16]) { u32 rk[44]; u8 N[16]; u8 L[16], S[16], V[16], tmp[16], t; int i, j, c, lastlen; c = Clen/16; lastlen = Clen % 16; memset(S, 0, 16); memcpy(N, npub, CRYPTO_NPUBBYTES); N[CRYPTO_NPUBBYTES-1] |= 0x01; aes128KeySet...
false
true
false
false
false
1
cpl_polynomial_new(cpl_size dim) { cpl_polynomial * p; /* Test input */ cpl_ensure(dim > 0, CPL_ERROR_ILLEGAL_INPUT, NULL); /* Allocate struct - and set nc == 0 */ p = cpl_calloc(1, sizeof(cpl_polynomial)); p->dim = dim; p->nc = 0; return p; }
false
false
false
false
false
0
get_string_all_children(gint row) { gint Numb = 0; gint *NumChildren = NULL; gint j; gchar* rowprocess = NULL; gchar* str = NULL; gchar* dump = NULL; NumChildren = get_all_children(row,&Numb); if(Numb>0) str = get_title_process(); for(j=0;j<Numb;j++) { rowprocess = get_row_process(NumChildre...
false
false
false
false
false
0
action_self_mount_volume_callback (GtkAction *action, gpointer data) { NemoFile *file; NemoView *view; GMountOperation *mount_op; view = NEMO_VIEW (data); file = nemo_view_get_directory_as_file (view); if (file == NULL) { return; } mount_op = gtk_mount_operation_new (nemo_view_get_containing_window ...
false
false
false
false
false
0
updateStoppedMark(RunMode mode) { if (!ctx()) return; DebugDocument::Ptr doc = ctx()->activeDocument(); assert(!doc.isNull()); KTextEditor::MarkInterface* imark = qobject_cast<KTextEditor::MarkInterface*>(doc->viewerDocument()); if (mode == Running) { // No longer stopped there...
false
false
false
false
false
0
pull_varattnos_walker(Node *node, Bitmapset **varattnos) { if (node == NULL) return false; if (IsA(node, Var)) { Var *var = (Var *) node; Assert(var->varno == 1); *varattnos = bms_add_member(*varattnos, var->varattno - FirstLowInvalidHeapAttributeNumber); return false; } /* Should not find a ...
false
false
false
false
false
0
orte_dt_copy_app_context(orte_app_context_t **dest, orte_app_context_t *src, opal_data_type_t type) { /* create the new object */ *dest = OBJ_NEW(orte_app_context_t); if (NULL == *dest) { ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE); return ORTE_ERR_OUT_OF_RESOURCE; } /* copy data i...
false
false
false
false
false
0
elm_smart_scroller_page_show(Evas_Object *obj, int pagenumber_h, int pagenumber_v) { API_ENTRY return; Evas_Coord x, y, w, h; elm_smart_scroller_child_viewport_size_get(sd->smart_obj, &w, &h); if (pagenumber_h >= 0) x = sd->pagesize_h * pagenumber_h; if (pagenumber_v >= 0) y = sd->pagesize_v * pagenumber...
false
false
false
false
false
0
GImageWrite_Jpeg(GImage *gi, FILE *outfile, int quality, int progressive) { struct _GImage *base = gi->list_len==0?gi->u.image:gi->u.images[0]; struct jpeg_compress_struct cinfo; struct my_error_mgr jerr; JSAMPROW row_pointer[1]; /* pointer to JSAMPLE row[s] */ cinfo.err = jpeg_std_error(&jerr.pub); ...
false
false
false
false
true
1
CGUIWindow(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle) : IGUIWindow(environment, parent, id, rectangle), Dragging(false), IsDraggable(true), DrawBackground(true), DrawTitlebar(true), IsActive(false) { #ifdef _DEBUG setDebugName("CGUIWindow"); #endif IGUISkin* skin =...
false
false
false
false
false
0
gegl_node_process (GeglNode *self) { /* XXX: should perhaps use the internal processor? */ GeglProcessor *processor; g_return_if_fail (GEGL_IS_NODE (self)); processor = gegl_node_new_processor (self, NULL); while (gegl_processor_work (processor, NULL)) ; g_object_unref (processor); }
false
false
false
false
false
0
logout(bool force) const { #ifdef Q_WS_X11 if(mCapabilities & GnomeSessionManager) { QDBusInterface dbusInterface("org.gnome.SessionManager", "/org/gnome/SessionManager", "org.gnome.SessionManager", QDBusConnection::sessionBus()); unsigned int code = (force ? 2 : 1); QDBusMessage reply = dbusInterface.call("Log...
false
false
false
false
false
0
ValidateServiceOptions(ServiceDescriptor* service, const ServiceDescriptorProto& proto) { if (IsLite(service->file()) && (service->file()->options().cc_generic_services() || service->file()->options().java_generic_services())) { AddError(service->full_name(), proto, DescriptorPool::E...
false
false
false
false
false
0
goo_cairo_matrix_copy (const cairo_matrix_t *matrix) { cairo_matrix_t *matrix_copy; if (!matrix) return NULL; matrix_copy = g_slice_new (cairo_matrix_t); *matrix_copy = *matrix; return matrix_copy; }
false
false
false
false
false
0
_bfd_generic_make_empty_symbol (bfd *abfd) { bfd_size_type amt = sizeof (asymbol); asymbol *new_symbol = (asymbol *) bfd_zalloc (abfd, amt); if (new_symbol) new_symbol->the_bfd = abfd; return new_symbol; }
false
false
false
false
false
0
new_socket(char flags) /* * Function: get a socket and add it to the socktbl * Returns: sock if OK * -1 if failed * * Socket flags (#defined above) specify how activity on a socket is handled. */ { int sock; sock = socket(AF_INET, SOCK_STREAM, 0); if(sock < 0) { internal("net: in priv new_so...
false
false
false
false
false
0
ls_tai(p_ls,pp_lsel) p_ls_t p_ls; pp_lsel_t pp_lsel; { AS_HCODE(ls_check(p_ls);) as_cold(p_ls->p_tail!=NULL,"ls_tai: List is empty."); *pp_lsel=p_ls->p_tail->p_data; }
false
false
false
true
false
1
evas_object_smart_callback_del_full(Evas_Object *obj, const char *event, Evas_Smart_Cb func, const void *data) { Evas_Object_Smart *o; Eina_List *l; Evas_Smart_Callback *cb; MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); return NULL; MAGIC_CHECK_END(); o = (Evas_Object_Smart *)(obj->object_data); MA...
false
false
false
false
false
0
content_type_is_default(Value *content_type){ if(content_type){ const String *ct=content_type->get_string(); return ct == &content_type_text || ct == &content_type_binary; } return true; }
false
false
false
false
false
0
sbs_get_property(struct power_supply *psy, enum power_supply_property psp, union power_supply_propval *val) { int ret = 0; struct sbs_info *chip = power_supply_get_drvdata(psy); struct i2c_client *client = chip->client; switch (psp) { case POWER_SUPPLY_PROP_PRESENT: case POWER_SUPPLY_PROP_HEALTH: ret = sbs_g...
false
false
false
false
false
0
double_check_before_after_dates (GTlsCertificateGnutls *chain) { GTlsCertificateFlags gtls_flags = 0; gnutls_x509_crt_t cert; time_t t, now; now = time (NULL); while (chain) { cert = g_tls_certificate_gnutls_get_cert (chain); t = gnutls_x509_crt_get_activation_time (cert); if (t == (tim...
false
false
false
false
false
0
gv_to_gml(Agraph_t* G, FILE* outFile) { Agnode_t* n; Agedge_t* e; fprintf (outFile, "graph [\n version 2\n"); if (agisdirected(G)) fprintf (outFile, " directed 1\n"); else fprintf (outFile, " directed 0\n"); emitGraphAttrs (G, outFile); /* FIX: Not sure how to handle default attribu...
false
false
false
false
false
0
calculateRowHeight(void) { MSFontObject fontObj; int th=0; unsigned n=numColumns(); for (unsigned i=0;i<n;i++) { fontObj.fontStruct(columnFontStruct(i)); th=MSUtil::max(th,fontObj.textHeight()); } if (th==0) th=textHeight(); th=(th>0)?th+(rowSpacing()<<1):0; if (th!=rowHei...
false
false
false
false
false
0
dlm_new_lock(int type, u8 node, u64 cookie, struct dlm_lockstatus *lksb) { struct dlm_lock *lock; int kernel_allocated = 0; lock = kmem_cache_zalloc(dlm_lock_cache, GFP_NOFS); if (!lock) return NULL; if (!lksb) { /* zero memory only if kernel-allocated */ lksb = kzalloc(sizeof(*lksb), GFP_NOFS); ...
false
false
false
false
false
0
fm10k_update_lport_state_pf(struct fm10k_hw *hw, u16 glort, u16 count, bool enable) { struct fm10k_mbx_info *mbx = &hw->mbx; u32 msg[3], lport_msg; /* do nothing if we are being asked to create or destroy 0 ports */ if (!count) return 0; /* if glort is not valid return error */ if (!fm10k_glort_val...
false
false
false
false
false
0
CalcScore(const Phrase &phrase, float &retFullScore, float &retNGramScore, float &retOOVScore, ScoreComponentCollection* breakdown) const { const_iterator lmIter; for (lmIter = begin(); lmIter != end(); ++lmIter) { const LanguageModel &lm = **lmIter; const float weightLM = lm.GetWeight(); const float o...
false
false
false
false
false
0
git_attr_foreach( git_repository *repo, uint32_t flags, const char *pathname, int (*callback)(const char *name, const char *value, void *payload), void *payload) { int error; git_attr_path path; git_vector files = GIT_VECTOR_INIT; unsigned int i, j, k; git_attr_file *file; git_attr_rule *rule; git_attr_a...
false
false
false
false
false
0
autohelperowl_attackpat270(int trans, int move, int color, int action) { int a, b, c; UNUSED(color); UNUSED(action); a = AFFINE_TRANSFORM(720, trans, move); b = AFFINE_TRANSFORM(722, trans, move); c = AFFINE_TRANSFORM(647, trans, move); return !same_string(a, b) && (countlib(a) <= 4 || countlib(b) <= 4 ...
false
false
false
false
false
0
__fop_write(env, txn, name, dirname, appname, fhp, pgsize, pageno, off, buf, size, istmp, flags) ENV *env; DB_TXN *txn; const char *name, *dirname; APPNAME appname; DB_FH *fhp; u_int32_t pgsize; db_pgno_t pageno; u_int32_t off; void *buf; u_int32_t size, istmp, flags; { DBT data, namedbt, dirdbt; DB_LSN...
false
false
false
false
false
0
format_small_cardinal (std::ostream& stream, uintL arg) { var uintL hundreds = floor(arg,100); var uintL tens_and_ones = arg % 100; if (hundreds > 0) { fprint(stream,cl_format_ones[hundreds]); fprint(stream," hundred"); } if (tens_and_ones > 0) { if (hundreds > 0) fprint(stream," and "); var uintL tens ...
false
false
false
false
false
0
expand_regions (struct tm_region *region, void *(*callback)(struct tm_region *, void *), void *data, bool traverse_clones) { void *retval = NULL; while (region) { retval = expand_regions_1 (region, callback, data, traverse_clones); if (retval) return retval; region = region->next; }...
false
false
false
false
false
0
H5HF_sect_row_revive(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. */ HDassert(hdr); HDassert(sect); HDassert(sect->u.row.under); HDassert(sect->sect_info.state == ...
false
false
false
false
false
0
show_mode(struct device *d, struct device_attribute *attr, char *buf) { struct ipoib_dev_priv *priv = netdev_priv(to_net_dev(d)); if (test_bit(IPOIB_FLAG_ADMIN_CM, &priv->flags)) return sprintf(buf, "connected\n"); else return sprintf(buf, "datagram\n"); }
false
false
false
false
false
0
create_window_ofm(const char *url1, const char *url2) { Bounds b; get_stdbounds_file(&b); ht_window *window=new ht_window(); window->init(&b, "file manager", FS_KILLER | FS_TITLE | FS_NUMBER | FS_MOVE | FS_RESIZE, 0); #if 1 b.w-=2; b.h-=2; VfsListbox2 *l = new VfsListbox2(); l->init(&b, virtual_fs_list, windo...
false
false
false
false
false
0
ns__div(struct soap *soap, double a, double b, double *result) { if (b) *result = a / b; else { char *s = (char*)soap_malloc(soap, 1024); sprintf(s, "<error xmlns=\"http://tempuri.org/\">Can't divide %f by %f</error>", a, b); return soap_sender_fault(soap, "Division by zero", s); } return SOAP_OK; }
false
true
false
false
false
1
hostap_set_rate(struct net_device *dev) { struct hostap_interface *iface; local_info_t *local; int ret, basic_rates; iface = netdev_priv(dev); local = iface->local; basic_rates = local->basic_rates & local->tx_rate_control; if (!basic_rates || basic_rates != local->basic_rates) { printk(KERN_INFO "%s: updati...
false
false
false
false
false
0
luname_lookup(const char * name) { const char *cp; unsigned sum = 0; const struct uhash *hp; if (!doneit) rpwfile(); cp = name; while (*cp) sum += *cp++; hp = unhash[sum % HASHMOD]; while (hp) { if (strcmp(name, hp->pwh_name) == 0) return hp; hp = hp->pwu_next; } return (struct uhash *) ...
false
false
false
false
false
0
selectAddrRegImm(SDValue Addr, SDValue &Base, SDValue &Offset) const { // if Address is FI, get the TargetFrameIndex. if (selectAddrFrameIndex(Addr, Base, Offset)) return true; // on PIC code Load GA if (Addr.getOpcode() == MipsISD::Wrapper) { Base = Addr.get...
false
false
false
false
false
0
doprarm(void) { if(!wearing_armor()) You("are not wearing any armor."); else { char lets[8]; register int ct = 0; if(uarmu) lets[ct++] = obj_to_let(uarmu); if(uarm) lets[ct++] = obj_to_let(uarm); if(uarmc) lets[ct++] = obj_to_let(uarmc); if(uarmh) let...
true
true
false
false
false
1
nextFrame() { curFrame = curFrame->nextFrame; if (!curFrame) curFrame = frame0; }
false
false
false
false
false
0
defer_scan(int when, int retries, Request r, const char *path) { timeval t; (void) gettimeofday(&t, NULL); int then = t.tv_sec + when + 1; DeferredScan *ds = new DeferredScan(then, retries, r, path); // In most cases, our new element will go either // at the beginning or end of the list. ...
false
false
false
false
false
0
daq_hup_post(const DAQ_Module_t *module, void *handle, void *old_config) { if (!module) return DAQ_ERROR_NOMOD; if (!handle) return DAQ_ERROR_NOCTX; if (!module->hup_post) return DAQ_SUCCESS; return module->hup_post(handle, old_config); }
false
false
false
false
false
0
write(DcmItem &dset) { OFCondition result = EC_Normal; DcmElement *delem=NULL; ADD_TO_DATASET(DcmUniqueIdentifier, seriesInstanceUID) if (retrieveAETitle.getLength() > 0) { ADD_TO_DATASET(DcmApplicationEntity, retrieveAETitle) } if (storageMediaFileSetID.getLength() > 0) { ADD_TO_DATASET(DcmSho...
false
false
false
false
false
0
on_setup_complete_cb (GdmDBusWorker *proxy, GAsyncResult *res, gpointer user_data) { GdmSessionConversation *conversation = user_data; GdmSession *self; char *service_name; GError *error = NULL; GVariant *ret; ret = g_d...
false
false
false
false
false
0
Save(OnDiskWrapper &onDiskWrapper) { // save in target ind size_t memUsed; char *mem = WriteToMemory(onDiskWrapper, memUsed); std::fstream &file = onDiskWrapper.GetFileTargetInd(); UINT64 startPos = file.tellp(); file.seekp(0, ios::end); file.write(mem, memUsed); UINT64 endPos = file.tellp(); CHEC...
false
false
false
false
false
0
draw_water(struct mame_bitmap* bitmap, const struct rectangle* cliprect) { struct rectangle rect = *cliprect; int x; int y; if (rect.max_y > 127) { rect.max_y = 127; } for (y = rect.min_y; y <= rect.max_y; y++) { UINT16* p = bitmap->line[y]; for (x = rect.min_x; x <= rect.max_x; x++) ...
false
false
false
false
false
0
SetFixedLevels( int nFixedLevelCount, double *padfFixedLevels ) { bFixedLevels = TRUE; for( int i = 0; i < nFixedLevelCount; i++ ) FindLevel( padfFixedLevels[i] ); }
false
false
false
false
false
0
eventFilter(QObject* watched, QEvent* event) { if (event->type() != QEvent::ContextMenu || !m_enabled || m_text->isReadOnly()) { return QSyntaxHighlighter::eventFilter(watched, event); } else { // Check spelling of text block under mouse QContextMenuEvent* context_event = static_cast<QContextMenuEvent*>(event);...
false
false
false
false
false
0
acl_truncate(acl_t *acl) { if (acl == NULL) { return; } WALK_LIST_FREE(*acl); }
false
false
false
false
false
0
cache_rrset_get(dns_msg_question_t *q, dns_tls_t *tls) { dns_cache_rrset_t *rrset; if ((rrset = cache_rrset_new(q, tls)) == NULL) return NULL; memcpy(&rrset->rrset_question, q, sizeof(*q)); STRLOWER(rrset->rrset_question.mq_name); rrset->rrset_category = 0; rrset->rrset_refs = 1; r...
false
false
false
false
false
0
SetFragmentSizeMax(unsigned int fragsize) { /* * A.4 TRANSFER SYNTAXES FOR ENCAPSULATION OF ENCODED PIXEL DATA * * All items containing an encoded fragment shall be made of an even number of bytes * greater or equal to two. The last fragment of a frame may be padded, if necessary, * to meet the sequence item forma...
false
false
false
false
false
0
expand_regex_vars (ParserState *parser_state, gchar *regex, gint len, GError **error) { /* This is the commented regex without the doubled escape needed * in a C string: * * (?<!\\)(\\\\)*\\%\{([^@]*?)\} * |------------||---||------||-| * | | | | * | the string | the endin...
false
false
false
false
false
0
Decode(std::istream &is, std::ostream &os) const { if ( BitSample == 8 ) { unsigned char idx; unsigned char rgb[3]; while( !is.eof() ) { //is.Get(c); is.read( (char*)(&idx), 1); // FIXME if( is.eof() ) { break; } if( IncompleteLUT ) {...
false
false
false
false
false
0
query_error_check_index(struct gl_context *ctx, GLenum target, GLuint index) { switch (target) { case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: case GL_PRIMITIVES_GENERATED: if (index >= ctx->Const.MaxVertexStreams) { _mesa_error(ctx, GL_INVALID_VALUE, "glBeginQueryIndexed(i...
false
false
false
false
false
0
os_isa_symlink(string_ty *path) { #ifndef S_IFLNK return 0; #else if (path->str_length == 0) return 0; os_become_must_be_active(); struct stat st; int err = glue_lstat(path->str_text, &st); if (err < 0) { int errno_old = errno; if (errno_old == ENOENT) return 0; sub_context_ty *scp ...
false
false
false
false
false
0
basic_map_partial_lexopt_base( __isl_take isl_basic_map *bmap, __isl_take isl_basic_set *dom, __isl_give isl_set **empty, int max, struct isl_sol *(*init)(__isl_keep isl_basic_map *bmap, __isl_take isl_basic_set *dom, int track_empty, int max)) { struct isl_tab *tab; struct isl_sol *sol = NULL; struct isl_c...
false
false
false
false
false
0
str_op(String *str) { DBUG_ASSERT(fixed == 1); null_value=0; for (uint i=0 ; i < arg_count ; i++) { String *res; if ((res=args[i]->val_str(str))) return res; } null_value=1; return 0; }
false
false
false
false
false
0
read(const char *name, kct_file_props_t *props) { int a; a = 0; for (KCTDir::iterator it = _dir.begin();it != _dir.end();it++) { if (strcmp((*it)->name, name) == 0) return read(a, props); a++; } cerr << "KCTFile::read(): file not found!" << endl; return NULL; }
false
false
false
false
false
0
calcdist2 (gdouble lon, gdouble lat) { double a, a1, a2, c, d, dlon, dlat, sa, radiant = M_PI / 180; dlon = radiant * (coords.current_lon - lon); dlat = radiant * (coords.current_lat - lat); if ((dlon == 0.0) && (dlat == 0.0)) return 0.0; a1 = sin (dlat / 2); a2 = sin (dlon / 2); a = (a1 * a1) + ...
false
false
false
false
false
0
table_new(t_symbol *s, t_floatarg f) { t_atom a[9]; t_glist *gl; t_canvas *x, *z = canvas_getcurrent(); if (s == &s_) { char tabname[255]; t_symbol *t = gensym("table"); sprintf(tabname, "%s%d", t->s_name, tabcount++); s = gensym(tabname); } if (f <= 1)...
false
false
false
false
false
0
wlc_lcnphy_get_receive_power(struct brcms_phy *pi, s32 *gain_index) { u32 received_power = 0; s32 max_index = 0; u32 gain_code = 0; struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy; max_index = 36; if (*gain_index >= 0) gain_code = lcnphy_23bitgaincode_table[*gain_index]; if (-1 == *gain_index) { *gain_in...
false
false
false
false
false
0
snd_hda_shutup_pins(struct hda_codec *codec) { int i; /* don't shut up pins when unloading the driver; otherwise it breaks * the default pin setup at the next load of the driver */ if (codec->bus->shutdown) return; for (i = 0; i < codec->init_pins.used; i++) { struct hda_pincfg *pin = snd_array_elem(&codec-...
false
false
false
false
false
0
on_OK (G_GNUC_UNUSED GtkWidget *widget, Dialog* pBox) { if (pBox->Apply ()) pBox->Destroy (); }
false
false
false
false
false
0
get_max_inline_xattr_value_size(struct inode *inode, struct ext4_iloc *iloc) { struct ext4_xattr_ibody_header *header; struct ext4_xattr_entry *entry; struct ext4_inode *raw_inode; int free, min_offs; min_offs = EXT4_SB(inode->i_sb)->s_inode_size - EXT4_GOOD_OLD_INODE_SIZE - EXT4_I(inode)->i_extra_i...
false
false
false
false
false
0
savelog (const TCHAR *path, const TCHAR *file) { TCHAR tmp[MAX_DPATH]; _tcscpy (tmp, path); _tcscat (tmp, file); _tcscat (tmp, _T(".log.txt")); struct zfile *zfd = zfile_fopen (tmp, _T("wb")); if (zfd) { int loglen; uae_u8 *log; loglen = 0; log = save_log (TRUE, &loglen); if (log) zfile_fwrite (log,...
false
false
false
false
false
0
CompensateComponentAddAndShift_mmx (int start_y, int end_y, int weight_bits, const ImageCoords& orig_pic_size, TwoDArray<ValueType> &comp_data, Pi...
false
false
false
false
false
0
decodeComponent(ExecState* exec, JSValue* jsVal) { double val = jsVal->toNumber(exec); if (jsVal->isUndefined()) val = 0.0; else if (val < 0.0) val = 0.0; else if (val > 255.0) val = 255.0; // ### fixme: round to even return (unsigned char)qRound(val); }
false
false
false
false
false
0
setCols ( const Hep3Vector & u1, const Hep3Vector & u2, const Hep3Vector & u3, double u1u2, Hep3Vector & v1, Hep3Vector & v2, Hep3Vector & v3 ) const { if ( (1-std::fabs(u1u2)) <= Hep4RotationInterface::tolerance ) { ZMthrowC (ZMxpvParallelCols( "All three cols supplied for a Rotation are ...
false
false
false
false
false
0
scale_thumbnail (GDesktopBackgroundStyle placement, const char *filename, GdkPixbuf *thumb, GdkScreen *screen, int dest_width, int dest_height) { int o_width; int o_height; if (placement != G_DESKTOP_BACKGROUND_STYLE_WALLPAPER && placement != G_DESKTOP_BACKGROUND_STYLE_CENTERED) { ...
false
false
false
false
false
0
check_nonsense_hmdf_table_for_hmdf(Hmdf_table *hmdf) { Hmdf_table *hpt1; Hmdf_table *hpt2; for (hpt1 = hmdf->parent->children; hpt1 != NULL; hpt1 = hpt1->brothers) { for (hpt2 = hpt1; hpt2 != NULL; hpt2 = hpt2->next) { if (hpt2->clustering == NULL) { fprintf(stderr, "War...
false
false
false
false
false
0
on_paint (gpointer data) { TestState *state = data; int frame_num; /* XXX: validate_result calls clutter_stage_read_pixels which will result in * another paint run so to avoid infinite recursion we only aim to validate * the first frame. */ frame_num = state->frame++; if (frame_num == 1) validate_r...
false
false
false
false
false
0
height() const { if (!isValid()) return qQNaN(); double result = d_ptr->topLeft.latitude() - d_ptr->bottomRight.latitude(); if (result < 0.0) result = qQNaN(); return result; }
false
false
false
false
false
0
warn_if_differ_considerably(struct drbd_device *device, const char *s, sector_t a, sector_t b) { sector_t d; if (a == 0 || b == 0) return; d = (a > b) ? (a - b) : (b - a); if (d > (a>>3) || d > (b>>3)) drbd_warn(device, "Considerable difference in %s: %llus vs. %llus\n", s, (unsigned long long)a, (unsig...
false
false
false
false
false
0
saveUndoInfo() { // save field state to undoInfo for(int x=0;x<FIELD_SIZE;++x) for(int y=0; y<FIELD_SIZE;++y) // NumColors represents no color m_undoInfo.fcolors[x][y] = ( m_field[x][y] ? m_field[x][y]->color() : NumColors ); m_undoInfo.numFreeCells = m_numFreeCells; m_un...
false
false
false
false
false
0
mono_dynamic_code_hash_insert (MonoDomain *domain, MonoMethod *method, MonoJitDynamicMethodInfo *ji) { if (!domain_jit_info (domain)->dynamic_code_hash) domain_jit_info (domain)->dynamic_code_hash = g_hash_table_new (NULL, NULL); g_hash_table_insert (domain_jit_info (domain)->dynamic_code_hash, method, ji); }
false
false
false
false
false
0
gst_asf_identify_guid (const ASFGuidHash * guids, ASFGuid * guid) { gint i; for (i = 0; guids[i].obj_id != ASF_OBJ_UNDEFINED; ++i) { if (guids[i].guid.v1 == guid->v1 && guids[i].guid.v2 == guid->v2 && guids[i].guid.v3 == guid->v3 && guids[i].guid.v4 == guid->v4) { return guids[i].obj_id; ...
false
false
false
false
false
0
ns83820_remove_one(struct pci_dev *pci_dev) { struct net_device *ndev = pci_get_drvdata(pci_dev); struct ns83820 *dev = PRIV(ndev); /* ok even if NULL */ if (!ndev) /* paranoia */ return; ns83820_disable_interrupts(dev); /* paranoia */ unregister_netdev(ndev); free_irq(dev->pci_dev->irq, ndev); iounmap(de...
false
false
false
false
false
0
load(nor_utils::StreamTokenizer& st) { // cout << "Sorry, you can't load a ParasiteLearner" << endl << flush; // exit(1); // Calling the super-class method BaseLearner::load(st); _signOfAlpha = UnSerialization::seekAndParseEnclosedValue<int>(st, "alphasign"); _nameBaseLearnerFile = UnSerializatio...
false
false
false
false
false
0
EnterEvadeMode() override { ScriptedAI::EnterEvadeMode(); On_Reset(); ENTRY_BEGIN(CreatureEventBindings, me->GetEntry(), CREATURE_EVENT_ON_LEAVE_COMBAT, return); Eluna::Push(L, me); ENTRY_EXECUTE(0); ENDCALL(); }
false
false
false
false
false
0
load ( const char *nm // Path to file. ) { ifstream file; U7open(file, nm); StreamDataSource shape_source(&file); Shape::load(&shape_source); }
false
false
false
false
false
0
mono_gc_alloc_fixed (size_t size, void *descr, MonoGCRootSource source, const char *msg) { /* To help track down typed allocation bugs */ /* static int count; count ++; if (count == atoi (g_getenv ("COUNT2"))) printf ("HIT!\n"); if (count > atoi (g_getenv ("COUNT2"))) return GC_MALLOC (size); */ if (descr)...
false
false
false
false
false
0
make_support(struct rr_state *theState, int percent, double percentage) { char title[100]; struct History hist; struct Categories cats; struct Colors clr; char *inraster, *mapset; struct RASTER_MAP_PTR nulls; /* write categories for output raster use values from input or cover map ...
false
false
false
false
false
0
append_copy_of_policy_list (DBusList **list, DBusList **to_append) { DBusList *link; DBusList *tmp_list; tmp_list = NULL; /* Preallocate all our links */ link = _dbus_list_get_first_link (to_append); while (link != NULL) { if (!_dbus_list_append (&tmp_list, link->data...
false
false
false
false
false
0
internalEcho(char **argv, int argc, ArSocket *socket) { // if they just typed it we tell them if its on or off if (argc == 1) { if (socket->getEcho()) socket->writeString("Echo is on."); else socket->writeString("Echo is off."); } // if the have two words see if they have the rig...
false
false
false
false
false
0
fli_show_object( FL_OBJECT * obj ) { if ( obj->visible ) return; obj->visible = 1; if ( obj->child ) { fli_show_composite( obj ); fli_handle_object( obj, FL_ATTRIB, 0, 0, 0, NULL, 0 ); } if ( obj->input && obj->active && ! obj->form->focusobj ) fl_set_focus_obj...
false
false
false
false
false
0
DrawAnimObj(void) { register anim_t *obj; register WORD cf; for (obj = (anim_t *) DrawList.pHead; obj->node.mpNext; obj = (anim_t *) obj->node.mpNext) { cf = obj->current_frame; if (!use_clipping) { if (save_back && obj->bg && obj->moved /* obj->x_back!...
false
false
false
false
false
0
rssyl_remove_feed_cb(GtkAction *action, gpointer data) { FolderView *folderview = (FolderView *)data; GtkCMCTree *ctree = GTK_CMCTREE(folderview->ctree); FolderItem *item; gint response; GtkWidget *dialog, *rmcache_widget = NULL; gboolean rmcache = FALSE; debug_print("RSSyl: remove_feed_cb\n"); item = foldervi...
false
false
false
false
false
0
nv04_tv_identify(struct drm_device *dev, int i2c_index) { struct nouveau_drm *drm = nouveau_drm(dev); struct nvkm_i2c *i2c = nvxx_i2c(&drm->device); struct nvkm_i2c_bus *bus = nvkm_i2c_bus_find(i2c, i2c_index); if (bus) { return nvkm_i2c_bus_probe(bus, "TV encoder", nv04_tv_encoder_info, NULL, NULL)...
false
false
false
false
false
0
cache_or_unpack_entry(struct packed_git *p, off_t base_offset, unsigned long *base_size, enum object_type *type, int keep_cache) { void *ret; unsigned long hash = pack_entry_hash(p, base_offset); struct delta_base_cache_entry *ent = delta_base_cache + hash; ret = ent->data; if (!ret || ent->p != p || ent->base_o...
false
false
false
false
false
0