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
find_nearby_threat(int objnum, int enemy_team_mask, float range, int *count) { int nearest_objnum; float nearest_dist; object *objp; ship_obj *so; nearest_objnum = -1; nearest_dist = range; *count = 0; for ( so = GET_FIRST(&Ship_obj_list); so != END_OF_LIST(&Ship_obj_list); so = GET_NEXT(so) ) { objp = &...
false
false
false
false
false
0
hashtable_init(hashtable_t *hashtable) { size_t i; hashtable->size = 0; hashtable->order = 3; hashtable->buckets = jsonp_malloc(hashsize(hashtable->order) * sizeof(bucket_t)); if(!hashtable->buckets) return -1; list_init(&hashtable->list); for(i = 0; i < hashsize(hashtable->order)...
false
false
false
false
false
0
paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget) { // speed up svg drawing and unbreak proxy widget painter->setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform | QPainter::HighQualityAntialiasing, false); // draw cached frame background QRect rec...
false
false
false
false
false
0
calc(double val) { // int i; double y; y = 0.0; indexm1 = index; // save index to last value, but what for? index = (index + 1) % order; x[index] = val; // update with new value x1 = x; // copy vector prior to sorting sort(x1.begin(), x1.end()); // sorted // window size parity check if(!parity) ...
false
false
false
false
false
0
compute_em_scale(const gs_font_base *pbfont, gs_fapi_metrics *metrics, double FontMatrix_div, double *em_scale_x, double *em_scale_y) { /* optimize : move this stuff to FAPI_refine_font */ gs_matrix mat; gs_matrix *m = &pbfont->base->orig_FontMatri...
false
false
false
false
false
0
DecodeSORegImmOperand(MCInst &Inst, unsigned Val, uint64_t Address, const void *Decoder) { DecodeStatus S = MCDisassembler::Success; unsigned Rm = fieldFromInstruction(Val, 0, 4); unsigned type = fieldFromInstruction(Val, 5, 2); unsigned imm = fieldFromInstruction(Val, 7, 5); ...
false
false
false
false
false
0
rtl92d_phy_enable_anotherphy(struct ieee80211_hw *hw, bool bmac0) { struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_hal *rtlhal = &(rtlpriv->rtlhal); u8 u1btmp; u8 direct = bmac0 ? BIT(3) | BIT(2) : BIT(3); u8 mac_reg = bmac0 ? REG_MAC1 : REG_MAC0; u8 mac_on_bit = bmac0 ? MAC1_ON : MAC0_ON; bool bresult = tr...
false
false
false
false
false
0
pointer_add(state_t *s, reg_t base, int offset) { mem_obj_t *mobj = GET_SEGMENT_ANY(s->seg_manager, base.segment); if (!mobj) { script_debug_flag = script_error_flag = 1; sciprintf("[VM] Error: Attempt to add %d to invalid pointer "PREG"!", offset, PRINT_REG(base)); return NULL_REG; } switch (mobj->type) { ...
false
false
false
false
false
0
MakePolysFromContours( vtkPolyData *data, vtkIdType firstLine, vtkIdType numLines, vtkCellArray *polys, const double normal[3]) { // If no cut lines were generated, there's nothing to do if (numLines <= 0) { return; } vtkPoints *points = data->GetPoints(); // Join all the new lines into connec...
false
false
false
false
false
0
L24() {register object *base=vs_base; register object *sup=base+VM24; VC24 vs_check; vs_top=sup; goto TTL; TTL:; vs_base=vs_top; (void) (*Lnk47)(); vs_top=sup; vs_base=vs_top; (void) (*Lnk36)(); vs_top=sup; (((object)VV[16])->s.s_dbind)= small_fixnum(0); (((object)VV[3])->s.s_dbind)= (((object)VV[8])->s.s_d...
false
false
false
false
false
0
addAttribute(const XMLChar* namespaceURI, const XMLChar* localName, const XMLChar* qname, const XMLChar* type, const XMLChar* value, bool specified) { AttributeVec::iterator it = _attributes.insert(_attributes.end(), Attribute()); it->namespaceURI = namespaceURI; it->localName = localName; it->qname = qna...
false
false
false
false
false
0
read_tree_cb(const char *root, git_tree_entry *tentry, void *data) { git_index *index = data; git_index_entry *entry = NULL; git_buf path = GIT_BUF_INIT; if (git_tree_entry__is_tree(tentry)) return 0; if (git_buf_joinpath(&path, root, tentry->filename) < 0) return -1; entry = git__calloc(1, sizeof(git_inde...
false
false
false
false
false
0
release_session(gpointer key, gpointer value, gpointer user_data) { struct connman_session *session = value; DBusMessage *message; DBG("owner %s path %s", session->owner, session->notify_path); if (session->notify_watch > 0) g_dbus_remove_watch(connection, session->notify_watch); g_dbus_unregister_interface(c...
false
false
false
false
false
0
n_print_znumber(zword n) { if(is_neg(n)) { output_char('-'); n_print_number(neg(n)); } else { n_print_number(n); } }
false
false
false
false
false
0
nfs_inode_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode , struct iatt *buf, struct iatt *preparent, struct iatt *postparent) { struct nfs_fop_local *nfl = frame->local...
false
false
false
false
false
0
ruby_float_step(VALUE from, VALUE to, VALUE step, int excl) { if (TYPE(from) == T_FLOAT || TYPE(to) == T_FLOAT || TYPE(step) == T_FLOAT) { const double epsilon = DBL_EPSILON; double beg = NUM2DBL(from); double end = NUM2DBL(to); double unit = NUM2DBL(step); double n = (end - beg)/unit; double err = (fabs(beg)...
false
false
false
false
false
0
move_south (Client * c) { if (c && c->isnotile) { c->x = (DisplayWidth (dpy, c->screen->num) / 2) - (c->dx / 2) - BORDER; c->y = c->screen->tile_height - c->dy - (2 * BORDER); if (c->x < 0) c->x = 0; XMoveWindow (dpy, c->parent, c->x, c->y); sendconfig (c); } }
false
false
false
false
false
0
convert_user_password( uint8_t real_key[5], uint8_t *user_pass, int len, uint8_t salt[16]) { MD5_CTX md5_ctx; unsigned char md5_result[16]; unsigned char intermediate[336]; int i; /* Take md5 hash of user_pass */ MD5_Init (&md5_ctx); MD5_Update (&md5_ctx, user_pass, len); MD5_Final (md5_result, &md5_ctx...
false
false
false
false
false
0
kfd_release_topology_device(struct kfd_topology_device *dev) { struct kfd_mem_properties *mem; struct kfd_cache_properties *cache; struct kfd_iolink_properties *iolink; BUG_ON(!dev); list_del(&dev->list); while (dev->mem_props.next != &dev->mem_props) { mem = container_of(dev->mem_props.next, struct kfd_...
false
false
false
false
false
0
trapcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) { char *action; char **ap; int signo, exitcode; nextopt(nullstr); ap = argptr; if (!*ap) { for (signo = 0; signo < NSIG; signo++) { char *tr = trap_ptr[signo]; if (tr) { /* note: bash adds "SIG", but only if invoked * as "bash". If called ...
false
false
false
false
false
0
egbb_close(void) { if (Egbb->init == 1) { UNLOAD_LIB(LibHandler); } }
false
false
false
false
false
0
parseHTTPHeader(UINT32* contentLength, UINT32 * statusCode, UINT32 msTimeOut) { if(contentLength!=NULL) *contentLength=0; if(statusCode!=NULL) *statusCode=0; char *line = new char[255]; SINT32 ret = 0; SINT32 ret2 = E_UNKNOWN; UINT64 currentTime = 0, endTime = 0; bool nbl = false; getcurren...
false
false
false
true
true
1
NK7110_GetMemoryStatus(gn_data *data, struct gn_statemachine *state) { unsigned char req[] = {FBUS_FRAME_HEADER, 0x03, 0x00, 0x00}; dprintf("Getting memory status...\n"); req[5] = get_memory_type(data->memory_status->memory_type); SEND_MESSAGE_BLOCK(NK7110_MSG_PHONEBOOK, 6); }
false
false
false
false
false
0
libcrypto_lock_callback(int mode, int i, const char *file, int line){ (void)file; (void)line; if(mode & CRYPTO_LOCK){ user_callbacks->mutex_lock(&libcrypto_mutexes[i]); } else { user_callbacks->mutex_unlock(&libcrypto_mutexes[i]); } }
false
false
false
false
false
0
__fop_read_meta(env, name, buf, size, fhp, errok, nbytesp) ENV *env; const char *name; u_int8_t *buf; size_t size; DB_FH *fhp; int errok; size_t *nbytesp; { size_t nr; int ret; /* * Our caller wants to know the number of bytes read, even if we * return an error. */ if (nbytesp != NULL) *nbytesp = 0;...
false
false
false
false
false
0
_fetch(Evry_Plugin *plugin, const char *input) { GET_PLUGIN(p, plugin); char buf[1024]; Evry_Item *it; if (!input) return 0; if (!exe && !_run_bc(p)) return 0; if (!cur_item) { it = EVRY_ITEM_NEW(Evry_Item, p, "0", NULL, NULL); it->context = eina_stringshare_ref(p->base.name);...
false
false
false
false
false
0
local__parse_int64_(const char *s) { FLAC__int64 ret = 0; char c; if(*s == '\0') return -1; while('\0' != (c = *s++)) if(c >= '0' && c <= '9') ret = ret * 10 + (c - '0'); else return -1; return ret; }
false
false
false
false
false
0
StyleToPositionInView(Position pos) { int endWindow = (vs.marginInside) ? (PositionAfterArea(GetClientRectangle())) : (pdoc->Length()); if (pos > endWindow) pos = endWindow; int styleAtEnd = pdoc->StyleAt(pos-1); pdoc->EnsureStyledTo(pos); if ((endWindow > pos) && (styleAtEnd != pdoc->StyleAt(pos-1))) { // Sty...
false
false
false
false
false
0
v_bignum_square_half(VBigDig *x) { VBigDigs w[256], uv, c, ouv; int t = *x / 2, i, j, high; if(t == 0) return; for(; x[t] == 0; t--) ; memset(w, 0, 2 * t * sizeof *w); /* Clear digits of w. */ /* printf("print %lu, ", ++count); v_bignum_print_hex(x); printf("*"); v_bignum_print_hex(x); */ for(i = 0; i < t...
false
false
false
false
false
0
gst_app_src_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { GstAppSrc *appsrc = GST_APP_SRC_CAST (object); GstAppSrcPrivate *priv = appsrc->priv; switch (prop_id) { case PROP_CAPS: gst_app_src_set_caps (appsrc, gst_value_get_caps (value)); break; ...
false
false
false
false
false
0
m_lose_armor(mon, obj) struct monst *mon; struct obj *obj; { mon->misc_worn_check &= ~obj->owornmask; if (obj->owornmask) update_mon_intrinsics(mon, obj, FALSE, FALSE); obj->owornmask = 0L; obj_extract_self(obj); place_object(obj, mon->mx, mon->my); /* call stackobj() if we ever drop anything that can merge...
false
false
false
false
false
0
tree_expr_nonnegative_p (t) tree t; { switch (TREE_CODE (t)) { case ABS_EXPR: case FFS_EXPR: return 1; case INTEGER_CST: return tree_int_cst_sgn (t) >= 0; case TRUNC_DIV_EXPR: case CEIL_DIV_EXPR: case FLOOR_DIV_EXPR: case ROUND_DIV_EXPR: return tree_expr_nonnegat...
false
false
false
false
true
1
ProcessImage(const void *pFrame, size_t nLength) { ST_JPGINFO_PACKET stJpgInfo; memset(&stJpgInfo, 0x00, sizeof(stJpgInfo)); if(pFrame) { if(RPCamSockManager::GetClientCnt()>0) { DBGTRC; stJpgInfo.stHeader.nFrom = 10; stJpgInfo.stHeader.nTo = 20; stJpgInfo.stHeader.tCreateTime = time(0); //stJp...
false
false
false
false
false
0
evtchn_2l_handle_events(unsigned cpu) { int irq; xen_ulong_t pending_words; xen_ulong_t pending_bits; int start_word_idx, start_bit_idx; int word_idx, bit_idx; int i; struct shared_info *s = HYPERVISOR_shared_info; struct vcpu_info *vcpu_info = __this_cpu_read(xen_vcpu); /* Timer interrupt has highest priorit...
false
false
false
false
false
0
bttv_ir_start(struct bttv *btv, struct bttv_ir *ir) { if (ir->polling) { setup_timer(&ir->timer, bttv_input_timer, (unsigned long)btv); ir->timer.expires = jiffies + msecs_to_jiffies(1000); add_timer(&ir->timer); } else if (ir->rc5_gpio) { /* set timer_end for code completion */ setup_timer(&ir->timer, btt...
false
false
false
false
false
0
lanai_int_1(struct lanai_dev *lanai, u32 reason) { u32 ack = 0; if (reason & INT_SERVICE) { ack = INT_SERVICE; spin_lock(&lanai->servicelock); run_service(lanai); spin_unlock(&lanai->servicelock); } if (reason & (INT_AAL0_STR | INT_AAL0)) { ack |= reason & (INT_AAL0_STR | INT_AAL0); vcc_rx_aal0(lanai); ...
false
false
false
false
false
0
main(int argc, char **argv) { FILE *f; int i, opt; enum { NO_UL_OPTION = CHAR_MAX + 1 }; static const struct option longopts[] = { { "no-underlining", no_argument, 0, NO_UL_OPTION }, { "half-lines", no_argument, 0, '2' }, { "version", no_argument, 0, 'V' }, { "help", no_argument, 0, 'h' }, { NULL, 0, ...
false
true
false
false
true
1
tuner_attach_dtt7520x(struct ngene_channel *chan) { struct drxd_config *feconf; feconf = chan->dev->card_info->fe_config[chan->number]; if (!dvb_attach(dvb_pll_attach, chan->fe, feconf->pll_address, &chan->i2c_adapter, feconf->pll_type)) { pr_err("No pll(%d) found!\n", feconf->pll_type); return -ENODEV; ...
false
false
false
false
false
0
_TIFFSetupFields(TIFF* tif, const TIFFFieldArray* fieldarray) { if (tif->tif_fields && tif->tif_nfields > 0) { uint32 i; for (i = 0; i < tif->tif_nfields; i++) { TIFFField *fld = tif->tif_fields[i]; if (fld->field_bit == FIELD_CUSTOM && strncmp("Tag ", fld->field_name, 4) == 0) { ...
false
false
false
false
false
0
yyerror (char *fmt, char *s) { if (syntax_errors++) return; fprintf (stderr, "graph parser: "); fprintf (stderr, fmt, s); fprintf (stderr, " near line %d\n", line_number); error_context (); }
false
false
false
false
true
1
cb_key_event (GtkWidget *widget, GdkEventKey *event, gpointer user_data) { if (event->keyval == GDK_KEY_w && (event->state & GDK_CONTROL_MASK)) { g_signal_stop_emission_by_name (G_OBJECT (widget), "key_press_event"); gtk_widget_destroy (app->win); app = NULL; return TRUE; } else return FALSE; }
false
false
false
false
false
0
xmlSecGCryptKWDes3GenerateRandom(void * context, xmlSecByte * out, xmlSecSize outSize) { xmlSecGCryptKWDes3CtxPtr ctx = (xmlSecGCryptKWDes3CtxPtr)context; xmlSecAssert2(ctx != NULL, -1); xmlSecAssert2(out != NULL, -1); xmlSecAssert2(outSize > 0, -1); gcry_randomize...
false
false
false
false
false
0
sisusb_bulk_completeout(struct urb *urb) { struct sisusb_urb_context *context = urb->context; struct sisusb_usb_data *sisusb; if (!context) return; sisusb = context->sisusb; if (!sisusb || !sisusb->sisusb_dev || !sisusb->present) return; #ifndef SISUSB_DONTSYNC if (context->actual_length) *(context->act...
false
false
false
false
false
0
zend_parse_arg(int arg_num, zval **arg, va_list *va, char **spec, int quiet TSRMLS_DC) /* {{{ */ { char *expected_type = NULL, *error = NULL; int severity = E_WARNING; expected_type = zend_parse_arg_impl(arg_num, arg, va, spec, &error, &severity TSRMLS_CC); if (expected_type) { if (!quiet && (*expected_type || e...
false
false
false
false
false
0
nrrdRangeSafeSet(NrrdRange *range, const Nrrd *nrrd, int blind8BitRange) { double minIn, maxIn; if (!range) { return; } minIn = range->min; maxIn = range->max; nrrdRangeSet(range, nrrd, blind8BitRange); if (AIR_EXISTS(minIn)) { range->min = minIn; } if (AIR_EXISTS(maxIn)) { range->max = m...
false
false
false
false
false
0
__lambda46_ (Block22Data* _data22_, UnityAggregatedScopeSearch* agg_scope_search, const gchar* scope_id) { UnityMasterScope * self; Block23Data* _data23_; UnityAggregatedScopeSearch* _tmp0_ = NULL; UnityAggregatedScopeSearch* _tmp1_ = NULL; guint _tmp2_ = 0U; self = _data22_->self; g_return_if_fail (agg_scope_se...
false
false
false
false
false
0
ElfHash(char *key) { unsigned char *p = key; int len = strlen(key); unsigned h = 0, g; unsigned int hashtablesize = CF_HASHTABLESIZE; int i; for ( i = 0; i < len; i++ ) { h = ( h << 4 ) + p[i]; g = h & 0xf0000000L; if ( g != 0 ) { h ^= g >> 24; } h &= ~g; } return...
false
false
false
false
false
0
isdn_statstr(void) { static char istatbuf[2048]; char *p; int i; sprintf(istatbuf, "idmap:\t"); p = istatbuf + strlen(istatbuf); for (i = 0; i < ISDN_MAX_CHANNELS; i++) { sprintf(p, "%s ", (dev->drvmap[i] < 0) ? "-" : dev->drvid[dev->drvmap[i]]); p = istatbuf + strlen(istatbuf); } sprintf(p, "\nchmap:\t");...
false
false
false
false
false
0
my_print_error(const char *fmt, ...) { if(!fmt) return; char buf[1000]; va_list ap; va_start(ap, fmt); vsnprintf(buf,1000, fmt, ap); va_end(ap); logerror(buf); }
false
false
false
false
false
0
findNextTags(unsigned int *typefound, int numtypes, ...) { /* dumps all blocks of the updateFile to the tempFile until one of the required tags is found, returns its length */ va_list typelist; unsigned int type; unsigned long int length; int i; while (!feof(updateFile)) { parseTagHeader...
false
false
false
false
false
0
op_mul_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst) { int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN; if (src_flags.alpha) { if (dst) dst->cache_entry.flags.alpha = 1; s = SP; } if ((col >> 24) < 255) { if (dst) dst->cache_entry.flags.alpha = 1; c = S...
false
false
false
false
false
0
se2_rd_all(struct orc_host * host) { int i; u8 *np, chksum = 0; np = (u8 *) nvramp; for (i = 0; i < 64; i++, np++) { /* <01> */ if (orc_nv_read(host, (u8) i, np) == 0) return -1; } /*------ Is ckecksum ok ? ------*/ np = (u8 *) nvramp; for (i = 0; i < 63; i++) chksum += *np++; if (nvramp->CheckSum !=...
false
false
false
false
false
0
file_handle_new (const gchar *path) { FileHandle *file_handle; file_handle = g_new0 (FileHandle, 1); file_handle->refcount = 1; g_mutex_init (&file_handle->mutex); file_handle->op = FILE_OP_NONE; file_handle->path = g_strdup (path); g_hash_table_insert (global_active_fh_map, file_handle, file_handle); ...
false
false
false
false
false
0
compressHash(const Hash & hash, unsigned int newSize) { Hash h; h.hashSize = newSize; for (unsigned int i = 0; i < hash.hashSize; ++i) h.hash[i % newSize] ^= hash.hash[i]; return h; }
false
false
false
false
false
0
load_module(void) { if(!reload_followme(0)) return AST_MODULE_LOAD_DECLINE; return ast_register_application_xml(app, app_exec); }
false
false
false
false
false
0
SyroFunc_CalculateEcc(uint8_t *pSrc, int size) { int i; uint8_t ecc_reg1, ecc_reg2, ecc_reg3; uint8_t ecc1, ecc2, bitpat_a, bitpat_b; uint8_t ci; uint32_t ecc; ecc_reg1 = 0; ecc_reg2 = 0; ecc_reg3 = 0; for (i=0; i<size; i++) { ci = ecc_table[pSrc[i]]; ecc_reg1 ^= ci; if (ci & 0x40) { ecc_reg3 ^= (u...
false
false
false
false
false
0
dynptarray_addPoint4d(DYNPTARRAY *dpa, POINT4D *p4d, int allow_duplicates) { POINTARRAY *pa=dpa->pa; POINT4D tmp; LWDEBUG(3, "dynptarray_addPoint4d called."); if ( ! allow_duplicates && pa->npoints > 0 ) { getPoint4d_p(pa, pa->npoints-1, &tmp); /* * return 0 and do nothing else if previous point i...
false
false
false
false
false
0
getp_set_sc_list(VMG_ vm_obj_id_t self, vm_val_t *retval, uint *in_argc) { static CVmNativeCodeDesc desc(1); const char *lstp; ushort cnt; size_t i; vm_val_t ele; ushort sc_cnt; vm_tadsobj_hdr *hdr = get_hdr(); /* check arguments */ if (g...
false
false
false
false
false
0
type_for_nonaliased_component_p (tree gnu_type) { /* If the type is passed by reference, we may have pointers to the component so it cannot be made non-aliased. */ if (must_pass_by_ref (gnu_type) || default_pass_by_ref (gnu_type)) return false; /* We used to say that any component of aggregate type is a...
false
false
false
false
false
0
fill_cmd_dcmi_activate_deactivate_power_limit (uint8_t power_limit_activation, fiid_obj_t obj_cmd_rq) { if (!IPMI_DCMI_POWER_LIMIT_ACTIVATION_VALID (power_limit_activation) || !fiid_obj_valid (obj_cmd_rq)) { SET_ERRNO (EINVAL); return (-1); } ...
false
false
false
false
false
0
crypt_keyslot_destroy(struct crypt_device *cd, int keyslot) { crypt_keyslot_info ki; int r; log_dbg("Destroying keyslot %d.", keyslot); r = onlyLUKS(cd); if (r < 0) return r; ki = crypt_keyslot_status(cd, keyslot); if (ki == CRYPT_SLOT_INVALID) { log_err(cd, _("Key slot %d is invalid.\n"), keyslot); ret...
false
false
false
false
false
0
bvcpy(struct sk_buff *skb, struct bio *bio, struct bvec_iter iter, long cnt) { int soff = 0; struct bio_vec bv; iter.bi_size = cnt; __bio_for_each_segment(bv, bio, iter, iter) { char *p = page_address(bv.bv_page) + bv.bv_offset; skb_copy_bits(skb, soff, p, bv.bv_len); soff += bv.bv_len; } }
false
false
false
false
false
0
requestUploadStravaFinished(QNetworkReply *reply) { parent->progressBar->setValue(parent->progressBar->value()+50/parent->shareSiteCount); parent->progressLabel->setText(tr("Upload to Strava finished.")); uploadSuccessful = false; QString response = reply->readLine(); //qDebug() << response; ...
false
false
false
false
false
0
list_delete(struct list_t *list, const void *key, equality_function_t equal, deallocator_t key_deallocator, deallocator_t value_deallocator) { struct list_t *prev = NULL; struct list_t *current = list; while (current != NULL) { if (equal(key, current->key)) { if (key_dealloca...
false
false
false
false
false
0
min_coord(struct incr_stats **next, int min, int max) { path_t min_c = next[min]->coord_path; for (int q = min + 1; q <= max; q++) { if (next[q]->coord_path < min_c) min_c = next[q]->coord_path; } return min_c; }
false
false
false
false
false
0
creature_update_network_variables(creature_t *creature) { // Leben/Food Prozentangaben aktualisieren int new_food_health = min(15, 16 * creature->food / creature_max_food(creature)) << 4 | min(15, 16 * creature->health / creature_max_health(creature)); if (new_food_health != crea...
false
false
false
false
false
0
aff_get_next_seg(AFFILE *af,char *segname,size_t segname_len,unsigned long *arg, unsigned char *data,size_t *datalen_) { if(af_trace) fprintf(af_trace,"aff_get_next_seg()\n"); if(!af->aseg){ snprintf(af->error_str,sizeof(af->error_str),"af_get_next_segv only works with aff files"); return AF_ERROR_INVALID_...
false
false
false
false
false
0
ns_run(_ns_efuns * efuns, char *cmd) { char **args = NULL; char *p = cmd; int c, n = 0, s = 0; if (!efuns || !efuns->execute) goto fail; if (cmd && *cmd) { /* count args (if any) */ D_ESCREEN(("ns_run: executing \"%s\"...\n", cmd)); do { n++; ...
false
false
false
true
true
1
get_allowed_dc_mask(const struct drm_i915_private *dev_priv, int enable_dc) { uint32_t mask; int requested_dc; int max_dc; if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) { max_dc = 2; mask = 0; } else if (IS_BROXTON(dev_priv)) { max_dc = 1; /* * DC9 has a separate HW flow from the rest of t...
false
false
false
false
false
0
gegl_eval_mgr_new (GeglNode *node, const gchar *pad_name) { GeglEvalMgr *self = g_object_new (GEGL_TYPE_EVAL_MGR, NULL); g_assert (GEGL_IS_NODE (node)); self->node = node; if (pad_name) self->pad_name = g_strdup (pad_name); else self->pad_name = g_strdup ("outp...
false
false
false
false
false
0
gst_aac_parse_latm_get_value (GstAacParse * aacparse, GstBitReader * br, guint32 * value) { guint8 bytes, i, byte; *value = 0; if (!gst_bit_reader_get_bits_uint8 (br, &bytes, 2)) return FALSE; for (i = 0; i < bytes; ++i) { *value <<= 8; if (!gst_bit_reader_get_bits_uint8 (br, &byte, 8)) r...
false
false
false
false
false
0
getFPTOSINT(EVT OpVT, EVT RetVT) { if (OpVT == MVT::f32) { if (RetVT == MVT::i8) return FPTOSINT_F32_I8; if (RetVT == MVT::i16) return FPTOSINT_F32_I16; if (RetVT == MVT::i32) return FPTOSINT_F32_I32; if (RetVT == MVT::i64) return FPTOSINT_F32_I64; if (RetVT == MVT::i128) ...
false
false
false
false
false
0
folder_emit_deleted_cb (gpointer user_data) { SignalClosure *signal_closure = user_data; CamelFolder *folder; folder = g_weak_ref_get (&signal_closure->folder); if (folder != NULL) { g_signal_emit (folder, signals[DELETED], 0); g_object_unref (folder); } return FALSE; }
false
false
false
false
false
0
on_tool_text_toggled (GtkToggleToolButton *button, gpointer user_data) { tool_toggled ( button, TOOL_TEXT ); if(gtk_toggle_tool_button_get_active(button)){ quick_message (GTK_WIDGET(button), "Sorry, but the text feature has\n" "not yet been implemented."); } }
false
false
false
false
false
0
scale_and_shuffle_up3(jxr_image_t image) { int mx; int my = image->cur_my + 3; int ch; /* Finish transform of the color space. */ switch (image->use_clr_fmt) { case 0: /* YONLY */ break; case 1: /* YUV420 */ if (image->output_clr_fmt == JXR_OCF_RGB) ...
false
false
false
false
false
0
resetStack() { // Discard any previous contents of the state save stack, and initialize a // new stack frame with all -1 data. The -1s are needed for capture group limits, // where they indicate that a group has not yet matched anything. fStack->removeAllElements(); REStackFrame *iFrame = (RESta...
false
false
false
false
false
0
getbuffers(Display *dpy, XID drawable, int *width, int *height, unsigned int *attachments, int count, int *outCount, int dri2ReqType) { XExtDisplayInfo *info = DRI2FindDisplay(dpy); xDRI2GetBuffersReply rep; xDRI2GetBuffersReq *req; DRI2Buffer *buffers; xDRI2Buffer repBuffer; CARD32 *p;...
false
false
false
false
false
0
saa7134_irq_ts_done(struct saa7134_dev *dev, unsigned long status) { enum v4l2_field field; spin_lock(&dev->slock); if (dev->ts_q.curr) { field = dev->ts_field; if (field != V4L2_FIELD_TOP) { if ((status & 0x100000) != 0x000000) goto done; } else { if ((status & 0x100000) != 0x100000) goto done;...
false
false
false
false
false
0
photos_base_item_create_thumbnail_in_thread_func (gpointer data, gpointer user_data) { GTask *task = G_TASK (data); PhotosBaseItem *self; GCancellable *cancellable; GError *error; gboolean op_res; self = PHOTOS_BASE_ITEM (g_task_get_source_object (task)); cancellable = g_task_get_cancellable (task); e...
false
false
false
false
false
0
get_process_by_name(const char *name) { struct process *p = first_process; while (p) { if (p->name && !strcmp(p->name, name)) return p; p = p->next; } return 0; }
false
false
false
false
false
0
bodyAction(Widget w, XtPointer client_data, XtPointer call_data) { int i; uschar buffer[256]; Widget text = text_create((uschar *)client_data, text_depth); FILE *f = NULL; w = w; /* Keep picky compilers happy */ call_data = call_data; for (i = 0; i < (spool_is_split? 2:1); i++) { message_subdir[0] = (i != 0)...
false
false
false
false
false
0
initMemberInfo (statementInfo *const st) { accessType accessDefault = ACCESS_UNDEFINED; if (st->parent != NULL) switch (st->parent->declaration) { case DECL_ENUM: accessDefault = (isLanguage (Lang_java) ? ACCESS_PUBLIC : ACCESS_UNDEFINED); break; case DECL_NAMESPACE: accessDefault = ACCESS_UNDEFINED; ...
false
false
false
false
false
0
qlt_async_event(uint16_t code, struct scsi_qla_host *vha, uint16_t *mailbox) { struct qla_hw_data *ha = vha->hw; struct qla_tgt *tgt = vha->vha_tgt.qla_tgt; int login_code; if (!ha->tgt.tgt_ops) return; if (unlikely(tgt == NULL)) { ql_dbg(ql_dbg_tgt, vha, 0xe03a, "ASYNC EVENT %#x, but no tgt (ha %p)\n...
false
false
false
false
false
0
Create(float near_distance, float far_distance, float horz_FOV_degrees, float vert_FOV_degrees, float lineWidth, bool draw_lines, bool draw_planes) { return CFrustumPtr(new CFrustum(near_distance,far_distance,horz_FOV_degrees,vert_FOV_degrees,lineWidth,draw_lines,draw_planes)); }
false
false
false
false
false
0
i40e_get_phys_port_id(struct net_device *netdev, struct netdev_phys_item_id *ppid) { struct i40e_netdev_priv *np = netdev_priv(netdev); struct i40e_pf *pf = np->vsi->back; struct i40e_hw *hw = &pf->hw; if (!(pf->flags & I40E_FLAG_PORT_ID_VALID)) return -EOPNOTSUPP; ppid->id_len = min_t(int, sizeof(hw->mac...
false
false
false
false
false
0
xdr_dis_em_system_info(xdrs, objp) XDR *xdrs; dis_em_system_info *objp; { if (!xdr_byte_u_char(xdrs, &objp->sys_data_length)) { return (FALSE); } if (!xdr_byte_u_char(xdrs, &objp->num_beams)) { return (FALSE); } if (!xdr_byte_u_short(xdrs, &objp->pad)) { return (FALSE); } if (!xdr_dis_emitter_system(xdrs...
false
false
false
false
false
0
switch_to_exception_section (const char * ARG_UNUSED (fnname)) { section *s; if (exception_section) s = exception_section; else { /* Compute the section and cache it into exception_section, unless it depends on the function name. */ if (targetm.have_named_sections) { int flags; if ...
false
false
false
false
false
0
saa7164_cmd_free_seqno(struct saa7164_dev *dev, u8 seqno) { mutex_lock(&dev->lock); if ((dev->cmds[seqno].inuse == 1) && (dev->cmds[seqno].seqno == seqno)) { dev->cmds[seqno].inuse = 0; dev->cmds[seqno].signalled = 0; dev->cmds[seqno].timeout = 0; } mutex_unlock(&dev->lock); }
false
false
false
false
false
0
inf_communication_joined_group_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfCommunicationJoinedGroup* group; InfCommunicationJoinedGroupPri...
false
false
false
false
false
0
yualtschul_scorematrix_validate(const ESL_SCOREMATRIX *S) { int i, j; int has_neg, has_pos; /* each row must have at least one positive and one negative score */ for (i = 0; i < S->K; i++) { has_neg = has_pos = FALSE; for (j = 0; j < S->K; j++) { if (S->s[i][j] > 0) has_pos = TRUE; if (S...
false
false
false
false
false
0
lookup_name(struct cpio *cpio, struct name_cache **name_cache_variable, int (*lookup_fn)(struct cpio *, const char **, id_t), id_t id) { char asnum[16]; struct name_cache *cache; const char *name; int slot; if (*name_cache_variable == NULL) { *name_cache_variable = malloc(sizeof(struct name_cache)); if (...
false
false
false
false
false
0
GetFace(int faceId) { if ( faceId < 0 || faceId >= this->GlobalFaces->GetValue(0) ) { return NULL; } this->GenerateFaces(); // Okay load up the polygon vtkIdType i, p, loc = this->FaceLocations->GetValue(faceId); vtkIdType *face = this->GlobalFaces->GetPointer(loc); this->Polygon->PointId...
false
false
false
false
false
0
test_slist_concat () { GSList *foo = g_slist_prepend (NULL, "foo"); GSList *bar = g_slist_prepend (NULL, "bar"); GSList *list = g_slist_concat (foo, bar); if (g_slist_length (list) != 2) return FAILED ("Concat failed."); g_slist_free (list); return OK; }
false
false
false
false
false
0
deref() { Private::refCount--; if( !Private::refCount ) { resetHandlers(); delete Private::instance; Private::instance = 0; } }
false
false
false
false
false
0
nalloc(char *str, enum gfield ntype) { struct name *np; struct str in, out; /*LINTED*/ np = (struct name *)salloc(sizeof *np); np->n_flink = NULL; np->n_blink = NULL; np->n_type = ntype; if (ntype & GFULL) { np->n_name = savestr(skin(str)); if (strcmp(np->n_name, str)) { in.s = str; in.l = strlen(str...
false
false
false
false
false
0
draw_sprites( struct mame_bitmap *bitmap, const struct rectangle *cliprect ) { UINT8 *source = spriteram; UINT8 *finish = source+96*4; while( source<finish ) { int sy = 240-source[0]; if( sy>=16 ) { int attributes = source[1]; /* SFCCBBBB */ int sx = source[3]; int sprite_number...
false
false
false
false
false
0
get(LLVMContext &C, unsigned Index, ArrayRef<Attribute::AttrKind> Kind) { SmallVector<std::pair<unsigned, Attribute>, 8> Attrs; for (ArrayRef<Attribute::AttrKind>::iterator I = Kind.begin(), E = Kind.end(); I != E; ++I) Attrs.push_back(std::make_pair(Index, Attribute::get...
false
false
false
false
false
0
uv_nmi_dump_state(int cpu, struct pt_regs *regs, int master) { if (master) { int tcpu; int ignored = 0; int saved_console_loglevel = console_loglevel; pr_alert("UV: tracing %s for %d CPUs from CPU %d\n", uv_nmi_action_is("ips") ? "IPs" : "processes", atomic_read(&uv_nmi_cpus_in_nmi), cpu); console_lo...
false
false
false
false
false
0
pmax(double M, /* M value should be explored by simulation ??? */ unsigned long x, double p, unsigned long subjectLength, int *thresholdReached, double *ln_n_fac, double *s1, unsigned long n_s) { unsigned long k; double s = 0.0, ln...
false
false
false
false
false
0
shash_ahash_finup(struct ahash_request *req, struct shash_desc *desc) { struct crypto_hash_walk walk; int nbytes; nbytes = crypto_hash_walk_first(req, &walk); if (!nbytes) return crypto_shash_final(desc, req->result); do { nbytes = crypto_hash_walk_last(&walk) ? crypto_shash_finup(desc, walk.data, nbytes...
false
false
false
false
false
0