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
hasPopup() { YPopupWindow *p = xapp->popup(); while (p && p->prevPopup()) p = p->prevPopup(); if (p) { YWindow *w = p->owner(); while (w) { if (w == this) return true; w = w->parent(); } } return false; }
false
false
false
false
false
0
getNewLevel(long maxLevel, float probability) { long newLevel = 0; while ( (newLevel < maxLevel - 1) && (drand48() < probability) ) // fast hack. fix later newLevel++; return(newLevel); }
false
false
false
false
false
0
do_eof(char c) { if (backslashed) { lbptr--; ansi_process_s("\b"); do_data(c); return; } if (lnext) { do_data(c); return; } do_data(c); forward_data(); }
false
false
false
false
false
0
_bfd_slurp_extended_name_table (bfd *abfd) { char nextname[17]; struct areltdata *namedata; bfd_size_type amt; /* FIXME: Formatting sucks here, and in case of failure of BFD_READ, we probably don't want to return TRUE. */ if (bfd_seek (abfd, bfd_ardata (abfd)->first_file_filepos, SEEK_SET) != 0) r...
false
false
false
false
false
0
parse_manifest(char *manifest_filename,FILE *output) { printf("opening manifest: %s\n",manifest_filename); fflush(stdout); node *root = json_LoadFile(manifest_filename); node *ec = node_GetItemByKey(root,"ExecutionChain"); printf("chain items:%d\n",node_array_GetNum(ec)); fflush(stdout); node_arra...
false
false
false
false
true
1
Perl_ck_substr(pTHX_ OP *o) { PERL_ARGS_ASSERT_CK_SUBSTR; o = ck_fun(o); if ((o->op_flags & OPf_KIDS) && (o->op_private == 4)) { OP *kid = cLISTOPo->op_first; if (kid->op_type == OP_NULL) kid = kid->op_sibling; if (kid) kid->op_flags |= OPf_MOD; } return o; }
false
false
false
false
false
0
i2list_multimember(I2list b, int i, int n) { if (b == NULL) return FALSE; else if (i == b->i) return n <= b->j; else return i2list_multimember(b->next, i, n); }
false
false
false
false
false
0
PlaySfx( unsigned short sfxid, unsigned short flags ) { SoundEffect *se = NULL; #ifndef DISABLE_SOUND if ( (sfxid < NUM_SFX) && sfx[sfxid] ) { se = sfx[sfxid]; se->Play( flags ); } #endif return se; }
false
false
false
false
false
0
play_enter_attack_run_state_sound(enemy *ThisRobot) { int SoundCode; const char *sounds[] = { "effects/bot_sounds/Start_Attack_Sound_0.ogg", "effects/bot_sounds/Start_Attack_Sound_1.ogg", "effects/bot_sounds/Start_Attack_Sound_2.ogg", "effects/bot_sounds/Start_Attack_Sound_9.ogg", "effects/bot_sounds/Start_...
true
true
false
false
false
1
post(Space& home, BoolVar b, bool pos, IntConLevel icl) { IntVar z = idx.post(home, icl); if (z.assigned() && z.val() >= 0 && z.val() < n) { BoolExpr be = pos ? (a[z.val()] == b) : (a[z.val()] == !b); be.rel(home,icl); } else { BoolVarArgs x(n); for (int i=n; i--;) x[i] = a[i...
false
false
false
false
false
0
CheckSpecies(string& name, string& ln, bool MustBeKnown) { MolMap::iterator mapitr = IMols.find(name); if(mapitr==IMols.end()) { //unknown species if(MustBeKnown) { obErrorLog.ThrowError(__FUNCTION__, name + " not recognized as a species in\n" + ln, obError); shared_ptr<OBMol> sp; ...
false
false
false
false
false
0
DeleteMultiValueField( void *theEnv, DATA_OBJECT *dst, DATA_OBJECT *src, long rb, long re, char *funcName) { register long i,j; register FIELD_PTR deptr,septr; unsigned long srclen, dstlen; srclen = (unsigned long) ((src != NULL) ? (src->end - src->begin + 1) : 0); if ((re < rb) || ...
false
false
false
false
false
0
pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec) { int nvec; int rc; if (!pci_msi_supported(dev, minvec)) return -EINVAL; WARN_ON(!!dev->msi_enabled); /* Check whether driver already requested MSI-X irqs */ if (dev->msix_enabled) { dev_info(&dev->dev, "can't enable MSI (MSI-X already e...
false
false
false
false
false
0
MakePaths() { struct File *ptr; struct Item *ip1,*ip2; char pathbuff[CF_BUFSIZE],basename[CF_EXPANDSIZE]; for (ptr = VMAKEPATH; ptr != NULL; ptr=ptr->next) { if (IsExcluded(ptr->classes)) { continue; } if (ptr->done == 'y' || strcmp(ptr->scope,CONTEXTID)) { continue; ...
false
false
false
false
false
0
dm_report_field_uint64(struct dm_report *rh, struct dm_report_field *field, const uint64_t *data) { const uint64_t value = *data; uint64_t *sortval; char *repstr; if (!(repstr = dm_pool_zalloc(rh->mem, 22))) { log_error("dm_report_field_uint64: dm_pool_alloc failed"); return 0; } if (!(sortval = dm_po...
false
false
false
false
false
0
tpaw_protocol_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { TpawProtocol *self = TPAW_PROTOCOL (object); switch (prop_id) { case PROP_CM: g_value_set_object (value, self->priv->cm); break; case PROP_CM_NAME: g_value_set_string (value, ...
false
false
false
false
false
0
my_strnncoll_simple(CHARSET_INFO * cs, const uchar *s, size_t slen, const uchar *t, size_t tlen, my_bool t_is_prefix) { size_t len = ( slen > tlen ) ? tlen : slen; uchar *map= cs->sort_order; if (t_is_prefix && slen > tlen) slen=tlen; while (len--) { if...
false
false
false
false
false
0
map_rgb(Uint8 r, Uint8 g, Uint8 b) { if(!engine) return 0; if(surface) return SDL_MapRGB(surface->format, r, g, b); else return 0xffffff; }
false
false
false
false
false
0
clear_keywtab(ht) hashtab_T *ht; { hashitem_T *hi; int todo; keyentry_T *kp; keyentry_T *kp_next; todo = (int)ht->ht_used; for (hi = ht->ht_array; todo > 0; ++hi) { if (!HASHITEM_EMPTY(hi)) { --todo; kp = HI2KE(hi); for (kp = HI2KE(hi); kp != NULL; kp = kp_next) {...
false
false
false
false
false
0
putconst(n, flags, len, pc, valp) int n; int flags, len; word pc; union xval *valp; { register struct centry *p; if (n >= csize) lctable = (struct centry *)trealloc(lctable, NULL, &csize, sizeof(struct centry), 1, "constant table"); if (nconst < n) nconst = n; p = &lctable[n]; p...
false
false
false
false
false
0
buffer_toulong(t_buffer *buffer, size_t *len, int base) { char *endptr; t_buffer *workbuf; unsigned long int result; workbuf = buffer; if (buffer->msize == 0) { /* Considering buffer->ptr has not been allocated */ workbuf = buffer_dup_class(buffer, &default_class); if (workbuf == NULL) { return 0; } }...
false
false
false
false
false
0
open_east_gate(short x1, short y1, short townRecno) { //------ check if any east gate tile is built ---------// Location *locPtr = get_loc(x1,y1+2); if( locPtr->is_wall() && locPtr->wall_id() == EGATE_N && locPtr->wall_town_recno() == townRecno) { for(short y = 3; y < GATE_LENGTH-3; ++y) for(short x = 0; x <...
false
false
false
false
false
0
skip_hsc_verbatim(HSCPRC * hp, EXPSTR * content) { #define VBST_TEXT 1 #define VBST_VBAR 2 #define VBST_END 3 INFILE *inpf = hp->inpf; int ch = infgetc(inpf); /* read next char */ BYTE state = VBST_TEXT; /* parser state */ while ((ch != EOF) && (state != VBST_END)) { /* append cur...
false
false
false
false
false
0
probe_by_mime (ProbeState * state) { char * mime; if (! check_opened (state)) return; if ((mime = vfs_get_metadata (state->handle, "content-type")) == NULL) return; AUDDBG ("Probing by MIME type.\n"); input_plugin_for_key (INPUT_KEY_MIME, mime, (PluginForEachFunc) probe_func_...
false
false
false
false
false
0
AlterTable(AlterTableStmt *stmt) { Relation rel = relation_openrv(stmt->relation, AccessExclusiveLock); CheckTableNotInUse(rel, "ALTER TABLE"); /* Check relation type against type specified in the ALTER command */ switch (stmt->relkind) { case OBJECT_TABLE: /* * For mostly-historical reasons, we allow ...
false
false
false
false
false
0
curlTimerCallback(CURLM *multi, long timeout_ms, void *userp) { struct timeval* timeout = userp; (void)multi; /* unused */ if (timeout_ms != -1) { *timeout = tutil_tvnow(); timeout->tv_usec += timeout_ms * 1000; } else { timeout->tv_sec = -1; } return 0; }
false
false
false
false
false
0
acpi_processor_register_performance(struct acpi_processor_performance *performance, unsigned int cpu) { struct acpi_processor *pr; if (!(acpi_processor_ppc_status & PPC_REGISTERED)) return -EINVAL; mutex_lock(&performance_mutex); pr = per_cpu(processors, cpu); if (!pr) { mutex_unlock(&performance_mu...
false
false
false
false
false
0
get_file_to_call(time_t filetime, char type) { static file_list **ptr = NULL; static int cnt; static time_t _filetime; int interval; if (filetime == 0) { if (ptr != NULL) { ptr++; cnt--; } } else { ptr = file_root; cnt = file_root_member; _filetime = filetime; } while (cnt > ...
false
false
false
false
false
0
qlt_del_sess_work_fn(struct delayed_work *work) { struct qla_tgt *tgt = container_of(work, struct qla_tgt, sess_del_work); struct scsi_qla_host *vha = tgt->vha; struct qla_hw_data *ha = vha->hw; struct qla_tgt_sess *sess; unsigned long flags, elapsed; spin_lock_irqsave(&ha->tgt.sess_lock, flags); while (!l...
true
true
false
false
false
1
copyData (const Table& right) { // ensure deep copy. clone() calls the copy constructor for Column. // Column has 'deep copy' because all its data members that need // to be copied (i.e. not the pointer to the fits file) are allocated // on the stack by being Container types. std::map<String,Column*> newCo...
false
false
false
false
false
0
pn533_tm_send_complete(struct pn533 *dev, void *arg, struct sk_buff *resp) { u8 status; dev_dbg(&dev->interface->dev, "%s\n", __func__); if (IS_ERR(resp)) return PTR_ERR(resp); status = resp->data[0]; /* Prepare for the next round */ if (skb_queue_len(&dev->fragment_skb) > 0) { queue_work(dev->wq, &...
false
false
false
false
false
0
redirect(filename, mode, stream, uncomp) const char *filename, *mode; FILE *stream; boolean uncomp; { if (freopen(filename, mode, stream) == (FILE *)0) { (void) fprintf(stderr, "freopen of %s for %scompress failed\n", filename, uncomp ? "un" : ""); terminate(EXIT_FAILURE); } }
false
false
false
false
false
0
writeItem(DcmItem &dataset) const { /* write ReferencedSOPClassUID */ OFCondition result = DSRTypes::putStringValueToDataset(dataset, DCM_ReferencedSOPClassUID, SOPClassUID); /* write ReferencedSOPInstanceUID */ if (result.good()) result = DSRTypes::putStringValueToDataset(dataset, DCM_Reference...
false
false
false
false
false
0
ips_intr_copperhead(ips_ha_t * ha) { ips_stat_t *sp; ips_scb_t *scb; IPS_STATUS cstatus; int intrstatus; METHOD_TRACE("ips_intr", 2); if (!ha) return 0; if (!ha->active) return 0; intrstatus = (*ha->func.isintr) (ha); if (!intrstatus) { /* * Unexpected/Shared interrupt */ return 0; } whi...
false
false
false
false
false
0
unmemoize_if (const SCM expr, const SCM env) { const SCM cdr_expr = SCM_CDR (expr); const SCM um_condition = unmemoize_expression (SCM_CAR (cdr_expr), env); const SCM cddr_expr = SCM_CDR (cdr_expr); const SCM um_then = unmemoize_expression (SCM_CAR (cddr_expr), env); const SCM cdddr_expr = SCM_CDR (cddr_expr)...
false
false
false
false
false
0
ns83820_transmit(struct nic *nic, const char *d, /* Destination */ unsigned int t, /* Type */ unsigned int s, /* size */ const char *p) { /* Packet */ /* send the packet to destination */ u16 nstype; u32 cmdsts, extsts; int cur_tx = 0; u32 isr = readl(ns->base + ISR); if (ISR_TXIDLE & ...
false
true
false
false
false
1
soup_session_has_feature (SoupSession *session, GType feature_type) { SoupSessionPrivate *priv; GSList *f; g_return_val_if_fail (SOUP_IS_SESSION (session), FALSE); priv = SOUP_SESSION_GET_PRIVATE (session); if (g_type_is_a (feature_type, SOUP_TYPE_SESSION_FEATURE)) { for (f = priv->features; f; f ...
false
false
false
false
false
0
DoSummonPriestess() { // Summon 2 Elune priestess and make each of them move to a different spot if (Creature* pPriestess = m_creature->SummonCreature(NPC_PRIESTESS_ELUNE, aWingThicketLocations[0].m_fX, aWingThicketLocations[0].m_fY, aWingThicketLocations[0].m_fZ, aWingThicketLocations[0].m_fO, TEMP...
false
false
false
false
false
0
addressing_normalize_vcard_address (TpSvcProtocolInterfaceAddressing *protocol, const gchar *vcard_field, const gchar *vcard_address, DBusGMethodInvocation *context) { TpBaseProtocol *self = TP_BASE_PROTOCOL (protocol); TpProtocolAddressingInterface *iface; GError *error = NULL; gchar *ret = NULL; ...
false
false
false
false
false
0
_midgard_blob_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_properties) { GObject *object = (GObject *) G_OBJECT_CLASS (parent_class)->constructor (type, n_construct_properties, construct_properties); MidgardBlob *self = MIDGARD_BLOB(object); if (self->priv->a...
false
false
false
false
false
0
theora_parse_src_query (GstPad * pad, GstQuery * query) { GstTheoraParse *parse; gboolean res = FALSE; parse = GST_THEORA_PARSE (gst_pad_get_parent (pad)); switch (GST_QUERY_TYPE (query)) { case GST_QUERY_POSITION: { gint64 frame, value; GstFormat my_format, format; gint64 time; ...
false
false
false
false
false
0
ja_task_verify_granted_destin_identifier_list(const lList *gdil, lList **answer_list) { bool ret = true; DENTER(TOP_LAYER, "ja_task_verify_granted_destin_identifier_list"); if (gdil == NULL) { answer_list_add_sprintf(answer_list, STATUS_ESYNTAX, ANSWER_QUALITY_ERROR, MSG_...
false
false
false
false
false
0
hessian(const ColumnVector& x, const EvalFunction& func, float h,int errorord) { //evaluates the hessian of function "eval" at x in parameter space //errorord=4 requires something like 8n^2-3n evaluations //errorord=2 requires something like 2n^2+n evaluations //errorord=1 requires same as errorord=2. no point re...
false
false
false
false
false
0
hashgettuple(PG_FUNCTION_ARGS) { IndexScanDesc scan = (IndexScanDesc) PG_GETARG_POINTER(0); ScanDirection dir = (ScanDirection) PG_GETARG_INT32(1); HashScanOpaque so = (HashScanOpaque) scan->opaque; Relation rel = scan->indexRelation; Page page; OffsetNumber offnum; bool res; /* * We hold pin but not lock ...
false
false
false
false
false
0
getProviderConfig(const QString &name) { if(!global_check()) return QVariantMap(); QVariantMap conf; global->config_mutex.lock(); // try loading from persistent storage conf = readConfig(name); // if not, load the one from memory if(conf.isEmpty()) conf = global->config.value(name); global->config_mute...
false
false
false
false
false
0
T1Read(buffP, size, n, f) /* Read n items into caller's buffer */ char *buffP; /* Buffer to be filled */ int size; /* Size of each item */ int n; /* Number of items to read */ F_FILE *f; /* Stream descriptor */ { int bytelen, cnt, i; F_char *p = (F_char *)buffP; int ic...
false
false
false
false
false
0
MovePoint1(double *p1, double *p2) { //Get the plane definition double *o = this->PlaneSource->GetOrigin(); double *pt1 = this->PlaneSource->GetPoint1(); double *pt2 = this->PlaneSource->GetPoint2(); //Get the vector of motion double v[3]; v[0] = p2[0] - p1[0]; v[1] = p2[1] - p1[1]; v[2] = p2[2] - p1...
false
false
false
false
false
0
start() { value=0; setVisible(true); setPosition(); active=true; if (!timer) { timer=new QTimer(this); connect(timer, SIGNAL(timeout()), this, SLOT(timeout())); } timer->start(100); }
false
false
false
false
false
0
parse(XML_PARSER& xp) { bool found_url = false; type = ""; appname = ""; device_num = -1; while (!xp.get_tag()) { if (!xp.is_tag) continue; if (xp.match_tag("/exclude_gpu")) { if (!found_url) return ERR_XML_PARSE; return 0; } if (xp.parse_string("url", ...
false
false
false
false
false
0
RunCreateArtifact(ARegion *r,Unit *u,int skill,int item) { int level = u->GetSkill(skill); unsigned int c; for(c = 0; c < sizeof(ItemDefs[item].mInput)/sizeof(Materials); c++) { if(ItemDefs[item].mInput[c].item == -1) continue; int amt = u->GetSharedNum(ItemDefs[item].mInput[c].item); int cost = ItemDefs[item]...
false
false
false
false
false
0
get_pane_menu_item( debugger_pane pane ) { const gchar *path; GtkWidget *menu_item; path = NULL; switch( pane ) { case DEBUGGER_PANE_REGISTERS: path = "/View/Registers"; break; case DEBUGGER_PANE_MEMORYMAP: path = "/View/Memory Map"; break; case DEBUGGER_PANE_BREAKPOINTS: path = "/View/Breakpoints"; bre...
false
false
false
false
false
0
V1_open_old_nat(struct Map_info *Map, int update) { char buf[1000]; G_debug(1, "V1_open_old_nat(): name = %s mapset = %s", Map->name, Map->mapset); sprintf(buf, "%s/%s", GRASS_VECT_DIRECTORY, Map->name); dig_file_init(&(Map->dig_fp)); if (update) Map->dig_fp.file = G_fopen_modify(buf, GRASS_...
true
true
false
false
false
1
bitmap_set_bit(u8 *bitmap, u32 bit) { if (bitmap[bit / 8] & 1 << (bit % 8)) return 1; bitmap[bit / 8] |= 1 << (bit % 8); return 0; }
false
false
false
false
false
0
HPDF_Fax4Encode(struct _HPDF_CCITT_Data *pData, tidata_t bp, tsize_t cc/*, tsample_t s*/) { HPDF_Fax3CodecState *sp = EncoderState(pData); /* (void) s; */ while ((long)cc > 0) { if (HPDF_Fax3Encode2DRow(pData, bp, sp->refline, sp->b.rowpixels)!=HPDF_OK) return 1; memcpy(sp->refline, bp, sp->b.rowbytes); bp...
false
true
false
false
false
1
SetRenderer( vtkRenderer * r ) { vtkRenderWindowInteractor *rwi = NULL; if (r && r->GetRenderWindow()) { rwi = r->GetRenderWindow()->GetInteractor(); } this->SetInteractor(rwi); if (this->Renderer == r) { return; } if (r && !r->GetRenderWindow()) { vtkErrorMacro( << "Rendere...
false
false
false
false
false
0
ext_buddy_added(MsnAccount *ma, MsnBuddy *bud) { eb_debug(DBG_MSN, "Added buddy %s\n", bud->passport); /* Associate an eb_account if it has not been done already */ if (!bud->ext_data) { eb_local_account *ela = ma->ext_data; eb_account *ea = find_account_with_ela(bud->passport, ela); if (!ea) { eb_debug(DB...
false
false
false
false
false
0
camera_reset_viewpoint(GF_Camera *cam, Bool animate) { if (!animate || (cam->had_viewpoint==2) ) { camera_set_vectors(cam, cam->vp_position, cam->vp_orientation, cam->vp_fov); cam->last_pos = cam->vp_position; cam->anim_len = 0; return; } #ifndef FORCE_CAMERA_3D if (cam->is_3D) #endif { cam->start_pos = ...
false
false
false
false
false
0
valuearray_add_valuearray_fast(Slapi_Value ***vals, Slapi_Value **addvals, int nvals, int naddvals, int *maxvals, int exact, /* Don't create an array bigger than needed */ int passin) /* The values are being passed in */ { int i, j; int allocate= 0; int need = nvals + naddv...
false
false
false
false
false
0
eap_sim_sendchallenge(EAP_HANDLER *handler) { struct eap_sim_server_state *ess; VALUE_PAIR **invps, **outvps, *newvp; ess = (struct eap_sim_server_state *)handler->opaque; rad_assert(handler->request != NULL); rad_assert(handler->request->reply); /* invps is the data from the client. * but, this is for non-pr...
false
false
false
false
false
0
preset_ethernet() { // ETH[0] with some default values safe_strncpy(ETH(0, type), XIF_TYPE, sizeof(ETH(0, type))); safe_strncpy(ETH(0, tunnel), XIF_TUNNEL, sizeof(ETH(0, tunnel))); safe_strncpy(ETH(0, ip_host), XIF_HOST_IP, sizeof(ETH(0, ip_host))); safe_strncpy(ETH(0, ip_atari), XIF_ATARI_IP, sizeof(ETH(0, ip_ata...
false
false
false
false
false
0
UTF8_Init (HPDF_Encoder encoder) { HPDF_CMapEncoderAttr attr; HPDF_STATUS ret; if ((ret = HPDF_CMapEncoder_InitAttr (encoder)) != HPDF_OK) return ret; /* * We override these two */ encoder->byte_type_fn = UTF8_Encoder_ByteType_Func; encoder->to_unicode_fn = UTF8_Encoder_ToU...
false
false
false
false
false
0
lab_range(lua_State *L) { double xmin = luaL_checknumber(L, 1); double xmax = luaL_checknumber(L, 2); double step = luaL_optnumber(L, 3, 1); long size, i; THTensor *x; double *x_p; luaL_argcheck(L, step > 0, 3, "step must be a positive number"); luaL_argcheck(L, xmax > xmin, 2, "upper bound must be lar...
false
false
false
false
false
0
PositionUpdate() { std::set<coreplayer_notifier *>::const_iterator i; LockNotifiers(); for (i = notifiers.begin(); i != notifiers.end(); i++) { if ((*i)->position_notify) (*i)->position_notify((*i)->data, GetPosition()); } UnlockNotifiers(); }
false
false
false
false
false
0
document_structure_truncate (DocumentStructure* self, const gchar* text) { gchar* result = NULL; const gchar* _tmp0_ = NULL; const gchar* _tmp1_ = NULL; gint _tmp2_ = 0; gint index = 0; const gchar* _tmp3_ = NULL; gint _tmp4_ = 0; const gchar* _tmp5_ = NULL; gint _tmp6_ = 0; gchar* _tmp7_ = NULL; g_return_va...
false
false
false
false
false
0
packet_alloc(rtsp_priv_t * priv, int size) { if(priv->packet_alloc < size) { priv->packet_alloc = size + 64; priv->packet = realloc(priv->packet, priv->packet_alloc); } priv->packet_ptr = priv->packet; priv->packet_len = size; }
false
false
false
false
false
0
get_var() const { IntVarObj* __v = NULL; int min = INT_MAX; for (std::vector<IntVarObj*>::const_iterator it = _vars.begin() ; it != _vars.end() ; ++it) { int __m = (*it)->cardinality(); if (__m > 1 && __m < min) { min = __m; __v = (*it); } } return __v; }
false
false
false
false
false
0
cmd_lookup(char *cmd, int len) { int i = 0; while (cmd_table[i].name != NULL) { if (name_matches(cmd_table[i].name, cmd, len)) { if (cmd_table[i].do_command == NULL) return -1; return i; } i++; } return -1; }
false
false
false
false
false
0
ASN1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it) { int utype; if (it) { const ASN1_PRIMITIVE_FUNCS *pf; pf = it->funcs; if (pf && pf->prim_free) { pf->prim_free(pval, it); return; } } /* Special case: if 'it' is NULL free contents of ASN1_TYPE */ if (!it) { ASN1_TYPE *typ = (AS...
false
false
false
false
false
0
mmo_write_obj_mark(const char* sobj, const char* name) { char* key; gbuint16 nr; char buf[16]; int res; if (avltree_find(mmobjects, sobj, (const void**)&key)) { nr = (unsigned)atoi(key); gbfputuint16(nr, fout); } else { mmo_object_id++; snprintf(buf, sizeof(buf), "%u", mmo_object_id); ...
false
false
false
false
false
0
tonga_thermal_get_temperature(struct pp_hwmgr *hwmgr) { int temp; temp = PHM_READ_VFPF_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC, CG_MULT_THERMAL_STATUS, CTF_TEMP); /* Bit 9 means the reading is lower than the lowest usable value. */ if (0 != (0x200 & temp)) temp = TONGA_THERMAL_MAXIMUM_TEMP_READING; else ...
false
false
false
false
false
0
conn_connect_bufferevent(struct bufferevent *bev, struct evdns_base *dns, int family, const char *name, int port, conn_connectcb conncb, void *arg) { struct conninfo *info; int rv = -1; info = mem_calloc(1, sizeof(*info)); info->bev = bev; info->on_connect = conncb; info->cbarg = arg; info->connecting...
false
false
false
false
false
0
l2tp_dict_find_attr_by_id(int id) { struct l2tp_dict_attr_t *attr; list_for_each_entry(attr, &dict->items, entry) { if (attr->id == id) return attr; } return NULL; }
false
false
false
false
false
0
BUF_MEM_grow(BUF_MEM *str, size_t len) { char *ret; size_t n; if (str->length >= len) { str->length=len; return(len); } if (str->max >= len) { memset(&str->data[str->length],0,len-str->length); str->length=len; return(len); } /* This limit is sufficient to ensure (len+3)/3*4 < 2**31 */ if (len...
false
false
false
false
false
0
eval_is(typcd, indx) int typcd; int indx; { int cond; #ifdef OptimizeType struct typinfo *typ; #else /* OptimizeType */ unsigned int *typ; #endif /* OptimizeType */ if (indx >= cur_symtyps->nsyms) return MaybeTrue | MaybeFalse; typ = cur_symtyps->types[indx]; if (has_type(typ, typcd,...
false
false
false
false
false
0
PyFF_Font_get_os2codepages(PyFF_Font *self,void *closure) { SplineFont *sf = self->fv->sf; if ( !sf->pfminfo.hascodepages ) OS2FigureCodePages(sf,sf->pfminfo.codepages); /* Don't mark it as having them though */ return( Py_BuildValue("(ii)", sf->pfminfo.codepages[0],sf->pfminfo.codepages[1])); }
false
false
false
false
false
0
session_stats(void *data, struct session_info *info) { int rc, i; iscsiadm_req_t req; iscsiadm_rsp_t rsp; if (!iscsi_match_session(data, info)) return -1; memset(&req, 0, sizeof(req)); req.command = MGMT_IPC_SESSION_STATS; req.u.session.sid = info->sid; rc = iscsid_exec_req(&req, &rsp, 1); if (rc) retur...
false
false
false
false
false
0
cli_bcapi_hashset_new(struct cli_bc_ctx *ctx ) { unsigned n = ctx->nhashsets+1; struct cli_hashset *s = cli_realloc(ctx->hashsets, sizeof(*ctx->hashsets)*n); if (!s) { cli_event_error_oom(EV, 0); return -1; } ctx->hashsets = s; ctx->nhashsets = n; s = &s[n-1]; cli_hashse...
false
false
false
false
false
0
__ats_fun_78 (ats_clo_ref_type env0, ats_clo_ref_type env1, ats_clo_ref_type env2, ats_ptr_type env3, ats_ref_type arg0, ats_ref_type arg1, ats_ref_type arg2) { /* local vardec */ ATSlocal (ats_ptr_type, tmp311) ; ATSlocal (ats_ptr_type, tmp312) ; ATSlocal (anairiats_rec_1, tmp313) ; ATSlocal (ats_ptr_type, tmp314) ; A...
false
false
false
false
false
0
_mpd_isint(const mpd_t *dec) { mpd_ssize_t tz; if (mpd_iszerocoeff(dec)) { return 1; } tz = mpd_trail_zeros(dec); return (dec->exp + tz >= 0); }
false
false
false
false
false
0
spinner_step(GtkWidget *spinner, gboolean reset) { SpinnerData *sp; sp = g_object_get_data(G_OBJECT(spinner), "spinner"); if (sp->timer_id) { log_printf("spinner warning: attempt to step with timer set\n"); return; } if (reset) { spinner_set_frame(sp, 0); } else { spinner_increment_frame(sp); ...
false
false
false
false
false
0
trampoline_address (tree function) { tree link; tree rtlexp; rtx tramp; struct function *fp; tree fn_context; /* Find an existing trampoline and return it. */ for (link = trampoline_list; link; link = TREE_CHAIN (link)) if (TREE_PURPOSE (link) == function) return adjust_trampoline_addr (XEXP ...
false
false
false
false
true
1
unleash_all() /* player is about to die (for bones) */ { register struct obj *otmp; register struct monst *mtmp; for(otmp = invent; otmp; otmp = otmp->nobj) if(otmp->otyp == LEASH) otmp->leashmon = 0; for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) mtmp->mleashed = 0; }
false
false
false
false
false
0
radeon_pm_program_mode_reg(struct radeonfb_info *rinfo, u16 value, u8 delay_required) { u32 mem_sdram_mode; mem_sdram_mode = INREG( MEM_SDRAM_MODE_REG); mem_sdram_mode &= ~MEM_SDRAM_MODE_REG__MEM_MODE_REG_MASK; mem_sdram_mode |= (value<<MEM_SDRAM_MODE_REG__MEM_MODE_REG__SHIFT) | MEM_SDRAM_MODE_REG...
false
false
false
false
false
0
read_report_descriptor(struct file *filp, struct kobject *kobj, struct bin_attribute *attr, char *buf, loff_t off, size_t count) { struct device *dev = container_of(kobj, struct device, kobj); struct hid_device *hdev = container_of(dev, struct hid_device, dev); if (off >= hdev->rsize) return 0; if (off + co...
false
true
false
false
false
1
ipmi_lan_keepalive(struct ipmi_intf * intf) { struct ipmi_rs * rsp; struct ipmi_rq req = { msg: { netfn: IPMI_NETFN_APP, cmd: 1, }}; if (!intf->opened) return 0; rsp = intf->sendrecv(intf, &req); if (rsp == NULL) return -1; if (rsp->ccode > 0) return -1; return 0; }
false
false
false
false
false
0
init_add_iter() { if (!m_add_iter_initialized){ dbus_message_iter_init_append(m_message, &m_iter); m_add_iter_initialized = true; m_get_iter_initialized = false; } }
false
false
false
false
false
0
hit_wall(short x, short y) { Location* locPtr = world.get_loc(x, y); if(!locPtr->is_wall()) return; float attackDamage = attenuated_damage(x * ZOOM_LOC_WIDTH, y * ZOOM_LOC_HEIGHT ); if( attackDamage == 0) return; // ###### end Gilbert 14/5 #########// Unit *virtualUnit, *parentUnit; if(unit_array.is_delete...
false
false
false
true
true
1
ath6kl_free_cookie(struct ath6kl *ar, struct ath6kl_cookie *cookie) { /* Insert first */ if (!ar || !cookie) return; cookie->arc_list_next = ar->cookie_list; ar->cookie_list = cookie; ar->cookie_count++; }
false
false
false
false
false
0
mask_rtx (enum machine_mode mode, int bitpos, int bitsize, int complement) { double_int mask; mask = double_int_mask (bitsize); mask = double_int_lshift (mask, bitpos, HOST_BITS_PER_DOUBLE_INT, false); if (complement) mask = double_int_not (mask); return immed_double_int_const (mask, mode); }
false
false
false
false
false
0
cmd_kill (int interactive UNUSED, struct cmdarg **args UNUSED) { if (current_window() == NULL) return cmdret_new (RET_FAILURE, NULL); XKillClient(dpy, current_window()->w); return cmdret_new (RET_FAILURE, NULL); }
false
false
false
false
false
0
egg_asn1x_create (const EggAsn1xDef *defs, const gchar *type) { const EggAsn1xDef *def; GNode *root, *parent, *node; int flags; g_return_val_if_fail (defs, NULL); g_return_val_if_fail (type, NULL); /* An OID */ if (is_oid_number (type)) { def = match_oid_in_definitions (defs, type); /* An...
false
false
false
false
false
0
ab_apply(FormStack *st, Fixed space, u32 *group_idx, u32 count) { Fixed min_y; u32 i, start; GF_Rect *rc; start = 0; rc = &form_get_group(st, group_idx[0])->final; min_y = rc->y - rc->height; if(space>-FIX_ONE) { start = 1; min_y += space; } else { for (i=1; i<count; i++) { rc = &form_get_group(st, gr...
false
false
false
false
false
0
cx231xx_dvb_bus_ctrl(struct dvb_frontend *fe, int acquire) { struct cx231xx *dev = fe->dvb->priv; if (acquire) return cx231xx_set_mode(dev, CX231XX_DIGITAL_MODE); else return cx231xx_set_mode(dev, CX231XX_SUSPEND); }
false
false
false
false
false
0
print_wifi_wmm_param(const uint8_t *data, uint8_t len) { int i; static const char *aci_tbl[] = { "BE", "BK", "VI", "VO" }; if (len < 19) goto invalid; if (data[0] != 1) { printf("Parameter: not version 1: "); return false; } printf("\t * Parameter version 1"); data++; if (data[0] & 0x80) printf("\n...
false
false
false
false
false
0
transient_activate_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t size) { struct led_classdev *led_cdev = dev_get_drvdata(dev); struct transient_trig_data *transient_data = led_cdev->trigger_data; unsigned long state; ssize_t ret; ret = kstrtoul(buf, 10, &state); if (ret) re...
false
false
false
false
false
0
ixgbe_read_eerd_buffer_generic(struct ixgbe_hw *hw, u16 offset, u16 words, u16 *data) { u32 eerd; s32 status; u32 i; hw->eeprom.ops.init_params(hw); if (words == 0) return IXGBE_ERR_INVALID_ARGUMENT; if (offset >= hw->eeprom.word_size) return IXGBE_ERR_EEPROM; for (i = 0; i < words; i++) { eerd ...
false
false
false
false
false
0
vte_cwd(const gchar *filename, gboolean force) { if (vte_info.have_vte && (vc->follow_path || force) && filename != NULL && g_path_is_absolute(filename)) { gchar *path; if (g_file_test(filename, G_FILE_TEST_IS_DIR)) path = g_strdup(filename); else path = g_path_get_dirname(filename); vte_get_working...
false
false
false
false
false
0
draw_tilemap(struct mame_bitmap *bitmap,const struct rectangle *cliprect, int addr,int gfx0,int gfx1,int transparency) { int x,y; for (y = 0;y < 32;y++) { for (x = 0;x < 32;x++) { int code = (tugboat_ram[addr + 0x400] << 8) | tugboat_ram[addr]; int color = (code & 0x3c00) >> 10; int rgn; ...
false
false
false
false
false
0
pipeopen (char *cmd, FILE **ifp, FILE **ofp, int *pidp) { int p1[2], p2[2]; char cmd2[1024]; char *s; if (pipe (p1) == -1 || pipe (p2) == -1) { *ifp = NULL; return; } switch ((*pidp = FORK ())) { case -1: panic2 (POS, "pipeopen", "cannot fork"); case 0: c...
true
true
false
false
true
1
elm_frame_collapse_go(Evas_Object *obj, Eina_Bool collapse) { ELM_FRAME_CHECK(obj); ELM_FRAME_DATA_GET_OR_RETURN(obj, sd); collapse = !!collapse; if (sd->collapsed == collapse) return; elm_layout_signal_emit(obj, "elm,action,toggle", "elm"); evas_object_smart_callback_add ...
false
false
false
false
false
0