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 |
|---|---|---|---|---|---|---|
gsm_dlci_t1(unsigned long data)
{
struct gsm_dlci *dlci = (struct gsm_dlci *)data;
struct gsm_mux *gsm = dlci->gsm;
switch (dlci->state) {
case DLCI_OPENING:
dlci->retries--;
if (dlci->retries) {
gsm_command(dlci->gsm, dlci->addr, SABM|PF);
mod_timer(&dlci->t1, jiffies + gsm->t1 * HZ / 100);
} else
... | false | false | false | false | false | 0 |
gfire_server_browser_create(PurpleConnection *p_gc)
{
if(!p_gc)
return NULL;
gfire_server_browser *ret = (gfire_server_browser*)g_malloc0(sizeof(gfire_server_browser));
ret->gc = p_gc;
g_datalist_init(&ret->favourites);
g_datalist_init(&ret->recent);
return ret;
} | false | false | false | false | false | 0 |
atm_init(struct solos_card *card, struct device *parent)
{
int i;
for (i = 0; i < card->nr_ports; i++) {
struct sk_buff *skb;
struct pkt_hdr *header;
skb_queue_head_init(&card->tx_queue[i]);
skb_queue_head_init(&card->cli_queue[i]);
card->atmdev[i] = atm_dev_register("solos-pci", parent, &fpga_ops, -1, N... | false | false | false | false | false | 0 |
camel_block_file_free_block (CamelBlockFile *bs,
camel_block_t id)
{
CamelBlock *bl;
g_return_val_if_fail (CAMEL_IS_BLOCK_FILE (bs), -1);
bl = camel_block_file_get_block (bs, id);
if (bl == NULL)
return -1;
CAMEL_BLOCK_FILE_LOCK (bs, root_lock);
((camel_block_t *) bl->data)[0] =... | false | false | false | false | false | 0 |
array_add(struct grecs_value *vx, struct grecs_value *vy)
{
size_t i;
vx->v.arg.v = grecs_realloc(vx->v.arg.v,
(vx->v.arg.c + vy->v.arg.c) *
sizeof(vx->v.arg.v[0]));
for (i = 0; i < vy->v.arg.c; i++)
vx->v.arg.v[i + vy->v.arg.c] = vy->v.arg.v[i];
grecs_free(vy->v.arg.v);
vy->v.arg.v = NULL;
... | false | false | false | false | false | 0 |
serviceUnitExists()
{
for ( Player::VehicleList::iterator vi = ai->getPlayer().vehicleList.begin(); vi != ai->getPlayer().vehicleList.end(); vi++ )
if ( possible ( *vi ))
return true;
return false;
} | false | false | false | false | false | 0 |
gkrellm_move_krell_yoff(GkrellmPanel *p, GkrellmKrell *k, gint y)
{
if (!k)
return;
if (!k->modified)
k->old_draw = k->draw;
k->y0 = k->draw.y_dst = y;
k->modified = TRUE;
} | false | false | false | false | false | 0 |
complete_transaction(struct fw_card *card, int rcode,
void *payload, size_t length, void *data)
{
struct outbound_transaction_event *e = data;
struct fw_cdev_event_response *rsp = &e->response;
struct client *client = e->client;
unsigned long flags;
if (length < rsp->length)
rsp->length = length;
if (rcod... | false | false | false | false | false | 0 |
_nrrdGN_f(float *f, const float *x, size_t len, const double *parm) {
float sig, cut, t;
size_t i;
sig = AIR_CAST(float, parm[0]);
cut = AIR_CAST(float, parm[1]);
for (i=0; i<len; i++) {
t = x[i];
t = AIR_ABS(t);
f[i] = AIR_CAST(float, _GAUSS(t, sig, cut));
}
} | false | false | false | false | false | 0 |
set_parameter_speex(void * data, const char * name,
const bg_parameter_value_t * v)
{
speex_t * speex;
speex = data;
if(!name)
{
return;
}
else if(!strcmp(name, "mode"))
{
if(!strcmp(v->val_str, "auto"))
speex->modeID = -1;
else if(!strcmp(v->v... | false | false | false | false | false | 0 |
push(int, Packet *p)
{
// If you change this code, also change NotifierQueue::push()
// and FullNoteQueue::push().
Storage::index_type h = _head, t = _tail, nt = next_i(t);
// should this stuff be in SimpleQueue::enq?
if (nt != h) {
_q[t] = p;
packet_memory_barrier(_q[t], _tail);
_tail = nt;
i... | false | false | false | false | false | 0 |
GDALDatasetShadow_WriteRaster(GDALDatasetShadow *self,int xoff,int yoff,int xsize,int ysize,GIntBig buf_len,char *buf_string,int *buf_xsize=0,int *buf_ysize=0,GDALDataType *buf_type=0,int band_list=0,int *pband_list=0,int *buf_pixel_space=0,int *buf_line_space=0,int *buf_band_space=0){
CPLErr eErr;
int nxsize =... | false | false | false | false | false | 0 |
CheckDMRules (void)
{
int i;
gclient_t *cl;
if (level.intermissiontime)
return;
if (!deathmatch->value)
return;
//FIREBLADE
if (teamplay->value)
{
CheckTeamRules ();
if (ctf->value)
{
if (CTFCheckRules ())
{
ResetPlayers ();
EndDMLevel ();
}
}
}
else /* not teamplay */
{
... | false | false | false | false | false | 0 |
MR_iterateOverTree(Tree *t,int chain[])
#else
void MR_iterateOverTree(t,chain)
Tree *t;
int chain[];
#endif
{
if (t == NULL) return;
chain[0]=t->token;
if (t->down != NULL) {
MR_iterateOverTree(t->down,&chain[1]);
} else {
MR_traceAmbSourceKclient();
};
MR_iterateOverTree(t->r... | false | false | false | false | false | 0 |
getRowBound(int iRow, double& lower, double& upper) const
{
lower = -COIN_DBL_MAX;
upper = COIN_DBL_MAX;
if (rowUpper_)
upper = rowUpper_[iRow];
if (rowLower_)
lower = rowLower_[iRow];
} | false | false | false | false | false | 0 |
error_message (CcDisplayPanel *self, const char *primary_text, const char *secondary_text)
{
GtkWidget *toplevel;
GtkWidget *dialog;
if (self && self->priv->panel)
toplevel = gtk_widget_get_toplevel (self->priv->panel);
else
toplevel = NULL;
dialog = gtk_message_dialog_new (GTK_WINDOW (toplevel),
... | false | false | false | false | false | 0 |
add_recentag(char *tag)
{
int err;
char *pp, temptags[tagRcc];
err = add_tag(tag,tags_recentags,tagRcc); // add tag to recent tags
while (err == 2) // overflow
{
strncpy0(temptags,tags_recentags,... | false | false | false | false | false | 0 |
nvkm_clk_tstate(struct nvkm_clk *clk, int req, int rel)
{
if (!rel) clk->tstate = req;
if ( rel) clk->tstate += rel;
clk->tstate = min(clk->tstate, 0);
clk->tstate = max(clk->tstate, -(clk->state_nr - 1));
return nvkm_pstate_calc(clk, true);
} | false | false | false | false | false | 0 |
is_centerpoint_elem_strict( U_CHAR el_number )
{
static U_CHAR el_numb[6];
static int len;
int i;
if ( !el_numb[0] && !len ) {
el_numb[len++] = (U_CHAR)get_periodic_table_number( "C" );
el_numb[len++] = (U_CHAR)get_periodic_table_number( "N" );
el_numb[len++] = (U_CHAR)get_period... | false | false | false | false | false | 0 |
dupmat(int l, int u, int i, int j, real_t **a, real_t **b)
{
int k;
for (; l<=u; l++)
for (k=i; k<=j; k++) a[l][k]=b[l][k];
} | false | false | false | false | false | 0 |
test19_read_static_ipv4_plen (const char *path)
{
NMConnection *connection;
NMSettingIP4Config *s_ip4;
char *unmanaged = NULL;
GError *error = NULL;
const char *expected_address = "10.0.0.3";
guint32 expected_prefix = 8;
NMIP4Address *ip4_addr;
struct in_addr addr;
#define TEST19_NAME "wired-static-verify-ip4-p... | false | false | false | false | false | 0 |
polite_kill(pid_t pid) {
struct sigaction ign_alrm, old_alrm;
memset(&ign_alrm, 0, sizeof(struct sigaction));
ign_alrm.sa_handler = sig_nop;
sigaction(SIGALRM, &ign_alrm, &old_alrm);
int ret = 0;
for (int i=0; i < sizeof(polite_kill_signals) / sizeof(int); i++) {
if (kill(pid, polite_k... | false | false | false | false | false | 0 |
op_adc_imm(/*@unused@*/ uint32_t op, const struct opinfo *oi)
{
uint8_t imm = get_imm8();
uint8_t old = gbcpu_regs.rn.a;
uint8_t new = old;
DPRINTF(" %s A, $0x%02x", oi->name, imm);
new += imm;
new += (gbcpu_regs.rn.f & CF) > 0;
gbcpu_regs.rn.f &= ~NF;
gbcpu_regs.rn.a = new;
if (old > new) gbcpu_regs.rn.f |= ... | false | false | false | false | false | 0 |
scan_reads_spill (read_info_t read_info, bitmap gen, bitmap kill)
{
while (read_info)
{
if (read_info->alias_set)
{
int index = get_bitmap_index (clear_alias_group,
read_info->alias_set);
if (index != 0)
{
if (kill)
bitmap_set_bit (kill, index);
bitmap_clear_bit (gen, index)... | false | false | false | false | false | 0 |
m41t93_probe(struct spi_device *spi)
{
struct rtc_device *rtc;
int res;
spi->bits_per_word = 8;
spi_setup(spi);
res = spi_w8r8(spi, M41T93_REG_WDAY);
if (res < 0 || (res & 0xf8) != 0) {
dev_err(&spi->dev, "not found 0x%x.\n", res);
return -ENODEV;
}
rtc = devm_rtc_device_register(&spi->dev, m41t93_driver... | false | false | false | false | false | 0 |
bmp_read_header(gdIOCtx *infile, bmp_hdr_t *hdr)
{
if(
!gdGetWordLSB(&hdr->magic, infile) ||
!gdGetIntLSB(&hdr->size, infile) ||
!gdGetWordLSB(&hdr->reserved1, infile) ||
!gdGetWordLSB(&hdr->reserved2 , infile) ||
!gdGetIntLSB(&hdr->off , infile)
) {
return 1;
}
return 0;
} | false | false | false | false | false | 0 |
document_structure_parse (DocumentStructure* self) {
StructureModel* _tmp0_ = NULL;
g_return_if_fail (self != NULL);
document_structure_set_parsing_done (self, FALSE);
_tmp0_ = structure_model_new ();
_g_object_unref0 (self->priv->_model);
self->priv->_model = _tmp0_;
_document_structure_env_data_free0 (self->pr... | false | false | false | false | false | 0 |
hash_algo_from_sigval (const unsigned char *sigval)
{
const unsigned char *s = sigval;
size_t n;
int depth;
char buffer[50];
if (!s || *s != '(')
return 0; /* Invalid S-expression. */
s++;
n = snext (&s);
if (!n)
return 0; /* Invalid S-expression. */
if (!smatch (&s, n, "sig-val"))
retu... | true | true | false | false | false | 1 |
bs_callback_table_remove(BSCallbackTable *table, gint id)
{
if (bs_callback_list_contains_callback(table->list, id)) {
bs_callback_list_remove(table->list, id);
return;
}
g_hash_table_foreach(table->table, remove_cb_from_value, &id);
} | false | false | false | false | false | 0 |
alDopplerVelocity(ALfloat value)
{
ALCcontext *Context;
Context = GetContextRef();
if(!Context) return;
if(value > 0.0f && isfinite(value))
{
Context->DopplerVelocity=value;
Context->UpdateSources = AL_TRUE;
}
else
alSetError(Context, AL_INVALID_VALUE);
ALCcont... | false | false | false | false | false | 0 |
WriteEntityInstance(FCDObject* object, xmlNode* parentNode)
{
FCDEntityInstance* entityInstance = (FCDEntityInstance*)object;
const char* instanceEntityName = GetInstanceClassTypeFCDEntityInstance(entityInstance->GetEntityType());
xmlNode* instanceNode = AddChild(parentNode, instanceEntityName);
if (!entit... | false | false | false | false | false | 0 |
device_request_disconnect(struct btd_device *device, DBusMessage *msg)
{
DBusConnection *conn = get_dbus_connection();
if (device->bonding)
bonding_request_cancel(device->bonding);
if (device->browse) {
discover_services_reply(device->browse, -ECANCELED, NULL);
browse_request_cancel(device->browse);
}
if ... | false | false | false | false | false | 0 |
gst_adder_sink_query (GstCollectPads * pads, GstCollectData * pad,
GstQuery * query, gpointer user_data)
{
gboolean res = FALSE;
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_CAPS:
{
GstCaps *filter, *caps;
gst_query_parse_caps (query, &filter);
caps = gst_adder_sink_getcaps (pad-... | false | false | false | false | false | 0 |
findMetaData(const SequencePtr& seq, const StringList& metaData, bool& isProtobuf, int typeCtx)
{
isProtobuf = false;
static const string prefix = "cpp:";
for(StringList::const_iterator q = metaData.begin(); q != metaData.end(); ++q)
{
string str = *q;
if(str.find(prefix) == 0)
{... | false | false | false | false | false | 0 |
jl_array_grow_end(jl_array_t *a, size_t inc)
{
// optimized for the case of only growing and shrinking at the end
size_t alen = a->length;
if ((alen + inc) > a->maxsize - a->offset) {
size_t newlen = a->maxsize==0 ? (inc<4?4:inc) : a->maxsize*2;
while ((alen + inc) > newlen - a->offset)
... | false | false | false | false | false | 0 |
sf_flush (SCM port)
{
scm_t_port *pt = SCM_PTAB_ENTRY (port);
SCM stream = SCM_PACK (pt->stream);
if (pt->write_pos > pt->write_buf)
{
/* write the byte. */
scm_call_1 (SCM_SIMPLE_VECTOR_REF (stream, 0),
SCM_MAKE_CHAR (*pt->write_buf));
pt->write_pos = pt->write_buf;
/* flush t... | false | false | false | false | false | 0 |
contrstats_show(struct seq_file *seq, void *v)
{
struct capi_ctr *ctr = *(struct capi_ctr **) v;
if (!ctr)
return 0;
seq_printf(seq, "%d %lu %lu %lu %lu\n",
ctr->cnr,
ctr->nrecvctlpkt,
ctr->nrecvdatapkt,
ctr->nsentctlpkt,
ctr->nsentdatapkt);
return 0;
} | false | false | false | false | false | 0 |
poly_hash(uhash_ctx_t hc, UINT32 data_in[])
{
int i;
UINT64 *data=(UINT64*)data_in;
for (i = 0; i < STREAMS; i++) {
if ((UINT32)(data[i] >> 32) == 0xfffffffful) {
hc->poly_accum[i] = poly64(hc->poly_accum[i],
hc->poly_key_8[i], p64 - 1);
... | false | false | false | false | false | 0 |
dbname(DBPROCESS * dbproc)
{
tdsdump_log(TDS_DBG_FUNC, "dbname(%p)\n", dbproc);
CHECK_PARAMETER(dbproc, SYBENULL, NULL);
return dbproc->dbcurdb;
} | false | false | false | false | false | 0 |
set_alias(DBusConnection *conn, DBusMessage *msg,
const char *alias, void *data)
{
struct btd_device *device = data;
struct btd_adapter *adapter = device->adapter;
char srcaddr[18], dstaddr[18];
bdaddr_t src;
int err;
/* No change */
if ((device->alias == NULL && g_str_equal(alias, "")) ||
g_strcmp0(dev... | false | false | false | false | false | 0 |
fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var)
{
struct fb_fix_screeninfo *fix = &info->fix;
unsigned int yres = info->var.yres;
int err = 0;
if (var->yoffset > 0) {
if (var->vmode & FB_VMODE_YWRAP) {
if (!fix->ywrapstep || (var->yoffset % fix->ywrapstep))
err = -EINVAL;
else
y... | false | false | false | false | false | 0 |
cf_section_sub_find(const CONF_SECTION *cs, const char *name)
{
CONF_ITEM *ci;
if (!name) return NULL; /* can't find an un-named section */
/*
* Do the fast lookup if possible.
*/
if (cs->section_tree) {
CONF_SECTION mycs;
mycs.name1 = name;
mycs.name2 = NULL;
return rbtree_finddata(cs->section_tree,... | false | false | false | false | false | 0 |
gck_attribute_init (GckAttribute *attr,
gulong attr_type,
const guchar *value,
gsize length)
{
g_return_if_fail (attr != NULL);
attr->type = attr_type;
if (length == G_MAXULONG) {
attr->value = NULL;
attr->length = G_MAXULONG;
} else if (value == NULL... | false | false | false | false | false | 0 |
_blob_constructor(HSQUIRRELVM v)
{
SQInteger nparam = sq_gettop(v);
SQInteger size = 0;
if(nparam == 2) {
sq_getinteger(v, 2, &size);
}
if(size < 0) return sq_throwerror(v, _SC("cannot create blob with negative size"));
SQBlob *b = new SQBlob(size);
if(SQ_FAILED(sq_setinstanceup(v,1,b))) {
delete b;
return... | false | false | false | false | false | 0 |
ReadImageData (PKV_DEV dev, int page)
{
SANE_Status status;
DBG (DBG_proc, "Reading image data for page %d\n", page);
if (IS_DUPLEX (dev))
{
DBG (DBG_proc, "ReadImageData: Duplex %d\n", page);
status = ReadImageDataDuplex (dev, page);
}
else
{
DBG (DBG_proc, "ReadImageData: Simple... | false | false | false | false | false | 0 |
cut( const MapCoordinate& pos )
{
MapField* fld = actmap->getField( pos );
if (!fld )
return;
cutPositions.push_back( pos );
if ( fld->vehicle ) {
MemoryStream stream ( &buf, tnstream::appending );
stream.writeInt( Reinforcements::ReinfVehicle );
fld->vehicle->write ( stream );
... | false | false | false | false | false | 0 |
record_cb (GtkAction *action,
GSRWindow *window)
{
if (!gsr_window_is_saved(window) && !gsr_discard_confirmation_dialog (window, FALSE))
return;
GSRWindowPrivate *priv = window->priv;
if (priv->record) {
char *current_source;
shutdown_pipeline (priv->record);
if (!make_record_source (window))
return... | false | false | false | false | false | 0 |
microread_mei_probe(struct mei_cl_device *cldev,
const struct mei_cl_device_id *id)
{
struct nfc_mei_phy *phy;
int r;
pr_info("Probing NFC microread\n");
phy = nfc_mei_phy_alloc(cldev);
if (!phy) {
pr_err("Cannot allocate memory for microread mei phy.\n");
return -ENOMEM;
}
r = microread_probe(p... | false | false | false | false | false | 0 |
jl_args_morespecific(jl_value_t *a, jl_value_t *b)
{
int msp = jl_type_morespecific(a,b,0);
if (jl_has_typevars(b)) {
if (jl_type_match_morespecific(a,b) == (jl_value_t*)jl_false) {
if (jl_has_typevars(a)) {
return 0;
}
return msp;
}
if... | false | false | false | false | false | 0 |
ar9003_rx_gain_table_mode1(struct ath_hw *ah)
{
if (AR_SREV_9330_12(ah))
INIT_INI_ARRAY(&ah->iniModesRxGain,
ar9331_common_wo_xlna_rx_gain_1p2);
else if (AR_SREV_9330_11(ah))
INIT_INI_ARRAY(&ah->iniModesRxGain,
ar9331_common_wo_xlna_rx_gain_1p1);
else if (AR_SREV_9340(ah))
INIT_INI_ARRAY(&ah->iniModesRxG... | false | false | false | false | false | 0 |
preview(int balls, int columns, int rows)
{
m_blackbox->setSize(columns, rows);
scene()->setSceneRect(0, 0, columns*KBBScalableGraphicWidget::RATIO + 2*KBBScalableGraphicWidget::BORDER_SIZE, rows*KBBScalableGraphicWidget::RATIO + 2*KBBScalableGraphicWidget::BORDER_SIZE);
// Show balls on the black box
while (m_bal... | false | false | false | false | false | 0 |
m_ShowBoundary ( Object *in, Object *out )
{
Object Xtra_output = NULL;
int option;
O_output = NULL;
if ( I_input == NULL )
DXErrorGoto2
( ERROR_MISSING_DATA,
"#10000", /* %s must be specified */ "Object" )
#if 0
/*
* Perform this check here because DXC... | false | false | false | false | false | 0 |
tm2_med_res_block(TM2Context *ctx, AVFrame *pic, int bx, int by)
{
int i;
int deltas[16];
TM2_INIT_POINTERS();
/* low-res chroma */
deltas[0] = GET_TOK(ctx, TM2_C_LO);
deltas[1] = deltas[2] = deltas[3] = 0;
tm2_low_chroma(U, Ustride, clast, ctx->CD, deltas, bx);
deltas[0] = GET_TOK(ctx... | false | false | false | false | false | 0 |
stabilizeScreenBackground(irr::video::IVideoDriver * driver,
irr::video::SColor color)
{
for(int i = 0; i < 100; ++i) // 100 - max checks
{
driver->beginScene(true, true, color);
driver->endScene();
irr::video::IImage * screenshot = driver->createScreenShot();
if (!screenshot)
return;
con... | false | false | false | false | false | 0 |
main(void)
{
int i;
struct timespec start, stop;
double elapsed;
for (i = 0; all_ciphers[i]; i++)
{
fprintf(stderr, "KAT: %11s... ", all_ciphers[i]->name);
all_ciphers[i]->selftest();
fputs("ok\n", stderr);
}
for (i = 0; all_ciphers[i]; i++)
{
wo.base ... | false | false | false | false | false | 0 |
myexp(double *acc, double val, unsigned *n, unsigned nmax)
{
if (*n < nmax)
(*n)++;
(*acc) += (val - *acc) / (double)*n;
} | false | false | false | false | false | 0 |
krb5_ccache_size(krb5_context kcontext, krb5_pointer arg, size_t *sizep)
{
krb5_error_code kret;
krb5_ccache ccache;
size_t required;
kret = EINVAL;
if ((ccache = (krb5_ccache) arg)) {
/*
* Saving FILE: variants of krb5_ccache requires at minimum:
... | false | false | false | false | false | 0 |
handle_set_type (UDisksPartition *partition,
GDBusMethodInvocation *invocation,
const gchar *type,
GVariant *options)
{
const gchar *action_id = NULL;
const gchar *message = NULL;
UDisksBlock *block = NULL;
UDisksObject *object ... | false | false | false | false | false | 0 |
_gnutls_x509_san_find_type (char *str_type)
{
if (strcmp (str_type, "dNSName") == 0)
return GNUTLS_SAN_DNSNAME;
if (strcmp (str_type, "rfc822Name") == 0)
return GNUTLS_SAN_RFC822NAME;
if (strcmp (str_type, "uniformResourceIdentifier") == 0)
return GNUTLS_SAN_URI;
if (strcmp (str_type, "iPAddress") =... | false | false | false | false | false | 0 |
assert_submodule_url_is_synced(
git_submodule *sm, const char *parent_key, const char *child_key)
{
git_config *cfg;
const char *str;
git_repository *smrepo;
cl_git_pass(git_repository_config(&cfg, g_repo));
cl_git_pass(git_config_get_string(&str, cfg, parent_key));
cl_assert_equal_s(git_submodule_url(sm), str)... | false | false | false | false | false | 0 |
skip_comment_line (std::istream & in) {
int c;
do {
c = in.get();
while ( c == '#' ) {
do {
c = in.get();
} while ( c != '\n' );
c = in.get();
}
} while (c == ' ' || c == '\t' || c == '\n');
if (c == EOF)
core_io_error_handler("CoreIO::read_from_file()","unexpected en... | false | false | false | false | false | 0 |
is_god_unit(int unitId)
{
for( int i=1 ; i<=god_res.god_count ; i++ )
{
if( god_res[i]->unit_id == unitId )
return 1;
}
return 0;
} | false | false | false | false | false | 0 |
check_owned(struct network *n)
{
/* resumed network */
if (n->n_beacon.p_len == 0)
return 0;
return n->n_astate == ASTATE_DONE;
} | false | false | false | false | false | 0 |
debug_level_params(DBusMessageIter *iter, void *user_data)
{
guint level = GPOINTER_TO_UINT(user_data);
const char *str;
if (level > 4)
level = 4;
str = debug_strings[level];
dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &str);
} | false | false | false | false | false | 0 |
ANN_Print(ANNetwork *ann)
{
printf("============= Start Neural Network =============\n\n");
// ouptut the number of layers, learning rate and momentum constant
printf("n_layers: %u learn_rate: " REAL_NUM_FORMAT " momentum: "REAL_NUM_FORMAT" \n",
ann->n_layers, ann->learn_rate, ann->momentum);
// print out t... | false | false | false | false | true | 1 |
parseRational(const std::string& s, bool& ok)
{
Rational ret = stringTo<Rational>(s, ok);
if (ok) return ret;
long l = stringTo<long>(s, ok);
if (ok) return Rational(l, 1);
float f = stringTo<float>(s, ok);
if (ok) return floatToRationalCast(f);
bool b = st... | false | false | false | false | false | 0 |
AddByteStream(const GP<ByteStream> &bs)
{
const GP<lt_XMLTags> gtags(lt_XMLTags::create(bs));
lt_XMLTags &tags=*gtags;
GPList<lt_XMLTags> Bodies=tags.get_Tags(bodystring);
if(! Bodies.isempty())
{
lt_XMLTags::get_Maps(messagestring,namestring,Bodies,Map);
}
} | false | false | false | false | false | 0 |
selector_sync (ccss_selector_t const *self,
ccss_selector_t *to)
{
g_assert (self && to);
to->modality = self->modality;
to->stylesheet_descriptor = self->stylesheet_descriptor;
to->importance = self->importance;
to->precedence = self->precedence;
to->a = self->a;
to->b = self->b;
to->c = self->c;
to... | false | false | false | false | false | 0 |
OnSendMessage(wxCommandEvent& WXUNUSED(event)) {
long index = GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
while( index != -1 ) {
// ADUNANZA BEGIN
// back
#if 0
CFriend* cur_friend = (CFriend*)GetItemData(index);
#else
CFriend* cur_friend = reinterpret_cast<CFriend*>(GetItemData(index));
#endif
/... | false | false | false | false | false | 0 |
find_item (const std::string jid)
{
PresentityPtr result;
for (iterator iter = begin (); iter != end (); ++iter) {
if ((*iter)->get_jid () == jid) {
result = *iter;
break;
}
}
return result;
} | false | false | false | false | false | 0 |
test_browse_skip (void)
{
GError *error = NULL;
GList *medias;
GrlOperationOptions *options;
GrlRegistry *registry;
GrlSource *source;
registry = grl_registry_get_default ();
source = grl_registry_lookup_source (registry, "grl-apple-trailers");
g_assert (source);
options = grl_operation_options_new (... | false | false | false | false | false | 0 |
runOnLoop(Loop *L, LPPassManager &LPM) {
if (skipOptnoneFunction(L))
return false;
// Only visit top-level loops.
if (L->getParentLoop())
return false;
// If LoopSimplify form is not available, stay out of trouble.
if (!L->isLoopSimplifyForm())
return false;
DominatorTree &DT = getAnalysis<Do... | false | false | false | false | false | 0 |
set_subquery_pathlist(PlannerInfo *root, RelOptInfo *rel,
Index rti, RangeTblEntry *rte)
{
Query *parse = root->parse;
Query *subquery = rte->subquery;
bool *differentTypes;
double tuple_fraction;
PlannerInfo *subroot;
List *pathkeys;
/*
* Must copy the Query so that planning doesn't mess ... | false | false | false | false | false | 0 |
isns_create_server_socket(const char *src_spec, const char *portspec, int af_hint, int sock_type)
{
struct addrinfo *src;
src = isns_get_address_list(src_spec, portspec,
af_hint, sock_type, AI_PASSIVE);
if (src == NULL)
return NULL;
return __isns_create_socket(src, NULL, sock_type);
} | false | false | false | false | false | 0 |
sumarr(x,n,y)
word2 *x, *y;
int n;
{
register word4 u;
unsigned carry = 0;
while(--n >= 0) {
u = *x;
u += *y++;
u += carry;
*x++ = u & 0xFFFF;
carry = (u >= 0x10000 ? 1 : 0);
}
return(carry);
} | false | false | false | false | false | 0 |
folder_item_set_batch (FolderItem *item, gboolean batch)
{
if (!item || !item->folder)
return;
if (item->folder->klass->set_batch) {
item->folder->klass->set_batch(item->folder, item, batch);
}
} | false | false | false | false | false | 0 |
tridentfb_setcolreg(unsigned regno, unsigned red, unsigned green,
unsigned blue, unsigned transp,
struct fb_info *info)
{
int bpp = info->var.bits_per_pixel;
struct tridentfb_par *par = info->par;
if (regno >= info->cmap.len)
return 1;
if (bpp == 8) {
t_outb(par, 0xFF, VGA_PEL_MSK);
t_ou... | false | false | false | false | false | 0 |
enum_fmt(struct s5p_jpeg_fmt *sjpeg_formats, int n,
struct v4l2_fmtdesc *f, u32 type)
{
int i, num = 0;
for (i = 0; i < n; ++i) {
if (sjpeg_formats[i].flags & type) {
/* index-th format of type type found ? */
if (num == f->index)
break;
/* Correct type but haven't reached our index yet,
* j... | false | false | false | false | false | 0 |
set_subqueryscan_references(PlannerGlobal *glob,
SubqueryScan *plan,
int rtoffset)
{
Plan *result;
/* First, recursively process the subplan */
plan->subplan = set_plan_references(glob, plan->subplan, plan->subrtable);
/* subrtable is no longer needed in the plan tree */
plan->subrtable = NIL;
... | false | false | false | false | false | 0 |
_sentinel_eval(Elm_Flipselector_Smart_Data *sd)
{
Elm_Flipselector_Item *it;
Eina_List *l;
if (!sd->items)
{
sd->sentinel = NULL;
return;
}
sd->sentinel = sd->items;
EINA_LIST_FOREACH (sd->items, l, it)
{
if (strlen(elm_object_item_text_get((Elm_Object_Item *)it)... | false | false | false | false | false | 0 |
dump(raw_ostream &OS) const {
const uint32_t num_ranges = getNumRanges();
for (uint32_t i = 0; i < num_ranges; ++i) {
const Range &range = Aranges[i];
OS << format("0x%8.8x: [0x%8.8llx - 0x%8.8llx)\n", range.Offset,
(uint64_t)range.LoPC, (uint64_t)range.HiPC());
}
} | false | false | false | false | false | 0 |
update_code_filenames(PyCodeObject *co, PyObject *oldname, PyObject *newname)
{
PyObject *constants, *tmp;
Py_ssize_t i, n;
if (!_PyString_Eq(co->co_filename, oldname))
return;
tmp = co->co_filename;
co->co_filename = newname;
Py_INCREF(co->co_filename);
Py_DECREF(tmp);
consta... | false | false | false | false | false | 0 |
mulcascade_init (void)
{
mul_casc *t;
t = (mul_casc *) malloc (sizeof (mul_casc));
if (t == NULL)
{
outputf (OUTPUT_ERROR, "mulcascade_init: could not allocate memory\n");
return NULL;
}
t->val = (mpz_t*) malloc (sizeof (mpz_t));
if (t->val == NULL)
{
outputf (OUTPUT_ERROR, "mul... | false | false | false | false | false | 0 |
action_camera_upload_file (GPParams *p, const char *folder, const char *path)
{
CameraFile *file;
int res;
char *fn;
gp_log (GP_LOG_DEBUG, "main", "Uploading file...");
CR (gp_file_new_from_fd (&file, -1));
res = gp_file_open (file, path);
if (res < GP_OK) {
gp_file_unref (file);
return res;
}
if (p->fil... | false | false | false | false | false | 0 |
print_ranks(opal_list_t *statlist)
{
opal_list_item_t *item;
opal_pstats_t *stats, *pstats;
int32_t minrank;
char pretty_time[10];
int i;
/* sort the results by rank */
while (0 < opal_list_get_size(statlist)) {
minrank = INT32_MAX;
pstats = NULL;
for (item = opal_li... | true | true | false | false | false | 1 |
au_new_suite(GString *suiteName,
autounit_test_setup_fp_t setup_fp,
autounit_test_teardown_fp_t teardown_fp)
{
autounit_suite_t *new_tc;
au_log_start("au_new_suite");
new_tc = g_new(autounit_suite_t,1);
new_tc->suite_name = g_string_new(suiteName->str);
new_tc->suite_status = g_strin... | false | false | false | false | false | 0 |
drop_cb (GtkWidget *widget,
GdkDragContext *context,
gint x,
gint y,
GtkSelectionData *data,
guint info,
guint _time,
TotemPlaylist *playlist)
{
char **list;
GList *p, *file_list, *mrl_list = NULL;
guint i;
GdkDragAction action;
if... | false | false | false | false | false | 0 |
linux_wlan_firmware_download(struct wilc *p_nic)
{
int ret = 0;
if (!g_linux_wlan->firmware) {
PRINT_ER("Firmware buffer is NULL\n");
ret = -ENOBUFS;
goto _FAIL_;
}
/**
* do the firmware download
**/
PRINT_D(INIT_DBG, "Downloading Firmware ...\n");
ret = wilc_wlan_firmware_download(g_linux_wlan->... | false | false | false | false | false | 0 |
Attach(Interactor* i) {
register ViewList* e;
e = new ViewList(i);
e->next = views;
views = e;
Reference();
} | false | false | false | false | false | 0 |
rem_help_reference(char *file)
{
struct help_ref *current, *last = NULL;
struct help_list_t *item;
for (current = help_list; current; last = current, current = current->next)
if (!strcmp(current->name, file)) {
while ((item = current->first)) {
current->first = item->next;
nfree(item->n... | false | false | false | false | false | 0 |
remove_dir_recursively(struct strbuf *path, int flag)
{
DIR *dir;
struct dirent *e;
int ret = 0, original_len = path->len, len;
int only_empty = (flag & REMOVE_DIR_EMPTY_ONLY);
unsigned char submodule_head[20];
if ((flag & REMOVE_DIR_KEEP_NESTED_GIT) &&
!resolve_gitlink_ref(path->buf, "HEAD", submodule_head... | true | true | false | false | false | 1 |
gee_array_queue_real_poll_tail (GeeDeque* base) {
GeeArrayQueue * self;
gpointer result = NULL;
gint _tmp0_ = 0;
gint _tmp1_ = 0;
self = (GeeArrayQueue*) base;
_tmp0_ = self->priv->_stamp;
self->priv->_stamp = _tmp0_ + 1;
_tmp1_ = self->priv->_length;
if (_tmp1_ == 0) {
self->priv->_start = 0;
result = NUL... | false | false | false | false | false | 0 |
main(){
//Create a board to hold the goal state.
int **board;
board = new int*[NUM_ROWS_ON_BOARD];
for(int i = 0 ; i < NUM_ROWS_ON_BOARD; i++)
{
board[i] = new int[NUM_COLS_ON_BOARD];
}
board[0][0] = 1;
board[0][1] = 2;
board[0][2] = 3;
board[1][0] = 8;
board[1][1] = 0;
board[1][2] = 4;
board[2][0] ... | false | false | false | false | false | 0 |
gnm_pane_display_object_menu (GnmPane *pane, SheetObject *so, GdkEvent *event)
{
SheetControlGUI *scg = pane->simple.scg;
GPtrArray *actions = g_ptr_array_new ();
GtkWidget *menu;
unsigned i = 0;
if (NULL != so && (!scg->selected_objects ||
NULL == g_hash_table_lookup (scg->selected_objects, so)))
scg_obje... | false | false | false | false | false | 0 |
OnProjectLoadingHook(cbProject* prj, TiXmlElement* elem, bool loading)
{
m_InitDone = true;
if (!prj || !elem)
return; // ?! Should actually NOT happen...
if (loading)
{
#if defined(TRACE_EC)
Manager::Get()->GetLogManager()->DebugLog(_T("EditorConfig::OnProjectLoadingHook(LOAD)"));
#en... | false | false | false | false | false | 0 |
go_component_build_snapshot (GOComponent *component)
{
cairo_surface_t *surface;
cairo_t *cr;
cairo_status_t status;
GOSnapshotType res;
struct write_state state;
g_return_val_if_fail (GO_IS_COMPONENT (component), GO_SNAPSHOT_NONE);
state.output = gsf_output_memory_new ();
state.length = 0;
switch (componen... | false | true | false | false | false | 1 |
cpp_make_system_header (cpp_reader *pfile, int syshdr, int externc)
{
int flags = 0;
/* 1 = system header, 2 = system header to be treated as C. */
if (syshdr)
flags = 1 + (externc != 0);
_cpp_do_file_change (pfile, LC_RENAME, pfile->map->to_file,
SOURCE_LINE (pfile->map, pfile->line), flags);
} | false | false | false | false | false | 0 |
PR_GetLine(PRFileDesc *fd, char *s, unsigned int n)
{
PRInt32 start, newstart;
int x;
char *p;
/* grab current location in file */
start = PR_Seek(fd, 0, PR_SEEK_CUR);
x = PR_Read(fd, s, n-1);
if (x <= 0) return 1; /* EOF or other error */
s[x] = 0;
p = strchr(s, '\n');
if (p ... | false | false | false | false | false | 0 |
mei_txe_write(struct mei_device *dev,
struct mei_msg_hdr *header, unsigned char *buf)
{
struct mei_txe_hw *hw = to_txe_hw(dev);
unsigned long rem;
unsigned long length;
int slots = dev->hbuf_depth;
u32 *reg_buf = (u32 *)buf;
u32 dw_cnt;
int i;
if (WARN_ON(!header || !buf))
return -EINVAL;
length = header... | false | false | false | false | false | 0 |
get_edge_adjust(e_id,w)
edge_id e_id;
REAL *w;
{
REAL x[MAXCOORD];
int i ;
for ( i = 0 ; i < SDIM ; i++ ) x[i] = 0.0;
(*sym_wrap)(x,w,get_edge_wrap(e_id));
} | 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.