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 |
|---|---|---|---|---|---|---|
varinfo (lua_State *L, const TValue *o) {
const char *name = NULL; /* to avoid warnings */
CallInfo *ci = L->ci;
const char *kind = NULL;
if (isLua(ci)) {
kind = getupvalname(ci, o, &name); /* check whether 'o' is an upvalue */
if (!kind && isinstack(ci, o)) /* no? try a register */
kind = geto... | false | false | false | false | false | 0 |
scan_to_frame( struct FLI *fli ) {
struct FLI_CHUNK_HEADER buf;
struct FLI_FRAMECHUNK *fc;
do {
readchunkheader( fli->f, &buf );
if( buf.type==0xF1FA ) break;
fseek( fli->f, buf.size - FLI_CHUNK_HEADERLEN, SEEK_CUR );
} while ( buf.type!=0xF1FA );
fc = fli->frame + fli->current;
fc->size = buf.size - FLI_CHUN... | false | false | false | false | false | 0 |
get_mipmap_chain(unsigned char *dst, int w, int h, int bpp,
gint32 image_id)
{
gint *layers, num_layers;
GimpDrawable *drawable;
GimpPixelRgn rgn;
int i, offset, mipw, miph;
layers = gimp_image_get_layers(image_id, &num_layers);
offset = 0;
while(get_next_mipmap_dime... | false | false | false | false | false | 0 |
on_button_press_event( GdkEventButton* event )
{
#ifdef _DEBUG
std::cout << "InputDiag::on_button_press_event\n";
#endif
const bool ret = SKELETON::PrefDiag::on_button_press_event( event );
if( m_mode & INPUTDIAG_MODE_MOUSE ){
m_control.MG_start( event );
m_str_motion = std::string();
... | false | false | false | false | false | 0 |
clutter_interval_new_with_values (GType gtype,
const GValue *initial,
const GValue *final)
{
g_return_val_if_fail (gtype != G_TYPE_INVALID, NULL);
g_return_val_if_fail (initial == NULL || G_VALUE_TYPE (initial) == gtype, NULL);
g_return_v... | false | false | false | false | false | 0 |
divas_idi_register_chrdev(void)
{
if ((major = register_chrdev(0, DEVNAME, &divas_idi_fops)) < 0)
{
printk(KERN_ERR "%s: failed to create /dev entry.\n",
DRIVERLNAME);
return (0);
}
return (1);
} | false | false | false | false | false | 0 |
play_about_to_finish (GstElement * playbin, gpointer user_data)
{
GstPlay *play = user_data;
const gchar *next_uri;
gchar *loc;
guint next_idx;
if (!play->gapless)
return;
next_idx = play->cur_idx + 1;
if (next_idx >= play->num_uris)
return;
next_uri = play->uris[next_idx];
loc = play_uri_g... | false | false | false | false | false | 0 |
CreateLowlightWindows (TwmWindow *tmp_win)
{
XSetWindowAttributes attributes; /* attributes for create windows */
unsigned long valuemask;
int h = (Scr->TitleHeight - 2 * Scr->FramePadding);
int y = Scr->FramePadding;
ColorPair cp;
if (!Scr->UseSunkTitlePixmap || ! tmp_win->titlehighlight) {... | false | false | false | false | false | 0 |
file_buffer_ready_cb (GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
InstallerData *idata = user_data;
GFile *file;
char *buffer;
gsize buffer_size;
GError *error = NULL;
char *uri;
const char *mime_type;
gboolean ... | false | false | false | false | false | 0 |
SafeRealloc(void *pOld, int nByte){
void *p;
if( pOld==0 ){
p = SafeMalloc(nByte);
}else{
p = realloc(pOld, nByte);
if( p==0 ){
fprintf(stderr,
"Out of memory. Can't enlarge an allocation to %d bytes\n",nByte);
exit(1);
}
}
return p;
} | false | false | false | false | false | 0 |
zeitgeist_engine_get_extension_names (ZeitgeistEngine* self, int* result_length1) {
gchar** result = NULL;
ZeitgeistExtensionCollection* _tmp0_ = NULL;
gint _tmp1_ = 0;
gchar** _tmp2_ = NULL;
gchar** _tmp3_ = NULL;
gint _tmp3__length1 = 0;
g_return_val_if_fail (self != NULL, NULL);
_tmp0_ = self->priv->extensio... | false | false | false | false | false | 0 |
pkix_Build_SortCertComparator(
PKIX_PL_Object *obj1,
PKIX_PL_Object *obj2,
PKIX_Int32 *pResult,
void *plContext)
{
PKIX_PL_Date *date1 = NULL;
PKIX_PL_Date *date2 = NULL;
PKIX_Boolean result = PKIX_FALSE;
PKIX_ENTER(BUILD, "pkix_Build_SortCertComparator")... | false | false | false | false | false | 0 |
ooH323EpSetGkClientCallbacks(OOGKCLIENTCALLBACKS gkClientCallbacks)
{
if(gH323ep.gkClient)
{
return ooGkClientSetCallbacks(gH323ep.gkClient, gkClientCallbacks);
}
else{
OOTRACEERR1("Error:Gk Client hasn't been initialized yet\n");
return OO_FAILED;
}
} | false | false | false | false | false | 0 |
m5mols_set_saturation(struct m5mols_info *info, int val)
{
int ret = m5mols_write(&info->sd, MON_CHROMA_LVL, val);
if (ret < 0)
return ret;
return m5mols_write(&info->sd, MON_CHROMA_EN, REG_CHROMA_ON);
} | false | false | false | false | false | 0 |
alloc_statement(void)
{
Statement *npt;
int i;
npt = (Statement *)calloc(1, sizeof(Statement));
if (npt == NULL)
fatal("No more room for statement.\n");
else {
npt->next = NULL;
npt->data = NULL;
for(i = 0; i < 3; i++)
npt->sym_code[i] = NULL;
for(i = 0; i < MAX_IND_D... | false | false | false | false | false | 0 |
n_tty_packet_mode_flush(struct tty_struct *tty)
{
unsigned long flags;
if (tty->link->packet) {
spin_lock_irqsave(&tty->ctrl_lock, flags);
tty->ctrl_status |= TIOCPKT_FLUSHREAD;
spin_unlock_irqrestore(&tty->ctrl_lock, flags);
wake_up_interruptible(&tty->link->read_wait);
}
} | false | false | false | false | false | 0 |
lp8501_post_init_device(struct lp55xx_chip *chip)
{
int ret;
u8 val = LP8501_DEFAULT_CFG;
ret = lp55xx_write(chip, LP8501_REG_ENABLE, LP8501_ENABLE);
if (ret)
return ret;
/* Chip startup time is 500 us, 1 - 2 ms gives some margin */
usleep_range(1000, 2000);
if (chip->pdata->clock_mode != LP55XX_CLOCK_EXT)
... | false | false | false | false | false | 0 |
similarity_init(
similarity_info *info, git_diff *diff, size_t file_idx)
{
info->idx = file_idx;
info->src = (file_idx & 1) ? diff->new_src : diff->old_src;
info->repo = diff->repo;
info->file = similarity_get_file(diff, file_idx);
info->odb_obj = NULL;
info->blob = NULL;
git_buf_init(&info->data, 0);
if (i... | false | false | false | false | false | 0 |
copy_chars(ptr, count, c)
char_u *ptr;
size_t count;
int c;
{
size_t i = count;
char_u *p = ptr;
while (i--)
*p++ = c;
} | false | false | false | false | false | 0 |
c_overwrite(c_block_t *v,long pos,int16_t *b,long size)
{
int vs=cs(v);
if(pos<0)return;
if(pos+size>vs)size=vs-pos;
memcpy(v->vector+pos,b,size*sizeof(int16_t));
} | false | true | false | false | false | 1 |
getPatternForCurrencySpacing(UCurrencySpacing type,
UBool beforeCurrency,
UErrorCode& status) const {
if (U_FAILURE(status)) {
return fNoSymbol; // always empty.
}
if (beforeCurrency) {
return curr... | false | false | false | false | false | 0 |
gt_sam_alignment_rightmost_pos(GtSamAlignment *sam_alignment)
{
gt_assert(sam_alignment != NULL);
if (sam_alignment->rightmost == GT_UNDEF_ULONG)
{
sam_alignment->rightmost = (unsigned long)bam_calend(
&sam_alignment->s_alignment->core,
bam1_cigar(sam_alignment->s_alignment));
}
return sam... | false | false | false | false | false | 0 |
finish_map(schar fg_typ, schar bg_typ, bool lit, bool walled)
{
int i, j;
if(walled) wallify_map();
if(lit) {
for(i=1; i<COLNO; i++)
for(j=0; j<ROWNO; j++)
if((!IS_ROCK(fg_typ) && levl[i][j].typ == fg_typ) ||
(!IS_ROCK(bg_typ) && levl[i][j].typ == bg_typ) ||
(bg_typ == TREE && levl[i... | false | false | false | false | false | 0 |
tg3_halt(struct tg3 *tp, int kind, bool silent)
{
int err;
tg3_stop_fw(tp);
tg3_write_sig_pre_reset(tp, kind);
tg3_abort_hw(tp, silent);
err = tg3_chip_reset(tp);
__tg3_set_mac_addr(tp, false);
tg3_write_sig_legacy(tp, kind);
tg3_write_sig_post_reset(tp, kind);
if (tp->hw_stats) {
/* Save the stats acr... | false | false | false | false | false | 0 |
Set_bondtype (int event_x, int event_y, int curbond)
{
struct data *hdc;
struct spline *hsp;
struct xy_co *coord;
int d;
if (curbond == 17 || curbond > 19)
return; /* cannot change anything to 3-point spline */
hdc = select_vector (event_x, event_y, size_factor);
if (hdc)
{
hdc->bond = ... | false | false | false | false | false | 0 |
bnxt_set_tpa_flags(struct bnxt *bp)
{
bp->flags &= ~BNXT_FLAG_TPA;
if (bp->dev->features & NETIF_F_LRO)
bp->flags |= BNXT_FLAG_LRO;
if ((bp->dev->features & NETIF_F_GRO) && (bp->pdev->revision > 0))
bp->flags |= BNXT_FLAG_GRO;
} | false | false | false | false | false | 0 |
record_nidle_now() {
// note the number of idle instances
//
rsc_work_fetch[0].nidle_now = gstate.ncpus - rsc_work_fetch[0].sim_nused;
if (rsc_work_fetch[0].nidle_now < 0) rsc_work_fetch[0].nidle_now = 0;
for (int i=1; i<coprocs.n_rsc; i++) {
rsc_work_fetch[i].nidle_now = coprocs.coprocs[i].... | false | false | false | false | false | 0 |
showErrorStatistics(double const f0,
V3D::StdDistortionFunction const& distortion,
std::vector<V3D::CameraMatrix> const& cams,
std::vector<V3D::Vector3d> const& Xs,
std::vector<V3D::Vector2d> const& measurements,
std::ve... | false | false | false | false | false | 0 |
gfarm_eventqueue_alloc_fd_set(struct gfarm_eventqueue *q, int fd,
fd_set **fd_setpp)
{
fd_set *fsp;
if (fd >= q->fd_set_size) {
size_t fds_size, fds_array_length, fds_bytes, fd_set_size;
int overflow = 0;
fds_size = q->fd_set_size > 0 ? q->fd_set_size : MIN_FDS_SIZE;
for (; fd >= fds_size; fds_size += fds_... | false | false | false | false | false | 0 |
giraffe_psfdata_contains(const GiPsfData* self, const cxchar* name)
{
cx_map_const_iterator position;
cx_assert(self != NULL);
if (name == NULL) {
return FALSE;
}
position = cx_map_find(self->values, name);
if (position == cx_map_end(self->values)) {
return FALSE;
}
... | false | false | false | true | false | 1 |
DumpConstants (const Proto *f, DumpState *D) {
int i;
int n = f->sizek;
DumpInt(n, D);
for (i = 0; i < n; i++) {
const TValue *o = &f->k[i];
DumpByte(ttype(o), D);
switch (ttype(o)) {
case LUA_TNIL:
break;
case LUA_TBOOLEAN:
DumpByte(bvalue(o), D);
break;
case LUA_TNUMF... | false | false | false | false | false | 0 |
next_id(struct fuse *f)
{
do {
f->ctr = (f->ctr + 1) & 0xffffffff;
if (!f->ctr)
f->generation ++;
} while (f->ctr == 0 || f->ctr == FUSE_UNKNOWN_INO ||
get_node_nocheck(f, f->ctr) != NULL);
return f->ctr;
} | false | false | false | false | false | 0 |
logfs_get_sb_mtd(struct logfs_super *s, int mtdnr)
{
struct mtd_info *mtd = get_mtd_device(NULL, mtdnr);
if (IS_ERR(mtd))
return PTR_ERR(mtd);
s->s_bdev = NULL;
s->s_mtd = mtd;
s->s_devops = &mtd_devops;
return 0;
} | false | false | false | false | false | 0 |
detect_link_ethtool(void)
{
struct ifreq ifreq;
struct ethtool_value edata;
set_ifreq_to_ifname(&ifreq);
edata.cmd = ETHTOOL_GLINK;
ifreq.ifr_data = (void*) &edata;
if (network_ioctl(SIOCETHTOOL, &ifreq, "ETHTOOL_GLINK") < 0) {
return IFSTATUS_ERR;
}
return edata.data ? IFSTATUS_UP : IFSTATUS_DOWN;
} | false | false | false | false | false | 0 |
fs_ptree_open_filename(const char *filename, int flags, fs_ptable *chain)
{
if (sizeof(struct ptree_header) != 512) {
fs_error(LOG_CRIT, "incorrect ptree header size %zd, should be 512",
sizeof(struct ptree_header));
return NULL;
}
fs_ptree *pt = calloc(1, sizeof(fs_ptree)... | false | false | false | false | false | 0 |
usbtv_audio_urb_received(struct urb *urb)
{
struct usbtv *chip = urb->context;
struct snd_pcm_substream *substream = chip->snd_substream;
struct snd_pcm_runtime *runtime = substream->runtime;
size_t i, frame_bytes, chunk_length, buffer_pos, period_pos;
int period_elapsed;
void *urb_current;
switch (urb->status)... | false | false | false | false | false | 0 |
CreateField (
OGRFieldDefn * poField,
int bApproxOK )
{
if ( !bUpdate )
return OGRERR_UNSUPPORTED_OPERATION;
SimpleFieldPtr poKmlSimpleField = NULL;
if ( (poKmlSimpleField =
FieldDef2kml ( poField, m_poOgrDS->GetKmlFactory ( ) )) != NULL )
m_poKmlSchema->add_simplefield ... | false | false | false | false | false | 0 |
_scroll_cb(Evas_Object *obj,
void *data __UNUSED__)
{
ELM_MAP_DATA_GET(obj, sd);
if (sd->scr_timer) ecore_timer_del(sd->scr_timer);
else
evas_object_smart_callback_call
(ELM_WIDGET_DATA(sd)->obj, SIG_SCROLL_DRAG_START, NULL);
sd->scr_timer = ecore_timer_add(0.25, _scr_timeout_cb, sd)... | false | false | false | false | false | 0 |
__ecereMethod___ecereNameSpace__ecere__sys__File_Print(struct __ecereNameSpace__ecere__com__Instance * this, struct __ecereNameSpace__ecere__com__Class * class, void * object, ...)
{
struct __ecereNameSpace__ecere__sys__File * __ecerePointer___ecereNameSpace__ecere__sys__File = (struct __ecereNameSpace__ecere__sys__Fil... | true | true | false | false | false | 1 |
iwl_dbgfs_prph_reg_write(struct iwl_mvm *mvm, char *buf,
size_t count, loff_t *ppos)
{
u8 args;
u32 value;
int ret;
args = sscanf(buf, "%i %i", &mvm->dbgfs_prph_reg_addr, &value);
/* if we only want to set the reg address - nothing more to do */
if (args == 1)
goto out;
/* otherwise, make sure we have bo... | false | false | false | false | false | 0 |
gnucash_register_cut_clipboard (GnucashRegister *reg)
{
GnucashSheet *sheet;
GncItemEdit *item_edit;
g_return_if_fail(reg != NULL);
g_return_if_fail(GNUCASH_IS_REGISTER(reg));
sheet = GNUCASH_SHEET(reg->sheet);
item_edit = GNC_ITEM_EDIT(sheet->item_editor);
gnc_item_edit_cut_clipboard(ite... | false | false | false | false | false | 0 |
set_ipnet(char *addr, int new)
{
char *pos, *net;
pos = strchr(addr, '/');
net = pos + 1;
*pos = 0;
set_ipaddr(addr);
if (new)
cur_host.mask.s_addr = make_netmask(atoi(net));
else
if (!inet_aton(net, &cur_host.mask))
e_error = TRUE;
*pos = '/';
strcpy(cur_host.orig, addr);
} | false | true | false | false | true | 1 |
globus_l_gfs_remote_send(
globus_gfs_operation_t op,
globus_gfs_transfer_info_t * transfer_info,
void * user_arg)
{
globus_l_gfs_remote_ipc_bounce_t * bounce_info;
globus_result_t result;
globus_l_gfs_remote_handle_t * my... | false | false | false | false | false | 0 |
PlusCompare(const Bignum& a, const Bignum& b, const Bignum& c) {
ASSERT(a.IsClamped());
ASSERT(b.IsClamped());
ASSERT(c.IsClamped());
if (a.BigitLength() < b.BigitLength()) {
return PlusCompare(b, a, c);
}
if (a.BigitLength() + 1 < c.BigitLength()) return -1;
if (a.BigitLength() > c.BigitLength()) ret... | false | false | false | false | false | 0 |
IsVertical() const
{
if( poRoot == NULL )
return FALSE;
if( EQUAL(poRoot->GetValue(),"VERT_CS") )
return TRUE;
else if( EQUAL(poRoot->GetValue(),"COMPD_CS") )
return GetAttrNode( "VERT_CS" ) != NULL;
else
return FALSE;
} | false | false | false | false | false | 0 |
pg_server_to_client(const char *s, int len)
{
Assert(DatabaseEncoding);
Assert(ClientEncoding);
if (len <= 0)
return (char *) s;
if (ClientEncoding->encoding == DatabaseEncoding->encoding ||
ClientEncoding->encoding == PG_SQL_ASCII ||
DatabaseEncoding->encoding == PG_SQL_ASCII)
return (char *) s; /* assu... | false | false | false | false | false | 0 |
generate_lineloop_uint_first2last(
unsigned start,
unsigned nr,
void *_out )
{
uint *out = (uint*)_out;
unsigned i, j;
(void)j;
for (i = start, j = 0; j < nr - 2; j+=2, i++) {
(out+j)[0] = (uint)(i+1);
(out+j)[1] = (uint)(i);
}
(out+j)[0] = (uint)(0);
(out+j)[1] = (uint)(... | false | false | false | false | false | 0 |
operator==( KCardTheme theme ) const
{
return dirName() == theme.dirName();
} | false | false | false | false | false | 0 |
init_minionlib(void)
{
PyObject *m, *d;
m = Py_InitModule("_minionlib", _mixcryptlib_functions);
d = PyModule_GetDict(m);
SSL_library_init();
SSL_load_error_strings();
/* crypt */
ERR_load_ERR_strings();
ERR_load_RSA_strings();
OpenSSL_add_all_a... | false | false | false | false | false | 0 |
strsplit_with_quote(const gchar *str, const gchar *delim,
gint max_tokens)
{
GSList *string_list = NULL, *slist;
gchar **str_array, *s, *new_str;
guint i, n = 1, len;
cm_return_val_if_fail(str != NULL, NULL);
cm_return_val_if_fail(delim != NULL, NULL);
if (max_tokens < 1)
max_tokens = G_MAXINT;
s = s... | false | false | false | false | false | 0 |
gst_mem_index_free_format (gpointer key, gpointer value, gpointer user_data)
{
GstMemIndexFormatIndex *index = (GstMemIndexFormatIndex *) value;
if (index->tree) {
g_tree_destroy (index->tree);
}
g_slice_free (GstMemIndexFormatIndex, index);
} | false | false | false | false | false | 0 |
AddParameter(const wxString &name,
const wxVariant &dft,
Validator *valid)
{
wxASSERT_MSG(valid->Validate(dft),
wxT("Invalid command signature: the default value of '")
+ dft.MakeString()
+ wxT("' for the '")
+ name
+ wxT("' parameter doesn't satisfy the provi... | false | false | false | false | false | 0 |
ad7606_reset(struct ad7606_state *st)
{
if (gpio_is_valid(st->pdata->gpio_reset)) {
gpio_set_value(st->pdata->gpio_reset, 1);
ndelay(100); /* t_reset >= 100ns */
gpio_set_value(st->pdata->gpio_reset, 0);
return 0;
}
return -ENODEV;
} | false | false | false | false | false | 0 |
parse_tag_buffer(git_tag *tag, const char *buffer, const char *buffer_end)
{
static const char *tag_types[] = {
NULL, "commit\n", "tree\n", "blob\n", "tag\n"
};
unsigned int i, text_len;
char *search;
int error;
if ((error = git__parse_oid(&tag->target, &buffer, buffer_end, "object ")) < 0)
return git__reth... | false | true | false | false | false | 1 |
isl29020_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
int res;
res = als_set_default_config(client);
if (res < 0)
return res;
res = sysfs_create_group(&client->dev.kobj, &m_als_gr);
if (res) {
dev_err(&client->dev, "isl29020: device create file failed\n");
return res;
}
dev_in... | false | false | false | false | false | 0 |
CDB___db_prnpage(dbp, pgno)
DB *dbp;
db_pgno_t pgno;
{
PAGE *h;
int ret;
if (set_psize == PSIZE_BOUNDARY)
CDB___db_psize(dbp);
if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &h)) != 0)
return (ret);
ret = CDB___db_prpage(dbp, h, DB_PR_PAGE);
(void)fflush(CDB___db_prinit(NULL));
(void)CDB_memp_fput(dbp->m... | false | false | false | false | false | 0 |
G_set_program_name(const char *s)
{
int i;
char *temp;
i = strlen(s);
while (--i >= 0) {
if (G_is_dirsep(s[i])) {
s += i + 1;
break;
}
}
temp = G_store(s);
G_basename(temp, "exe");
name = G_store(temp);
G_free(temp);
return 0;
} | false | false | false | false | false | 0 |
ladish_graph_find_client_port_by_uuid(
ladish_graph_handle graph_handle,
ladish_client_handle client,
const uuid_t uuid,
bool use_link_override_uuids)
{
struct ladish_graph_client * client_ptr;
struct ladish_graph_port * port_ptr;
client_ptr = ladish_graph_find_client(graph_ptr, client);
ASSERT(client_... | false | false | false | false | false | 0 |
change_cset(int cset)
{
if (cset == cset_normal || cset == cset_iconified)
{
ProxyWindow *proxy;
for (proxy = firstProxy; proxy != NULL; proxy = proxy->next)
{
DrawProxyBackground(proxy);
}
}
else if (cset == cset_select && selectProxy != NULL)
{
DrawProxyBackground(selectProxy);
}
return;
} | false | false | false | false | false | 0 |
ina2xx_set_shunt(struct device *dev,
struct device_attribute *da,
const char *buf, size_t count)
{
unsigned long val;
int status;
struct ina2xx_data *data = dev_get_drvdata(dev);
status = kstrtoul(buf, 10, &val);
if (status < 0)
return status;
if (val == 0 ||
/* Values greater than the calibratio... | false | false | false | false | false | 0 |
cmd_set_comment_apply (Sheet *sheet, GnmCellPos *pos,
char const *text, PangoAttrList *attributes,
char const *author)
{
GnmComment *comment;
Workbook *wb = sheet->workbook;
comment = sheet_get_comment (sheet, pos);
if (comment) {
if (text)
g_object_set (G_OBJECT (comment), "text", text,
... | false | false | false | false | false | 0 |
giframestack_exec(cpl_plugin* plugin)
{
cpl_recipe* recipe = (cpl_recipe*)plugin;
cxint status = 0;
if (recipe->parameters == NULL || recipe->frames == NULL) {
return 1;
}
status = giframestack(recipe->parameters, recipe->frames);
if (status != 0) {
return 1;
}
ret... | false | false | false | false | false | 0 |
G__quant_export(const char *name, const char *mapset,
const struct Quant *quant)
{
char element[GNAME_MAX + 7];
char xname[GNAME_MAX], xmapset[GMAPSET_MAX];
FILE *fd;
if (G__name_is_fully_qualified(name, xname, xmapset)) {
if (strcmp(xmapset, mapset) != 0)
return -1;
name = xname;
}
i... | true | true | false | false | false | 1 |
CL_Skins_f (void)
{
int i;
for (i=0 ; i<MAX_CLIENTS ; i++)
{
if (!cl.configstrings[CS_PLAYERSKINS+i][0])
continue;
Com_Printf ("client %i: %s\n", i, cl.configstrings[CS_PLAYERSKINS+i]);
SCR_UpdateScreen ();
Sys_SendKeyEvents (); // pump message loop
CL_ParseClientinfo (i);
}
} | false | false | false | false | false | 0 |
mm_TLSSock_dealloc(mm_TLSSock *self)
{
Py_DECREF(self->context);
Py_DECREF(self->sockObj);
SSL_free(self->ssl);
PyObject_DEL(self);
} | false | false | false | false | false | 0 |
vfio_user_config_read(struct pci_dev *pdev, int offset,
__le32 *val, int count)
{
int ret = -EINVAL;
u32 tmp_val = 0;
switch (count) {
case 1:
{
u8 tmp;
ret = pci_user_read_config_byte(pdev, offset, &tmp);
tmp_val = tmp;
break;
}
case 2:
{
u16 tmp;
ret = pci_user_read_config_word(pdev, offset,... | false | false | false | false | false | 0 |
vGetBulletValue(conversion_type eConversionType, encoding_type eEncoding,
char *szResult, size_t tMaxResultLen)
{
fail(szResult == NULL);
fail(tMaxResultLen < 2);
if (eEncoding == encoding_utf_8) {
(void)tUcs2Utf8(UNICODE_BULLET, szResult, tMaxResultLen);
} else {
szResult[0] = (char)ucGetBulletCharacter(eCon... | false | false | false | false | false | 0 |
get_cur_time(void) {
time_info_t ti;
struct timeval tv;
gettimeofday(&tv, NULL);
int t = tv.tv_sec % (60 * 60 * 24);
ti.hour = t / (60 * 60) + time_zone;
if (ti.hour >= 24) {
ti.hour -= 24;
}
t %= (60 * 60);
ti.min = t / 60;
ti.sec = t % 60;
ti.usec = tv.tv_usec;
ti.day_num = (tv.tv_sec + time_zone*(60 *... | false | false | false | false | false | 0 |
getudpdispatch(int family, dns_dispatchmgr_t *dispatchmgr,
isc_socketmgr_t *socketmgr, isc_taskmgr_t *taskmgr,
isc_boolean_t is_shared, dns_dispatch_t **dispp,
isc_sockaddr_t *localaddr)
{
unsigned int attrs, attrmask;
dns_dispatch_t *disp;
unsigned buffersize, maxbuffers, maxrequests, bucket... | false | false | false | false | false | 0 |
IoNumber_log(IoNumber *self, IoObject *locals, IoMessage *m)
{
/*doc Number log
Returns the logarithm of the receiver. The base
is taken as the value of the first argument or the constant e if
the first argument is omitted.
*/
float base;
if(IoMessage_argCount(m) > 0){
base = DATA(IoMessage_locals_numberArgA... | false | false | false | false | false | 0 |
type1_command(int cmd)
{
switch (cmd) {
case Cs::cCallothersubr: {
// Expand known othersubr calls. If we cannot expand the othersubr
// call completely, then write it to the expander.
if (size() < 2)
goto partial_othersubr;
int command = (int)top(0);
int n = (int)top(1);
if (command... | false | false | false | false | false | 0 |
_pool_tex_find(Evas_Engine_GL_Context *gc, int w, int h,
int intformat, int format, int *u, int *v,
Eina_List **l_after, int atlas_w)
{
Evas_GL_Texture_Pool *pt = NULL;
Eina_List *l;
int th, th2;
if (atlas_w > gc->shared->info.max_texture_size)
atlas_w = gc->shared->info... | false | false | false | false | false | 0 |
validate_rbio_for_parity_scrub(struct btrfs_raid_bio *rbio)
{
if (atomic_read(&rbio->error) > rbio->bbio->max_errors)
goto cleanup;
if (rbio->faila >= 0 || rbio->failb >= 0) {
int dfail = 0, failp = -1;
if (is_data_stripe(rbio, rbio->faila))
dfail++;
else if (is_parity_stripe(rbio->faila))
failp = rbi... | false | false | false | false | false | 0 |
ipPrefix(const char *zIP){
int i, j;
static int ip_prefix_terms = -1;
if( ip_prefix_terms<0 ){
ip_prefix_terms = db_get_int("ip-prefix-terms",2);
}
if( ip_prefix_terms==0 ) return mprintf("0");
for(i=j=0; zIP[i]; i++){
if( zIP[i]=='.' ){
j++;
if( j==ip_prefix_terms ) break;
}
}
r... | false | false | false | false | false | 0 |
iadc_rsense_read(struct iadc_chip *iadc, struct device_node *node)
{
int ret, sign, int_sense;
u8 deviation;
ret = of_property_read_u32(node, "qcom,external-resistor-micro-ohms",
&iadc->rsense[IADC_EXT_RSENSE]);
if (ret < 0)
iadc->rsense[IADC_EXT_RSENSE] = IADC_INT_RSENSE_IDEAL_VALUE;
if (!iadc->rsense[... | false | false | false | false | false | 0 |
jpgFix_closeXform (IP_XFORM_HANDLE hXform)
{
PJFIX_INST g;
HANDLE_TO_PTR (hXform, g);
if (g->pSlaveXform) jpgDecodeTbl.closeXform(g->pSlaveXform);
if (g->headerBuffer) IP_MEM_FREE(g->headerBuffer);
g->dwValidChk = 0;
IP_MEM_FREE (g); /* free memory for the instance */
return IP_DONE... | false | false | false | false | false | 0 |
get_simple_starting_guess_sparse(int n,
int noOfElectrons,
symmMatrix & densityMatrix)
{
std::vector<ergo_real> diagonalValues(n);
std::vector<int> rowind(n);
std::vector<int> colind(n);
for(int i = 0; i < n; i++)
diagonalValues[i] = (ergo_real)noOfElectrons / n;
for(int i = 0; i < n; i++)
... | false | false | false | false | false | 0 |
siv_subscript_p (const_tree chrec_a, const_tree chrec_b)
{
if ((evolution_function_is_constant_p (chrec_a)
&& evolution_function_is_univariate_p (chrec_b))
|| (evolution_function_is_constant_p (chrec_b)
&& evolution_function_is_univariate_p (chrec_a)))
return true;
if (evolution_function_is_uni... | false | false | false | false | false | 0 |
qlcnic_sysfs_write_crb(struct file *filp, struct kobject *kobj,
struct bin_attribute *attr, char *buf,
loff_t offset, size_t size)
{
struct device *dev = container_of(kobj, struct device, kobj);
struct qlcnic_adapter *adapter = dev_get_drvdata(dev);
int ret;
ret = qlcnic_sysfs_validate_crb(adap... | false | false | false | false | false | 0 |
packet_stats()
{
int i, cnt, PacketCount, Bad_Packets, DiscardCount;
PPKTSTR pps = Get_Pkt_Str();
PacketCount = 0;
Bad_Packets = 0;
DiscardCount = pps[pkt_Discards].count;
for (i = 0; i < pkt_Max; i++) {
cnt = pps[i].count;
PacketCount += cnt;
if (i < pkt_First)
... | false | false | false | false | false | 0 |
iw_conn(struct nl80211_state *state, struct nl_cb *cb,
struct nl_msg *msg, int argc, char **argv)
{
char *end;
unsigned char bssid[6];
int freq;
if (argc < 1)
return 1;
/* SSID */
NLA_PUT(msg, NL80211_ATTR_SSID, strlen(argv[0]), argv[0]);
argv++;
argc--;
/* freq */
if (argc) {
freq = strtoul(argv[... | false | false | false | false | false | 0 |
encodeProfile(const IIOP::ProfileBody& body,IOP::TaggedProfile& profile)
{
profile.tag = IOP::TAG_INTERNET_IOP;
{
cdrEncapsulationStream s((CORBA::ULong)0,1);
s.marshalOctet(body.version.major);
s.marshalOctet(body.version.minor);
s.marshalRawString(body.address.host);
body.address.port >>= s;
... | false | false | false | false | false | 0 |
release( void )
throw( SemaphoreException )
{
GUARD;
SemaphoreOperationStatus aStatus( SUCCESS );
//
// Take the fast way if possible
//
aStatus = setLock( IPC_NOWAIT );
return aStatus;
} | false | false | false | false | false | 0 |
tidyup_forchild()
{
struct sigaction sa;
memset(&sa, 0, sizeof(sa));
sa.sa_handler = &sig_childterm;
if (sigaction(SIGTERM, &sa, NULL)) { // restore sig handler
// in child process
#ifdef DGDEBUG
std::cerr << "Error resetting signal for SIGTERM" << std::endl;
#endif
syslog(LOG_ERR, "%s", "Error resetting sign... | false | false | false | false | false | 0 |
unlink_and_free_file_node_entry(struct gr_learn_file_node *remove, struct gr_learn_file_node **filelist)
{
struct gr_learn_file_node *ret;
ret = remove->next;
if (remove->prev == NULL) {
*filelist = remove->next;
if (remove->next != NULL)
remove->next->prev = NULL;
} else {
remove->prev->next = remove->n... | false | false | false | false | false | 0 |
shuffle_inv(uint64_t in, const uint8_t *shuffle, int shuffle_len) {
int i;
uint64_t res = 0;
shuffle += shuffle_len - 1;
for (i = 0; i < shuffle_len; i++) {
res |= (in & 1) << *shuffle--;
in >>= 1;
}
return res;
} | false | false | false | false | false | 0 |
finish_root_table (struct flist *flp, const char *pfx, const char *lastname,
const char *tname, const char *name)
{
struct flist *fli2;
for (fli2 = flp; fli2; fli2 = fli2->next)
if (fli2->started_p)
{
oprintf (fli2->f, " %s\n", lastname);
oprintf (fli2->f, "};\n\n");
}
for (fli2 = flp; f... | false | false | false | false | false | 0 |
pcxhr_update_analog_audio_level(struct snd_pcxhr *chip,
int is_capture, int channel)
{
int err, vol;
struct pcxhr_rmh rmh;
pcxhr_init_rmh(&rmh, CMD_ACCESS_IO_WRITE);
if (is_capture) {
rmh.cmd[0] |= IO_NUM_REG_IN_ANA_LEVEL;
rmh.cmd[2] = chip->analog_capture_volume[channel];
} else {
rmh.cmd[0] |= IO_... | false | false | false | false | false | 0 |
is_there_a_player_sitting_aside(connection_data *connection) {
int index = 0;
for (index = 0; index < MAX_CONNECTIONS; index++) {
if (connection->players[index].fd && connection->players[index].view_only)
return index;
}
return -1;
} | false | false | false | false | false | 0 |
SaveTransformer (Graphic* g) {
Transformer* orig = g->GetTransformer();
Ref(orig);
g->SetTransformer(new Transformer(orig));
return orig;
} | false | false | false | false | false | 0 |
metx_dump(GF_Box *a, FILE * trace)
{
GF_MetaDataSampleEntryBox *ptr = (GF_MetaDataSampleEntryBox*)a;
const char *name = (ptr->type==GF_ISOM_BOX_TYPE_METX) ? "XMLMetaDataSampleEntryBox" : "TextMetaDataSampleEntryBox";
fprintf(trace, "<%s ", name);
if (ptr->type==GF_ISOM_BOX_TYPE_METX) {
fprintf(trace, "namespace=... | false | false | false | false | false | 0 |
kvm_hv_irq_routing_update(struct kvm *kvm)
{
struct kvm_irq_routing_table *irq_rt;
struct kvm_kernel_irq_routing_entry *e;
u32 gsi;
irq_rt = srcu_dereference_check(kvm->irq_routing, &kvm->irq_srcu,
lockdep_is_held(&kvm->irq_lock));
for (gsi = 0; gsi < irq_rt->nr_rt_entries; gsi++) {
hlist_for_each_entry(e... | false | false | false | false | false | 0 |
adjust_suc_ILD(LoopDat *looplst,
LoopDat *lpdat,
IntSet grp_mask,
int diff)
{
int suc_num;
int suc_bpt_id;
IntSet suc_tmp;
LoopDat *suc_lpdat;
int i;
suc_num = number_IntSet(lpdat->suc);
copy_construct_IntSet(suc_tmp, lpdat->suc);
fo... | false | false | false | false | false | 0 |
Stream_send(Stream *self, PyObject *args)
{
int e;
PyObject *s;
char *str;
if (!PyArg_ParseTuple(args, "O", &s))
return NULL;
s = PyObject_Str(s);
if (s) {
str = PyString_AsString(s);
if (str) {
e = iks_send_raw(self->parser, str);
if (e) {
Py_DECREF(s);
return exceptions_stream_error(e);
... | false | false | false | false | false | 0 |
action(void)
{
char c;
int scope;
ECHO;
c = nextchar();
scope = 1;
while (scope > 0)
switch (c = nextchar()) {
case '*':
if (lastchar == '/')
do
c = nextchar();
while (lastchar != '*' || c != '/');
break;
case '"':
do
c = nextchar();
while (lastchar == '\\' || c != '"');
br... | false | false | false | false | false | 0 |
_ibox_cb_icon_mouse_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
{
Evas_Event_Mouse_Up *ev;
IBox_Icon *ic;
ev = event_info;
ic = data;
if ((ev->button == 1) && (!ic->drag.dnd))
{
e_border_uniconify(ic->border);
e_border_focus_set(ic->border, 1, 1... | false | false | false | false | false | 0 |
hb_ft_face_create_cached (FT_Face ft_face)
{
if (unlikely (!ft_face->generic.data || ft_face->generic.finalizer != (FT_Generic_Finalizer) hb_ft_face_finalize))
{
if (ft_face->generic.finalizer)
ft_face->generic.finalizer (ft_face);
ft_face->generic.data = hb_ft_face_create (ft_face, NULL);
ft_fac... | false | false | false | false | false | 0 |
add_session_id(List *headers, long session_id)
{
if (session_id != -1) {
char buf[40];
sprintf(buf, "%ld", session_id);
http_header_add(headers, "X-WAP-Session-ID", buf);
}
} | true | true | false | false | false | 1 |
convertToXBGR() {
if (mode == splashModeXBGR8)
return gTrue;
int newrowSize = width * 4;
SplashColorPtr newdata = (SplashColorPtr)gmallocn_checkoverflow(newrowSize, height);
if (newdata != NULL) {
for (int y = 0; y < height; y++) {
unsigned char *row = newdata + y * newrowSize;
getXBGRLin... | false | false | false | false | false | 0 |
IsExtensionNumber(int number) const {
// Linear search should be fine because we don't expect a message to have
// more than a couple extension ranges.
for (int i = 0; i < extension_range_count(); i++) {
if (number >= extension_range(i)->start &&
number < extension_range(i)->end) {
return true;... | false | false | false | false | false | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.