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 |
|---|---|---|---|---|---|---|
init_ivtv_i2c(struct ivtv *itv)
{
int retval;
IVTV_DEBUG_I2C("i2c init\n");
/* Sanity checks for the I2C hardware arrays. They must be the
* same size.
*/
if (ARRAY_SIZE(hw_devicenames) != ARRAY_SIZE(hw_addrs)) {
IVTV_ERR("Mismatched I2C hardware arrays\n");
return -ENODEV;
}
if (itv->options.newi2c > 0... | false | true | false | false | false | 1 |
m_explore_and_check (pIIR_InterfaceDeclaration id, RegionStack &rstack, bool collect_access_info)
{
if (done(id) & EXPLORED) return 0; else done(id) |= EXPLORED;
int error_count = 0;
ContextInfo &ctxt = *ActiveContext(rstack);
error_count += explore_and_check(id->subtype, rstack, collect_access_info);
if ... | false | false | false | false | false | 0 |
write_task_queue(void)
{
int forked_count = 0;
int suspended_count = 0;
task *t;
tqueue *tq;
dbio_printf("0 clocks\n"); /* for compatibility's sake */
for (t = waiting_tasks; t; t = t->next)
if (t->kind == TASK_FORKED)
forked_count++;
else /* t->kind == TASK_SUSPENDED */
suspende... | false | false | false | false | false | 0 |
homogeneous_spec_list (struct Spec_list *s)
{
int b, c;
s->state = BEGIN_STATE;
if ((b = get_next (s, NULL)) == -1)
return false;
while ((c = get_next (s, NULL)) != -1)
if (c != b)
return false;
return true;
} | false | false | false | false | false | 0 |
__tzstring (const char *s)
{
char *p;
struct tzstring_l *t, *u, *new;
size_t len = strlen (s);
/* Walk the list and look for a match. If this string is the same
as the end of an already-allocated string, it can share space. */
for (u = t = tzstring_list; t; u = t, t = t->next)
if (len <= t->len)
... | false | true | false | false | false | 1 |
pack_float_ARGB2101010(const GLfloat src[4], void *dst)
{
GLuint *d = ((GLuint *) dst);
GLushort r, g, b, a;
UNCLAMPED_FLOAT_TO_USHORT(r, src[RCOMP]);
UNCLAMPED_FLOAT_TO_USHORT(g, src[GCOMP]);
UNCLAMPED_FLOAT_TO_USHORT(b, src[BCOMP]);
UNCLAMPED_FLOAT_TO_USHORT(a, src[ACOMP]);
*d = PACK_COLOR_210101... | false | false | false | false | false | 0 |
predicate_elimination(Clist clauses, Clist disabled, BOOL echo)
{
Plist clauses2 = prepend_clist_to_plist(NULL, clauses);
BOOL equality = equality_in_clauses(clauses2); /* eq => different method */
Ilist syms = eliminable_relations(clauses2, equality);
if (syms == NULL) {
zap_plist(clauses2);
if (echo... | false | false | false | false | false | 0 |
ocfs2_put_slot(struct ocfs2_super *osb)
{
int status, slot_num;
struct ocfs2_slot_info *si = osb->slot_info;
if (!si)
return;
spin_lock(&osb->osb_lock);
ocfs2_update_slot_info(si);
slot_num = osb->slot_num;
ocfs2_invalidate_slot(si, osb->slot_num);
osb->slot_num = OCFS2_INVALID_SLOT;
spin_unlock(&osb->osb... | false | false | false | false | false | 0 |
GetLineRect(size_t line) const
{
if ( !InReportView() )
return GetLine(line)->m_gi->m_rectAll;
wxRect rect;
rect.x = HEADER_OFFSET_X;
rect.y = GetLineY(line);
rect.width = GetHeaderWidth();
rect.height = GetLineHeight();
return rect;
} | false | false | false | false | false | 0 |
cr_statement_ruleset_append_decl2 (CRStatement * a_this,
CRString * a_prop,
CRTerm * a_value)
{
CRDeclaration *new_decls = NULL;
g_return_val_if_fail (a_this && a_this->type == RULESET_STMT
&& a_this->k... | false | false | false | false | false | 0 |
find_items_decode_secrets (DBusMessageIter *iter, find_items_args *args)
{
DBusMessageIter array, dict;
GnomeKeyringFound *found;
const char *path;
gchar *keyring;
gchar *secret;
guint32 item_id;
int type;
if (dbus_message_iter_get_arg_type (iter) != DBUS_TYPE_ARRAY ||
dbus_message_iter_get_element_type (... | false | false | false | false | false | 0 |
front_chdir(const char* dir)
{
int rc;
if ( dir == NULL ) {
cerr << "chdir: No valid diretory given!" << endl;
return false;
}
#if defined(WIN32)
rc = _chdir(dir);
#else
rc = chdir(dir);
#endif
if(rc == -1) {
switch(errno) {
case EACCES:
cerr << "chdir: No permissions to:" << dir ... | false | false | false | false | false | 0 |
cafe_smbus_write_data(struct cafe_camera *cam,
u16 addr, u8 command, u8 value)
{
unsigned int rval;
unsigned long flags;
struct mcam_camera *mcam = &cam->mcam;
spin_lock_irqsave(&mcam->dev_lock, flags);
rval = TWSIC0_EN | ((addr << TWSIC0_SID_SHIFT) & TWSIC0_SID);
rval |= TWSIC0_OVMAGIC; /* Make OV sensors wo... | false | false | false | false | false | 0 |
createDate() const
{
GooString *goo = m_embeddedFile->filespec->getEmbeddedFile()->createDate();
return goo ? convertDate(goo->getCString()) : QDateTime();
} | false | false | false | false | false | 0 |
account_up(GtkWidget *widget, gpointer data)
{
GtkTreePath *sel = account_list_view_get_selected_account_path
(edit_account.list_view),
*up;
GtkTreeIter isel, iup;
GtkTreeModel *model = gtk_tree_view_get_model
(GTK_TREE_VIEW(edit_account.list_view));
if (!sel)
return;
account_list_dirty = TRUE;
... | false | false | false | false | false | 0 |
run_init(int dir)
{
int py = p_ptr->py;
int px = p_ptr->px;
int i, row, col;
bool deepleft, deepright;
bool shortleft, shortright;
/* Save the direction */
p_ptr->run_cur_dir = dir;
/* Assume running straight */
p_ptr->run_old_dir = dir;
/* Assume looking for open area */
p_ptr->run_open_area = TRUE;
... | false | false | false | false | false | 0 |
closest_grid_new (GfsDomain * domain, gdouble h)
{
ClosestGrid * g = g_malloc (sizeof (ClosestGrid));
guint i;
g->max.x = - G_MAXDOUBLE;
g->max.y = - G_MAXDOUBLE;
g->max.z = - G_MAXDOUBLE;
g->min.x = G_MAXDOUBLE;
g->min.y = G_MAXDOUBLE;
g->min.z = G_MAXDOUBLE;
gfs_domain_cell_traverse (domain, FTT_PR... | false | false | false | false | false | 0 |
main()
{
string s;
if (s.empty())
cout << "It's an empty string" << endl;
} | false | false | false | false | false | 0 |
find_ticket_state_attr_legacy(cib_t * the_cib, const char *attr, const char *ticket_id,
const char *set_type, const char *set_name, const char *attr_id,
const char *attr_name, char **value)
{
int offset = 0;
static int xpath_max = 1024;
int rc = pc... | false | false | false | false | false | 0 |
reposition (ChamplainMarkerLayer *layer)
{
ClutterActorIter iter;
ClutterActor *child;
g_return_if_fail (CHAMPLAIN_IS_MARKER_LAYER (layer));
clutter_actor_iter_init (&iter, CLUTTER_ACTOR (layer));
while (clutter_actor_iter_next (&iter, &child))
{
ChamplainMarker *marker = CHAMPLAIN_MARKER (child);... | false | false | false | false | false | 0 |
vfio_basic_config_read(struct vfio_pci_device *vdev, int pos,
int count, struct perm_bits *perm,
int offset, __le32 *val)
{
if (is_bar(offset)) /* pos == offset for basic config */
vfio_bar_fixup(vdev);
count = vfio_default_config_read(vdev, pos, count, perm, offset, val);
/* Mask in virtual memory e... | false | false | false | false | false | 0 |
http_unescape(char *data)
{
char hex[3];
char *stp;
int src_x = 0;
int dst_x = 0;
int length = (int) strlen(data);
hex[2] = 0;
while (src_x < length)
{
if (strncmp(data + src_x, "%", 1) == 0 && src_x + 2 < length)
{
//
// Since we encountered a '%' we know this is an escaped character
... | false | false | false | false | false | 0 |
appledisplay_complete(struct urb *urb)
{
struct appledisplay *pdata = urb->context;
struct device *dev = &pdata->udev->dev;
unsigned long flags;
int status = urb->status;
int retval;
switch (status) {
case 0:
/* success */
break;
case -EOVERFLOW:
dev_err(dev,
"OVERFLOW with data length %d, actual leng... | false | false | false | false | false | 0 |
news_command(char *arg, struct session *ses)
{
char line[BUFFER_SIZE];
FILE* news=fopen( NEWS_FILE , "r");
#ifdef DATA_PATH
if (!news)
news=fopen( DATA_PATH "/" NEWS_FILE , "r");
#endif
if (news)
{
tintin_printf(ses,"~2~");
while (fgets(line,BUFFER_SIZE,news))
{
... | true | true | false | false | true | 1 |
_dxf_pushHwGatherClipPlanes(gatherO go, int n, Point *p, Vector *v)
{
int i;
gatherP gop;
clipPlaneP clips = NULL;
if (! go)
return ERROR;
gop = _getHwGatherData(go);
clips = (clipPlaneP)DXAllocateZero(sizeof(clipPlanesT));
if (! clips)
goto error;
clips->n = n;
if (n > 0)... | false | false | false | false | false | 0 |
reserve(size_t to) {
if (_capacity >= to)
return true;
if (to >= IntUtil::maxUInt<size_t>() - sizeof(intptr_t) * 2)
return false;
to = IntUtil::alignTo<size_t>(to, sizeof(intptr_t));
char* newData = static_cast<char*>(ASMJIT_ALLOC(to + sizeof(intptr_t)));
if (newData == NULL)
return false;
:... | false | false | false | false | false | 0 |
nuke_dead_procs(void)
{
Proc *proc, *next;
for (proc = proclist; proc; proc = next) {
next = proc->next;
if (proc->state == PROC_DEAD)
nukeproc(proc);
}
} | false | false | false | false | false | 0 |
addWebcamProvider(WebcamPhotoProvider *provider)
{
if (!provider)
return;
ui->devicesCombo->addItem(provider->name(), QVariant(provider->id()));
// m_availableDevices[provider->device()] = provider;
} | false | false | false | false | false | 0 |
gconf_list_model_iter_n_children (GtkTreeModel *tree_model, GtkTreeIter *iter)
{
/* it should ask for the root node, because we're a list */
if (!iter)
return g_slist_length (GCONF_LIST_MODEL (tree_model)->values);
return -1;
} | false | false | false | false | false | 0 |
lms_parser_del(lms_t *lms, lms_plugin_t *handle)
{
int i;
if (!lms)
return -1;
if (!handle)
return -2;
if (!lms->parsers)
return -3;
if (lms->is_processing) {
fprintf(stderr, "ERROR: do not del parsers while it's processing.\n");
return -4;
}
for (i ... | false | false | false | false | false | 0 |
ArgumentOption_is_set(ArgumentOption *ao){
if(ao->arg_list)
return ao->arg_list->len?TRUE:FALSE;
return ao->arg_value?TRUE:FALSE;
} | false | false | false | false | false | 0 |
isEmptyType(const Type* type)
{
// a type that has no variables and no constructor
std::pair<std::map<const Type *,bool>::iterator,bool> found=isEmptyTypeMap.insert(
std::pair<const Type *,bool>(type,false));
bool & emptyType=found.first->second;
if (!found.second)
return emptyT... | false | false | false | false | false | 0 |
AcpiDsExecBeginOp (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT **OutOp)
{
ACPI_PARSE_OBJECT *Op;
ACPI_STATUS Status = AE_OK;
UINT32 OpcodeClass;
ACPI_FUNCTION_TRACE_PTR (DsExecBeginOp, WalkState);
Op = WalkState->Op;
if (!Op)
{
... | false | false | false | false | false | 0 |
find_kernel_nfs_mount_version(void)
{
int kernel_version;
if (nfs_mount_version)
return;
nfs_mount_version = 4; /* default */
kernel_version = get_linux_version_code();
if (kernel_version) {
if (kernel_version < KERNEL_VERSION(2,2,18))
nfs_mount_version = 3;
/* else v4 since 2.3.99pre4 */
}
} | false | false | false | false | false | 0 |
FindDefaultValue(
void *theEnv,
int theType,
CONSTRAINT_RECORD *theConstraints,
void *standardDefault)
{
struct expr *theList;
/*=====================================================*/
/* Look on the the allowed values list to see if there */
/* is a value of the requested type. Return the first ... | false | false | false | false | false | 0 |
existsTimeLineHistoryFile(char *basedir, TimeLineID tli)
{
char path[MAXPGPATH];
char histfname[MAXFNAMELEN];
int fd;
/*
* Timeline 1 never has a history file. We treat that as if it existed,
* since we never need to stream it.
*/
if (tli == 1)
return true;
TLHistoryFileName(histfname, tli);
snpri... | true | true | false | false | true | 1 |
resolve_name(struct addrinfo **out, char* fullname)
{
struct addrinfo hint;
char *serv, *host;
int res;
char *sep = strrchr(fullname, ':');
if (!sep) /* No separator: parameter is just a port */
{
fprintf(stderr, "names must be fully specified as hostname:port\n");
exit(1);
}
host... | false | false | false | false | false | 0 |
read_line(CvsServerCtx * ctx, char * p)
{
int len = 0;
while (1)
{
if (ctx->head == ctx->tail)
if (refill_buffer(ctx) <= 0)
return -1;
*p = *ctx->head++;
if (*p == '\n')
{
*p = 0;
break;
}
p++;
len++;
}
return len;
} | false | false | false | false | false | 0 |
getmaxgroups ()
{
static int maxgroups = -1;
if (maxgroups > 0)
return maxgroups;
#if defined (HAVE_SYSCONF) && defined (_SC_NGROUPS_MAX)
maxgroups = sysconf (_SC_NGROUPS_MAX);
#else
# if defined (NGROUPS_MAX)
maxgroups = NGROUPS_MAX;
# else /* !NGROUPS_MAX */
# if defined (NGROUPS)
maxgroups = NGR... | false | false | false | false | false | 0 |
__bamc_compress_get_prev_nodup(dbc, flags)
DBC *dbc;
u_int32_t flags;
{
int ret;
BTREE_CURSOR *cp;
DB *dbp;
BTREE *t;
cp = (BTREE_CURSOR *)dbc->internal;
dbp = dbc->dbp;
t = (BTREE *)dbp->bt_internal;
if (cp->currentKey == 0)
return (__bamc_compress_get_prev(dbc, flags));
/*
* If this is a deleted ent... | false | false | false | false | false | 0 |
build_map_info(struct address_space *mapping, loff_t offset, bool is_register)
{
unsigned long pgoff = offset >> PAGE_SHIFT;
struct vm_area_struct *vma;
struct map_info *curr = NULL;
struct map_info *prev = NULL;
struct map_info *info;
int more = 0;
again:
i_mmap_lock_read(mapping);
vma_interval_tree_foreach(... | false | false | false | false | false | 0 |
creator (CONST int type)
{
int i;
int color1 = color (type, 0, 0);
for (i = nrockets; i < nobjects && (object[i].live ||
object[i].type == CREATOR);
i++);
if (i >= MAXOBJECT)
return;
if (!find_possition (&object[i].x, &object[i].y, radius (type)))
return;
if ... | false | false | false | false | false | 0 |
dwc_alloc_chan_resources(struct dma_chan *chan)
{
struct dw_dma_chan *dwc = to_dw_dma_chan(chan);
struct dw_dma *dw = to_dw_dma(chan->device);
struct dw_desc *desc;
int i;
unsigned long flags;
dev_vdbg(chan2dev(chan), "%s\n", __func__);
/* ASSERT: channel is idle */
if (dma_readl(dw, CH_EN) & dwc->mask)... | false | false | false | false | false | 0 |
__pyx_f_9lightning_4impl_14primal_cd_fast_3Log_derivatives(CYTHON_UNUSED struct __pyx_obj_9lightning_4impl_14primal_cd_fast_Log *__pyx_v_self, CYTHON_UNUSED int __pyx_v_j, double __pyx_v_C, int *__pyx_v_indices, double *__pyx_v_data, int __pyx_v_n_nz, double *__pyx_v_y, double *__pyx_v_b, double *__pyx_v_Lp, double *__... | false | false | false | false | false | 0 |
tools_read_range(const string & s, S_I & min, U_I & max)
{
string::const_iterator it = s.begin();
while(it < s.end() && *it != '-')
it++;
try
{
if(it < s.end())
{
min = tools_str2int(string(s.begin(), it));
max = tools_str2int(string(++it, s.end()));
}
else
... | false | false | false | false | false | 0 |
ExecSelect (
PTreeNode *pt,
ObjStruct *os,
int numInputs,
Pointer *inputs,
Pointer result,
InvalidComponentHandle *invalids,
InvalidComponentHandle outInvalid)
{
int size0 = pt->args->metaType.items;
int size1 = pt->args->next->metaType.items;
int i, j, k;
int numBasic;
... | true | true | false | false | false | 1 |
get_type(int fd)
{
int drive;
struct stat statbuf;
if (fstat(fd, &statbuf) < 0 ){
perror("stat");
exit(0);
}
if (!S_ISBLK(statbuf.st_mode) || major(statbuf.st_rdev) != FLOPPY_MAJOR)
return -1;
drive = minor( statbuf.st_rdev );
return (drive & 3) + ((drive & 0x80) >> 5);
} | false | false | false | false | false | 0 |
acpi_ut_display_init_pathname(u8 type,
struct acpi_namespace_node *obj_handle,
char *path)
{
acpi_status status;
struct acpi_buffer buffer;
ACPI_FUNCTION_ENTRY();
/* Only print the path if the appropriate debug level is enabled */
if (!(acpi_dbg_level & ACPI_LV_INIT_NAMES)) {
return;
}
/*... | false | false | false | false | false | 0 |
apol_bst_get_element(const apol_bst_t * b, const void *elem, void *data, void **result)
{
bst_node_t *node;
int compval;
if (!b || !result) {
errno = EINVAL;
return -1;
}
node = b->head;
while (node != NULL) {
if (b->cmp != NULL) {
compval = b->cmp(node->elem, elem, data);
} else {
char *p1 = (char ... | false | false | false | false | false | 0 |
steeltal_init_common(offs_t ds3_transfer_pc, int proto_sloop)
{
/* initialize the boards */
init_multisync(0);
init_ds3();
init_dspcom();
atarijsa3_init_adpcm(REGION_SOUND1);
atarijsa_init(hdcpu_jsa, 14, 0, 0x0020);
install_mem_read16_handler(hdcpu_main, 0x908000, 0x908001, steeltal_dummy_r);
/* se... | false | false | false | false | true | 1 |
inc_running (void)
{
StgWord new;
new = atomic_inc(&gc_running_threads);
ASSERT(new <= n_gc_threads);
return new;
} | false | false | false | false | false | 0 |
Vect_point_in_area(struct Map_info *Map, int area, double x, double y)
{
int i, isle;
struct Plus_head *Plus;
P_AREA *Area;
int poly;
Plus = &(Map->plus);
Area = Plus->Area[area];
if (Area == NULL)
return 0;
poly = Vect_point_in_area_outer_ring(x, y, Map, area);
if (poly == 0)
re... | false | false | false | false | false | 0 |
OGRDODSGetVarPath( BaseType *poTarget )
{
string oFullName;
oFullName = poTarget->name();
while( (poTarget = poTarget->get_parent()) != NULL )
{
oFullName = poTarget->name() + "." + oFullName;
}
return oFullName;
} | false | false | false | false | false | 0 |
WriteCharges(ostream &ofs,OBMol &mol)
{
unsigned int i;
OBAtom *atom;
char buffer[BUFF_SIZE];
for(i = 1;i <= mol.NumAtoms(); i++)
{
atom = mol.GetAtom(i);
snprintf(buffer, BUFF_SIZE, "%4s%4d % 2.10f",
etab.GetSymbol(atom->GetAtomicNum()),
i,
... | false | false | false | false | false | 0 |
bt_store_piece_sha1(torrent_ctx *ctx)
{
unsigned char* block;
unsigned char* hash;
if((ctx->piece_count % BT_BLOCK_SIZE) == 0) {
block = (unsigned char*)malloc(BT_HASH_SIZE * BT_BLOCK_SIZE);
if(block == NULL || !bt_vector_add_ptr(&ctx->hash_blocks, block)) {
if(block) free(block);
return 0;
}
} else {
... | true | true | false | false | false | 1 |
xstrcat(const char *arg1, ...)
{
const char *argptr;
char *resptr, *result;
int nargs = 0;
size_t len = 0;
va_list valist;
va_start(valist, arg1);
for(argptr = arg1; argptr != NULL; argptr = va_arg(valist, char *))
len += strlen(argptr);
va_end(valist);
result = xmalloc(len + 1);
resptr = r... | false | true | false | false | true | 1 |
canVectorizeInst(Instruction *Inst, User *User) {
switch (Inst->getOpcode()) {
case Instruction::Load:
case Instruction::BitCast:
case Instruction::AddrSpaceCast:
return true;
case Instruction::Store: {
// Must be the stored pointer operand, not a stored value.
StoreInst *SI = cast<StoreInst>(Inst... | false | false | false | false | false | 0 |
xmalloc_vmm_inited(void)
{
STATIC_ASSERT(IS_POWER_OF_2(XMALLOC_BUCKET_FACTOR));
STATIC_ASSERT(IS_POWER_OF_2(XMALLOC_BLOCK_SIZE));
STATIC_ASSERT(0 == (XMALLOC_FACTOR_MASK & XMALLOC_SPLIT_MIN));
STATIC_ASSERT(XMALLOC_SPLIT_MIN / 2 == XMALLOC_BUCKET_FACTOR);
STATIC_ASSERT(1 == (((1 << WALLOC_MAX_SHIFT) - 1) & XMALLOC... | false | false | false | false | false | 0 |
cifs_get_root(struct smb_vol *vol, struct super_block *sb)
{
struct dentry *dentry;
struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
char *full_path = NULL;
char *s, *p;
char sep;
full_path = cifs_build_path_to_root(vol, cifs_sb,
cifs_sb_master_tcon(cifs_sb));
if (full_path == NULL)
return ERR_PTR(-ENOMEM... | false | false | false | false | false | 0 |
IPrcParse(const pfPrcTag* tag, plResManager* mgr) {
if (tag->getName() == "OneShotLinkParams") {
fAnimName = tag->getParam("AnimName", "");
fMarkerName = tag->getParam("MarkerName", "");
} else {
plCreatable::IPrcParse(tag, mgr);
}
} | false | false | false | false | false | 0 |
padata_do_parallel(struct padata_instance *pinst,
struct padata_priv *padata, int cb_cpu)
{
int target_cpu, err;
struct padata_parallel_queue *queue;
struct parallel_data *pd;
rcu_read_lock_bh();
pd = rcu_dereference_bh(pinst->pd);
err = -EINVAL;
if (!(pinst->flags & PADATA_INIT) || pinst->flags & PA... | false | false | false | false | false | 0 |
snd_pcm_extplug_dump(snd_pcm_t *pcm, snd_output_t *out)
{
extplug_priv_t *ext = pcm->private_data;
if (ext->data->callback->dump)
ext->data->callback->dump(ext->data, out);
else {
if (ext->data->name)
snd_output_printf(out, "%s\n", ext->data->name);
else
snd_output_printf(out, "External PCM Plugin\n");
... | false | false | false | false | false | 0 |
unpack_index_entry(struct cache_entry *ce,
struct unpack_trees_options *o)
{
struct cache_entry *src[5] = { NULL };
int ret;
src[0] = ce;
mark_ce_used(ce, o);
if (ce_stage(ce)) {
if (o->skip_unmerged) {
add_entry(o, ce, 0, 0);
return 0;
}
}
ret = call_unpack_fn(src, o);
if (ce_stage(ce))
... | false | false | false | false | false | 0 |
PyFF_Font_get_texparams(PyFF_Font *self,void *closure) {
SplineFont *sf = self->fv->sf;
int i, em = sf->ascent+sf->descent;
PyObject *tuple = PyTuple_New(23);
double val;
if ( sf->texdata.type==tex_text )
PyTuple_SetItem(tuple,0,Py_BuildValue("s", "text"));
else if ( sf->texdata.type==tex_math... | false | false | false | false | false | 0 |
clutter_x11_get_default_screen (void)
{
ClutterBackend *backend = clutter_get_default_backend ();
if (backend == NULL)
{
g_critical ("The Clutter backend has not been initialised");
return 0;
}
if (!CLUTTER_IS_BACKEND_X11 (backend))
{
g_critical ("The Clutter backend is not a X11 ba... | false | false | false | false | false | 0 |
Get_Nil(WamWord start_word)
{
WamWord word, tag_mask;
DEREF(start_word, word, tag_mask);
if (tag_mask == TAG_REF_MASK)
{
Bind_UV(UnTag_REF(word), NIL_WORD);
return TRUE;
}
return (word == NIL_WORD);
} | false | false | false | false | false | 0 |
__unref_object(gpointer data, GClosure *closure)
{
if (data == NULL)
return;
if (!G_IS_OBJECT(data))
return;
g_object_unref(G_OBJECT(data));
} | false | false | false | false | false | 0 |
Rule_compile_c2(Node *node)
{
assert(node);
assert(Rule == node->type);
if (!node->rule.expression)
fprintf(stderr, "rule '%s' used but not defined\n", node->rule.name);
else
{
int ko= yyl(), safe;
if ((!(RuleUsed & node->rule.flags)) && (node != start))
fprintf(stderr, "rule '%s' defined... | false | false | false | true | false | 1 |
TCSP_CreateEndorsementKeyPair_Internal(TCS_CONTEXT_HANDLE hContext, /* in */
TCPA_NONCE antiReplay, /* in */
UINT32 endorsementKeyInfoSize, /* in */
BYTE * endorsementKeyInfo, /* in */
UINT32 * endorsementKeySize, /* out */
BYTE ** endorsementKey, /* out */
... | false | false | false | false | false | 0 |
do_include(char *name, struct pnode *parms)
{
struct pnode *p;
/* FIXME: make sure only one argument is passed */
p = HEAD(parms);
if (enforce_simple(p)) {
open_src(p->value.symbol, 1);
}
return 0;
} | false | false | false | false | false | 0 |
add_answer_to_cache(const char *address, uint8_t is_reverse, uint32_t addr,
const char *hostname, char outcome, uint32_t ttl)
{
cached_resolve_t *resolve;
if (outcome == DNS_RESOLVE_FAILED_TRANSIENT)
return;
//log_notice(LD_EXIT, "Adding to cache: %s -> %s (%lx, %s), %d",
// a... | false | false | false | false | false | 0 |
__resize_get_dir_from_window(
int *ret_xmotion, int *ret_ymotion, FvwmWindow *fw, Window context_w)
{
if (context_w != Scr.Root && context_w != None)
{
if (context_w == FW_W_SIDE(fw, 0)) /* top */
{
*ret_ymotion = 1;
}
else if (context_w == FW_W_SIDE(fw, 1)) /* right */
{
*ret_xmotion = -1;
}
... | false | false | false | false | false | 0 |
init(GtkWidget *widget)
{
/* OpenGL functions can be called only if makecurrent returns true */
if (gtk_gl_area_make_current(GTK_GL_AREA(widget))) {
#if !defined(WIN32)
GdkFont *font;
#endif
/* set viewport */
glViewport(0,0, widget->allocation.width, widget->allocation.height);
#if !defined(WIN32)
... | false | false | false | false | false | 0 |
modem_init(void)
{
int i;
static int inited = 0;
if (inited) return;
sqrt_lo = (int *)malloc(2048*sizeof(int));
sqrt_hi = (int *)malloc(2048*sizeof(int));
if (!(sqrt_lo) || !(sqrt_hi)) {
perror("modem_init:sqrt_*");
exit(1);
}
amreal = (char *)malloc(258);
if (!(amreal)) {
perror("modem_... | false | false | false | false | false | 0 |
TraceGoodLine(TraceData *base,TraceData *end) {
/* Make sure that we don't stray more than line_wobble pixels */
int dx, dy;
double diff;
TraceData *pt;
if (( dx = end->x-base->x )<0 ) dx = -dx;
if (( dy = end->y-base->y )<0 ) dy = -dy;
if ( dy>dx ) {
dx = end->x-base->x; dy = end->y-base... | false | false | false | false | false | 0 |
fdilate_1_30(l_uint32 *datad,
l_int32 w,
l_int32 h,
l_int32 wpld,
l_uint32 *datas,
l_int32 wpls)
{
l_int32 i;
register l_int32 j, pwpls;
register l_uint32 *sptr, *dptr;
l_int32 wpls2, wpls3;
wpls2 = 2 * wpls;
... | false | false | false | false | false | 0 |
cqueue_verify_attributes(lListElem *cqueue, lList **answer_list,
lListElem *reduced_elem, bool in_master)
{
bool ret = true;
DENTER(CQUEUE_LAYER, "cqueue_verify_attributes");
if (cqueue != NULL && reduced_elem != NULL) {
int index = 0;
while (cqueue_attribute_array[index]... | true | true | true | false | true | 1 |
readXMLPatientData(const DSRXMLDocument &doc,
DSRXMLCursor cursor,
const size_t /*flags*/)
{
OFCondition result = SR_EC_InvalidDocument;
if (cursor.valid())
{
OFString tmpString;
result = EC_Normal;
... | false | false | false | false | false | 0 |
nh_aux(void *kp, void *dp, void *hp, UINT32 dlen)
/* Same as previous nh_aux, but two streams are handled in one pass,
* reading and writing 16 bytes of hash-state per call.
*/
{
UINT64 h1,h2;
UWORD c = dlen / 32;
UINT32 *k = (UINT32 *)kp;
UINT32 *d = (UINT32 *)dp;
UINT32 d0,d1,d2,d3,d4,d5,d6,d7;
UINT32 k... | false | false | false | false | false | 0 |
BuildPaths(vtkAssemblyPaths *paths, vtkAssemblyPath *path)
{
// the path consists only of the active image
vtkImageSlice *image = this->GetActiveImage();
if (image)
{
path->AddNode(image, image->GetMatrix());
image->BuildPaths(paths, path);
path->DeleteLastNode();
}
} | false | false | false | false | false | 0 |
dce_v8_0_audio_write_latency_fields(struct drm_encoder *encoder,
struct drm_display_mode *mode)
{
struct amdgpu_device *adev = encoder->dev->dev_private;
struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder);
struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv;
struct drm_connector *co... | false | false | false | false | false | 0 |
krb5_rc_register_type(krb5_context context, const krb5_rc_ops *ops)
{
struct krb5_rc_typelist *t;
k5_mutex_lock(&rc_typelist_lock);
for (t = typehead;t && strcmp(t->ops->type,ops->type);t = t->next)
;
if (t) {
k5_mutex_unlock(&rc_typelist_lock);
return KRB5_RC_TYPE_EXISTS;
}... | false | false | false | false | false | 0 |
implicitConvTo(Type *t)
{
MATCH result = Expression::implicitConvTo(t);
Type *tb = t->toBasetype();
Type *typeb = type->toBasetype();
if (result == MATCHnomatch &&
tb->ty == Tsarray && typeb->ty == Tarray &&
lwr && upr)
{
typeb = toStaticArrayType();
if (typeb)
... | false | false | false | false | false | 0 |
xmlSecNssKWAesGetKeySize(xmlSecTransformPtr transform) {
if(xmlSecTransformCheckId(transform, xmlSecNssTransformKWAes128Id)) {
return(XMLSEC_NSS_AES128_KEY_SIZE);
} else if(xmlSecTransformCheckId(transform, xmlSecNssTransformKWAes192Id)) {
return(XMLSEC_NSS_AES192_KEY_SIZE);
} else if(xmlSecTransformCheck... | false | false | false | false | false | 0 |
getOutputDescriptors() const
{
OutputList list;
float stepSecs = m_preferredStepSecs;
// if (m_d) stepSecs = m_d->dfConfig.stepSecs;
OutputDescriptor onsets;
onsets.identifier = "onsets";
onsets.name = "Note Onsets";
onsets.description = "Perceived note onset positions";
onsets.unit = "... | false | false | false | false | false | 0 |
abst(void)
{
if ( (INT32)(R.ACC.d) < 0 ) {
R.ACC.d = -R.ACC.d;
if (OVM) {
SET0(OV_FLAG);
if (R.ACC.d == 0x80000000) R.ACC.d-- ;
}
}
CLR1(C_FLAG);
} | false | false | false | false | false | 0 |
AsssListCheck (
Obj list,
Obj poss,
Obj rhss )
{
if ( ! IS_POSS_LIST(poss) ) {
ErrorQuit(
"List Assignment: <positions> must be a dense list of positive integers",
0L, 0L );
}
if ( ! IS_DENSE_LIST(rhss) ) {
ErrorQuit... | false | false | false | false | false | 0 |
esl_permutation_Reuse(ESL_PERMUTATION *P)
{
int i;
for (i = 0; i < P->n; i++)
P->pi[i] = i;
return eslOK;
} | false | false | false | false | false | 0 |
store_temp_max(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
int nr = (to_sensor_dev_attr(attr))->index;
struct lm93_data *data = dev_get_drvdata(dev);
struct i2c_client *client = data->client;
long val;
int err;
err = kstrtol(buf, 10, &val);
if (err)
return err;... | false | false | false | false | false | 0 |
buff_addb (char* buff, char* buffEnd, const void* data, int len)
{
int avail = (buffEnd - buff);
if (avail <= 0 || len <= 0) /* already overflowing */
return buff;
if (len > avail)
len = avail;
memcpy(buff, data, len);
buff += len;
/* ensure there is a terminating zero... | false | false | false | false | false | 0 |
is_runnable()
{
if (this->object_->relocs_must_follow_section_writes()
&& this->output_sections_blocker_->is_blocked())
return this->output_sections_blocker_;
if (this->object_->is_locked())
return this->object_->token();
return NULL;
} | false | false | false | false | false | 0 |
_notify_srun_missing_step(struct job_record *job_ptr, int node_inx,
time_t now, time_t node_boot_time)
{
ListIterator step_iterator;
struct step_record *step_ptr;
char *node_name = node_record_table_ptr[node_inx].name;
xassert(job_ptr);
step_iterator = list_iterator_create (job_ptr->step_list);
while (... | false | false | false | false | false | 0 |
OpAssignsToB(unsigned int op)
{
if(op >= OP_BITSET && op <= OP_BITCLRP)
return true;
if(op >= OP_STORE_I && op <= OP_STORE_FI)
return true;
if(op == OP_STOREP_C || op == OP_LOADP_C)
return true;
if(op >= OP_MULSTORE_F && op <= OP_SUBSTOREP_V)
return true;
if(op >= OP_STORE_F && op <= OP_STOREP_FNC)
retur... | false | false | false | false | false | 0 |
CKYBuffer_GetShortLE(const CKYBuffer *buf, CKYOffset offset)
{
unsigned short val;
if (buf->len < offset+2) {
return 0;
}
val = ((unsigned short)buf->data[offset+1]) << 8;
val |= ((unsigned short)buf->data[offset+0]) << 0;
return val;
} | false | false | false | false | false | 0 |
merge_session_cookie_dir_config(apr_pool_t * p, void *basev,
void *addv)
{
session_cookie_dir_conf *new = (session_cookie_dir_conf *)
apr_pcalloc(p, sizeof(session_cookie_dir_conf));
session_cookie_dir_conf *add = (session_cookie_dir_c... | false | false | false | false | false | 0 |
iwl_drv_init(void)
{
int i;
mutex_init(&iwlwifi_opmode_table_mtx);
for (i = 0; i < ARRAY_SIZE(iwlwifi_opmode_table); i++)
INIT_LIST_HEAD(&iwlwifi_opmode_table[i].drv);
pr_info(DRV_DESCRIPTION "\n");
pr_info(DRV_COPYRIGHT "\n");
#ifdef CONFIG_IWLWIFI_DEBUGFS
/* Create the root of iwlwifi debugfs subsystem. *... | false | false | false | false | false | 0 |
resolve(const Value &root, const Value &defaultValue) const {
const Value *node = &root;
for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) {
const PathArgument &arg = *it;
if (arg.kind_ == PathArgument::kindIndex) {
if (!node->isArray() || !node->isValidIndex(arg.index_))
... | false | false | false | false | false | 0 |
read_post(SAPI_Info& , char *buf, size_t max_bytes) {
size_t read_size=0;
do {
ssize_t chunk_size=read(fileno(stdin),
buf+read_size, min(READ_POST_CHUNK_SIZE, max_bytes-read_size));
if(chunk_size<=0)
break;
read_size+=chunk_size;
} while(read_size<max_bytes);
return read_size;
} | false | false | false | false | false | 0 |
dup_basename_token(const char *name, const char *ext)
{
char *p, *ret = dup_basename( name, ext );
/* map invalid characters to '_' */
for (p = ret; *p; p++) if (!isalnum(*p)) *p = '_';
return ret;
} | false | false | false | false | false | 0 |
dSncpy(String *dest, const char *src, int n, const char *file, int line)
{
int len = strlen(src);
if (n < 0) core("dSncpy: n==%ld", file, line, (long)n);
if (n > len) n = len;
dest->len = n;
if (dest->charattrs) {
Sfree(dest, dest->charattrs);
dest->charattrs = NULL;
}
lchec... | 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.