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 |
|---|---|---|---|---|---|---|
Dcg_Trans_Body_4(WamWord dcg_body_word, WamWord in_word, WamWord out_word,
WamWord body_word)
{
top = Local_Top; /* use local stack for the stack */
opt_term_unif = TRUE;
in_word = Globalize_If_In_Local(in_word);
out_word = Globalize_If_In_Local(out_word);
return Unify(body_word,
Dcg_Body(dcg_b... | false | false | false | false | false | 0 |
nerr_init (void)
{
NEOERR *err;
if (Inited == 0)
{
#ifdef HAVE_PTHREADS
/* In threaded environments, we have to mutex lock to do this init, but
* we don't want to use a mutex every time to check that it was Inited.
* So, we only lock if our first test of Inited was false */
err = mLock(&InitLoc... | false | false | false | false | false | 0 |
gnet_prop_get_stub(void)
{
static prop_set_stub_t stub;
static gboolean inited;
if G_LIKELY(inited)
return &stub;
stub.size = GNET_PROPERTY_NUM;
stub.offset = GNET_PROPERTY_MIN;
stub.get_def = gnet_prop_get_def;
stub.get_by_name = gnet_prop_get_by_name;
stub.to_string = gnet_prop_to_string;
stub.prop_... | false | false | false | false | false | 0 |
check_duplicates (void)
{
g_print ("\nChecking duplicates...\n");
task_list_li = task_list;
while (task_list_li) {
CopyTask *current;
gchar *uri;
current = task_list_li->data;
uri = g_file_get_uri (current->destfile);
check_duplicates_for_uri (uri);
g_free (uri);
g_object_unref (current->destfile)... | false | false | false | false | false | 0 |
qs_regexec(pcre *preg, const char *string,
apr_size_t nmatch, regmatch_t pmatch[]) {
int rc;
int options = 0;
int *ovector = NULL;
int small_ovector[POSIX_MALLOC_THRESHOLD * 3];
int allocated_ovector = 0;
if (nmatch > 0) {
if (nmatch <= POSIX_MALLOC_THRESHOLD) {
ovector = &(small_ovector[0... | false | false | false | false | false | 0 |
ttm_zones_above_swap_target(struct ttm_mem_global *glob,
bool from_wq, uint64_t extra)
{
unsigned int i;
struct ttm_mem_zone *zone;
uint64_t target;
for (i = 0; i < glob->num_zones; ++i) {
zone = glob->zones[i];
if (from_wq)
target = zone->swap_limit;
else if (capable(CAP_SYS_ADMIN))
target = zon... | false | false | false | false | true | 1 |
load_file (const char *file)
{
gnutls_datum_t loaded_file = { NULL, 0 };
size_t length;
loaded_file.data = read_binary_file (file, &length);
if (loaded_file.data)
loaded_file.size = (unsigned int) length;
return loaded_file;
} | false | false | false | false | false | 0 |
mma_init()
{
unsigned int stat,error;
if(0!=SLM_RegisterBoard(0x0036344B00800803LL,
"192.168.0.2","255.255.255.0",
"0.0.0.0",4001)){
e("register board");
return -4;
}
if(0!=SLM_SetLocalIf("192.168.0.1",4001)){
e("set local interface");
return -3;
}
if(0!=SLM_Connect()){
e("conn... | false | false | false | false | true | 1 |
authenticate(HTTPRequest& request, const HTTPResponse& response)
{
for (HTTPResponse::ConstIterator iter = response.find("WWW-Authenticate"); iter != response.end(); ++iter)
{
if (isBasicCredentials(iter->second))
{
HTTPBasicCredentials(_digest.getUsername(), _digest.getPassword()).authenticate(request);
r... | false | false | false | false | false | 0 |
uvc_ioctl_g_input(struct file *file, void *fh, unsigned int *input)
{
struct uvc_fh *handle = fh;
struct uvc_video_chain *chain = handle->chain;
int ret;
u8 i;
if (chain->selector == NULL ||
(chain->dev->quirks & UVC_QUIRK_IGNORE_SELECTOR_UNIT)) {
*input = 0;
return 0;
}
ret = uvc_query_ctrl(chain->de... | false | false | false | false | false | 0 |
check_array_index(int pc, vbm_operand* sp)
{
check_variable_for_null(pc, sp);
if (sp[1].min < 0) {
if (sp[1].max < 0) {
message(msg_bad_index, pc, sp[1].min, sp[1].max);
} else if (sp[1].min > -128) {
message(msg_maybe_bad_index, pc, sp[1].min, sp[1].max);
}
}
if (sp[1].max >= sp->ma... | false | false | false | false | false | 0 |
quest_get_player_state(player *pl, sstring quest_code) {
quest_player *q = get_or_create_quest(pl);
quest_state *s = get_state(q, quest_code);
quest_definition *quest = quest_get(quest_code);
if (!s)
return 0;
if (s->state == QC_CAN_RESTART && quest && quest->quest_restart)
return ... | false | false | false | false | false | 0 |
vbufprintf(struct print_buf *buf, const char *format, va_list ap)
{
va_list ap2;
int rv;
va_copy(ap2, ap);
rv = vsnprintf(NULL, 0, format, ap);
/* >= to make sure we have space for terminating null */
if (rv + buf->len >= buf->size) {
size_t newsize = rv + buf->len + BUFPAD;
char *newbuf;
... | false | false | false | false | false | 0 |
del_infilepos(INFILEPOS * pos)
{
if (pos)
{
INFILE *inpf = pos->inpf;
/* remove filename */
ufreestr(pos->fname);
/* check, if file has already been closed by user,
* but the last pos-requests has just been deleted
* now.
* if so, really close the fil... | false | false | false | false | true | 1 |
get_ins_mem_width(unsigned long ins_addr)
{
unsigned int opcode;
unsigned char *p;
struct prefix_bits prf;
int i;
p = (unsigned char *)ins_addr;
p += skip_prefix(p, &prf);
p += get_opcode(p, &opcode);
for (i = 0; i < ARRAY_SIZE(mw8); i++)
if (mw8[i] == opcode)
return 1;
for (i = 0; i < ARRAY_SIZE(mw16)... | false | false | false | false | false | 0 |
handle_object_property (NMObject *self, const char *property_name, GValue *value,
PropertyInfo *pi, gboolean synchronously)
{
NMObjectPrivate *priv = NM_OBJECT_GET_PRIVATE (self);
GObject *obj;
const char *path;
ObjectCreatedData *odata;
odata = g_slice_new (ObjectCreatedData);
odata->sel... | false | false | false | false | false | 0 |
GetComments(int start, int end, vector<StringPiece> *ranges) {
// short circuit out if we've not yet initialized comments_
// (e.g., when save_comments is false)
if (!comments_) {
return;
}
// TODO: if we guarantee that comments_ will contain StringPieces
// that are ordered by their start, then we can ... | false | false | false | false | false | 0 |
ext2fs_find_first_zero_generic_bmap(ext2fs_generic_bitmap bitmap,
__u64 start, __u64 end, __u64 *out)
{
__u64 cstart, cend, cout;
errcode_t retval;
if (!bitmap)
return EINVAL;
if (EXT2FS_IS_32_BITMAP(bitmap)) {
blk_t blk = 0;
if (((start) & ~0xffffffffULL) ||
((end) & ~0xffffffffULL)) {
... | false | false | false | false | false | 0 |
nand_onfi_get_features(struct mtd_info *mtd, struct nand_chip *chip,
int addr, uint8_t *subfeature_param)
{
int i;
if (!chip->onfi_version ||
!(le16_to_cpu(chip->onfi_params.opt_cmd)
& ONFI_OPT_CMD_SET_GET_FEATURES))
return -EINVAL;
chip->cmdfunc(mtd, NAND_CMD_GET_FEATURES, addr, -1);
for (i = 0;... | false | false | false | false | false | 0 |
FindBatch(
void *theEnv,
char *logicalName)
{
#if MAC_MCW || IBM_MCW || MAC_XCD
#pragma unused(theEnv)
#endif
if (strcmp(logicalName,"stdin") == 0)
{ return(TRUE); }
return(FALSE);
} | false | false | false | false | false | 0 |
_link_tree_nodes(struct dm_tree_node *parent, struct dm_tree_node *child)
{
/* Don't link to root node if child already has a parent */
if (parent == &parent->dtree->root) {
if (dm_tree_node_num_children(child, 1))
return 1;
} else
_remove_from_toplevel(child);
if (child == &child->dtree->root) {
if (dm_t... | false | false | false | false | false | 0 |
xfer_done(struct xfer_header **xferptr)
{
struct xfer_header *xfer = *xferptr;
struct xfer_item *item, *next;
/* remove items */
item = xfer->items;
while (item) {
next = item->next;
free(item->name);
free(item->part);
free(item->acl);
free(item);
item = next;
}
/* disconnect */
... | false | false | false | false | false | 0 |
create_build_menu(BuildMenuItems *build_menu_items)
{
GtkWidget *menu;
GtkAccelGroup *accel_group = gtk_accel_group_new();
GeanyKeyGroup *keygroup = keybindings_get_core_group(GEANY_KEY_GROUP_BUILD);
guint i, j;
menu = gtk_menu_new();
build_menu_items->menu_item[GEANY_GBG_FT] = g_new0(GtkWidget*, build_groups_co... | false | false | false | false | false | 0 |
fixColours(PartnerMap partners, bool anti,
double colourDisrupt) const {
PartnerMap::iterator prev;
tPPtr pnew, pold;
assert(partners.size()>=2);
PartnerMap::iterator it=partners.begin();
while(it != partners.end()) {
//skip the first one to have a partner
if(it==partners.begin()){
it... | false | false | false | false | false | 0 |
ADTS_SyncFrame(GF_BitStream *bs, Bool is_complete, ADTSHeader *hdr)
{
u32 val;
u64 start_pos, pos;
start_pos = gf_bs_get_position(bs);
while (gf_bs_available(bs)) {
val = gf_bs_read_u8(bs);
if (val!=0xFF) continue;
val = gf_bs_read_int(bs, 4);
if (val != 0x0F) {
gf_bs_read_int(bs, 4);
continue;
}
... | false | false | false | false | false | 0 |
readXdgListEntry(const char *key, const QStringList& aDefault) const
{
Q_ASSERT_X(isValid(), "KConfigGroup::readXdgListEntry", "accessing an invalid group");
const QString data = readEntry(key, QString());
if (data.isNull())
return aDefault;
QStringList value;
QString val;
val.reserve(... | false | false | false | false | false | 0 |
adjust_lengths_r(node *p)
{
node *q;
p->v = adjusted_v(p->v);
p->back->v = p->v;
if (!p->tip) {
for (q = p->next; q != p; q = q->next)
adjust_lengths_r(q->back);
}
} | false | false | false | false | false | 0 |
clean_target_met(struct smq_policy *mq, bool critical)
{
if (critical) {
/*
* Cache entries may not be populated. So we're cannot rely on the
* size of the clean queue.
*/
unsigned nr_clean = from_cblock(mq->cache_size) - q_size(&mq->dirty);
unsigned target = from_cblock(mq->cache_size) * CLEAN_TARGET_... | false | false | false | false | false | 0 |
ff_h264_idct_dc_add_c(uint8_t *dst, DCTELEM *block, int stride){
int i, j;
uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
int dc = (block[0] + 32) >> 6;
for( j = 0; j < 4; j++ )
{
for( i = 0; i < 4; i++ )
dst[i] = cm[ dst[i] + dc ];
dst += stride;
}
} | false | false | false | false | false | 0 |
add_rtc_cmos(void)
{
#ifdef CONFIG_PNP
static const char * const ids[] __initconst =
{ "PNP0b00", "PNP0b01", "PNP0b02", };
struct pnp_dev *dev;
struct pnp_id *id;
int i;
pnp_for_each_dev(dev) {
for (id = dev->id; id; id = id->next) {
for (i = 0; i < ARRAY_SIZE(ids); i++) {
if (compare_pnp_id(id, ids... | false | false | false | false | false | 0 |
page_mkclean_one(struct page *page, struct vm_area_struct *vma,
unsigned long address, void *arg)
{
struct mm_struct *mm = vma->vm_mm;
pte_t *pte;
spinlock_t *ptl;
int ret = 0;
int *cleaned = arg;
pte = page_check_address(page, mm, address, &ptl, 1);
if (!pte)
goto out;
if (pte_dirty(*pte) || pte_wri... | false | false | false | false | false | 0 |
command_help (argc, argv)
int argc;
char *argv[];
{
int i;
char buff[256];
const char *p;
switch (argc) {
case 1:
/*
* List up all command helps
*/
for (i = 0; command_table[i].name != NULL; i++) {
sprintf (buff, "%s %s",
command_table[i].name, command_table[i].option_... | false | false | false | false | false | 0 |
rgbe_RGBEToFloat(FIRGBF *rgbf, BYTE rgbe[4]) {
if (rgbe[3]) { // nonzero pixel
float f = (float)(ldexp(1.0, rgbe[3] - (int)(128+8)));
rgbf->red = rgbe[0] * f;
rgbf->green = rgbe[1] * f;
rgbf->blue = rgbe[2] * f;
}
else {
rgbf->red = rgbf->green = rgbf->blue = 0;
}
} | false | false | false | false | false | 0 |
NormaliseSubsector(subsec_t *sub)
{
seg_t *new_head = NULL;
seg_t *new_tail = NULL;
# if DEBUG_SUBSEC
PrintDebug("Subsec: Normalising %d\n", sub->index);
# endif
while (sub->seg_list)
{
// remove head
seg_t *cur = sub->seg_list;
sub->seg_list = cur->next;
// only add non-minisegs to new lis... | false | false | false | false | false | 0 |
sys_close_audio(void)
{
if (sys_externalschedlib)
{
return;
}
if (!audio_isopen())
return;
#ifdef USEAPI_PORTAUDIO
if (sys_audioapiopened == API_PORTAUDIO)
pa_close_audio();
else
#endif
#ifdef USEAPI_JACK
if (sys_audioapiopened == API_JACK)
jack_close_audio()... | false | false | false | false | false | 0 |
se_SetWatchedObject( eCamera * cam, eGameObject * obj )
{
nObserverPtr< ePlayerNetID > & player = se_GetWatchedPlayer( cam );
// switch the favorite player to watch if we switch away from him deliberately
if ( !player || ( player->Object() && player->Object()->Alive() ) )
{
// determine the pla... | false | false | false | false | false | 0 |
AlignmentHomogenousGapsym(char **aseq, int nseq, int alen, char gapsym)
{
int i, apos;
for (i = 0; i < nseq; i++)
for (apos = 0; apos < alen; apos++)
if (isgap(aseq[i][apos])) aseq[i][apos] = gapsym;
} | false | false | false | false | false | 0 |
cc_step(uint16_t pc)
{
int b;
uint8_t status;
b = find_breakpoint(pc);
if (b != -1)
disable_breakpoint(b);
status = ccdbg_step_instr(s51_dbg);
if (b != -1)
enable_breakpoint(b);
return status;
} | false | false | false | false | false | 0 |
matrixUnconfigSuperLU(matrix_ *r)
{
matrixLibrary_ *p;
ReturnErrIf(r == NULL);
p = r->library;
ReturnErrIf(p == NULL);
Debug("Unconfiguring Solution %p", r);
SUPERLU_FREE(p->perm_r);
SUPERLU_FREE(p->perm_c);
SUPERLU_FREE(p->etree);
SUPERLU_FREE(p->R);
SUPERLU_FREE(p->C);
SUPERLU_FREE(p->ferr);
SUPE... | false | false | false | false | false | 0 |
excel_read_NUMBER (BiffQuery *q, ExcelReadSheet *esheet, size_t ofs)
{
XL_CHECK_CONDITION (q->length >= ofs + 8);
excel_sheet_insert_val
(esheet, q,
value_new_float (gsf_le_get_double (q->data + ofs)));
} | false | false | false | false | false | 0 |
invalidate(AffcorControls *controls)
{
controls->calculated = FALSE;
if (controls->invalid_corr
|| controls->args->image_mode != IMAGE_CORRECTED)
return;
if (controls->recalculate_id)
return;
controls->recalculate_id = g_idle_add(recalculate, controls);
} | false | false | false | false | false | 0 |
link_serve_address(const char *addr, int port)
{
struct link *link = 0;
struct sockaddr_in address;
int success;
int value;
link = link_create();
if(!link)
goto failure;
link->fd = socket(AF_INET, SOCK_STREAM, 0);
if(link->fd < 0)
goto failure;
value = 1;
setsockopt(link->fd, SOL_SOCKET, SO_REUSEADDR, ... | false | false | false | false | false | 0 |
trackRemoved( Playlists::PlaylistPtr playlist, int position )
{
int indexNumber = m_playlists.indexOf( playlist );
if( indexNumber == -1 )
{
error() << "This playlist is not in the list of this model.";
return;
}
QModelIndex playlistIdx = index( indexNumber, 0, QModelIndex() );
b... | false | false | false | false | false | 0 |
tp_call_content_media_description_set_rtcp_feedback_minimum_interval (
TpCallContentMediaDescription *self,
guint codec_identifier,
guint rtcp_minimum_interval)
{
GValueArray *properties;
GValue *value;
g_return_if_fail (TP_IS_CALL_CONTENT_MEDIA_DESCRIPTION (self));
properties = ensure_rtcp_feedba... | false | false | false | false | false | 0 |
getStats( // get subtree statistics
int dim, // dimension of space
ANNkdStats &st, // stats (modified)
ANNorthRect &bnd_box) // bounding box
{
ANNkdStats ch_stats; // stats for children
ANNorthRect inner_box(dim); // inner box of shrink
annBnds2Box(bnd_box, // enclosing box
... | false | false | false | false | false | 0 |
gt_sequence_buffer_set_desc_buffer(GtSequenceBuffer *si, GtDescBuffer *db)
{
gt_assert(si && si->pvt && db);
si->pvt->descptr = db;
} | false | false | false | false | false | 0 |
__pata_platform_probe(struct device *dev, struct resource *io_res,
struct resource *ctl_res, struct resource *irq_res,
unsigned int ioport_shift, int __pio_mask,
struct scsi_host_template *sht)
{
struct ata_host *host;
struct ata_port *ap;
unsigned int mmio;
int irq = 0;
int irq_flags = 0;
/*
* ... | false | false | false | false | false | 0 |
VSM_n_Arg(struct VSM_data *vd, const char *opt)
{
CHECK_OBJ_NOTNULL(vd, VSM_MAGIC);
AN(opt);
REPLACE(vd->n_opt, opt);
if (VIN_N_Arg(vd->n_opt, NULL, NULL, &vd->fname))
return (vsm_diag(vd, "Invalid instance name: %s\n",
strerror(errno)));
return (1);
} | false | false | false | false | false | 0 |
compute_antialias_float(MPADecodeContext *s,
GranuleDef *g)
{
int32_t *ptr;
int n, i;
/* we antialias only "long" bands */
if (g->block_type == 2) {
if (!g->switch_point)
return;
/* XXX: check this for 8000Hz case */
n = 1;
} else {
... | false | false | false | false | false | 0 |
platform_entropy_poll( void *data,
unsigned char *output, size_t len, size_t *olen )
{
FILE *file;
size_t ret;
((void) data);
*olen = 0;
file = fopen( "/dev/urandom", "rb" );
if( file == NULL )
return POLARSSL_ERR_ENTROPY_SOURCE_FAILED;
ret = fread( ... | false | false | false | false | true | 1 |
ParseTryStatement(bool* ok) {
// TryStatement ::
// 'try' Block Catch
// 'try' Block Finally
// 'try' Block Catch Finally
//
// Catch ::
// 'catch' '(' Identifier ')' Block
//
// Finally ::
// 'finally' Block
// In preparsing, allow any number of catch/finally blocks, including zero
/... | false | false | false | false | false | 0 |
gerbv_draw_rectangle(cairo_t *cairoTarget, gdouble width1, gdouble height1, gboolean pixelOutput)
{
gdouble width = width1, height = height1;
if (pixelOutput) {
cairo_user_to_device_distance (cairoTarget, &width, &height);
width = round(width);
height = round(height);
width -= ((int)width % 2);
height -= ((... | false | false | false | false | false | 0 |
create_server_config (apr_pool_t *p, server_rec *s)
{
value arg = Val_server_rec (s);
value *v = alloc_root_value (p);
static value *f = NULL;
if(f == NULL) f = caml_named_value("netcgi2_apache_create_server_config");
*v = callback(*f, arg);
return v;
} | false | false | false | false | false | 0 |
snd_es1938_new_pcm(struct es1938 *chip, int device)
{
struct snd_pcm *pcm;
int err;
if ((err = snd_pcm_new(chip->card, "es-1938-1946", device, 2, 1, &pcm)) < 0)
return err;
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_es1938_playback_ops);
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_es1938_captu... | false | false | false | false | false | 0 |
bof_entry_grow(bof_t *bof)
{
bof_t **array;
if (bof->array_size < bof->nentry)
return 0;
array = realloc(bof->array, (bof->nentry + 16) * sizeof(void*));
if (array == NULL)
return -ENOMEM;
bof->array = array;
bof->nentry += 16;
return 0;
} | false | false | false | false | false | 0 |
link_changed( ED4_base *link )
{
if ( (width_link == link) || (height_link == link) )
if ( calc_bounding_box() )
if ( parent != NULL )
parent->resize_requested_by_child();
return ( ED4_R_OK );
} | false | false | false | false | false | 0 |
zmod_poly_gcd_euclidean(zmod_poly_t res, zmod_poly_t poly1, zmod_poly_t poly2)
{
zmod_poly_t R, A, B;
int steps = 0;
if (poly1->length == 0)
{
if (poly2->length == 0)
zmod_poly_zero(res);
else zmod_poly_make_monic(res, poly2);
return;
}
if (poly2->length == 0)
{
zmod_poly_make... | false | false | false | false | false | 0 |
parse (ACEXML_InputSource *input)
{
if (input == 0)
{
this->fatal_error(ACE_TEXT ("Invalid input source"));
}
if (this->content_handler_ == 0)
{
this->fatal_error (ACE_TEXT ("No content handlers defined. Exiting.."));
}
if (this->validate_ && this->dtd_handler_ == 0)
{
this-... | false | false | false | false | false | 0 |
cb_field (cb_tree x)
{
if (CB_REFERENCE_P (x)) {
return CB_FIELD (cb_ref (x));
} else {
return CB_FIELD (x);
}
} | false | false | false | false | false | 0 |
cell_comment_set_property (GObject *obj, guint param_id,
GValue const *value, GParamSpec *pspec)
{
GnmComment *cc = CELL_COMMENT (obj);
switch (param_id) {
case CC_PROP_TEXT:
g_free (cc->text);
cc->text = g_value_dup_string (value);
break;
case CC_PROP_AUTHOR:
g_free (cc->author);
cc->author = g_va... | false | false | false | false | false | 0 |
removeLodLevels(void)
{
#if !OGRE_NO_MESHLOD
// Remove data from SubMeshes
SubMeshList::iterator isub, isubend;
isubend = mSubMeshList.end();
for (isub = mSubMeshList.begin(); isub != isubend; ++isub)
{
(*isub)->removeLodLevels();
}
bool edgeListW... | false | false | false | false | false | 0 |
sentinelInfoReplyCallback(redisAsyncContext *c, void *reply, void *privdata) {
sentinelRedisInstance *ri = c->data;
redisReply *r;
REDIS_NOTUSED(privdata);
if (ri) ri->pending_commands--;
if (!reply || !ri) return;
r = reply;
if (r->type == REDIS_REPLY_STRING) {
sentinelRefreshInst... | false | false | false | false | false | 0 |
filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev,
struct nfs_page *req)
{
unsigned int size;
u64 p_stripe, r_stripe;
u32 stripe_offset;
u64 segment_offset = pgio->pg_lseg->pls_range.offset;
u32 stripe_unit = FILELAYOUT_LSEG(pgio->pg_lseg)->stripe_unit;
/* calls nfs_generic_pg_tes... | false | false | false | false | false | 0 |
smgrinit(void)
{
int i;
for (i = 0; i < NSmgr; i++)
{
if (smgrsw[i].smgr_init)
(*(smgrsw[i].smgr_init)) ();
}
/* register the shutdown proc */
on_proc_exit(smgrshutdown, 0);
} | false | false | false | false | false | 0 |
_window_tracker_dbus_controllable_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
UnityWebappsWindowTrackerDbusControllable *track... | false | false | false | false | false | 0 |
__connman_ipconfig_gateway_add(struct connman_ipconfig *ipconfig)
{
struct connman_service *service;
DBG("");
if (ipconfig->address == NULL)
return -EINVAL;
service = __connman_service_lookup_from_index(ipconfig->index);
if (service == NULL)
return -EINVAL;
__connman_connection_gateway_remove(service, ipc... | false | false | false | false | false | 0 |
make_kit() {
String gui;
if (Session::instance()->style()->find_attribute("gui", gui)) {
#ifdef bw_kit
if (gui == "monochrome") {
return new MonoKit;
}
#endif
#if defined(motif_kit)
if (gui == "Motif" || gui == "motif") {
return new MFKit;
}
#endif
#ifdef openlook_kit
if (gui == "OpenLook" || gui... | false | false | false | false | false | 0 |
ubifs_write_end(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len, unsigned copied,
struct page *page, void *fsdata)
{
struct inode *inode = mapping->host;
struct ubifs_inode *ui = ubifs_inode(inode);
struct ubifs_info *c = inode->i_sb->s_fs_info;
loff_t end_pos = pos + len;
in... | false | false | false | false | false | 0 |
get_constant_of_unit(const eng_convert_unit_t units[],
const eng_convert_unit_t prefixes[],
char const *unit_name,
gnm_float *c, gnm_float *prefix)
{
int i;
*prefix = 1;
for (i = 0; units[i].str != NULL; i++)
if (strcmp (unit_name, units[i].str) == 0) {
*c = units[i].c... | false | false | false | false | false | 0 |
gnc_split_register_add_transaction (SplitRegister *reg,
Transaction *trans,
Split *split,
CellBlock *lead_cursor,
CellBlock *split_cursor,
g... | false | false | false | false | false | 0 |
load_config(
string filename,
TreeHandler* pConfig,
const Glib::RefPtr<Gnome::Glade::Xml>& refGlade,
MainWindow* pWindow)
{
//todo: check use of strtol() !
if(!Utils::Io::check_file(filename)) // if file does not exists (or is no regular file)
return 0;
/*parse the file and get the DOM... | false | false | false | false | false | 0 |
check_bt_mac(char *bt_mac)
{
ssize_t readlen;
u32 bt_mac_value[4];
readlen = file_read_urandom(bt_mac_value, sizeof(bt_mac_value));
if (readlen < 0)
{
unsigned int i;
for (i = 0; i < ARRAY_SIZE(bt_mac_value); i++)
{
bt_mac_value[i] = random();
}
}
sscanf(bt_mac, "&0001 = %x %x %x %x", bt_mac_value,... | false | true | false | false | true | 1 |
ensQcdasfeatureadaptorStore(EnsPQcdasfeatureadaptor qcdasfa,
EnsPQcdasfeature qcdasf)
{
AjBool result = AJFALSE;
AjPSqlstatement sqls = NULL;
AjPStr statement = NULL;
EnsPDatabaseadaptor dba = NULL;
if (!qcdasfa)
return ajFalse;
if (!qcdasf)
... | false | false | false | false | false | 0 |
tp_dbus_tube_channel_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
TpDBusTubeChannel *self = (TpDBusTubeChannel *) object;
switch (property_id)
{
case PROP_SERVICE_NAME:
g_value_set_string (value,
tp_dbus_tube_channel_get_service_nam... | false | false | false | false | false | 0 |
set_type(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
struct lm95234_data *data = dev_get_drvdata(dev);
unsigned long val;
u8 mask = to_sensor_dev_attr(attr)->index;
int ret = lm95234_update_device(data);
if (ret)
return ret;
ret = kstrtoul(buf, 10, &val);
if (ret < ... | false | false | false | false | false | 0 |
snd_atiixp_interrupt(int irq, void *dev_id)
{
struct atiixp *chip = dev_id;
unsigned int status;
status = atiixp_read(chip, ISR);
if (! status)
return IRQ_NONE;
/* process audio DMA */
if (status & ATI_REG_ISR_OUT_XRUN)
snd_atiixp_xrun_dma(chip, &chip->dmas[ATI_DMA_PLAYBACK]);
else if (status & ATI_REG_I... | false | false | false | false | false | 0 |
get_femission_score_trunc(CM_t *cm, ESL_DSQ *dsq, int v, int i, int j, char mode)
{
switch(cm->sttype[v]) {
case ML_st:
case IL_st:
if(ModeEmitsLeft(mode)) return cm->oesc[v][dsq[i]];
else return 0.;
break;
case MR_st:
case IR_st:
if(ModeEmitsRight(mode)) return cm->oesc[v]... | false | false | false | false | false | 0 |
listSearchKey(list *list, void *key)
{
listIter *iter;
listNode *node;
iter = listGetIterator(list, AL_START_HEAD);
while((node = listNext(iter)) != NULL) {
if (list->match) {
if (list->match(node->value, key)) {
listReleaseIterator(iter);
return node... | false | false | false | false | false | 0 |
load_code_heap(FILE *file, image_header *h, vm_parameters *p)
{
if(h->code_size > p->code_size)
fatal_error("Code heap too small to fit image",h->code_size);
init_code_heap(p->code_size);
if(h->code_size != 0)
{
size_t bytes_read = safe_fread(code->allocator->first_block(),1,h->code_size,file);
if(bytes_rea... | false | false | false | false | false | 0 |
vformat(const char* fmt, va_list ap)
{
//XXX can truncate but cant do much about it without va_copy
int size = DEFAULT_FORMAT_BUFFER;
fxStr s;
char* tmp = NULL;
int len = 0;
do
{
if (len)
size *= 2;
tmp = (char*)realloc(tmp, size);
va_list ac;
va_copy(ac, ap);
len = vsnprintf(tmp... | false | false | false | false | false | 0 |
collect_types(HashTable<ElementClassT *, int> &m) const
{
HashTable<ElementClassT *, int>::iterator it = m.find_insert(const_cast<RouterT *>(this), 0);
if (it.value() == 0) {
it.value() = 1;
for (int i = 0; i < _declared_types.size(); i++)
_declared_types[i].type->collect_types(m);
for (int i = 0; i < _... | false | false | false | false | false | 0 |
ScrollBy (int dx, int dy) {
if (dx != 0 || dy != 0) {
ScrollTo(perspective->curx + dx, perspective->cury + dy);
}
} | false | false | false | false | false | 0 |
callback_send_g_polygon_set_face_uint8(void *user, VNodeID node_id, VLayerID layer_id, uint32 polygon_id, uint8 value)
{
VSNodeGeometry *node;
unsigned int i, count;
node = (VSNodeGeometry *)vs_get_node(node_id, V_NT_GEOMETRY);
if(node == NULL)
return;
if(layer_id >= node->layer_count || node->layer[layer_id].l... | false | false | false | false | false | 0 |
cmsCreateMultiprofileTransformTHR(cmsContext ContextID,
cmsHPROFILE hProfiles[],
cmsUInt32Number nProfiles,
cmsUInt32Number InputFormat,
... | false | false | false | false | false | 0 |
nv_help(void)
{
int i;
printf("Command syntax is:\n\n"
" nv <type> <valuename>\n\n"
"where <type> should be the HEX NUMBER from one of these registry value types:\n\n");
for (i=0; i < REG_MAX; i++) {
printf(" %2x : %s\n",i,val_types[i]);
}
printf("\nExample:\n nv 4 foobar\n");
printf("to make a ne... | false | false | false | false | false | 0 |
upsc_getparams(const char *cmd, const simple_t *table)
{
char var[UPSC_BUFLEN];
char val[UPSC_BUFLEN];
int first = 1;
upsc_flush_input();
upscsend(cmd);
buffer_empty = 0;
while (!buffer_empty) {
upscrecv(var);
if (strlen(var) == 0) {
if (first)
upscrecv(var);
if (strlen(var) == 0) {
ser_comm_... | false | false | false | false | false | 0 |
internal_expunge(int sock)
/* ship an expunge, resetting associated counters */
{
int ok;
actual_deletions = 0;
if ((ok = gen_transact(sock, "EXPUNGE")))
return(ok);
/* if there is a mismatch between the number of mails which should
* have been expunged and the number of mails actually expunged... | false | false | false | false | false | 0 |
saveFile(const char *fileName,
const E_TransferSyntax writeXfer,
const E_EncodingType encodingType,
const E_GrpLenEncoding groupLength,
const E_PaddingEncoding padEncoding,
... | false | false | false | false | false | 0 |
check_prereqs(void *data, void *state)
{
encap_profile_t *epp;
profile_prereq_t *ppp;
profile_environment_t *pep;
char buf[MAXPATHLEN], pkgdir[MAXPATHLEN];
struct stat s;
ppp = (profile_prereq_t *)data;
epp = (encap_profile_t *)state;
snprintf(pkgdir, sizeof(buf), "%s/%s", source, ppp->pp_pkgspec);
if (stat(... | false | false | false | false | false | 0 |
nvkm_vm_link(struct nvkm_vm *vm, struct nvkm_gpuobj *pgd)
{
struct nvkm_mmu *mmu = vm->mmu;
struct nvkm_vm_pgd *vpgd;
int i;
if (!pgd)
return 0;
vpgd = kzalloc(sizeof(*vpgd), GFP_KERNEL);
if (!vpgd)
return -ENOMEM;
vpgd->obj = pgd;
mutex_lock(&vm->mutex);
for (i = vm->fpde; i <= vm->lpde; i++)
mmu->f... | false | false | false | false | false | 0 |
LengthFunction(
void *theEnv)
{
DATA_OBJECT item;
/*====================================================*/
/* The length$ function expects exactly one argument. */
/*====================================================*/
if (EnvArgCountCheck(theEnv,"length$",EXACTLY,1) == -1) return(-1L);
EnvRtn... | false | false | false | false | false | 0 |
glade_gtk_table_configure_end (GladeFixed *fixed,
GladeWidget *child,
GtkWidget *table)
{
GladeGtkTableChild new_child = { child, };
glade_widget_pack_property_get (child, "left-attach",
&new_child.left_attach);
glade_widget_pack_property_get (child, "right-attach",
&new_child.rig... | false | false | false | false | false | 0 |
init_list(KILL_FILE *file)
{
KILL_WIDGETS *w = file->w;
char buffer[256];
long n;
ScrListClearLines(w->list);
for (n = 0 ; n < file->n ; n++) {
sprint_kill_node(file->nodes[n], buffer, sizeof buffer);
ScrListAddLine(w->list, buffer, file->nodes[n]->pixmap);
}
Remanage(w->listmgr);
} | false | false | false | false | false | 0 |
addPath<agg::rasterizer_scanline_aa<> >(agg::rasterizer_scanline_aa<>& ras,
const agg::trans_affine& tr,
const AST::CommandInfo& attr)
{
apply(attr, tr, 1.0);
if (attr.mFlags & AST::CF_FILL) {
... | false | false | false | false | false | 0 |
limitMaxResultSize( int size )
{
//forward the call so the m_builders do not have to do work
//that we definitely know is unnecessary (like returning more than size results)
//we have to limit the combined result of all m_builders nevertheless
m_maxResultSize = size;
foreach( QueryMaker *b, m_builde... | false | false | false | false | false | 0 |
pkcs7_verify(struct pkcs7_message *pkcs7,
enum key_being_used_for usage)
{
struct pkcs7_signed_info *sinfo;
struct x509_certificate *x509;
int enopkg = -ENOPKG;
int ret, n;
kenter("");
switch (usage) {
case VERIFYING_MODULE_SIGNATURE:
if (pkcs7->data_type != OID_data) {
pr_warn("Invalid module sig (not... | false | false | false | false | false | 0 |
tftpd_clientlist_done(struct thread_data *thread,
struct client_info *client,
struct sockaddr_storage *sock)
{
struct client_info *head = thread->client_info;
pthread_mutex_lock(&thread->client_mutex);
if (client)
{
client->done = 1;
... | false | false | false | false | false | 0 |
xer_check_tag(const void *buf_ptr, int size, const char *need_tag) {
const char *buf = (const char *)buf_ptr;
const char *end;
xer_check_tag_e ct = XCT_OPENING;
if(size < 2 || buf[0] != LANGLE || buf[size-1] != RANGLE) {
if(size >= 2)
ASN_DEBUG("Broken XML tag: \"%c...%c\"", buf[0], buf[size - 1]);
return XC... | false | false | false | false | false | 0 |
setAnnotationText(UT_uint32 iAnnotation, const std::string & sText,
const std::string & sAuthor, const std::string & sTitle)
{
fl_AnnotationLayout * pAL = getAnnotationLayout(iAnnotation);
if(!pAL)
return false;
pf_Frag_Strux* sdhStart = pAL->getStruxDocHandle();
pf_Frag_Strux* sd... | false | false | false | false | false | 0 |
it87_gpio_set(struct gpio_chip *chip,
unsigned gpio_num, int val)
{
u8 mask, curr_vals;
u16 reg;
struct it87_gpio *it87_gpio = to_it87_gpio(chip);
mask = 1 << (gpio_num % 8);
reg = (gpio_num / 8) + it87_gpio->io_base;
curr_vals = inb(reg);
if (val)
outb(curr_vals | mask, reg);
else
outb(curr_vals & ~... | 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.