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 |
|---|---|---|---|---|---|---|
PrintSelf(std::ostream & os, Indent indent) const
{
Superclass::PrintSelf(os, indent);
// Print state vector contents
os << indent << "State vector: " << state << std::endl;
os << indent;
const IntegerType *s = state;
int i = StateVectorLength;
for (; i--; os << *s++ << "\t" ) {}
os << std::endl;
//... | false | false | false | false | false | 0 |
H5HF_sect_indirect_shrink(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect)
{
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
/* Sanity check parameters */
HDassert(hdr);
HDassert(sect);
... | false | false | false | false | false | 0 |
find_merges_cvsnt(rcsfile_t *rcs)
{
int i;
if(!conf.merge_cvsnt)
return;
for(i = 0; i < rcs->nsrev; i++)
{
revision_t **r;
if(!rcs->srev[i]->delta->mergepoint)
continue;
r = bsearch(rcs->srev[i]->delta->mergepoint->rev, rcs->srev, rcs->nsrev, sizeof(rcs->srev[0]), search_revision);
if(!r)
contin... | false | false | false | false | false | 0 |
unknownSafe( const QString &s ) const
{
return ( s.isNull() || s.isEmpty() || s == "?" || s == "-" )
? i18nc( "The value for this tag is not known", "Unknown" )
: s;
} | false | false | false | false | false | 0 |
ti_close(tabix_t *t)
{
if (t) {
bgzf_close(t->fp);
if (t->idx) ti_index_destroy(t->idx);
free(t->fn); free(t->fnidx);
free(t);
}
} | false | false | false | false | false | 0 |
yMargin(unsigned yMargin_)
{
if (yMargin()!=yMargin_)
{
_yMargin=yMargin_;
redraw();
}
} | false | false | false | false | false | 0 |
node_good(struct node *node)
{
return
node->pinged <= 2 &&
node->reply_time >= now.tv_sec - 7200 &&
node->time >= now.tv_sec - 900;
} | false | false | false | false | false | 0 |
sonypi_compat_init(void)
{
int error;
spin_lock_init(&sonypi_compat.fifo_lock);
error =
kfifo_alloc(&sonypi_compat.fifo, SONY_LAPTOP_BUF_SIZE, GFP_KERNEL);
if (error) {
pr_err("kfifo_alloc failed\n");
return error;
}
init_waitqueue_head(&sonypi_compat.fifo_proc_list);
if (minor != -1)
sonypi_misc_devi... | false | false | false | false | false | 0 |
jpeg_parse_exif (JpegExifContext *context, j_decompress_ptr cinfo)
{
jpeg_saved_marker_ptr cmarker;
/* check for interesting Exif markers */
cmarker = cinfo->marker_list;
while (cmarker != NULL) {
if (cmarker->marker == JPEG_APP0+1)
jpeg_parse_exif_app1 (context, cmarker);
else if (cmarker->marker == JPEG_A... | false | false | false | false | false | 0 |
checkComparisonOfFuncReturningBool()
{
if (!_settings->isEnabled("style"))
return;
if (!_tokenizer->isCPP())
return;
const SymbolDatabase * const symbolDatabase = _tokenizer->getSymbolDatabase();
const std::size_t functionsCount = symbolDatabase->functionScopes.size();
for (std::s... | false | false | false | false | false | 0 |
_getHardwareVertexBuffer(const VertexData* origData) const
{
size_t numVertices = origData->vertexCount;
if (mBuffer.isNull())
{
// Create buffer
size_t vertexSize = VertexElement::getTypeSize(VET_FLOAT3);
bool normals = getIncludesNormals();
... | false | false | false | false | false | 0 |
creature_set_target(creature_t *creature, int target_id) {
// Sich selbst als Ziel macht nie Sinn.
if (target_id == creature->vm_id)
return 0;
// Nicht vorhanden?
if (!creature_by_id(target_id))
return 0;
// Nicht mehr pruefen, da sich das Ziel bereits in dieser
// Runde toeten... | false | false | false | false | false | 0 |
mono_seq_point_find_next_by_native_offset (MonoSeqPointInfo* info, int native_offset, SeqPoint* seq_point)
{
SeqPointIterator it;
mono_seq_point_iterator_init (&it, info);
while (mono_seq_point_iterator_next (&it)) {
if (it.seq_point.native_offset >= native_offset) {
memcpy (seq_point, &it.seq_point, sizeof (Se... | false | false | false | false | false | 0 |
drbg_hmac_generate(struct drbg_state *drbg,
unsigned char *buf,
unsigned int buflen,
struct list_head *addtl)
{
int len = 0;
int ret = 0;
struct drbg_string data;
LIST_HEAD(datalist);
/* 10.1.2.5 step 2 */
if (addtl && !list_empty(addtl)) {
ret = drbg_hmac_update(drbg, addtl, 1);
i... | false | true | false | false | false | 1 |
dgl_edge_prioritizer_del(dglGraph_s * pG, dglInt32_t nId,
dglInt32_t nPriId)
{
dglTreeEdgePri32_s findPriItem, *pPriItem;
register int iEdge1, iEdge2;
dglInt32_t *pnNew;
if (pG->edgePrioritizer.pvAVL) {
findPriItem.nKey = nPriId;
pPriItem = avl_find(pG->edgePrioritizer.pvAVL, &findPriItem);
... | false | true | false | false | false | 1 |
genBox(boxf bb0, ginfo * info, int ssize, int margin, point center, char* s)
{
PointSet *ps;
int W, H;
point UR, LL;
box bb;
int x, y;
BF2B(bb0, bb);
ps = newPS();
LL.x = center.x - margin;
LL.y = center.y - margin;
UR.x = center.x + bb.UR.x - bb.LL.x + margin;
UR.y = cente... | false | false | false | false | false | 0 |
script_autoload(name, reload)
char_u *name;
int reload; /* load script again when already loaded */
{
char_u *p;
char_u *scriptname, *tofree;
int ret = FALSE;
int i;
/* Return quickly when autoload disabled. */
if (no_autoload)
return FALSE;
/* If there is no '#' after name... | false | false | false | false | false | 0 |
newhistory(n)
int n;
{
int i, size;
if (n < 0 || n >= HISTTYPES) return(-1);
size = (int)histsize[n];
if (size > histbufsize[n]) {
i = (history[n]) ? histbufsize[n] + 1 : 0;
history[n] = (char **)Xrealloc(history[n],
(size + 1) * sizeof(char *));
while (i <= size) history[n][i++] = NULL;
histbufsize[n] ... | false | false | false | false | false | 0 |
fz_new_buffer(fz_context *ctx, int size)
{
fz_buffer *b;
size = size > 1 ? size : 16;
b = fz_malloc_struct(ctx, fz_buffer);
b->refs = 1;
fz_try(ctx)
{
b->data = fz_malloc(ctx, size);
}
fz_catch(ctx)
{
fz_free(ctx, b);
fz_rethrow(ctx);
}
b->cap = size;
b->len = 0;
b->unused_bits = 0;
return b;
} | false | false | false | false | false | 0 |
sftk_IsWeakKey(unsigned char *key,CK_KEY_TYPE key_type)
{
switch(key_type) {
case CKK_DES:
return sftk_CheckDESKey(key);
case CKM_DES2_KEY_GEN:
if (sftk_CheckDESKey(key)) return PR_TRUE;
return sftk_CheckDESKey(&key[8]);
case CKM_DES3_KEY_GEN:
if (sftk_CheckDESKey(key)) return PR_TRUE;
if (sftk_Ch... | false | false | false | false | false | 0 |
simple_object_write_add_data (simple_object_write *sobj ATTRIBUTE_UNUSED,
simple_object_write_section *section,
const void *buffer,
size_t size, int copy,
int *err ATTRIBUTE_UNUSED)
{
struct simple_object_write_section_buffer *wsb;
wsb = XNEW (struct simple_object_write_section_... | false | false | false | false | false | 0 |
ajFmtString(const char *fmt, ...)
{
char *str;
va_list ap;
assert(fmt);
va_start(ap, fmt);
str = ajFmtVString(fmt, ap);
va_end(ap);
return str;
} | false | false | false | false | false | 0 |
oaktrail_lvds_commit(struct drm_encoder *encoder)
{
struct drm_device *dev = encoder->dev;
struct drm_psb_private *dev_priv = dev->dev_private;
struct gma_encoder *gma_encoder = to_gma_encoder(encoder);
struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev;
if (mode_dev->backlight_duty_cycle == 0)
mode_d... | false | false | false | false | false | 0 |
dayOfWeek(const char* nameOfDay)
#else
Date::dayTy Date::dayOfWeek(const char* nameOfDay)
#endif
/*
Returns the number, 1-7, of the day of the week named nameOfDay.
*/
{
{
String s(nameOfDay);
register unsigned len = s.length();
if (len > 2) {
for (register unsigned i =0; i<7; i++)
if (s.case_insensitive_... | false | false | false | false | false | 0 |
enc_start_array(Encoder* e)
{
e->count++;
e->shiftcnt++;
if(!enc_char(e, '['))
return 0;
MAYBE_PRETTY(e);
return 1;
} | false | false | false | false | false | 0 |
get_alpha_tile_info(int tile_index)
{
UINT16 data = atarigen_alpha32[tile_index / 2] >> (16 * (~tile_index & 1));
int code = data & 0xfff;
int color = (data >> 12) & 0x0f;
SET_TILE_INFO(1, code, color, 0);
} | false | false | false | false | false | 0 |
closest_point (struct Bond *list, LLINT * x, LLINT * y,
const LLINT sensibility)
{
double best = VERY_BIG;
LLINT x_save, y_save;
struct Bond *current;
if (list == NULL)
return 0;
x_save = *x;
y_save = *y;
current = list;
do
{
if (SQR (x_save - current->x1) + SQR (y_save - current... | false | false | false | false | false | 0 |
add_step_line(int num,const Glib::ustring& f_line)
{
Gtk::TreeModel::iterator iter = m_refTreeModel->append();
(*iter)[m_columns.step_line] = f_line;
(*iter)[m_columns.step_num] = num;
(*iter)[m_columns.step_bout] = (int)((num+1)/2);
if((num%2) ==0){
(*iter)[m_columns.player] = _("Black");
}
else{
(*iter)[m_... | false | false | false | false | false | 0 |
getValue(unsigned int i) const
{
double z = 0;
switch(_outcome[i]) {
case BGLM_NORMAL:
z = CHILD(i)->value(_chain)[0];
break;
case BGLM_PROBIT: case BGLM_LOGIT:
z = _z[i];
break;
}
return z;
} | false | false | false | false | false | 0 |
sgen_gc_unlock (void)
{
gboolean try_free = sgen_try_free_some_memory;
sgen_try_free_some_memory = FALSE;
mono_mutex_unlock (&gc_mutex);
MONO_GC_UNLOCKED ();
if (try_free)
mono_thread_hazardous_try_free_some ();
} | false | false | false | false | false | 0 |
pm8001_ctl_mpi_interface_rev_show(struct device *cdev,
struct device_attribute *attr, char *buf)
{
struct Scsi_Host *shost = class_to_shost(cdev);
struct sas_ha_struct *sha = SHOST_TO_SAS_HA(shost);
struct pm8001_hba_info *pm8001_ha = sha->lldd_ha;
if (pm8001_ha->chip_id == chip_8001) {
return snprintf(buf, PAG... | false | false | false | false | false | 0 |
GetClosestGraveYard(Player* player)
{
BattleGroundTeamIndex teamIndex = GetTeamIndexByTeamId(player->GetTeam());
// Is there any occupied node for this team?
std::vector<uint8> nodes;
for (uint8 i = 0; i < BG_AB_NODES_MAX; ++i)
if (m_Nodes[i] == teamIndex + 3)
nodes.push_back(i);
... | false | false | false | false | false | 0 |
pwm_info(struct nvkm_therm *therm, int line)
{
struct nvkm_subdev *subdev = &therm->subdev;
struct nvkm_device *device = subdev->device;
u32 gpio = nvkm_rd32(device, 0x00d610 + (line * 0x04));
switch (gpio & 0x000000c0) {
case 0x00000000: /* normal mode, possibly pwm forced off by us */
case 0x00000040: /* nvio ... | false | false | false | false | false | 0 |
init()
{
Min::init();
if (linestyle == 0) linemin = &MinLineSearch::linemin_backtrack;
else if (linestyle == 1) linemin = &MinLineSearch::linemin_quadratic;
else if (linestyle == 2) linemin = &MinLineSearch::linemin_forcezero;
delete [] gextra;
delete [] hextra;
gextra = hextra = NULL;
delete [] x0ex... | false | false | false | false | false | 0 |
curbufIsChanged()
{
return
#ifdef FEAT_QUICKFIX
!bt_dontwrite(curbuf) &&
#endif
(curbuf->b_changed || file_ff_differs(curbuf, TRUE));
} | false | false | false | false | false | 0 |
gbemol_utils_get_selected (GtkTreeView* tvw)
{
GtkTreeModel *model;
GtkTreeSelection *select;
GList *rows = NULL;
select = gtk_tree_view_get_selection (tvw);
if (gtk_tree_selection_count_selected_rows (select) > 0)
{
rows = gtk_tree_selection_get_selected_rows (select, &model);
return rows;
}
else
retur... | false | false | false | false | false | 0 |
add_children (ClutterScript *script,
ObjectInfo *oinfo)
{
ClutterContainer *container = CLUTTER_CONTAINER (oinfo->object);
GList *l, *unresolved;
unresolved = NULL;
for (l = oinfo->children; l != NULL; l = l->next)
{
const gchar *name = l->data;
GObject *object = NULL;
Ob... | false | false | false | false | false | 0 |
fcallprop_vpiget(struct h_t *hp, int32 prop)
{
int32 pval;
struct sy_t *fsyp;
struct sysfunc_t *sfbp;
struct task_t *tskp;
struct net_t *np;
struct hrec_t *hrp;
hrp = hp->hrec;
pval = 0;
/* case 1: user function call */
if (hrp->htyp == vpiFuncCall)
{
fsyp = hrp->hu.hxp->lu.x->lu.sy;
switch (prop) {
... | false | false | false | true | false | 1 |
print_caller (char *str, int size, call_frame_t *frame)
{
server_state_t *state = NULL;
GF_VALIDATE_OR_GOTO ("server", str, out);
GF_VALIDATE_OR_GOTO ("server", frame, out);
state = CALL_STATE (frame);
snprintf (str, size,
" Callid=%"PRId64", Client=%s",
... | false | false | false | false | false | 0 |
readMorphKeyFrame(DataStreamPtr& stream, VertexAnimationTrack* track)
{
// float time
float timePos;
readFloats(stream, &timePos, 1);
VertexMorphKeyFrame* kf = track->createVertexMorphKeyFrame(timePos);
// Create buffer, allow read and use shadow buffer
size_t verte... | false | false | false | false | false | 0 |
inabook_fldr_types(int indexarg)
{
static NAMEVAL_S inabook_fldr_list[] = {
{"Don't care, always matches", "E", IAB_EITHER},
{"Yes, in any address book", "YES", IAB_YES},
{"No, not in any address book", "NO", IAB_NO},
{"Yes, in specific address books", "SYES", IAB_SPEC_YES},
{"No, not in any of specific... | false | false | false | false | false | 0 |
setSuggestionsMethod(const QString &method)
{
QString requestMethod = method.toLower();
if (!m_requestMethods.contains(requestMethod))
return;
m_suggestionsMethod = requestMethod;
} | false | false | false | false | false | 0 |
drbd_single_open(struct file *file, int (*show)(struct seq_file *, void *),
void *data, struct kref *kref,
void (*release)(struct kref *))
{
struct dentry *parent;
int ret = -ESTALE;
/* Are we still linked,
* or has debugfs_remove() already been called? */
parent = file->f_path.dentry->d_pa... | false | false | false | false | false | 0 |
setEaseControllers(const hsTArray<class plEaseController*>& controllers) {
DeallocControllers();
AllocControllers(controllers.getSize());
for (size_t i=0; i<controllers.getSize(); i++)
fEaseControllers[i] = controllers[i];
} | false | false | false | false | false | 0 |
joy_flush()
{
int i;
joy_button_info *bi;
if ( joy_num_sticks < 1 )
return;
for ( i = 0; i < JOY_TOTAL_BUTTONS; i++) {
bi = &joy_buttons[i];
bi->actual_state = 0;
bi->state = 0;
bi->down_count = 0;
bi->up_count = 0;
bi->down_time = 0;
bi->last_down_check = timer_get_millisecond... | false | false | false | false | false | 0 |
test_diff_index__0(void)
{
/* grabbed a couple of commit oids from the history of the attr repo */
const char *a_commit = "26a125ee1bf"; /* the current HEAD */
const char *b_commit = "0017bd4ab1ec3"; /* the start */
git_tree *a = resolve_commit_oid_to_tree(g_repo, a_commit);
git_tree *b = resolve_commit_oid_to_tre... | false | false | false | false | false | 0 |
parse_call(struct vcc *tl)
{
vcc_NextToken(tl);
ExpectErr(tl, ID);
vcc_AddCall(tl, tl->t);
vcc_AddRef(tl, tl->t, SYM_SUB);
Fb(tl, 1, "if (VGC_function_%.*s(sp))\n", PF(tl->t));
Fb(tl, 1, "\treturn (1);\n");
vcc_NextToken(tl);
return;
} | false | false | false | false | false | 0 |
removeAll()
{
QFile::remove(configDirectory(false) + iniName);
QFile::remove(configDirectory(false) + dbName);
QFile::remove(configDirectory(false) + historyName);
QFile::remove(configDirectory(true) + iniName);
QFile::remove(configDirectory(true) + dbName);
QFile::remove(configDirectory(true) + historyName);
} | false | false | false | false | false | 0 |
rmi_raw_event(struct hid_device *hdev,
struct hid_report *report, u8 *data, int size)
{
size = rmi_check_sanity(hdev, data, size);
if (size < 2)
return 0;
switch (data[0]) {
case RMI_READ_DATA_REPORT_ID:
return rmi_read_data_event(hdev, data, size);
case RMI_ATTN_REPORT_ID:
return rmi_input_event(hdev, da... | false | false | false | false | false | 0 |
breadth_rec(int cubos_lado) {
Square cubo;
sMarching_Square m_cubo;
bool salir = false;
QList<Square> cubos;
cubo.setHalfEdge(largo_mundo/(2*cubos_lado));
double x = 0;
double y = 0;
static const double iteration_square_val = 0.5;
for(double i=mundo.minX; i<=mundo.maxX; i+=ite... | false | false | false | false | false | 0 |
sync_inode_page(struct dnode_of_data *dn)
{
if (IS_INODE(dn->node_page) || dn->inode_page == dn->node_page) {
update_inode(dn->inode, dn->node_page);
} else if (dn->inode_page) {
if (!dn->inode_page_locked)
lock_page(dn->inode_page);
update_inode(dn->inode, dn->inode_page);
if (!dn->inode_page_locked)
u... | false | false | false | false | false | 0 |
mms114_setup_regs(struct mms114_data *data)
{
const struct mms114_platform_data *pdata = data->pdata;
int val;
int error;
error = mms114_get_version(data);
if (error < 0)
return error;
error = mms114_set_active(data, true);
if (error < 0)
return error;
val = (pdata->x_size >> 8) & 0xf;
val |= ((pdata->y... | false | false | false | false | false | 0 |
param_value(int i)const
{itested();
switch (COMMON_SWITCH::param_count() - 1 - i) {
case 0: return (_ic == _ON) ? "1" : "0";
default: return COMMON_COMPONENT::param_value(i);
}
} | false | false | false | false | false | 0 |
visu_data_node_newWithCallbacks(const gchar *name,
VisuDataNodeFromStringFunc setAsString,
VisuDataNodeToStringFunc getAsString)
{
VisuDataNode *data;
g_return_val_if_fail(name, (GObject*)0);
g_return_val_if_fail(setAsString && get... | false | false | false | false | false | 0 |
index_iterator__current(
git_iterator *self, const git_index_entry **entry)
{
index_iterator *ii = (index_iterator *)self;
git_index_entry *ie = git_index_get(ii->index, ii->current);
if (ie != NULL &&
ii->base.end != NULL &&
git__prefixcmp(ie->path, ii->base.end) > 0)
{
ii->current = git_index_entrycount(i... | false | false | false | false | false | 0 |
mtdoops_workfunc_erase(struct work_struct *work)
{
struct mtdoops_context *cxt =
container_of(work, struct mtdoops_context, work_erase);
struct mtd_info *mtd = cxt->mtd;
int i = 0, j, ret, mod;
/* We were unregistered */
if (!mtd)
return;
mod = (cxt->nextpage * record_size) % mtd->erasesize;
if (mod != 0)... | false | false | false | false | false | 0 |
get_key_value (key)
char *key;
{
char *prefix = 0;
#ifdef _WIN32
prefix = lookup_key (key);
#endif
if (prefix == 0)
prefix = getenv (concat (key, "_ROOT", NULL_PTR));
return prefix;
} | false | false | false | false | false | 0 |
vhd_checksum (uae_u8 *p, int offset)
{
int i;
uae_u32 sum;
sum = 0;
for (i = 0; i < 512; i++) {
if (offset >= 0 && i >= offset && i < offset + 4)
continue;
sum += p[i];
}
return ~sum;
} | false | false | false | false | false | 0 |
badcache_resize(dns_badcache_t *bc, isc_time_t *now, isc_boolean_t grow) {
dns_bcentry_t **new, *bad, *next;
unsigned int newsize, i;
if (grow)
newsize = bc->size * 2 + 1;
else
newsize = (bc->size - 1) / 2;
new = isc_mem_get(bc->mctx, sizeof(dns_bcentry_t *) * newsize);
if (new == NULL)
return (ISC_R_NOME... | false | false | false | false | false | 0 |
is_tm_builtin (const_tree fndecl)
{
if (fndecl == NULL)
return false;
if (decl_is_tm_clone (fndecl))
return true;
if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL)
{
switch (DECL_FUNCTION_CODE (fndecl))
{
case BUILT_IN_TM_COMMIT:
case BUILT_IN_TM_COMMIT_EH:
case BUILT_IN_TM_ABORT:
case... | false | false | false | false | false | 0 |
ap_dbd_acquire(request_rec *r)
{
dbd_acquire_t *acq;
while (!ap_is_initial_req(r)) {
if (r->prev) {
r = r->prev;
}
else if (r->main) {
r = r->main;
}
}
acq = ap_get_module_config(r->request_config, &dbd_module);
if (!acq) {
acq = apr_... | false | false | false | false | false | 0 |
ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_RngGetBytes (gpointer handle, MonoArray *arry)
{
gint file = GPOINTER_TO_INT (handle);
guint32 len = mono_array_length (arry);
guchar *buf = mono_array_addr (arry, guchar, 0);
if (egd) {
const char *socket_path = g_getenv ("MONO_EGD_SOCKET");
/* e... | false | false | false | false | false | 0 |
Curl_strerror(struct connectdata *conn, int err)
{
char *buf, *p;
size_t max;
curlassert(conn);
curlassert(err >= 0);
buf = conn->syserr_buf;
max = sizeof(conn->syserr_buf)-1;
*buf = '\0';
#ifdef USE_WINSOCK
#ifdef _WIN32_WCE
buf[0]=0;
{
wchar_t wbuf[256];
FormatMessage(FORMAT_MESSAGE_FRO... | false | false | false | false | false | 0 |
check_trusted(char *host)
{
int i;
check_unknown(host);
for (i = 0; i < trusted_host_num; i++)
if ((wildmat(host, prog_config.trusted[i])) ||
(wildmat(ip_address, prog_config.trusted[i]))) {
syslog(LOG_NOTICE, "Finger from %s %s",
host, prog_config.p_strings[D_TRUST_HOST]);
return(TRUE);... | false | false | false | false | false | 0 |
do_timeout(int x)
{
(void)x;
if (timeout_flag == 0) {
timeout_flag = 1;
alarm(2);
signal(SIGALRM, do_timeout);
} else {
/* something has gone wrong ... exit */
exit(1);
}
} | false | false | false | false | false | 0 |
dig_fread(void *ptr, size_t size, size_t nmemb, GVFILE *file)
{
long tot;
size_t cnt;
if (file->loaded) { /* using memory */
if (file->current >= file->end) { /* EOF */
return 0;
}
tot = size * nmemb;
cnt = nmemb;
if (file->current + tot > file->end) {
tot = file->end - file->current;
c... | false | false | false | false | false | 0 |
propIffr(const Theorem& iffr_th,
int p,
const Theorem& a_th,
const Theorem& b_th)
{
int a(-1), b(-1);
if(CHECK_PROOFS)
CHECK_SOUND(p == 0 || p == 1 || p == 2,
"SearchEngineTheoremPro... | false | false | false | false | false | 0 |
Scm_DeleteDuplicatesX(ScmObj list, int cmpmode)
{
ScmObj lp;
SCM_FOR_EACH(lp, list) {
ScmObj obj = SCM_CAR(lp);
ScmObj tail = Scm_DeleteX(obj, SCM_CDR(lp), cmpmode);
if (SCM_CDR(lp) != tail) SCM_SET_CDR(lp, tail);
}
return list;
} | false | false | false | false | false | 0 |
can_convert_arg_bad (tree to, tree from, tree arg, int flags,
tsubst_flags_t complain)
{
conversion *t;
void *p;
/* Get the high-water mark for the CONVERSION_OBSTACK. */
p = conversion_obstack_alloc (0);
/* Try to perform the conversion. */
t = implicit_conversion (to, from, arg, /*c_cast_p=*/fa... | false | false | false | false | false | 0 |
vrf_get_rtable(const struct net_device *dev,
const struct flowi4 *fl4)
{
struct rtable *rth = NULL;
if (!(fl4->flowi4_flags & FLOWI_FLAG_L3MDEV_SRC)) {
struct net_vrf *vrf = netdev_priv(dev);
rth = vrf->rth;
atomic_inc(&rth->dst.__refcnt);
}
return rth;
} | false | false | false | false | false | 0 |
readHeaderLine(
mpStreamPtr mpp,
char *attr,
int attrSpace,
char *value,
int valueSpace)
{
int attrLen = 0;
int valueLen = 0;
int valueFound = 0;
while (1) {
char d[1];
int got = mpRead(mpp, d, 1);
if (got != 1) {
return 0;
}
if (d[0] == '\r') {
got = mpRead(mpp, d, 1);
if (got == 1) {
... | false | false | false | false | false | 0 |
operator=(const DigitList& other)
{
if (this != &other)
{
uprv_memcpy(&fContext, &other.fContext, sizeof(decContext));
if (other.fStorage.getCapacity() > fStorage.getCapacity()) {
fDecNumber = fStorage.resize(other.fStorage.getCapacity());
}
// Always reset the fCont... | false | false | false | false | false | 0 |
optionally_create_toast_tables(void)
{
int dbnum;
prep_status("Creating newly-required TOAST tables");
for (dbnum = 0; dbnum < new_cluster.dbarr.ndbs; dbnum++)
{
PGresult *res;
int ntups;
int rowno;
int i_nspname,
i_relname;
DbInfo *active_db = &new_cluster.dbarr.dbs[dbnum];
PGconn ... | false | false | false | false | false | 0 |
applicable ( const TBox::TSimpleRule& rule )
{
BipolarPointer bp = curConcept.bp();
const CWDArray& lab = curNode->label().getLabel(dtPConcept);
// dep-set to keep track for all the concepts in a rule-head
DepSet loc = curConcept.getDep();
for ( TBox::TSimpleRule::const_iterator p = rule.Body.begin(), p_end = rul... | false | false | false | false | false | 0 |
setup_xattr(struct archive_read_disk *a,
struct archive_entry *entry, const char *name, int fd)
{
ssize_t size;
void *value = NULL;
const char *accpath;
(void)fd; /* UNUSED */
accpath = archive_entry_sourcepath(entry);
if (accpath == NULL)
accpath = archive_entry_pathname(entry);
... | false | false | false | false | false | 0 |
boxComplexity (Tree box)
{
Tree prop = box->getProperty(BCOMPLEXITY);
if (prop) {
return tree2int(prop);
} else {
int v = computeBoxComplexity(box);
box->setProperty(BCOMPLEXITY,tree(v));
return v;
}
} | false | false | false | false | false | 0 |
read_16(IOBUF inp)
{
unsigned short a;
a = (unsigned short)iobuf_get_noeof(inp) << 8;
a |= iobuf_get_noeof(inp);
return a;
} | false | false | false | false | false | 0 |
_cb_sort(const void *data1, const void *data2)
{
const Evry_Item *it1 = data1;
const Evry_Item *it2 = data2;
const Evry_Action *act1 = data1;
const Evry_Action *act2 = data2;
if (act1->remember_context || act2->remember_context)
{
if (act1->remember_context && !act2->remember_context)
... | false | false | false | false | false | 0 |
main(int argc, char **argv) {
int opt;
int i;
// yydebug = 1;
while ((opt = getopt(argc, argv, "dO:phs:")) >= 0) {
switch (opt) {
case 'd': debug = 1; break;
case 'O': optimized = 1; resched_buf_len = atoi(optarg); break;
case 'p': profile = 1; break;
case 'h': help(); return 0;
case 's': stall_r... | false | false | false | false | true | 1 |
shortcut_init (win_struct *win)
{
GdkWindow *root_gdk;
root_gdk=gdk_screen_get_root_window (gdk_screen_get_default());
gdk_error_trap_push();
XGrabKey(GDK_DISPLAY(), win->shortcut_key , win->shortcut_modifier,
GDK_ROOT_WINDOW(), True ,GrabModeAsync,GrabModeAsync);
if (gdk_error_trap_pop()) {
pr... | false | false | false | false | false | 0 |
save_savefile()
{
char base[_MAX_FNAME] = { '\0' };
std::ostringstream buf;
if (Game_mode & GM_MULTIPLAYER) {
return false;
}
// set player ptr first thing
Assert( (Player_num >= 0) && (Player_num < MAX_PLAYERS) );
p = &Players[Player_num];
if ( !strlen(Campaign.filename) ) {
return false;
}
// build ... | false | false | false | false | false | 0 |
nmc94cX6_get_addr(struct nmc93cX6_group *g,u_int cmd)
{
switch(g->eeprom_type) {
case EEPROM_TYPE_NMC93C46:
return((cmd >> 3) & 0x3f);
case EEPROM_TYPE_NMC93C56:
return(m_reverse_u8((cmd >> 3) & 0xff));
default:
return(0);
}
} | false | false | false | false | false | 0 |
mmc_start_host(struct mmc_host *host)
{
host->f_init = max(freqs[0], host->f_min);
host->rescan_disable = 0;
host->ios.power_mode = MMC_POWER_UNDEFINED;
mmc_claim_host(host);
if (host->caps2 & MMC_CAP2_NO_PRESCAN_POWERUP)
mmc_power_off(host);
else
mmc_power_up(host, host->ocr_avail);
mmc_release_host(host);... | false | false | false | false | false | 0 |
traverse(TIntermTraverser* it)
{
if (it->visitSymbol)
it->visitSymbol(this, it);
} | false | false | false | false | false | 0 |
write_globalrec(file_info *global_info, long file_offset)
{
uchar *file_data;
if (int_buff) {
set_ibuff(file_offset,compute_recsize(global_info));
file_data=get_ibuff(0);
} else {
bw_setblock(file_offset, 1, compute_recsize(global_info));
file_data=bw_getbuff(0);
}
write_filerec(global_info,... | false | false | false | false | false | 0 |
CAST_encrypt(CAST_LONG *data, const CAST_KEY *key)
{
register CAST_LONG l,r,t;
const register CAST_LONG *k;
k= &(key->data[0]);
l=data[0];
r=data[1];
E_CAST( 0,k,l,r,+,^,-);
E_CAST( 1,k,r,l,^,-,+);
E_CAST( 2,k,l,r,-,+,^);
E_CAST( 3,k,r,l,+,^,-);
E_CAST( 4,k,l,r,^,-,+);
E_CAST( 5,k,r,l,-,+,^);
E_CAST( 6,k... | false | false | false | false | false | 0 |
pcx_errormsg(int error_number)
{
char *p = pcx_error_messages;
while (error_number--) {
if (!p) return NULL;
p += strlen(p)+1;
}
return p;
} | false | false | false | false | false | 0 |
update_coverage(rb_event_flag_t event, VALUE proc, VALUE self, ID id, VALUE klass)
{
VALUE coverage = GET_THREAD()->cfp->iseq->coverage;
if (coverage && RBASIC(coverage)->klass == 0) {
long line = rb_sourceline() - 1;
long count;
if (RARRAY_PTR(coverage)[line] == Qnil) {
return;
}
count = FIX2LONG(RAR... | false | false | false | false | false | 0 |
report_window_copy_prefs(struct report_window *rw, toplevel_t * top)
{
static int report_window_initialized = 0;
if (!report_window_initialized) {
preferences_t *prefs = toplevel_get_prefs(top);
gtk_entry_set_text(rw->stylesheet_entry, preferences_get_stylesheet(prefs));
gtk_entry_set_text(rw->config_entry, pre... | false | false | false | false | false | 0 |
Echon(__G)
__GDEF
{
struct sgttyb sg; /* tty device structure */
if (GLOBAL(echofd) != -1) {
GTTY(GLOBAL(echofd), &sg); /* get settings */
sg.sg_flags |= ECHO; /* turn echo on */
STTY(GLOBAL(echofd), &sg);
GLOBAL(echofd) = -1;
}
} | false | false | false | false | false | 0 |
addBookmarks(const QList<QPair<QString, QString> > & list, const QString & name, KBookmarkGroup parent)
{
if(!m_layout)
initLayoutPrivate();
if(parent.isNull())
parent = m_mgr->root();
m_list = list;
setButtons( User1 | Ok | Cancel);
setButtonGuiItem( KDialog::Ok, KGuiItem( i18nc(... | false | false | false | false | false | 0 |
get_bits(vorb *f, int n)
{
uint32 z;
if (f->valid_bits < 0) return 0;
if (f->valid_bits < n) {
if (n > 24) {
// the accumulator technique below would not work correctly in this case
z = get_bits(f, 24);
z += get_bits(f, n-24) << 24;
return z;
}
... | false | false | false | false | false | 0 |
ai_profiles_init()
{
int temp;
if (Ai_profiles_initted)
return;
Num_ai_profiles = 0;
Default_ai_profile = 0;
Default_profile_name[0] = '\0';
// init retail entry first
parse_ai_profiles_tbl(NULL);
// now parse the supplied table (if any)
if (cf_exists_full("ai_profiles.tbl", CF_TYPE_TABLES))
parse_ai_p... | false | false | false | false | false | 0 |
wiz_create_item_subaction(menu_type *m, const ui_event *e, int oid)
{
object_kind **choices = menu_priv(m);
object_kind *kind = choices[oid];
object_type *i_ptr;
object_type object_type_body;
if (e->type != EVT_SELECT)
return TRUE;
/* Get local object */
i_ptr = &object_type_body;
/* Create the item */
... | false | false | false | false | false | 0 |
mt7601u_init_wcid_attr_mem(struct mt7601u_dev *dev)
{
u32 *vals;
int i, ret;
vals = kmalloc(sizeof(*vals) * N_WCIDS * 2, GFP_KERNEL);
if (!vals)
return -ENOMEM;
for (i = 0; i < N_WCIDS * 2; i++)
vals[i] = 1;
ret = mt7601u_burst_write_regs(dev, MT_WCID_ATTR_BASE,
vals, N_WCIDS * 2);
kfree(vals);... | false | false | false | false | false | 0 |
afs_install_vnode(struct afs_vnode *vnode,
struct afs_server *server)
{
struct afs_server *old_server = vnode->server;
struct afs_vnode *xvnode;
struct rb_node *parent, **p;
_enter("%p,%p", vnode, server);
if (old_server) {
spin_lock(&old_server->fs_lock);
rb_erase(&vnode->server_rb, &old_server->fs... | false | false | false | false | false | 0 |
parameters_to_hir(exec_list *ast_parameters,
bool formal,
exec_list *ir_parameters,
_mesa_glsl_parse_state *state)
{
ast_parameter_declarator *void_param = NULL;
unsigned count = 0;
foreach_list_typed (ast_parameter_declarator, param, link, ast_parameters) {
param->formal_para... | false | false | false | false | false | 0 |
portio_name_show(struct uio_port *port, char *buf)
{
if (unlikely(!port->name))
port->name = "";
return sprintf(buf, "%s\n", port->name);
} | false | false | false | false | false | 0 |
__rep_newfile(env, rp, rec)
ENV *env;
__rep_control_args *rp;
DBT *rec;
{
DB_LOG *dblp;
DB_LSN tmplsn;
DB_REP *db_rep;
LOG *lp;
REP *rep;
__rep_newfile_args nf_args;
int ret;
dblp = env->lg_handle;
lp = dblp->reginfo.primary;
db_rep = env->rep_handle;
rep = db_rep->region;
/*
* If a newfile is alread... | false | false | false | false | false | 0 |
public2PrivateKey (const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
*publicKey)
{
struct GNUNET_CRYPTO_RsaPrivateKey *ret;
gcry_sexp_t result;
gcry_mpi_t n;
gcry_mpi_t e;
size_t size;
size_t erroff;
int rc;
if ((ntohs (publicKey->sizen) != GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH) ... | 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.