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 |
|---|---|---|---|---|---|---|
sin_set_ip(union sockaddr_union *so, const IPADDR *ip)
{
if (ip == NULL) {
#ifdef HAVE_IPV6
so->sin6.sin6_family = AF_INET6;
so->sin6.sin6_addr = in6addr_any;
#else
so->sin.sin_family = AF_INET;
so->sin.sin_addr.s_addr = INADDR_ANY;
#endif
return;
}
so->sin.sin_family = ip->family;
#ifdef HAVE_IPV6
if (i... | false | true | false | false | false | 1 |
bp__destroy(bp_db_t* tree) {
bp__writer_destroy((bp__writer_t*) tree);
if (tree->head.page != NULL) {
bp__page_destroy(tree, tree->head.page);
tree->head.page = NULL;
}
} | false | false | false | false | false | 0 |
xmlConfiguration() const
{
QDomDocument doc;
QDomElement root = doc.createElement(::TAG_ROOT);
doc.appendChild(root);
QStringList savedServerUuid; // Avoid duplicates
for(int i = 0; i < m_Servers.count(); ++i) {
const Server &s = m_Servers.at(i);
if (savedServerUuid.contains(s.uuid(... | false | false | false | false | false | 0 |
remove_record(DBusConnection *conn, const char *sender,
struct service_adapter *serv_adapter,
dbus_uint32_t handle)
{
struct record_data *user_record;
DBG("remove record 0x%x", handle);
user_record = find_record(serv_adapter, handle, sender);
if (!user_record)
return -1;
DBG("listner_id %d", user_record... | false | false | false | false | false | 0 |
skl_pcm_new(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_dai *dai = rtd->cpu_dai;
struct hdac_ext_bus *ebus = dev_get_drvdata(dai->dev);
struct snd_pcm *pcm = rtd->pcm;
unsigned int size;
int retval = 0;
struct skl *skl = ebus_to_skl(ebus);
if (dai->driver->playback.channels_min ||
dai->driver->capture.c... | false | false | false | false | false | 0 |
do_push(const char *refspecs[], size_t refspecs_len,
push_status expected_statuses[], size_t expected_statuses_len,
expected_ref expected_refs[], size_t expected_refs_len, int expected_ret)
{
git_push *push;
git_push_options opts = GIT_PUSH_OPTIONS_INIT;
size_t i;
int ret;
if (_remote) {
/* Auto-detect the nu... | false | false | false | false | false | 0 |
standard_advance(archive_file_ty *afp)
{
int nbytes;
struct ar_hdr *h;
h = afp->header;
assert(h);
nbytes = read(afp->fd, h, sizeof(*h));
if (nbytes < 0)
return -1;
if (nbytes == 0)
{
errno = ENOENT;
return -1;
}
if (nbytes != sizeof(*h))
... | false | true | false | false | true | 1 |
fc_vport_sched_delete(struct work_struct *work)
{
struct fc_vport *vport =
container_of(work, struct fc_vport, vport_delete_work);
int stat;
stat = fc_vport_terminate(vport);
if (stat)
dev_printk(KERN_ERR, vport->dev.parent,
"%s: %s could not be deleted created via "
"shost%d channel %d - error %d\n", __... | false | false | false | false | false | 0 |
cmd_lq(int dev_id, int argc, char **argv)
{
struct hci_conn_info_req *cr;
bdaddr_t bdaddr;
uint8_t lq;
int opt, dd;
for_each_opt(opt, lq_options, NULL) {
switch (opt) {
default:
printf("%s", lq_help);
return;
}
}
helper_arg(1, 1, &argc, &argv, lq_help);
str2ba(argv[0], &bdaddr);
if (dev_id < 0) ... | false | false | false | false | false | 0 |
inventory_item_deleted(G_GNUC_UNUSED GwyInventory *inventory,
guint pos,
GtkTreeStore *store)
{
GrainValueStorePrivate *priv;
GtkTreeIter siter, iter;
priv = g_object_get_qdata(G_OBJECT(store), priv_quark);
g_return_if_fail(pos >= priv->user_start_pos);
... | false | false | false | false | false | 0 |
gst_debug_category_set_threshold (GstDebugCategory * category,
GstDebugLevel level)
{
g_return_if_fail (category != NULL);
if (level > _gst_debug_min) {
_gst_debug_enabled = TRUE;
_gst_debug_min = level;
}
g_atomic_int_set (&category->threshold, level);
} | false | false | false | false | false | 0 |
buffers_match(const struct download *d, const char *data, size_t len)
{
const struct dl_buffers *b;
slist_iter_t *iter;
download_check(d);
socket_check(d->socket);
g_assert(d->buffers != NULL);
g_assert(d->status == GTA_DL_RECEIVING);
b = d->buffers;
g_assert(len <= b->held);
iter = slist_iter_before_head(b... | false | false | false | false | false | 0 |
parse_icmpv6(const char *icmpv6type, uint8_t type[], uint8_t code[])
{
static const unsigned int limit = ARRAY_SIZE(icmpv6_codes);
unsigned int match = limit;
unsigned int i;
long number[2];
for (i = 0; i < limit; i++) {
if (strncasecmp(icmpv6_codes[i].name, icmpv6type, strlen(icmpv6type)))
continue;
if (m... | false | false | false | false | false | 0 |
tsmux_stream_find_pts_dts_within (TsMuxStream * stream, guint bound,
gint64 * pts, gint64 * dts)
{
GList *cur;
*pts = -1;
*dts = -1;
for (cur = stream->buffers; cur; cur = cur->next) {
TsMuxStreamBuffer *curbuf = cur->data;
/* FIXME: This isn't quite correct - if the 'bound' is within this
*... | false | false | false | false | false | 0 |
setTifftype(int pixeltype, /* pixel type */
int imagetype, /* image type */
int *pi, /* photometric interpretation */
int *sf, /* sample format */
int *spp, /* samples per pixel (this parameter is I/O) */
... | false | false | false | false | false | 0 |
outn(string s, size_t n, bool preformatted)
{
size_t i;
for (i = 0; i < n; i++) outc(s[i], preformatted);
} | false | false | false | false | false | 0 |
_e_border_menu_cb_netwm_icon(void *data, E_Menu *m, E_Menu_Item *mi)
{
E_Border *bd;
Evas_Object *o;
bd = data;
E_OBJECT_CHECK(bd);
if (bd->client.netwm.icons)
{
o = e_icon_add(m->evas);
e_icon_data_set(o, bd->client.netwm.icons[0].data,
bd->client.netwm.ico... | false | false | false | false | false | 0 |
hugetlbfs_dec_free_inodes(struct hugetlbfs_sb_info *sbinfo)
{
if (sbinfo->free_inodes >= 0) {
spin_lock(&sbinfo->stat_lock);
if (unlikely(!sbinfo->free_inodes)) {
spin_unlock(&sbinfo->stat_lock);
return 0;
}
sbinfo->free_inodes--;
spin_unlock(&sbinfo->stat_lock);
}
return 1;
} | false | false | false | false | false | 0 |
dataset_allocate_varnames (DATASET *dset)
{
int i, j, v = dset->v;
int err = 0;
dset->varname = strings_array_new_with_length(v, VNAMELEN);
if (dset->varname == NULL) {
return E_ALLOC;
}
dset->varinfo = malloc(v * sizeof *dset->varinfo);
if (dset->varinfo == NULL) {
free(dset->varname);
... | false | true | false | false | false | 1 |
buffer_get_token(buffer* b,char* x,size_t len,const char* charset,size_t setlen) {
size_t blen;
for (blen=0;blen<len;++blen) {
register int r;
if ((r=buffer_getc(b,x))<0) return r;
if (r==0) { *x=0; break; }
if (byte_chr(charset,setlen,*x)<setlen) break;
++x;
}
return blen;
} | false | false | false | false | false | 0 |
symdel(char *sym, int space)
{
long h;
char *p;
Symtab *s, *ls;
/* multiple memory leaks */
for(p = sym, h = space; *p; h += *p++)
h *= HASHMUL;
if(h < 0)
h = ~h;
h %= NHASH;
for(s = hash[h], ls = 0; s; ls = s, s = s->next)
if((s->space == space) && (strcmp(s->name, sym) == 0)){
if(ls)
ls->next =... | false | false | false | false | false | 0 |
tx_complete (amb_dev * dev, tx_out * tx) {
tx_simple * tx_descr = bus_to_virt (tx->handle);
struct sk_buff * skb = tx_descr->skb;
PRINTD (DBG_FLOW|DBG_TX, "tx_complete %p %p", dev, tx);
// VC layer stats
atomic_inc(&ATM_SKB(skb)->vcc->stats->tx);
// free the descriptor
kfree (tx_descr);
// f... | false | false | false | false | false | 0 |
Translate(const string &from)
{
if (!_init)
Init();
if (from.empty())
return("");
if (_from >= 0 && _to >= 0 &&
_from < (signed)_table.size() && _to < (signed)_table.size())
{
vector<vector<string> >::iterator i;
for (i = _table.begin();i != _table.end();++i)
... | false | false | false | false | false | 0 |
thread_ident_compare(GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b,
gpointer gdata)
{
char *s1, *s2;
gint result;
gtk_tree_model_get(model, a, GPOINTER_TO_INT(gdata), &s1, -1);
gtk_tree_model_get(model, b, GPOINTER_TO_INT(gdata), &s2, -1);
result = g_strcmp0(s1, s2);
if (s1 && s2)
{
const char *p1, *p... | false | false | false | false | true | 1 |
__ecereInstMeth___ecereNameSpace__ecere__gui__controls__Button_NotifyClicked__00000001(struct __ecereNameSpace__ecere__com__Instance * this, struct __ecereNameSpace__ecere__com__Instance * button, int x, int y, unsigned int mods)
{
struct SettingsDialog * __ecerePointer_SettingsDialog = (struct SettingsDialog *)(this ?... | false | false | false | false | false | 0 |
OP_LDRBT_M_LSL_IMM_OFF_POSTIND(armcpu_t *cpu)
{
u32 oldmode;
u32 i;
u32 adr;
u32 val;
u32 shift_op;
if(cpu->CPSR.bits.mode==USR)
return 2;
oldmode = armcpu_switchMode(cpu, SYS);
//execute = FALSE;
LOG("Untested opcode: OP_LDRBT_M_LSL_IMM_OFF_POSTIND");
... | false | false | false | false | false | 0 |
brcmf_sdiod_ramrw(struct brcmf_sdio_dev *sdiodev, bool write, u32 address,
u8 *data, uint size)
{
int bcmerror = 0;
struct sk_buff *pkt;
u32 sdaddr;
uint dsize;
dsize = min_t(uint, SBSDIO_SB_OFT_ADDR_LIMIT, size);
pkt = dev_alloc_skb(dsize);
if (!pkt) {
brcmf_err("dev_alloc_skb failed: len %d\n", dsize);
... | false | true | false | false | false | 1 |
read_bsd_byte(int *count = NULL, int *sum = NULL) {
char c;
if (file.read(&c, 1) != 1)
throw TruncatedRead();
if (sum)
*sum += (0xff & c);
if (count)
*count += 1;
return (0xff & c) - (int(c/16)*6);
} | false | false | false | false | false | 0 |
_e_static_grab_discard(const char *current, Eina_File_Line *line, int begin, int end)
{
while (current < line->end &&
strchr(" \t", *current))
current++;
if (*current != begin) return current;
while (current < line->end &&
*current != end)
current++;
if (current == line->end... | false | false | false | false | false | 0 |
trash_state_changed_cb (NemoTrashMonitor *monitor,
gboolean is_empty,
gpointer user_data)
{
NemoFileUndoManager *self = user_data;
if (!is_empty) {
return;
}
if (self->priv->state == NEMO_FILE_UNDO_MANAGER_STATE_NONE) {
return;
}
if (NEMO_IS_FILE_UNDO_INFO_TRASH (self->priv->info)) {
file_undo_mana... | false | false | false | false | false | 0 |
SetInternalCoord(std::vector<OBInternalCoord*> int_coord) {
if (int_coord[0] != NULL) {
std::vector<OBInternalCoord*>::iterator it = int_coord.begin();
int_coord.insert(it, static_cast<OBInternalCoord*>(NULL));
}
if (int_coord.size() != _natoms + 1) {
string error = "Number of internal co... | false | false | false | false | false | 0 |
component_init(bool enable_progress_threads, bool enable_mpi_threads)
{
int ret;
ret = ompi_free_list_init(&mca_osc_sm_component.requests,
sizeof(ompi_request_t),
OBJ_CLASS(ompi_request_t),
0,
... | false | false | false | false | false | 0 |
ToString(cec_adapter_messagecode msgCode)
{
switch (msgCode)
{
case MSGCODE_NOTHING:
return "NOTHING";
case MSGCODE_PING:
return "PING";
case MSGCODE_TIMEOUT_ERROR:
return "TIMEOUT";
case MSGCODE_HIGH_ERROR:
return "HIGH_ERROR";
case MSGCODE_LOW_ERROR:
return "LOW_ERROR";
case MSGCOD... | false | false | false | false | false | 0 |
getto(P *p, P *q)
{
while (p->hdr != q->hdr || p->ofst != q->ofst) {
if (GCHAR(p) == '\n')
++p->line;
++p->byte;
++p->ofst;
if (p->ofst == GSIZE(p->hdr))
pnext(p);
while (!p->ofst && p->hdr != q->hdr) {
p->byte += GSIZE(p->hdr);
p->line += p->hdr->nlines;
pnext(p);
}
}
return p;
} | false | false | false | false | false | 0 |
ss_return_ship(int wing_block, int wing_slot, int *ship_index, p_object **ppobjp)
{
*ship_index = -1;
*ppobjp = NULL;
ss_slot_info *ws;
Assert( Ss_wings != NULL );
if (!Wss_num_wings) {
*ppobjp = NULL;
*ship_index = Player_obj->instance;
return Player_ship->ship_info_index;
}
if ( Ss_wings[wing_block].... | false | false | false | false | false | 0 |
monitor_vert_retrace(void *_cpssp)
{
struct cpssp *cpssp = (struct cpssp *) _cpssp;
if (cpssp->width < MONITOR_WIDTH && cpssp->y < MONITOR_HEIGHT) {
monitor_found_sync(cpssp);
cpssp->height = cpssp->y;
if (cpssp->width != cpssp->last_width
|| cpssp->height != cpssp->last_height) {
if (cpssp->height ... | false | false | false | false | false | 0 |
get_node_of_insn (ddg_ptr g, rtx insn)
{
int i;
for (i = 0; i < g->num_nodes; i++)
if (insn == g->nodes[i].insn)
return &g->nodes[i];
return NULL;
} | false | false | false | false | false | 0 |
snippets_key_release_cb (GuSnippets* sc, GuEditor* ec, GdkEventKey* e) {
if (e->keyval != GDK_KEY_Tab && !sc->info)
return FALSE;
if (sc->info)
snippet_info_sync_group (sc->info, ec);
return FALSE;
} | false | false | false | false | false | 0 |
xgc_block_is_freeable(size_t len, struct xgc_context *xgctx, bool commit)
{
struct xsplit *xs;
size_t i1, i2 = 0;
if G_UNLIKELY(0 == len)
return TRUE;
g_assert(len >= XMALLOC_SPLIT_MIN);
if (len > XMALLOC_MAXSIZE)
return FALSE;
/*
* Compute the freelists into which the block would end-up being freed.
... | false | false | false | false | false | 0 |
bgx_sgmii_change_link_state(struct lmac *lmac)
{
struct bgx *bgx = lmac->bgx;
u64 cmr_cfg;
u64 port_cfg = 0;
u64 misc_ctl = 0;
cmr_cfg = bgx_reg_read(bgx, lmac->lmacid, BGX_CMRX_CFG);
cmr_cfg &= ~CMR_EN;
bgx_reg_write(bgx, lmac->lmacid, BGX_CMRX_CFG, cmr_cfg);
port_cfg = bgx_reg_read(bgx, lmac->lmacid, BGX_GM... | false | false | false | false | false | 0 |
vfio_unpin_pages(unsigned long pfn, long npage,
int prot, bool do_accounting)
{
unsigned long unlocked = 0;
long i;
for (i = 0; i < npage; i++)
unlocked += put_pfn(pfn++, prot);
if (do_accounting)
vfio_lock_acct(-unlocked, NULL);
return unlocked;
} | false | false | false | false | false | 0 |
vnc_display_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
VncDisplay *vnc = VNC_DISPLAY (object);
switch (prop_id)
{
case PROP_POINTER_LOCAL:
g_value_set_bo... | false | false | false | false | false | 0 |
documentLoaded()
{
const int pageCount = document()->numPages();
for (int i = 0; i < pageCount; ++i) {
m_pageCombo->addItem(QString::number(i + 1));
}
m_pageCombo->setEnabled(true);
} | false | false | false | false | false | 0 |
gf_smil_mark_modified(SMIL_Timing_RTI *rti, Bool remove)
{
GF_SceneGraph * sg = rti->timed_elt->sgprivate->scenegraph;
while (sg->parent_scene) sg = sg->parent_scene;
if (remove) {
gf_list_del_item(sg->modified_smil_timed_elements, rti);
} else {
gf_list_add(sg->modified_smil_timed_elements, rti);
}
} | false | false | false | false | false | 0 |
encode822(const QString &s)
{
QString out;
for(int n = 0; n < (int)s.length(); ++n) {
if(s[n] == '\\' || s[n] == '<' || s[n] == '>') {
QString hex;
hex.sprintf("\\x%02X", (unsigned char )s[n].toLatin1());
out.append(hex);
}
else
out += s[n];
}
return out;
} | false | false | false | false | false | 0 |
setFileName(const QString &fileName)
{
disconnect(ui.templateCombo->lineEdit(), SIGNAL(textChanged(QString)),
this, SIGNAL(fileNameChanged(QString)));
const int index = ui.templateCombo->findText(fileName);
if (index >= 0) // then remove item in order to re-add it at the top
ui.templateCombo->removeItem(i... | false | false | false | false | false | 0 |
bt_array_rw(struct bt_stream_pos *pos, struct bt_definition *definition)
{
struct definition_array *array_definition =
container_of(definition, struct definition_array, p);
const struct declaration_array *array_declaration =
array_definition->declaration;
uint64_t i;
int ret;
/* No need to align, because the ... | false | false | false | false | false | 0 |
xsltNewAttrVT(xsltStylesheetPtr style) {
xsltAttrVTPtr cur;
cur = (xsltAttrVTPtr) xmlMalloc(sizeof(xsltAttrVT));
if (cur == NULL) {
xsltTransformError(NULL, style, NULL,
"xsltNewAttrVTPtr : malloc failed\n");
if (style != NULL) style->errors++;
return(NULL);
}
memset(cur, 0, sizeof(xsltAttrVT)... | false | false | false | false | false | 0 |
set_template_file(std::string filename,
CdlDiagnosticFnPtr error_fn, CdlDiagnosticFnPtr warn_fn, bool limbo)
{
CYG_REPORT_FUNCNAME("CdlConfiguration::set_template_file");
CYG_REPORT_FUNCARG1XV(this);
CdlLocalTransaction transaction(this);
this->set_template_file(... | false | false | false | false | false | 0 |
adau1977_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
struct adau1977 *adau1977 = snd_soc_codec_get_drvdata(dai->codec);
u64 formats = 0;
if (adau1977->slot_width == 16)
formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE;
else if (adau1977->right_j || adau1977->slot_width == ... | false | false | false | false | false | 0 |
pref_dialog_response(GtkDialog *dialog, gint arg1, gpointer user_data)
{
if (arg1 == GTK_RESPONSE_REJECT)
pref_dialog_hide(GTK_WIDGET(dialog));
else if (arg1 == GTK_RESPONSE_ACCEPT)
pref_dialog_accept(GTK_WIDGET(dialog), GTK_WIDGET(user_data));
else if (arg1 == GTK_RESPONSE_OK) {
pref_dialog_accept(GTK_WIDGET(... | false | false | false | false | false | 0 |
msea_search_w(Searcher *self,
Weight *weight,
int first_doc,
int num_docs,
Filter *filter,
Sort *sort,
filter_ft filter_func,
... | false | false | false | false | false | 0 |
clip_x11_request_selection_cb(w, success, sel_atom, type, value, length,
format)
Widget w UNUSED;
XtPointer success;
Atom *sel_atom;
Atom *type;
XtPointer value;
long_u *length;
int *format;
{
int motion_type = MAUTO;
long_u len;
char_u *p;
char **text_list = NULL;... | false | false | false | false | false | 0 |
compute_atomic_domain(struct isl_codegen_domains *domains,
__isl_keep isl_set *domain)
{
isl_basic_set *bset;
isl_set *atomic_domain;
int empty;
atomic_domain = isl_set_copy(domains->option[atomic]);
atomic_domain = isl_set_intersect(atomic_domain, isl_set_copy(domain));
empty = isl_set_is_empty(atomic_domain);... | false | false | false | false | false | 0 |
unbuildtree()
{
/* throw all nodes of the tree onto the garbage heap */
long i;
gdispose(root);
for (i = 0; i < nonodes; i++)
nodep[i] = NULL;
} | false | false | false | false | false | 0 |
marker_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, inode_t *inode,
struct iatt *buf, struct iatt *preparent,
struct iatt *postparent)
{
marker_conf_t *priv = NULL;
marker_local_t *local ... | false | false | false | false | false | 0 |
get_pairs_floats_cache_entry (GnmValue const *vx, GnmValue const *vy,
CollectFlags flags)
{
PairsFloatsCacheEntry key;
if (flags & (COLLECT_INFO | COLLECT_IGNORE_SUBTOTAL))
return NULL;
create_caches ();
key.vx = (GnmValue *)vx;
key.vy = (GnmValue *)vy;
key.flags = flags;
return g_hash_table_looku... | false | false | false | false | false | 0 |
sendExtTexture(GLuint texobj, GLfloat xRatio, GLfloat yRatio, GLint texType, GLboolean upsidedown) {
// send textureID to outlet
if(texobj){
t_atom ap[5];
SETFLOAT(ap, (t_float)texobj);
SETFLOAT(ap+1, (t_float)xRatio);
SETFLOAT(ap+2, (t_float)yRatio);
SETFLOAT(ap+3, (t_float)texType);
SETF... | false | false | false | false | false | 0 |
hwloc_distances_destroy(struct hwloc_topology * topology)
{
struct hwloc_os_distances_s *osdist, *next = topology->first_osdist;
while ((osdist = next) != NULL) {
next = osdist->next;
/* remove final distance matrics AND physically-ordered ones */
free(osdist->indexes);
free(osdist->objs);
free(... | false | false | false | false | false | 0 |
setup_button_type (ButtonData *button_data,
NautilusPathBar *path_bar,
GFile *location)
{
GMount *mount;
if (nautilus_is_root_directory (location)) {
button_data->type = ROOT_BUTTON;
} else if (nautilus_is_home_directory (location)) {
button_data->type = HOME_BUTTON;
button_data->is_root = TR... | false | false | false | false | false | 0 |
doubletime(void) {
double now;
struct timeval tv_now;
if (-1 == gettimeofday(&tv_now, (struct timezone *)0))
return -1;
now = tv_now.tv_sec + (tv_now.tv_usec / 1000000.0);
return now;
} | false | false | false | false | false | 0 |
ReserveGroupDataElement( unsigned short ndataelement )
{
if( ndataelement <= 256 )
{
this->ReservedGroupDataElement = ndataelement;
return true;
}
return false;
} | false | false | false | false | false | 0 |
sg_save_event_cache(struct savedata *saving)
{
/* Check status and return if not OK (sg_success != TRUE). */
sg_check_ret();
if (saving->scenario) {
/* Do _not_ save events in a scenario. */
return;
}
event_cache_save(saving->file, "event_cache");
} | false | false | false | false | false | 0 |
NSS_CMSDecoder_Update(NSSCMSDecoderContext *p7dcx, const char *buf,
unsigned long len)
{
SECStatus rv = SECSuccess;
if (p7dcx->dcx != NULL && p7dcx->error == 0) {
/* if error is set already, don't bother */
if ((p7dcx->type == SEC_OID_PKCS7_SIGNED_DATA)
&& (p7dcx->first_decoded=... | true | true | false | false | false | 1 |
processRGBA_MMX(imageStruct &image, imageStruct &right){
int datasize = image.xsize * image.ysize * image.csize;
__m64*leftPix = (__m64*)image.data;
__m64*rightPix = (__m64*)right.data;
datasize=datasize/sizeof(__m64)+(datasize%sizeof(__m64)!=0);
__m64 l, r, b;
while(datasize--){
l =leftPix [datasize... | false | false | false | false | false | 0 |
mx_menu_show_with_position (MxMenu *menu,
gfloat x,
gfloat y)
{
g_return_if_fail (MX_IS_MENU (menu));
clutter_actor_set_position (CLUTTER_ACTOR (menu), x, y);
clutter_actor_show (CLUTTER_ACTOR (menu));
} | false | false | false | false | false | 0 |
checkVisibility()
{
bool hasVisibleRect = (visibleRegion().boundingRect().width()>1) &&
(visibleRegion().boundingRect().height()>1);
if (0) qDebug("TabWidget %s: VR (%dx%d) HasVisibleRect: %s => %s",
qPrintable(objectName()),
visibleRegion().boundingRect().wi... | false | false | false | false | false | 0 |
make_token_with_key(MWK_REQ_CTXT *rc, const void *key, size_t key_len,
struct webauth_token *data, const char **token,
const char *mwk_func)
{
int status;
struct webauth_keyring *ring;
struct webauth_key *wkey;
status = webauth_key_create(rc->ctx, WA_KEY_AES, key... | false | false | false | false | false | 0 |
extend_free_cache(netsnmp_cache *cache, void *magic)
{
netsnmp_extend *extension = (netsnmp_extend *)magic;
if (!magic)
return;
DEBUGMSGTL(( "nsExtendTable:cache", "free %s\n", extension->token ));
if (extension->output) {
SNMP_FREE(extension->output);
extension->output = NULL;
... | false | false | false | false | false | 0 |
ath9k_deinit_leds(struct ath9k_htc_priv *priv)
{
if (!priv->led_registered)
return;
ath9k_led_brightness(&priv->led_cdev, LED_OFF);
led_classdev_unregister(&priv->led_cdev);
cancel_work_sync(&priv->led_work);
} | false | false | false | false | false | 0 |
ram_open_input(Store *store, const char *filename)
{
RAMFile *rf = (RAMFile *)h_get(store->dir.ht, filename);
InStream *is = NULL;
if (rf == NULL) {
/*
Hash *ht = store->dir.ht;
int i;
printf("\nlooking for %s, %ld\n", filename, str_hash(filename));
for (i = 0; i <= ... | false | false | false | false | false | 0 |
ith_literal(Literals lits, int i)
{
if (lits == NULL)
return NULL;
else if (i == 1)
return lits;
else
return ith_literal(lits->next, i-1);
} | false | false | false | false | false | 0 |
print_blurb (FILE *bout,
gboolean print_help)
{
if (!print_help)
{
g_fprintf (bout, "%s version ", PRG_NAME);
g_fprintf (bout, "%s", GDK_PIXBUF_VERSION);
g_fprintf (bout, "\n");
g_fprintf (bout, "%s comes with ABSOLUTELY NO WARRANTY.\n", PRG_NAME);
g_fprintf (bout, "You may ... | false | false | false | false | false | 0 |
buildAppleResponse(struct connection *pConn, char *pIpStr, char *pHWID)
{
// Find Apple-Challenge
char *tResponse = NULL;
int tFoundSize = 0;
char* tFound = getFromHeader(pConn->recv.data, "Apple-Challenge", &tFoundSize);
if(tFound != NULL)
{
char tTrim[tFoundSize + 2];
getTrimmed(tFound, tFound... | false | false | false | false | false | 0 |
__sched_fork(register struct st_t *stp)
{
register int32 fji;
register struct thread_t *thp;
int32 sav_slin_cnt, sav_sfnam_ind;
struct thread_t *last_thp;
struct st_t *fjstp;
/* DBG remove */
if (__cur_thd->thofscnt != 0) __misc_terr(__FILE__, __LINE__);
/* --- */
/* convert current thread (one-up) to fork ... | false | false | false | false | false | 0 |
phys_ram_within_limit(u64 limit)
{
struct memory_map memmap;
struct memory_region *highest = NULL;
get_memmap(&memmap);
if (memmap.count == 0)
return 0;
highest = &memmap.regions[memmap.count - 1];
return (highest->end < limit);
} | false | false | false | false | false | 0 |
print_truncation_expr(int lvl, struct string *str,
struct expression *expr)
{
int err;
err = append_formatted(lvl, str, "TRUNCATION:\n");
if (err)
goto out;
err = append_simple_attr(lvl + 1, str, "to_type",
type_names[expr->to_type]);
if (err)
goto out;
err = append_tree_attr(lvl + 1, str, "from_... | false | false | false | false | false | 0 |
mca_spml_yoda_fence_internal(int puts_wait)
{
int n_puts_wait;
/* Waiting for certain number of puts : 'puts_wait'
* if 'puts_wait' == 0 waiting for all puts ('n_active_puts')
* if 'puts_wait' > 'n_active_puts' waiting for 'n_active_puts' */
n_puts_wait = puts_wait > 0 ? mca_spml_yoda.n_active_p... | false | false | false | false | false | 0 |
DoubleSize(const Image& image)
{
int rows, cols, nrows, ncols, r, c, r2, c2;
Image newimage;
rows = image.rows;
cols = image.cols;
nrows = 2 * rows - 2;
ncols = 2 * cols - 2;
newimage.setSize(nrows, ncols);
const FloatMatrix& im = image.pixels;
FloatMatrix& _new = newimage.pixels;
... | false | false | false | false | false | 0 |
song_lib_count(songlib_t songlib)
{
song_t *seeker = *(songlib.lib);
int retval = 0;
while (seeker) {
retval++;
seeker = seeker->next;
}
return retval;
} | false | false | false | false | false | 0 |
reconnect(void) {
delete client; client = NULL;
logger.msg(DEBUG, "Re-creating an A-REX client");
client = new ClientSOAP(cfg, rurl, timeout);
//if (!client) {
// logger.msg(VERBOSE, "Unable to create SOAP client used by AREXClient.");
// error_description = "Internal error: unable to create o... | false | false | false | false | false | 0 |
getAxis(unsigned int axis)
{
// make sure we have that axis
if (axis < 1 || axis > myAxes.size())
return 0;
std::map<unsigned int, int>::iterator iter = myAxes.find(axis);
if (iter != myAxes.end()) {
return (iter->second) / 128.0;
}
else {
return 0;
}
/**
// now make sure its in there
i... | false | false | false | false | false | 0 |
interface_field_name(void *mem_ctx, char *base_name, ir_dereference *d)
{
ir_constant *previous_index = NULL;
while (d != NULL) {
switch (d->ir_type) {
case ir_type_dereference_variable: {
ir_dereference_variable *v = (ir_dereference_variable *) d;
if (previous_index
&&... | false | false | false | false | false | 0 |
read_objid(const char *input, oid * output, size_t * out_len)
{ /* number of subid's in "output" */
#ifndef NETSNMP_DISABLE_MIB_LOADING
struct tree *root = tree_top;
#endif /* NETSNMP_DISABLE_MIB_LOADING */
char buf[SPRINT_MAX_LEN];
int ret, max_out_le... | true | true | false | false | false | 1 |
lakai_setmode(LHANDLE handle, int mode)
{
static unsigned char cmdblk[SCSI_CMD_LEN] = {
S2000_MODE, /* command */
0, /* lun/AEN */
1, /* len msb */ /* gets set to correct mode before usage */
0, /* len */
0, /* len lsb */
0 }; /* control */
/*
* Possible mode settings:
* MIDI: cmdblk... | true | true | false | false | false | 1 |
repo_init_create_head(const char *git_dir, const char *ref_name)
{
git_buf ref_path = GIT_BUF_INIT;
git_filebuf ref = GIT_FILEBUF_INIT;
const char *fmt;
if (git_buf_joinpath(&ref_path, git_dir, GIT_HEAD_FILE) < 0 ||
git_filebuf_open(&ref, ref_path.ptr, 0) < 0)
goto fail;
if (!ref_name)
ref_name = GIT_BRANC... | false | false | false | false | false | 0 |
print_some_list(const char *listname)
{
/* ISO C forbids initialization between function pointers and void*
so we use one more level of indirection to comply (and hope gracious
complier will forgive us our sins, amen) */
static const ReportFunc printer_bics = print_builtin_charsets;
static const ReportF... | false | false | false | false | false | 0 |
options_dialogs_set(void)
{
char buf[64];
bool visible;
int i;
fc_assert_ret(NULL != dialog_options_hash);
/* Player report dialog options. */
for (i = 1; i < num_player_dlg_columns; i++) {
fc_snprintf(buf, sizeof(buf), "player_dlg_%s",
player_dlg_columns[i].tagname);
if (dialog_op... | true | true | false | false | false | 1 |
camel_folder_set_message_flags (CamelFolder *folder,
const gchar *uid,
CamelMessageFlags flags,
CamelMessageFlags set)
{
CamelFolderClass *class;
g_return_val_if_fail (CAMEL_IS_FOLDER (folder), FALSE);
g_return_val_if_fa... | false | false | false | true | false | 1 |
cmd_menupopup(MainInfo *min, DirPane *src, DirPane *dst, const CmdArg *ca)
{
GdkEventButton *evt;
const gchar *name;
guint button = 0;
guint32 ac_time = 0U;
GtkMenuPositionFunc pos = NULL;
if((evt = (GdkEventButton *) evt_event_get(GDK_BUTTON_PRESS)) != NULL)
{
button = evt->button;
ac_time = evt->ti... | false | false | false | false | false | 0 |
buildin_kickwaitingroom(struct script_state *st)
{
struct map_session_data *sd;
sd = map_id2sd(conv_num(st,& (st->stack->stack_data[st->start+2])));
if(sd && sd->chatID)
chat_leavechat(sd,1);
return 0;
} | false | false | false | false | false | 0 |
SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// optional int32 start = 1;
if (_has_bit(0)) {
target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->start(), target);
}
// optional int32 end = 2;
if (_has_bit(1)) {
target = ::google::prot... | false | false | false | false | false | 0 |
out_read(const char *txt)
{
if (!tmpf)
{
char buf[PATH_MAX];
snprintf(buf, sizeof(buf), "/tmp/.elm-speak-XXXXXX");
tmpfd = mkstemp(buf);
if (tmpfd >= 0) tmpf = strdup(buf);
else return;
}
if (write(tmpfd, txt, strlen(txt)) < 0) perror("write to tmpfile (espeak)")... | true | true | false | false | true | 1 |
af9015_read_reg_i2c(struct dvb_usb_device *d, u8 addr, u16 reg,
u8 *val)
{
struct af9015_state *state = d_to_priv(d);
struct req_t req = {READ_I2C, addr, reg, 0, 1, 1, val};
if (addr == state->af9013_config[0].i2c_addr ||
addr == state->af9013_config[1].i2c_addr)
req.addr_len = 3;
return af9015_ctrl_msg(d... | false | false | false | false | false | 0 |
_policy_zone_layout_conformant_single(E_Border *bd, E_Illume_Config_Zone *cz __UNUSED__)
{
if (!_policy_layout_app_check(bd)) return;
_border_geometry_set(bd, bd->zone->x, bd->zone->y,
bd->zone->w, bd->zone->h,
POL_CONFORMANT_LAYER);
} | false | false | false | false | false | 0 |
evdev_is_appleir(unsigned short *id)
{
unsigned short product = id[ID_PRODUCT];
if (id[ID_BUS] != BUS_USB)
return 0;
if (id[ID_VENDOR] != USB_VENDOR_ID_APPLE)
return 0;
if ((product == USB_PRODUCT_ID_APPLEIR)
|| (product == USB_PRODUCT_ID_APPLEIR_2))
{
logdebug(" -> Apple IR receiver\... | false | false | false | false | false | 0 |
disk_expand_part_tbl(struct gendisk *disk, int partno)
{
struct disk_part_tbl *old_ptbl = disk->part_tbl;
struct disk_part_tbl *new_ptbl;
int len = old_ptbl ? old_ptbl->len : 0;
int i, target;
size_t size;
/*
* check for int overflow, since we can get here from blkpg_ioctl()
* with a user passed 'partno'.
... | false | false | false | false | false | 0 |
dataDevice()
{
if (mDataMmapInfo.file) {
// Make sure the file still exists
QFileInfo fi(mDataFile);
if (!fi.exists() || fi.size() != mDataMmapInfo.available) {
kDebug(264) << "File size has changed, re-initializing.";
q->recreateCacheFiles(); // Recreates memory map... | false | false | false | false | false | 0 |
qmembernames(Object o, char *type)
{
int i = 0;
char **cp = NULL;
Array a;
if (type[0] == 'c') {
CHECKIF(o, CLASS_FIELD, "field");
}
else if (type[0] == 'm') {
CHECKIF(o, CLASS_GROUP, "group");
}
switch (DXGetObjectClass(o)) {
case CLASS_GROUP:
if (!DXGetMemberCount((Group)o... | false | false | false | false | false | 0 |
UTI_IPHostToNetwork(IPAddr *src, IPAddr *dest)
{
/* Don't send uninitialized bytes over network */
memset(dest, 0, sizeof (IPAddr));
dest->family = htons(src->family);
switch (src->family) {
case IPADDR_INET4:
dest->addr.in4 = htonl(src->addr.in4);
break;
case IPADDR_INET6:
memcpy(de... | 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.