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
e_bindings_signal_handle(E_Binding_Context ctxt, E_Object *obj, const char *sig, const char *src) { E_Action *act; E_Binding_Signal *binding; if (sig && (sig[0] == 0)) sig = NULL; if (src && (src[0] == 0)) src = NULL; act = e_bindings_signal_find(ctxt, obj, sig, src, &binding); if (act) { ...
false
false
false
false
false
0
setFlowAccuColorTable(char* cellname) { struct Colors colors; char *mapset; struct Range r; mapset = G_find_cell(cellname, ""); if (mapset == NULL) { G_fatal_error (_("Raster map <%s> not found"), cellname); } if (G_read_range(cellname, mapset, &r) == -1) { G_fatal_error(_("cannot read range")...
false
false
false
false
false
0
bnxt_free_stats(struct bnxt *bp) { u32 size, i; struct pci_dev *pdev = bp->pdev; if (!bp->bnapi) return; size = sizeof(struct ctx_hw_stats); for (i = 0; i < bp->cp_nr_rings; i++) { struct bnxt_napi *bnapi = bp->bnapi[i]; struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; if (cpr->hw_stats) { dma_free_...
false
false
false
false
false
0
gst_file_index_add_id (GstIndex * index, GstIndexEntry * entry) { GstFileIndex *fileindex = GST_FILE_INDEX (index); GstFileIndexId *id_index; id_index = g_hash_table_lookup (fileindex->id_index, &entry->id); if (!id_index) { id_index = g_slice_new0 (GstFileIndexId); id_index->id = entry->id; id_i...
false
false
false
false
false
0
dlm_migrate_request_handler(struct o2net_msg *msg, u32 len, void *data, void **ret_data) { struct dlm_ctxt *dlm = data; struct dlm_lock_resource *res = NULL; struct dlm_migrate_request *migrate = (struct dlm_migrate_request *) msg->buf; struct dlm_master_list_entry *mle = NULL, *oldmle = NULL; const char *name...
false
false
false
false
false
0
gt_lua_get_table_as_uchararray(lua_State *L, int index, unsigned char **outarray, unsigned long *arrlen, GtError *err) { int had_err = 0, val; unsigned long i; unsigne...
false
false
false
false
false
0
field() const { XData::Field f = XDataField::field(); QStringList val; for (int i = 0; i < list->count(); i++) { QListWidgetItem* item = list->item(i); if ( list->isItemSelected(item) ) { QString lbl = item->text(); XData::Field::OptionList opts = f.options(); XData::Field::OptionList::Iterato...
false
false
false
false
false
0
pxenv_undi_set_station_address ( struct s_PXENV_UNDI_SET_STATION_ADDRESS *undi_set_station_address ) { struct ll_protocol *ll_protocol = pxe_netdev->ll_protocol; DBG ( "PXENV_UNDI_SET_STATION_ADDRESS %s", ll_protocol->ntoa ( undi_set_station_address->StationAddress ) ); /* If adapter is open, the chang...
false
false
false
false
false
0
with_bus_thread_func (void *data) { DBusError error; DBusConnection *connection; ClientData cd; const char *address; GMainContext *context; g_printerr ("Starting client thread %p\n", g_thread_self()); address = g_getenv ("DBUS_SESSION_BUS_ADDRESS"); if (address == NULL) { g_printerr ("DB...
false
false
false
false
false
0
allocateCandidatesAndFindBasisForAdd( Value *LHS, Value *RHS, Instruction *I) { Value *S = nullptr; ConstantInt *Idx = nullptr; if (match(RHS, m_Mul(m_Value(S), m_ConstantInt(Idx)))) { // I = LHS + RHS = LHS + Idx * S allocateCandidatesAndFindBasis(Candidate::Add, SE->getSCEV(LHS), Idx, S, I); } els...
false
false
false
false
false
0
vmw_kms_stdu_surface_dirty(struct vmw_private *dev_priv, struct vmw_framebuffer *framebuffer, struct drm_clip_rect *clips, struct drm_vmw_rect *vclips, struct vmw_resource *srf, s32 dest_x, s32 dest_y, unsigned num_clips, int inc, struct vm...
false
false
false
false
false
0
RuleComplexity( void *theEnv, struct lhsParseNode *theLHS) { struct lhsParseNode *thePattern, *tempPattern; int complexity = 0; while (theLHS != NULL) { complexity += 1; /* Add 1 for each pattern. */ complexity += ExpressionComplexity(theEnv,theLHS->networkTest); thePattern = theL...
false
false
false
false
false
0
nla_put_drbd_cfg_context(struct sk_buff *skb, struct drbd_resource *resource, struct drbd_connection *connection, struct drbd_device *device) { struct nlattr *nla; nla = nla_nest_start(skb, DRBD_NLA_CFG_CONTEXT); if (!nla) goto nla_put_failure; if (device && nla_put_u32(skb, T_ctx_vol...
false
false
false
false
false
0
ipw2100_pci_remove_one(struct pci_dev *pci_dev) { struct ipw2100_priv *priv = pci_get_drvdata(pci_dev); struct net_device *dev = priv->net_dev; mutex_lock(&priv->action_mutex); priv->status &= ~STATUS_INITIALIZED; sysfs_remove_group(&pci_dev->dev.kobj, &ipw2100_attribute_group); #ifdef CONFIG_PM if (ipw2100_f...
false
false
false
false
false
0
check_for_hex(BW *bw) { W *w; if (bw->o.hex) return 1; for (w = bw->parent->link.next; w != bw->parent; w = w->link.next) if ((w->watom == &watomtw || w->watom == &watompw) && ((BW *)w->object)->b == bw->b && ((BW *)w->object)->o.hex) return 1; return 0; }
false
false
false
false
false
0
elm_clock_show_am_pm_get(const Evas_Object *obj) { ELM_CLOCK_CHECK(obj) EINA_FALSE; ELM_CLOCK_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE); return sd->am_pm; }
false
false
false
false
false
0
cd_device_set_enabled (CdDevice *device, gboolean enabled, GError **error) { CdDevicePrivate *priv = device->priv; gboolean ret; GError *error_local = NULL; /* device is already the correct state */ if (priv->enabled == enabled) { ret = TRUE; goto out; } /* update database */ ret = cd_de...
false
false
false
false
false
0
getname(const u_char *ap) { register struct hostent *hp; u_int32_t addr; static struct hnamemem *p; /* static for longjmp() */ memcpy(&addr, ap, sizeof(addr)); p = &hnametable[addr & (HASHNAMESIZE-1)]; for (; p->nxt; p = p->nxt) { if (p->addr == addr) return (p->name); } p->addr = addr; p->nxt = newhnam...
false
false
false
false
false
0
fuse_attr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, struct iatt *buf) { fuse_state_t *state; fuse_in_header_t *finh; fuse_private_t *priv = NULL; struct fuse_attr_out fao; priv = this->private; state =...
false
false
false
false
false
0
compute_prefixtab(const char *p, unsigned long m) { unsigned long i, vlen = 0, *prefixtab; char b; gt_assert(p); prefixtab = gt_malloc(sizeof (unsigned long) * (m+1)); prefixtab[0] = GT_UNDEF_ULONG; /* paranoia */ if (m) prefixtab[1] = 0; for (i = 2; i <= m; i++) { b = p[i-1]; while (vlen > 0 ...
false
false
false
false
false
0
mouseDoubleClickEvent( QMouseEvent* e ) { if ( e->button() == Qt::LeftButton ) { d->possibleTripleClick=true; QTimer::singleShot( QApplication::doubleClickInterval(),this, SLOT(tripleClickTimeout()) ); } QLineEdit::mouseDoubleClickEvent( e ); }
false
false
false
false
false
0
overwriteBuf(UT_UCSChar * pBuf, UT_uint32 length, PT_BufIndex * pbi) { if (m_buffer[_varsetFromBufIndex(*pbi)] .overwrite(_subscriptFromBufIndex(*pbi), (UT_GrowBufElement*)pBuf, length)) { return true; } UT_DEBUGMSG(("could not overwriteBuf\n")); return false; }
false
false
false
false
false
0
_ov_open1(void *f,OggVorbis_File *vf,char *initial, long ibytes, ov_callbacks callbacks){ long offset=(f?callbacks.seek_func(f,0,SEEK_CUR):-1); int ret; memset(vf,0,sizeof(OggVorbis_File)); vf->datasource=f; vf->callbacks = callbacks; /* init the framing state */ ogg_sync_init(&vf->...
false
false
false
false
false
0
new_g15_screen(int screentype) { struct sigaction new_sigaction; int g15screen_fd; struct sockaddr_in serv_addr; static int sighandler_init=0; /* raise the priority of our packets */ int tos = 0x6; char buffer[256]; if(sighandler_init==0) { #ifdef HAVE_BACKTRACE new_sigaction.sa_h...
false
false
false
false
false
0
_expblur (guchar* pixels, gint width, gint height, gint channels, gint radius, gint aprec, gint zprec) { gint alpha; gint row = 0; gint col = 0; if (radius < 1) return; // calculate the alpha such that 90% of // the kernel is within the radius. // (Kernel extends to infin...
false
false
false
false
false
0
ajp_msg_append_string_ex(ajp_msg_t *msg, const char *value, int convert) { apr_size_t len; if (value == NULL) { return(ajp_msg_append_uint16(msg, 0xFFFF)); } len = strlen(value); if ((msg->len + len + 3) > msg->max_size) { return ajp_log_overfl...
false
true
false
false
false
1
GetUpperBounds(int i, int j) { if (i < j) return bounds(i, j); else return bounds(j, i); }
false
false
false
false
false
0
setConfiguration(const XMPP::XData& c) { MUCConfigurationTask* t = new MUCConfigurationTask(room_, client_->rootTask()); XData config = c; config.setType(XData::Data_Submit); connect(t,SIGNAL(finished()),SLOT(setConfiguration_finished())); t->set(config); t->go(true); }
false
false
false
false
false
0
tool_hash_function(gconstpointer key) { const char *s_key = (const char*)key; guint hash = 0; if (s_key) { int i; int length = strlen(s_key); for (i=0; i<length; i++) { hash = (hash<<4) + (hash ^ (guint)s_key[i]); } } return hash; }
false
false
false
false
false
0
pontis_add_controls(struct snd_ice1712 *ice) { unsigned int i; int err; for (i = 0; i < ARRAY_SIZE(pontis_controls); i++) { err = snd_ctl_add(ice->card, snd_ctl_new1(&pontis_controls[i], ice)); if (err < 0) return err; } wm_proc_init(ice); cs_proc_init(ice); return 0; }
false
false
false
false
false
0
follow_inner(PointRep *target) { if (this == target) { return true; } else { for (PointRepSet::iterator curr = inner_set.begin(); curr != inner_set.end(); ++curr) { if ((*curr)->follow_inner(target)) { return true; ...
false
false
false
false
false
0
seeImpossible() { QString s; mutex.lock(); s+=TimetableGenerateForm::tr("Information relating difficult to schedule activities:"); s+="\n\n"; s+=TimetableGenerateForm::tr("Please check the constraints related to the last " "activities in the list below, which might be difficult to schedule:"); s+="\n\n"; s+=...
false
false
false
false
false
0
msg_puts_long_len_attr(longstr, len, attr) char_u *longstr; int len; int attr; { int slen = len; int room; room = Columns - msg_col; if (len > room && room >= 20) { slen = (room - 3) / 2; msg_outtrans_len_attr(longstr, slen, attr); msg_puts_attr((char_u *)"...", hl_attr(HLF_8)); ...
false
false
false
false
false
0
attr_set_deletion_csn( Slapi_Attr *a, const CSN *csn) { PR_ASSERT(a!=NULL); if(csn_compare(csn,a->a_deletioncsn)>0) { csn_free(&a->a_deletioncsn); a->a_deletioncsn= csn_dup(csn); } return 0; }
false
false
false
false
false
0
Intersects( OGRGeometry *poOtherGeom ) const { OGREnvelope oEnv1, oEnv2; if( this == NULL || poOtherGeom == NULL ) return TRUE; this->getEnvelope( &oEnv1 ); poOtherGeom->getEnvelope( &oEnv2 ); if( oEnv1.MaxX < oEnv2.MinX || oEnv1.MaxY < oEnv2.MinY || oEnv2.MaxX < ...
false
false
false
false
false
0
ssl_cert_type(X509 *x, EVP_PKEY *pkey) { EVP_PKEY *pk; int ret= -1,i; if (pkey == NULL) pk=X509_get_pubkey(x); else pk=pkey; if (pk == NULL) goto err; i=pk->type; if (i == EVP_PKEY_RSA) { ret=SSL_PKEY_RSA_ENC; } else if (i == EVP_PKEY_DSA) { ret=SSL_PKEY_DSA_SIGN; } #ifndef OPENSSL_NO_EC els...
false
false
false
false
false
0
mpcf_fold_ast(int n, mpc_val_t **xs) { int i, j; mpc_ast_t** as = (mpc_ast_t**)xs; mpc_ast_t *r; if (n == 0) { return NULL; } if (n == 1) { return xs[0]; } if (n == 2 && xs[1] == NULL) { return xs[0]; } if (n == 2 && xs[0] == NULL) { return xs[1]; } r = mpc_ast_new(">", ""); f...
false
false
false
false
false
0
dialog_create_action_areav (GtkDialog *dialog, va_list args) { GtkWidget *hbbox = NULL; GtkWidget *button; /* action area variables */ const gchar *label; GtkSignalFunc callback; gpointer data; GObject *slot_object; GtkWidget **widget_ptr; gboolean default_ac...
false
false
false
false
false
0
GetMaxPlayers() const { if (MapDifficultyEntry const* mapDiff = GetMapDifficulty()) { if (mapDiff->maxPlayers || IsRegularDifficulty()) // Normal case (expect that regular difficulty always have correct maxplayers) return mapDiff->maxPlayers; else ...
false
false
false
false
false
0
is_equal(const ExecutionPath *e) const { const UninitVar *c = static_cast<const UninitVar *>(e); return (varname == c->varname && pointer == c->pointer && array == c->array && alloc == c->alloc && strncpy_ == c->strncpy_); }
false
false
false
false
false
0
lock_piece(Field *field, Block *block) { int i, j; for (i = 0; i < 4; ++i) { for (j = 0; j < 4; ++j) { (*field)[i + block->posy][j + block->posx] |= blocks[block->blocktype][block->orient][i][j]; } } }
false
false
false
false
false
0
VasySimplifyHashTristateAsg( RtlFigure ) rtlfig_list *RtlFigure; { rtldecl_list *RtlDeclar; rtlsym *RtlSymbol; rtlasg_list *RtlAsg; authelem *Element; chain_list *HeadChain; vexexpr *VexAtom; char *AtomName; int VexMin; int VexMax; int ...
false
false
false
false
false
0
main(int cnt, char *vec[]) { int iface; if (cnt < 2) { err("Usage:\n" "%s <UART device>\n" "UART device --> UART device node Ex: /dev/ttyS0\n", vec[0]); return EXIT_FAILURE; } signal(SIGTERM, app_sig_handler); signal(SIGINT, app_sig_handler); if ((iface = uart_init(vec[1])) < 0) { return EXIT_FA...
false
false
false
false
false
0
rsvg_defs_extern_lookup (const RsvgDefs * defs, const char *filename, const char *name) { RsvgHandle *file; file = (RsvgHandle *) g_hash_table_lookup (defs->externs, filename); if (file == NULL) { if (rsvg_defs_load_extern (defs, filename)) return NULL; file = (RsvgHandle *) g_ha...
false
false
false
false
false
0
ilt_load_table(FILE *fd) { insn_lookup_t *ilt; int i; if (!(ilt = malloc(sizeof(*ilt)))) return NULL; memset(ilt,0,sizeof(*ilt)); fseek(fd,0,SEEK_SET); for(i=0;i<RFC_ARRAY_NUMBER;i++) { if (ilt_load_rfct(fd,ilt) == -1) return NULL; } if (ilt_check_cached_table(ilt) ==...
false
false
false
false
false
0
extract_nb(uint32 insn, bool *invalid) { uint32 ret; ret = (insn >> 11) & 0x1f; if (ret == 0) ret = 32; return ret; }
false
false
false
false
false
0
mul_under_dim_size(Array_table *atbl, const int udim) { int i; SemTree *ret = make_semtree_const_int(1); for (i = 0; i < udim; i++) { SemTree *dim_size; dim_size = get_array_table_dim_size(atbl, i); ret = concat_semtree(OPE_MUL, ret, dim_size); } semtree_process(ret); ...
false
false
false
false
false
0
apply_seg( x86_op_t *op, unsigned int prefixes ) { if (! prefixes ) return; /* apply overrides from prefix */ switch ( prefixes & PREFIX_REG_MASK ) { case PREFIX_CS: op->flags |= op_cs_seg; break; case PREFIX_SS: op->flags |= op_ss_seg; break; case PREFIX_DS: op->flags |= op_ds_seg; break; case PRE...
false
false
false
false
false
0
IDirectFBVideoProvider_V4L_GetCapabilities( IDirectFBVideoProvider *thiz, DFBVideoProviderCapabilities *caps ) { DIRECT_INTERFACE_GET_DATA (IDirectFBVideoProvider_V4L) if (!caps) return DFB_INVARG; #ifdef DFB_HAVE_V4L2 if (data->is_v4l2) { ...
false
false
false
false
false
0
blogic_dealloc_ccb(struct blogic_ccb *ccb, int dma_unmap) { struct blogic_adapter *adapter = ccb->adapter; if (ccb->command != NULL) scsi_dma_unmap(ccb->command); if (dma_unmap) pci_unmap_single(adapter->pci_device, ccb->sensedata, ccb->sense_datalen, PCI_DMA_FROMDEVICE); ccb->command = NULL; ccb->status...
false
false
false
false
false
0
sis900_mdio_idle(long mdio_addr) { outl(MDIO | MDDIR, mdio_addr); sis900_mdio_delay(); outl(MDIO | MDDIR | MDC, mdio_addr); }
false
false
false
false
false
0
write_smc(u8 cmd, const char *key, const u8 *buffer, u8 len) { int i; if (send_command(cmd) || send_argument(key)) { pr_warn("%s: write arg fail\n", key); return -EIO; } if (send_byte(len, APPLESMC_DATA_PORT)) { pr_warn("%.4s: write len fail\n", key); return -EIO; } for (i = 0; i < len; i++) { if (se...
false
false
false
false
false
0
rfbCloseClient(rfbClientPtr cl) { rfbExtensionData* extension; for(extension=cl->extensions; extension; extension=extension->next) if(extension->extension->close) extension->extension->close(cl, extension->data); LOCK(cl->updateMutex); #ifdef LIBVNCSERVER_HAVE_LIBPTHREAD if (cl->sock != -1) #end...
false
false
false
false
false
0
string_sequence_new (gchar **strings) { GSequence *sequence; sequence = g_sequence_new(g_free); for (; *strings; strings++) { g_sequence_append(sequence, g_strdup(*strings)); } return sequence; }
false
false
false
false
false
0
ufs2_update_inode(struct inode *inode, struct ufs2_inode *ufs_inode) { struct super_block *sb = inode->i_sb; struct ufs_inode_info *ufsi = UFS_I(inode); UFSD("ENTER\n"); ufs_inode->ui_mode = cpu_to_fs16(sb, inode->i_mode); ufs_inode->ui_nlink = cpu_to_fs16(sb, inode->i_nlink); ufs_inode->ui_uid = cpu_to_fs32(s...
false
true
false
false
false
1
main(int argc, char* argv[]) { UBool verbose = TRUE; char writeCode; U_MAIN_INIT_ARGS(argc, argv); options[kOptDestDir].value = "."; /* read command line options */ argc=u_parseArgs(argc, argv, sizeof(options)/sizeof(options[0]), options); /* error handling, printing usage message */ ...
false
false
false
false
true
1
SetSaslError(Authen_SASL_Cyrus sasl,int code, const char* msg) { if (sasl == NULL) #ifdef SASL2 code = SASL_NOTINIT; #else code = SASL_FAIL; #endif else { _DEBUG("former error: %s, Code: %d",sasl->additional_errormsg, sasl->error_code); // Do not overwrite Error which are not handled yet, except this on...
false
false
false
false
false
0
win_enter_ext(wp, undo_sync, curwin_invalid, trigger_enter_autocmds, trigger_leave_autocmds) win_T *wp; int undo_sync; int curwin_invalid; int trigger_enter_autocmds UNUSED; int trigger_leave_autocmds UNUSED; { #ifdef FEAT_AUTOCMD int other_buffer = FALSE; #endif if (wp == curwin && !c...
false
false
false
false
false
0
crush_find_rule(const struct crush_map *map, int ruleset, int type, int size) { __u32 i; for (i = 0; i < map->max_rules; i++) { if (map->rules[i] && map->rules[i]->mask.ruleset == ruleset && map->rules[i]->mask.type == type && map->rules[i]->mask.min_size <= size && map->rules[i]->mask.max_...
false
false
false
false
false
0
emit_notes_for_changes (rtx insn, enum emit_note_where where, shared_hash vars) { emit_note_data data; htab_t htab = shared_hash_htab (vars); if (!htab_elements (changed_variables)) return; if (MAY_HAVE_DEBUG_INSNS) process_changed_values (htab); data.insn = insn; data.where = where; data.va...
false
false
false
false
false
0
CellGetNumberOfNodes( Partition *p, Cell *W ) { int first = W->first; int next = W->next; int i, num; for ( i = first, num = 0; i < next; i ++ ) { if ( !( rank_mark_bit & p->Rank[(int)p->AtNumber[i]] ) ) { num++; } } INCHI_HEAPCHK return num; }
false
false
false
false
false
0
OnHash(const unsigned char *srcmac, const unsigned char *dstmac, struct evbuffer *evb) { if (evbuffer_get_length(evb) < 4 + Sha1Hash::SIZE) { eprintf("%s #%u incorrect size in eth has\n", tintstr(), my_channel); return; } bin_t range = bin_fromUInt32(evbuffer_remove_32be(evb)); rec_ranges.set(ra...
false
false
false
false
false
0
engineBoots_conf(const char *word, char *cptr) { engineBoots = atoi(cptr) + 1; DEBUGMSGTL(("snmpv3", "engineBoots: %lu\n", engineBoots)); }
false
false
false
false
true
1
Curl_expire(struct SessionHandle *data, long milli) { struct Curl_multi *multi = data->multi; struct timeval *nowp = &data->state.expiretime; int rc; /* this is only interesting for multi-interface using libcurl, and only while there is still a multi interface struct remaining! */ if(!multi) return;...
false
false
false
false
false
0
silence_gen_init(silence_gen_state_t *s, int silent_samples) { if (s == NULL) { if ((s = (silence_gen_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); s->remaining_samples = silent_samples; return s; }
false
false
false
false
false
0
game_view_redraw_tile_cb (GameView* self, Tile* tile) { gint x = 0; gint y = 0; Tile* _tmp0_ = NULL; gint _tmp1_ = 0; gint _tmp2_ = 0; gint _tmp3_ = 0; gint _tmp4_ = 0; g_return_if_fail (self != NULL); g_return_if_fail (tile != NULL); game_view_update_dimensions (self); _tmp0_ = tile; game_view_get_tile_pos...
false
false
false
false
false
0
vmpressure_work_fn(struct work_struct *work) { struct vmpressure *vmpr = work_to_vmpressure(work); unsigned long scanned; unsigned long reclaimed; spin_lock(&vmpr->sr_lock); /* * Several contexts might be calling vmpressure(), so it is * possible that the work was rescheduled again before the old * work con...
false
false
false
false
false
0
io_type_enabled(struct pci_dev *pdev, unsigned int mask) { u16 cmd; return !pci_read_config_word(pdev, PCI_COMMAND, &cmd) && (cmd & mask); }
false
false
false
false
false
0
ListExpr2 ( Obj list, Expr expr ) { Obj sub; /* value of a subexpression */ Int len; /* logical length of the list */ Int i; /* loop variable */ Int ...
false
false
false
false
false
0
method_A5(const int *account, int *weight) { number2Array("2121212120", weight); if (AccountNumberCheck::OK == algo01(10, weight, true, 10, account)) return AccountNumberCheck::OK; if (account[0] == 9) return AccountNumberCheck::ERROR; number2Array("0987654320", weight); weight[0] = 10; return alg...
false
false
false
false
false
0
mg_md5(char buf[33], ...) { unsigned char hash[16]; const char *p; va_list ap; MD5_CTX ctx; MD5Init(&ctx); va_start(ap, buf); while ((p = va_arg(ap, const char *)) != NULL) { MD5Update(&ctx, (const unsigned char *) p, (unsigned) strlen(p)); } va_end(ap); MD5Final(hash, &ctx); bin2str(buf, h...
false
false
false
false
false
0
alphabet_lua_decode(lua_State *L) { GtAlphabet **alpha; unsigned int code; char character; alpha = check_alphabet(L, 1); code = luaL_checkinteger(L, 2); /* XXX: too restrictive, does not consider wildcards */ luaL_argcheck(L, code < gt_alphabet_size(*alpha), 2, "invalid code"); character = gt_alphabet_d...
false
false
false
false
false
0
sge_uid2user(uid_t uid, char *dst, size_t sz, int retries) { const char *last_username; DENTER(UIDGID_LAYER, "sge_uid2user"); last_username = uidgid_state_get_last_username(); if (!last_username[0] || (uidgid_state_get_last_uid() != uid)) { struct passwd *pw; struct passwd pwentry; int ...
false
false
false
false
false
0
zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC) /* {{{ */ { if ((class_type->ce_flags & ZEND_ACC_CONSTANTS_UPDATED) == 0 || (!CE_STATIC_MEMBERS(class_type) && class_type->default_static_members_count)) { zend_class_entry **scope = EG(in_execution)?&EG(scope):&CG(active_class_entry); zend_class_...
false
false
false
false
false
0
visible_context(gs_context_t *pctx) { return (pctx && pctx->visible ? pctx : (gs_context_t *)0); }
false
false
false
false
false
0
jt1_i(void) { UINT8 adr = ROP_ARG(PC); PC += 1; if( !(ENABLE & CNT) ) { UINT8 level = RP(I8X41_t1); if( level ) CONTROL |= TEST1; else CONTROL &= ~TEST1; } if( (CONTROL & TEST1) ) PC = (PC & 0x700) | adr; }
false
false
false
false
false
0
CallAssistance() { // FIXME: should player pets call for assistance? if (!m_AlreadyCallAssistance && getVictim() && !isCharmed()) { SetNoCallAssistance(true); if (GetCreatureInfo()->ExtraFlags & CREATURE_FLAG_EXTRA_NO_CALL_ASSIST) return; AI()->SendAIEventAround(AI_EVEN...
false
false
false
false
false
0
putxy (gadouble x, gadouble y) { if (xycnt>=grsize) return(1); *(xybuf+(xycnt*2)) = x; *(xybuf+(xycnt*2+1)) = y; xycnt++; return(0); }
false
false
false
false
false
0
UpdateEscortAI(const uint32 uiDiff) override { if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) { return; } if (m_uiRend_Timer < uiDiff) { DoCastSpellIfCan(m_creature->getVictim(), SPELL_REND); m_uiRend_Timer = 20000; ...
false
false
false
false
false
0
printSysThermalZoneTemperature(const char *cmd) { int zone = 0; if (sscanf(cmd, "acpi/Thermal_Zone/%d", &zone) <= 0) { output("-1\n"); return; } output( "%d\n", getSysFileValue("thermal_zone", zone, "temp") / 1000); }
false
false
false
false
false
0
define_variable(Sexp* var, Sexp* val, Env* ep) { Frame* fp; fp = ep->frames; char* varstr = (var->u.atom)->u.sym; Sexp* interned_var = intern_symbol(varstr); free(var); if (fp == NULL){ Frame* newfp; newfp = (Frame*)emalloc(sizeof(Frame)); mk_frame(interned_var, val, newfp); ep->frames = n...
false
false
false
false
false
0
ar_style_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { ArStyle *style = AR_STYLE (object); ArStylePrivate *priv = style->priv; switch (property_id) { case PROP_CARD_OVERHANG: ...
false
false
false
false
false
0
instance_reduce(object instance_obj) { list result; object instance_class(instance_obj.attr("__class__")); result.append(instance_class); object none; if (!getattr(instance_obj, "__safe_for_unpickling__", none)) { str type_name(getattr(instance_class, "__name__")); ...
false
false
false
false
false
0
spool_berkeleydb_check_reopen_database(lList **answer_list, bdb_info info) { bool ret = true; DB_ENV *env; DENTER(BDB_LAYER, "spool_berkeleydb_check_reopen_database"); env = bdb_get_env(info); /* * if environment is not set, it was either * - closed due ...
false
false
false
false
false
0
get_device(int number, char *device, int device_len) { FILE *proc_file; char *current_device; char *lineptr = NULL; char *saveptr = NULL; size_t bufflen; int i, count, counter; int return_value = 0; proc_file = fopen("/proc/sys/dev/cdrom/info", "r"); if (proc_file != NULL) { /* skip to line containing devic...
false
false
true
false
true
1
ves_icall_System_Buffer_SetByteInternal (MonoArray *array, gint32 idx, gint8 value) { MONO_ARCH_SAVE_REGS; mono_array_set (array, gint8, idx, value); }
false
false
false
false
false
0
EnsureConstructor(i::Handle<i::ObjectTemplateInfo> templ) { if (templ->constructor()->IsUndefined()) { Local<FunctionTemplate> constructor = FunctionTemplate::New(); Utils::OpenHandle(*constructor)->set_instance_template(*templ); templ->set_constructor(*Utils::OpenHandle(*constructor)); } return i::Ha...
false
false
false
false
false
0
EmitEOL() { // If we don't have any comments, just emit a \n. if (!IsVerboseAsm) { OS << '\n'; return; } EmitCommentsAndEOL(); }
false
false
false
false
false
0
xgbe_acpi_support(struct xgbe_prv_data *pdata) { struct device *dev = pdata->dev; u32 property; int ret; /* Obtain the system clock setting */ ret = device_property_read_u32(dev, XGBE_ACPI_DMA_FREQ, &property); if (ret) { dev_err(dev, "unable to obtain %s property\n", XGBE_ACPI_DMA_FREQ); return ret; } ...
false
false
false
false
false
0
send_firing_info_packet() { ubyte data[MAX_PACKET_SIZE]; int packet_size; ubyte plinked, sdual; Assert( !(Net_player->flags & NETINFO_FLAG_AM_MASTER) ); BUILD_HEADER(FIRING_INFO); plinked = (ubyte)((Player_ship->flags & SF_PRIMARY_LINKED)?1:0); sdual = (ubyte)((Player_ship->flags & SF_SECONDARY_DUAL_FIRE)?1:0)...
false
false
false
false
false
0
savelist(bool forsure) { int retval = 0; if (!pointlist.empty()) { string trueFileName; if (!forsure) // backup trueFileName = PtFileName + ".bak"; else trueFileName = PtFileName; ofstream PtFile(trueFileName.c_str()); ///,ios_base::out); // declare and...
false
false
false
false
false
0
uwb_rsv_handle_timeout_work(struct work_struct *work) { struct uwb_rsv *rsv = container_of(work, struct uwb_rsv, handle_timeout_work); struct uwb_rc *rc = rsv->rc; mutex_lock(&rc->rsvs_mutex); uwb_rsv_dump("TO", rsv); switch (rsv->state) { case UWB_RSV_STATE_O_INITIATED: if (rsv->is_multicast) { u...
false
false
false
false
false
0
default_series_name(char *template_path) { if(template_path) return string_format("%s.series", template_path); else return string_format(DEFAULT_LOG_NAME ".series", getpid()); }
false
false
false
false
false
0
tdb1_free_region(struct tdb_context *tdb, tdb1_off_t offset, ssize_t length) { struct tdb1_record rec; if (length <= sizeof(rec)) { /* the region is not worth adding */ return 0; } if (length + offset > tdb->file->map_size) { tdb->last_error = tdb_logerr(tdb, TDB_ERR_CORRUPT, TDB_LOG_ERROR, "tdb1_free_re...
false
false
false
false
false
0
wsm_multi_tx_confirm(struct cw1200_common *priv, struct wsm_buf *buf, int link_id) { int ret; int count; int i; count = WSM_GET32(buf); if (WARN_ON(count <= 0)) return -EINVAL; if (count > 1) { /* We already released one buffer, now for the rest */ ret = wsm_release_tx_buffer(priv, count - 1); if (r...
false
false
false
false
false
0
addrcache_next_cache_id() { int retVal; if( _nextCacheID__ == 0 ) { _nextCacheID__ = 1; } retVal = _nextCacheID__; ++_nextCacheID__; return retVal; }
false
false
false
false
false
0
real_setmiss (double missval, int varno, DATASET *dset) { int i, t, count = 0; int start = 1, end = dset->v; if (varno) { start = varno; end = varno + 1; } for (i=start; i<end; i++) { for (t=0; t<dset->n; t++) { if (dset->Z[i][t] == missval) { dset->Z[i][t] = NADBL; count++; ...
false
false
false
false
false
0
clear() { DictionaryEntry *de; ListIterator iterator(*this); while ((de=(DictionaryEntry*)iterator.getNext())) delete de; this->List::clear(); // FIXME: should be clear the local symbol table. }
false
false
false
false
false
0
OpUnmap() { pmd_unmap_it in ; pmd_unmap_ot out ; if (!readn(newsock, (char *)&in, sizeof( pmd_unmap_it))) return ; /* read input for operation */ if (ntohl(in.pid) > 0) /* remove all entries for pid */ out.count = unmapPid(ntohl(in.pid)) ; else /* ...
false
false
false
false
false
0
bq2415x_i2c_read_mask(struct bq2415x_device *bq, u8 reg, u8 mask, u8 shift) { int ret; if (shift > 8) return -EINVAL; ret = bq2415x_i2c_read(bq, reg); if (ret < 0) return ret; return (ret & mask) >> shift; }
false
false
false
false
false
0