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 |
|---|---|---|---|---|---|---|
stmt_expr_value_expr (tree stmt_expr)
{
tree t = STMT_EXPR_STMT (stmt_expr);
if (TREE_CODE (t) == BIND_EXPR)
t = BIND_EXPR_BODY (t);
if (TREE_CODE (t) == STATEMENT_LIST && STATEMENT_LIST_TAIL (t))
t = STATEMENT_LIST_TAIL (t)->stmt;
if (TREE_CODE (t) == EXPR_STMT)
t = EXPR_STMT_EXPR (t);
return... | false | false | false | false | true | 1 |
UTF16toUCS4(
uint32_t &U,uint16_t const * const s,void const * const eptr)
{
int retval=0;
U=0;
uint16_t const * const r=s+1;
if(r <= eptr)
{
uint32_t const W1=s[0];
if((W1<0xD800)||(W1>0xDFFF))
{
if((U=W1))
{
retval=1;
}
}else if(W1<=0xDBFF)
{
uint16_t co... | false | false | false | false | false | 0 |
b44_init_hw(struct b44 *bp, int reset_kind)
{
u32 val;
b44_chip_reset(bp, B44_CHIP_RESET_FULL);
if (reset_kind == B44_FULL_RESET) {
b44_phy_reset(bp);
b44_setup_phy(bp);
}
/* Enable CRC32, set proper LED modes and power on PHY */
bw32(bp, B44_MAC_CTRL, MAC_CTRL_CRC32_ENAB | MAC_CTRL_PHY_LEDCTRL);
bw32(bp, ... | false | false | false | false | false | 0 |
inf_adopted_algorithm_new(InfUserTable* user_table,
InfBuffer* buffer)
{
GObject* object;
g_return_val_if_fail(INF_IS_BUFFER(buffer), NULL);
object = g_object_new(
INF_ADOPTED_TYPE_ALGORITHM,
"user-table", user_table,
"buffer", buffer,
NULL
);
return INF_ADOPTED_AL... | false | false | false | false | false | 0 |
trackList()
{
XSPFTrackList list;
QDomNode trackList = documentElement().namedItem( "trackList" );
QDomNode subNode = trackList.firstChild();
QDomNode subSubNode;
while( !subNode.isNull() )
{
XSPFTrack track;
subSubNode = subNode.firstChild();
if( subNode.nodeName() == ... | false | false | false | false | false | 0 |
tryRemoveUnrefSample(const QUrl& url)
{
QMutexLocker locker(&m_mutex);
if (m_capacity > 0)
return false;
m_samples.remove(url);
return true;
} | false | false | false | false | false | 0 |
_evry_selector_thumb_gen(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Evas_Coord w, h;
Evry_Selector *sel = data;
Evry_Window *win = sel->win;
char buf[64];
if (sel->o_icon)
{
evas_object_del(sel->o_icon);
sel->o_icon = NULL;
}
e_icon_size_get(sel... | true | true | false | false | false | 1 |
agmt_set_binddn_from_entry(Repl_Agmt *ra, const Slapi_Entry *e)
{
Slapi_Attr *sattr = NULL;
int return_value = 0;
PR_ASSERT(NULL != ra);
slapi_entry_attr_find(e, type_nsds5ReplicaBindDN, &sattr);
PR_Lock(ra->lock);
slapi_ch_free((void **)&ra->binddn);
ra->binddn = NULL;
if (NULL != sattr)
{
Slapi_Value *sva... | false | false | false | false | false | 0 |
__d_drop(struct dentry *dentry)
{
if (!d_unhashed(dentry)) {
struct hlist_bl_head *b;
/*
* Hashed dentries are normally on the dentry hashtable,
* with the exception of those newly allocated by
* d_obtain_alias, which are always IS_ROOT:
*/
if (unlikely(IS_ROOT(dentry)))
b = &dentry->d_sb->s_anon;... | false | false | false | false | false | 0 |
gst_wavparse_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
GstWavParse *self;
g_return_if_fail (GST_IS_WAVPARSE (object));
self = GST_WAVPARSE (object);
switch (prop_id) {
case PROP_IGNORE_LENGTH:
g_value_set_boolean (value, self->ignore_length);
brea... | false | false | false | false | false | 0 |
bnx2fc_ulp_stop(void *handle)
{
struct bnx2fc_hba *hba = handle;
struct bnx2fc_interface *interface;
printk(KERN_ERR "ULP_STOP\n");
mutex_lock(&bnx2fc_dev_lock);
if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &hba->flags))
goto exit;
list_for_each_entry(interface, &if_list, list) {
if (interface->hba == hba)
bn... | false | false | false | false | false | 0 |
mp_failback_handler(vector strvec)
{
struct mpentry * mpe = VECTOR_LAST_SLOT(conf->mptable);
char * buff;
if (!mpe)
return 1;
buff = set_value(strvec);
if (strlen(buff) == 6 && !strcmp(buff, "manual"))
mpe->pgfailback = -FAILBACK_MANUAL;
else if (strlen(buff) == 9 && !strcmp(buff, "immediate"))
mpe->pgfa... | false | false | false | false | false | 0 |
client_queue_empty (struct vink_xmpp_state *state)
{
if (!initial_presence_sent)
{
if (-1 == vink_xmpp_set_presence (state, VINK_PRESENT))
do_log (&ARRAY_GET (&windows, 0), L"Failed to set presence: %s",
vink_last_error ());
initial_presence_sent = 1;
}
} | false | false | false | false | false | 0 |
end_polygon() {
fixloop();
if (n < 3) {
end_line();
return;
}
#if defined(USE_X11)
if (n>2) XFillPolygon(fl_display, fl_window, fl_gc, p, n, Convex, 0);
#elif defined(WIN32)
if (n>2) {
SelectObject(fl_gc, fl_brush());
Polygon(fl_gc, p, n);
}
#elif defined(__APPLE_QUARTZ__)
if (n<=1) return... | false | false | false | false | false | 0 |
PostGarbageCollectionProcessing() {
Relocatable* current = top_;
while (current != NULL) {
current->PostGarbageCollection();
current = current->prev_;
}
} | false | false | false | false | false | 0 |
add_subst(vector<Subst>& subst, Automaton *A, int s)
{
list<Rule> rules = A->rules(s);
list<Rule>::const_iterator r;
for (r = rules.begin(); r != rules.end(); r++)
if (r->id != NULL)
subst[r->r].push_back(Assoc(r->id, r->p));
} | false | false | false | false | false | 0 |
createEvenPort(bool reserve)
{
QByteArray val(1, 0);
unsigned char c = 0;
if(reserve)
c |= 0x80; // set high bit
val[0] = c;
return val;
} | false | false | false | false | false | 0 |
gnc_find_split_in_account_by_memo (Account *account, const char *memo,
gboolean unit_price)
{
GList *slp;
if (account == NULL) return NULL;
for (slp = g_list_last (xaccAccountGetSplitList (account));
slp;
slp = slp->prev)
{
Split *spli... | false | false | false | false | false | 0 |
sh_tmu_clock_event_start(struct sh_tmu_channel *ch, int periodic)
{
struct clock_event_device *ced = &ch->ced;
sh_tmu_enable(ch);
clockevents_config(ced, ch->rate);
if (periodic) {
ch->periodic = (ch->rate + HZ/2) / HZ;
sh_tmu_set_next(ch, ch->periodic, 1);
}
} | false | false | false | false | false | 0 |
dvb_net_filter_sec_set(struct net_device *dev,
struct dmx_section_filter **secfilter,
u8 *mac, u8 *mac_mask)
{
struct dvb_net_priv *priv = netdev_priv(dev);
int ret;
*secfilter=NULL;
ret = priv->secfeed->allocate_filter(priv->secfeed, secfilter);
if (ret<0) {
printk("%s: could not get filter\n", dev->... | false | false | false | false | false | 0 |
fc_exch_em_alloc(struct fc_lport *lport,
struct fc_exch_mgr *mp)
{
struct fc_exch *ep;
unsigned int cpu;
u16 index;
struct fc_exch_pool *pool;
/* allocate memory for exchange */
ep = mempool_alloc(mp->ep_pool, GFP_ATOMIC);
if (!ep) {
atomic_inc(&mp->stats.no_free_exch);
goto out;
}
memset(ep, 0, size... | false | false | false | false | false | 0 |
calculateSerializeBufferSize() const
{
unsigned baseSize = sizeof(btQuantizedBvh) + getAlignmentSerializationPadding();
baseSize += sizeof(btBvhSubtreeInfo) * m_subtreeHeaderCount;
if (m_useQuantization)
{
return baseSize + m_curNodeIndex * sizeof(btQuantizedBvhNode);
}
return baseSize + m_curNodeIndex * sizeof... | false | false | false | false | false | 0 |
destroy_freelist(void)
{
int i;
Bigint *tmp;
_THREAD_PRIVATE_MUTEX_LOCK(dtoa_mutex);
for (i = 0; i <= Kmax; i++) {
Bigint **listp = &freelist[i];
while ((tmp = *listp) != NULL) {
*listp = tmp->next;
free(tmp);
}
freelist[i] = NULL;
}
_THREAD_PRIVATE_MUTEX_UNLOCK(dtoa_mutex);
} | false | false | false | false | false | 0 |
pop_str_val_ui(VMG_ char *buf, size_t buflen)
{
const char *strp;
size_t copy_len;
/* pop the string value */
strp = pop_str_val(vmg0_);
/* get the length */
copy_len = vmb_get_len(strp);
/*
* if they didn't allocate any space for the buffer, allocate one on
* ... | false | false | false | false | false | 0 |
PGM_Image(const char* pathname) {
GraphicComp* comp = nil;
int width, height;
boolean compressed;
boolean tiled;
int twidth, theight;
PortableImageHelper* pih;
FILE* file = Portable_Raster_Open(
pih, pathname, 0, width, height, compressed, tiled, twidth, theight
);
if (file)... | false | false | false | false | false | 0 |
gfm_server_fchmod(struct peer *peer, int from_client, int skip)
{
gfarm_error_t e;
gfarm_int32_t fd;
gfarm_int32_t mode;
struct host *spool_host = NULL;
struct process *process;
struct user *user;
struct inode *inode;
static const char diag[] = "GFM_PROTO_FCHMOD";
e = gfm_server_get_request(peer, diag, "i", &... | false | false | false | false | false | 0 |
binread(genfile f, void *buff, long recsize, long recnum, char **errstr)
{
long num;
num=varread(f,buff,recsize,recnum,errstr);
if (num<recsize*recnum && *errstr==NULL)
*errstr=rstrdup("Unexpected end of file.");
return (*errstr==NULL);
} | false | false | false | false | false | 0 |
odf_write_graph_styles (GnmOOExport *state, GsfOutput *child)
{
int i;
state->xml = create_new_xml_child (state, child);
gsf_xml_out_start_element (state->xml, OFFICE "document-styles");
for (i = 0 ; i < (int)G_N_ELEMENTS (ns) ; i++)
gsf_xml_out_add_cstr_unchecked (state->xml, ns[i].key, ns[i].url);
gsf_xml_out... | false | false | false | false | false | 0 |
ipmi_picmg_get_led_capabilities(struct ipmi_intf * intf, int argc, char ** argv)
{
int i;
struct ipmi_rs * rsp;
struct ipmi_rq req;
unsigned char msg_data[6];
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_PICMG;
req.msg.cmd = PICMG_GET_LED_COLOR_CAPABILITIES_CMD;
req.msg.data = msg_data;
req.m... | false | false | false | false | false | 0 |
FixRfmProtArg(RfmFunc func)
{
RfmProtArg arg;
if (func == NULL) {
return;
}
for (arg = func->arg_list;
arg != NULL;
arg = arg->next) {
arg->entry = (arg->prev)?(arg->prev->entry + 1):1;
arg->func = func;
}
} | false | false | false | false | false | 0 |
prefs_dialog_show(void)
{
if (!dlog) dlog = prefs_dialog_new();
options_dialog_set (dlog);
gtk_widget_show(GTK_WIDGET(dlog->dlg));
} | false | false | false | false | false | 0 |
istgt_lu_allow_ipv4(const char *netmask, const char *addr)
{
struct in_addr in4_mask;
struct in_addr in4_addr;
char mask[MAX_MASKBUF];
const char *p;
uint32_t bmask;
int bits;
int n;
p = strchr(netmask, '/');
if (p == NULL) {
p = netmask + strlen(netmask);
}
n = p - netmask;
if (n + 1 > sizeof mask)
re... | true | true | false | false | false | 1 |
pitivi_can_load_uri (GESFormatter * dummy_instance, const gchar * uri,
GError ** error)
{
xmlDocPtr doc;
gboolean ret = TRUE;
xmlXPathObjectPtr xpathObj;
xmlXPathContextPtr xpathCtx;
if (!(doc = xmlParseFile (uri))) {
GST_ERROR ("The xptv file for uri %s was badly formed or did not exist",
ur... | false | false | false | false | false | 0 |
set_long_request_time(cmd_parms *parms,
void *mconfig, const char *arg)
{
long val;
val = atol(arg);
if (val < MIN_LOG_SLOW_REQUEST ) {
ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
"LogSlowLongRequestTime of %ld must be greater than %ld",
... | false | false | false | false | false | 0 |
gf_sg_get_namespace(GF_SceneGraph *sg, u32 xmlns_id)
{
GF_XMLNS *ns;
u32 i, count;
count = sg->ns ? gf_list_count(sg->ns) : 0;
for (i=0; i<count; i++) {
ns = gf_list_get(sg->ns, i);
if (ns->xmlns_id == xmlns_id)
return ns->name;
}
return NULL;
} | false | false | false | false | false | 0 |
get_swapdev(ulong type, char *buf)
{
unsigned int i, swap_info_len;
ulong swap_info, swap_info_ptr, swap_file;
ulong vfsmnt;
if (!symbol_exists("nr_swapfiles"))
error(FATAL, "nr_swapfiles doesn't exist in this kernel!\n");
if (!symbol_exists("swap_info"))
error(FATAL... | false | false | false | false | false | 0 |
maze_solver_pi_get_vlist_cost(
struct maze_markov_state *state,
struct maze_markov_bellman_vlist *prec,
struct maze_markov_bellman_policy *policy
)
{
float ret;
struct maze_markov_transition_list *l;
l = MAZE_MARKOV_GET_TRANSITION_LIST(
state,
maze_markov_bellman_policy_get_action(state,policy)
);
if (l)
... | false | false | false | false | false | 0 |
dwmac1000_setup(void __iomem *ioaddr, int mcbins,
int perfect_uc_entries)
{
struct mac_device_info *mac;
u32 hwid = readl(ioaddr + GMAC_VERSION);
mac = kzalloc(sizeof(const struct mac_device_info), GFP_KERNEL);
if (!mac)
return NULL;
mac->pcsr = ioaddr;
mac->multicast_filter_bins = mcbins;
mac->unicast_... | false | false | false | false | false | 0 |
gfire_proto_invitation(gfire_data *p_gfire, guint16 p_packet_len)
{
if(!p_gfire)
return;
guint32 offset = XFIRE_HEADER_LEN;
GList *names = NULL;
GList *aliases = NULL;
GList *msgs = NULL;
offset = gfire_proto_read_attr_list_ss(p_gfire->buff_in, &names, "name", offset);
if(offset == -1 || !names)
return;
... | false | false | false | false | false | 0 |
H5C_set_prefix(H5C_t * cache_ptr, char * prefix)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
if ( ( cache_ptr == NULL ) ||
( cache_ptr->magic != H5C__H5C_T_MAGIC ) ||
( prefix == NULL ) ||
( HDstrlen(prefix) >= H5C__PREFIX_LEN ) ) {
HGOTO_E... | false | false | false | false | false | 0 |
slice_dma_loaf(struct dma_loaf *loaf, size_t len,
dma_addr_t *dma_handle)
{
void *cpu_end = loaf->cpu_free + len;
void *cpu_addr = loaf->cpu_free;
BUG_ON(cpu_end > loaf->cpu_base + loaf->length);
*dma_handle = loaf->dma_free;
loaf->cpu_free = cpu_end;
loaf->dma_free += len;
return cpu_addr;
} | false | false | false | false | false | 0 |
crop_sprite(struct sprite *source,
int x, int y,
int width, int height,
struct sprite *mask,
int mask_offset_x, int mask_offset_y)
{
GdkPixbuf *mypixbuf, *sub, *mask_pixbuf;
/* First just crop the image. */
if (x < 0) {
width += x;
x = 0;
}
if (y < 0) {
height += y;
y ... | false | false | false | false | false | 0 |
tree_dce_done (bool aggressive)
{
if (aggressive)
{
int i;
for (i = 0; i < last_basic_block; ++i)
BITMAP_FREE (control_dependence_map[i]);
free (control_dependence_map);
sbitmap_free (visited_control_parents);
sbitmap_free (last_stmt_necessary);
sbitmap_free (bb_contains_liv... | false | false | false | false | false | 0 |
e_cal_component_get_transparency (ECalComponent *comp,
ECalComponentTransparency *transp)
{
ECalComponentPrivate *priv;
icalproperty_transp ical_transp;
g_return_if_fail (comp != NULL);
g_return_if_fail (E_IS_CAL_COMPONENT (comp));
g_return_if_fail (transp != NULL);
priv = comp... | false | false | false | false | false | 0 |
find_exception_blocks (function_t *fn)
{
unsigned ix;
block_t **queue = XALLOCAVEC (block_t *, fn->num_blocks);
/* First mark all blocks as exceptional. */
for (ix = fn->num_blocks; ix--;)
fn->blocks[ix].exceptional = 1;
/* Now mark all the blocks reachable via non-fake edges */
queue[0] = fn->blocks... | false | false | false | false | false | 0 |
tlan_handle_rx_eoc(struct net_device *dev, u16 host_int)
{
struct tlan_priv *priv = netdev_priv(dev);
dma_addr_t head_list_phys;
u32 ack = 1;
if (priv->tlan_rev < 0x30) {
TLAN_DBG(TLAN_DEBUG_RX,
"RECEIVE: Handling RX EOC (head=%d tail=%d) -- IRQ\n",
priv->rx_head, priv->rx_tail);
head_list_phys = pri... | false | false | false | false | false | 0 |
nfs3svc_write_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
struct iatt *postbuf, dict_t *xdata)
{
struct nfs3_state *nfs3 = NULL;
nfsstat3 stat = NFS3ERR_SERVERF... | false | false | false | false | false | 0 |
setEditorData(QWidget *editor, const QModelIndex &index) const
{
KTextEdit *textedit = qobject_cast<KTextEdit*>(editor);
Q_ASSERT(textedit != 0);
//Do not update existing text that the user may already have edited.
//The models will call setEditorData(..) whenever the icon has changed,
//and this m... | false | false | false | false | false | 0 |
gf128mul_init_4k_lle(const be128 *g)
{
struct gf128mul_4k *t;
int j, k;
t = kzalloc(sizeof(*t), GFP_KERNEL);
if (!t)
goto out;
t->t[128] = *g;
for (j = 64; j > 0; j >>= 1)
gf128mul_x_lle(&t->t[j], &t->t[j+j]);
for (j = 2; j < 256; j += j)
for (k = 1; k < j; ++k)
be128_xor(&t->t[j + k], &t->t[j], &t->... | false | false | false | false | false | 0 |
ide_find_setting(const struct ide_proc_devset *st,
char *name)
{
while (st->name) {
if (strcmp(st->name, name) == 0)
break;
st++;
}
return st->name ? st : NULL;
} | false | false | false | false | false | 0 |
dev_sparse_shutdown(struct vdevice *dev)
{
if (!(dev->flags & VDEVICE_FLAG_SPARSE))
return(-1);
free(dev->sparse_map);
dev->sparse_map = NULL;
return(0);
} | false | false | false | false | false | 0 |
DBTableFieldIsNumeric(const DBObject *obj)
{
DBObjTableField *tableField = (DBObjTableField *) obj;
return ((tableField->Type () == DBTableFieldInt) ||
(tableField->Type () == DBTableFieldFloat) ? true : false);
} | false | false | false | false | false | 0 |
drm_dp_find_vcpi_slots(struct drm_dp_mst_topology_mgr *mgr,
int pbn)
{
int num_slots;
num_slots = DIV_ROUND_UP(pbn, mgr->pbn_div);
if (num_slots > mgr->avail_slots)
return -ENOSPC;
return num_slots;
} | false | false | false | false | false | 0 |
efipci_driver_startup ( void ) {
struct efi_driver *efidrv = &efipci_driver;
int rc;
/* Install driver */
if ( ( rc = efi_driver_install ( efidrv ) ) != 0 ) {
DBGC ( efidrv, "EFIPCI could not install driver: %s\n",
strerror ( rc ) );
return;
}
DBGC ( efidrv, "EFIPCI driver installed\n" );
} | false | false | false | false | false | 0 |
media_transport_release(struct media_transport *transport,
const char *accesstype)
{
if (g_strstr_len(accesstype, -1, "r") != NULL) {
transport->read_lock = FALSE;
DBG("Transport %s: read lock released", transport->path);
}
if (g_strstr_len(accesstype, -1, "w") != NULL) {
transport->write_lock = FALSE;
... | false | false | false | false | false | 0 |
set_chunks(int sock, struct auth_context *actx)
{
struct sctp_authchunk chunks;
int i;
if (!actx->auth_chunks)
return 0; // no chunks defined
for ( i = 0; i < NUM_OF_CHUNK_TYPES; i++) {
if (is_flag(actx->auth_chunks, supported_chunk[i].flag)) {
... | false | false | false | false | false | 0 |
nfs4_xdr_dec_write(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
struct nfs_pgio_res *res)
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
res->op_status = hdr.status;
if (status)
goto out;
status = decode_sequence(xdr, &res->seq_res, rqstp);
if (status)
goto out;
... | false | false | false | false | true | 1 |
UnrollDoublesToFloat(_cmsTRANSFORM* info,
cmsFloat32Number wIn[],
cmsUInt8Number* accum,
cmsUInt32Number Stride)
{
int nChan = T_CHANNELS(info -> InputFormat);
int DoSwap = T_DOSWAP(info ->Input... | false | false | false | false | false | 0 |
filter_ro(const Geometry *g)
{
const LineString *ls = dynamic_cast<const LineString *>(g);
if ( ls ) pol->add(ls);
} | false | false | false | false | false | 0 |
put_state (ogzstream& file)
{
// currently playing
current_background >> file;
// music file
if (current_background != -1) music_file[current_background] >> file;
// Save the schedule script state
schedule.class_name () >> file;
if (schedule_args)
{
true >> file;
pyth... | false | false | false | false | false | 0 |
qos_get_create_user_tracking(request_rec *r, qos_srv_config* sconf,
const char *value) {
const char *uid = qos_unique_id(r, NULL);
const char *verified = NULL;
if(value != NULL) {
int buf_len = 0;
unsigned char *buf;
buf_len = qos_decrypt(r, sconf, &buf, value)... | true | true | false | false | false | 1 |
homeexpand(char *name)
{
#if defined(_WIN32)
return NULL;
#else /* Windoz free systems */
struct passwd *ent; /* password entry */
char *home2; /* fullpath of the home directory */
char *fullpath; /* the malloced expanded path */
char *after; /* after the ~user or ~ */
char *username; /* extracted username... | false | false | false | false | false | 0 |
tpaw_irc_network_chooser_constructed (GObject *object)
{
TpawIrcNetworkChooser *self = (TpawIrcNetworkChooser *) object;
g_assert (self->priv->settings != NULL);
set_label_from_settings (self);
g_signal_connect (self, "clicked", G_CALLBACK (clicked_cb), self);
} | false | false | false | false | false | 0 |
isVar(c) /* is cell a VARIDCELL/VAROPCELL ? */
Cell c; { /* also recognises DICTVAR cells */
return isPair(c) &&
(fst(c)==VARIDCELL || fst(c)==VAROPCELL || fst(c)==DICTVAR);
} | false | false | false | false | false | 0 |
chunk_write(chunk_t chunk, char *path, mode_t mask, bool force)
{
mode_t oldmask;
FILE *fd;
bool good = FALSE;
int tmp = 0;
if (!force && access(path, F_OK) == 0)
{
errno = EEXIST;
return FALSE;
}
oldmask = umask(mask);
fd = fopen(path,
#ifdef WIN32
"wb"
#else
"w"
#endif
);
if (fd)
{
if (fwr... | false | false | false | false | true | 1 |
send_fuse_iov (xlator_t *this, fuse_in_header_t *finh, struct iovec *iov_out,
int count)
{
fuse_private_t *priv = NULL;
struct fuse_out_header *fouh = NULL;
int res, i;
if (!this || !finh || !iov_out) {
gf_log ("send_fuse_iov", GF_LOG_ERROR,"Invalid argume... | false | false | false | false | false | 0 |
ex_break(eap)
exarg_T *eap;
{
int idx;
struct condstack *cstack = eap->cstack;
if (cstack->cs_looplevel <= 0 || cstack->cs_idx < 0)
eap->errmsg = (char_u *)N_("E587: :break without :while or :for");
else
{
/* Inactivate conditionals until the matching ":while" or a try
* conditional not in... | false | false | false | false | false | 0 |
gfxop_scan_bitmask(gfx_state_t *state, rect_t area, gfx_map_mask_t map)
{
gfxr_pic_t *pic = (state->pic_unscaled)? state->pic_unscaled : state->pic;
int retval = 0;
_gfxop_clip(&area, gfx_rect(0, 10, 320, 200));
if (area.xl <= 0
|| area.yl <= 0)
return 0;
if (map & GFX_MASK_VISUAL)
retval |= _gfxop_sca... | false | false | false | false | false | 0 |
spi_dv_device_get_echo_buffer(struct scsi_device *sdev, u8 *buffer)
{
int l, result;
/* first off do a test unit ready. This can error out
* because of reservations or some other reason. If it
* fails, the device won't let us write to the echo buffer
* so just return failure */
const char spi_test_unit_r... | false | false | false | false | false | 0 |
startslave (char *host, int autologin, char *autoname)
{
pid_t pid;
int master;
#ifdef AUTHENTICATION
if (!autoname || !autoname[0])
autologin = 0;
if (autologin < auth_level)
{
fatal (net, "Authorization failed");
exit (EXIT_FAILURE);
}
#else /* !AUTHENTICATION */
(void) autoname; /... | false | false | false | false | false | 0 |
sftk_PrintReturnedObjectHandle(char *out, PRUint32 outlen,
const char *argName, CK_OBJECT_HANDLE_PTR phObject, CK_RV rv)
{
if ((rv == CKR_OK) && phObject) {
PR_snprintf(out, outlen,
" *%s=0x%08lX", argName, (PRUint32)*phObject);
} else {
PORT_Assert(outlen != 0);
out[0] = '\0';
}
} | false | false | false | false | false | 0 |
clutter_event_copy (const ClutterEvent *event)
{
ClutterEvent *new_event;
ClutterEventPrivate *new_real_event;
ClutterInputDevice *device;
gint n_axes = 0;
g_return_val_if_fail (event != NULL, NULL);
new_event = clutter_event_new (CLUTTER_NOTHING);
new_real_event = (ClutterEventPrivate *) new_event;
... | false | false | false | false | false | 0 |
relevantPrgAtom(const Solver& s, PrgAtomNode* a) const {
return !s.isFalse(a->literal()) && a->scc() != PrgNode::noScc;
} | false | false | false | false | false | 0 |
modified_dijkstra(int src, char flag){
int i,k;
double min;
k=src;
//node[src-1].cost=0.0f;
node[k].flag=1;
for(i=0;i<total_nodes;i++)
{
if(i!=k)
{
if(node[k].edge_cost[i]!=INF){
//printf("D[%d] = C(%d,%d) = %lf\n",i+1,k+1,i+1,node[k].edge_cost[i]);
node[i].cost = node[k].edge_c... | false | false | false | false | false | 0 |
text_search_forward(Text *txt, size_t pos, Regex *regex) {
int start = pos + 1;
int end = text_size(txt);
RegexMatch match[1];
bool found = !text_search_range_forward(txt, start, end - start, regex, 1, match, 0);
if (!found) {
start = 0;
end = pos;
found = !text_search_range_forward(txt, start, end, regex, ... | false | false | false | false | false | 0 |
inputline_return(GtkEntry *w, gpointer data)
{
const char *theinput;
theinput = gtk_entry_get_text(w);
if (*theinput) {
if (client_state() == C_S_RUNNING && gui_gtk2_allied_chat_only
&& is_plain_public_message(theinput)) {
char buf[MAX_LEN_MSG];
fc_snprintf(buf, sizeof(buf), ". %s", th... | true | true | false | false | false | 1 |
entry_secondary_activated (GtkWidget * widget, GdkEvent * event, gpointer user_data)
{
g_return_val_if_fail(GTK_IS_WIDGET(widget), FALSE);
switch (event->type) {
case GDK_ENTER_NOTIFY:
g_object_set_data(G_OBJECT(widget), MENU_DATA_IN_MENUITEM, GINT_TO_POINTER(TRUE));
break;
case GDK_LEAVE_NOTI... | false | false | false | false | false | 0 |
tracker_data_commit_transaction (GError **error)
{
TrackerDBInterface *iface;
GError *actual_error = NULL;
g_return_if_fail (in_transaction);
iface = tracker_db_manager_get_db_interface ();
tracker_data_update_buffer_flush (&actual_error);
if (actual_error) {
tracker_data_rollback_transaction ();
g_propaga... | false | false | false | false | false | 0 |
pgsql_get_db_connection(PGconn **pgsql_db, char *db_name,
pgsql_db_info_t *db_info)
{
int rc = SLURM_SUCCESS;
bool storage_init = false;
char *connect_line = xstrdup_printf("dbname = '%s'"
" host = '%s'"
" port = '%u'"
" user = '%s'"
" password = '%s'",
db_name,
... | false | false | false | false | false | 0 |
dwc2_fill_host_isoc_dma_desc(struct dwc2_hsotg *hsotg,
struct dwc2_qtd *qtd,
struct dwc2_qh *qh, u32 max_xfer_size,
u16 idx)
{
struct dwc2_hcd_dma_desc *dma_desc = &qh->desc_list[idx];
struct dwc2_hcd_iso_packet_desc *frame_desc;
memset(dma_desc, 0, sizeof(*dma_desc));
frame_desc = &qtd->urb->iso... | false | false | false | false | false | 0 |
proc_text (void)
{
static intmax_t blank_lines = 0; /* Consecutive blank lines so far. */
switch (*current_type)
{
case 'a':
if (blank_join > 1)
{
if (1 < line_buf.length || ++blank_lines == blank_join)
{
print_lineno ();
blank_lines = 0;
... | false | false | false | false | false | 0 |
devcd_dev_release(struct device *dev)
{
struct devcd_entry *devcd = dev_to_devcd(dev);
devcd->free(devcd->data);
module_put(devcd->owner);
/*
* this seems racy, but I don't see a notifier or such on
* a struct device to know when it goes away?
*/
if (devcd->failing_dev->kobj.sd)
sysfs_delete_link(&devcd-... | false | false | false | false | false | 0 |
PyEval_SaveThread(void)
{
PyThreadState *tstate = PyThreadState_Swap(NULL);
if (tstate == NULL)
Py_FatalError("PyEval_SaveThread: NULL tstate");
#ifdef WITH_THREAD
if (interpreter_lock)
PyThread_release_lock(interpreter_lock);
#endif
return tstate;
} | false | false | false | false | false | 0 |
AddHistoryItem(aprsString *hp)
{
Lock histLock(histMutex);
if (hp == NULL)
return false;
if (pTail == NULL) { // Starting from empty list
pTail = hp;
pHead = hp;
hp->next = NULL;
hp->last = NULL;
ItemCount++;
} else { // List ha... | false | false | false | false | false | 0 |
control_readint(i,fn)
int *i;
char *fn;
{
unsigned long u;
switch(control_readline(&line,fn))
{
case 0: return 0;
case -1: return -1;
}
if (!stralloc_0(&line)) return -1;
if (!scan_ulong(line.s,&u)) return 0;
*i = u;
return 1;
} | false | false | false | false | false | 0 |
match(const nstring &actual, size_t offset)
{
trace(("regular_expression::match(actual = \"%.*s\" / \"%s\", "
"offset = %ld)\n{\n", (int)offset, actual.c_str(),
actual.c_str() + offset, (long)offset));
if (!compile())
{
trace(("return false;\n}\n"));
return false;
}
int err =
regexec
(
&p... | false | false | false | false | false | 0 |
no_context(struct pt_regs *regs, unsigned long error_code,
unsigned long address, int signal, int si_code)
{
struct task_struct *tsk = current;
unsigned long flags;
int sig;
/* Are we prepared to handle this kernel fault? */
if (fixup_exception(regs)) {
/*
* Any interrupt that takes a fault gets the fixu... | false | false | false | false | false | 0 |
libbfio_pool_close(
libbfio_pool_t *pool,
int entry,
libcerror_error_t **error )
{
libbfio_internal_handle_t *internal_handle = NULL;
libbfio_internal_pool_t *internal_pool = NULL;
libcdata_list_element_t *last_used_list_element = NULL;
static char *function = ... | false | false | false | false | false | 0 |
AddCaseEquivalents(ZoneList<CharacterRange>* ranges,
bool is_ascii) {
uc16 bottom = from();
uc16 top = to();
if (is_ascii) {
if (bottom > String::kMaxAsciiCharCode) return;
if (top > String::kMaxAsciiCharCode) top = String::kMaxAsciiCharCode;
}
unibrow::uchar ch... | false | false | false | false | false | 0 |
vslider_draw_io(t_vslider* x,t_glist* glist, int old_snd_rcv_flags)
{
int xpos=text_xpix(&x->x_gui.x_obj, glist);
int ypos=text_ypix(&x->x_gui.x_obj, glist);
t_canvas *canvas=glist_getcanvas(glist);
if((old_snd_rcv_flags & IEM_GUI_OLD_SND_FLAG) && !x->x_gui.x_fsf.x_snd_able)
sys_vgui(".x%lx.c c... | false | false | false | false | false | 0 |
gsb_combo_box_get_index ( GtkWidget *combo_box )
{
gint index;
GtkTreeIter iter;
if (!combo_box)
return -1;
if ( !gtk_combo_box_get_active_iter ( GTK_COMBO_BOX (combo_box),
&iter ))
return -1;
gtk_tree_model_get ( GTK_TREE_MODEL (gtk_combo_box_get_model (GTK_COMBO_BOX (combo_box))),
... | false | false | false | false | false | 0 |
_dxfEndSWRenderPass (WinP win, Field image)
{
DEFWINDATA(win) ;
ENTRY(("_dxfEndSWRenderPass(0x%x, 0x%x)",win,image));
if (image)
DXDelete((Pointer)image);
_dxfRedrawInteractorEchos(INTERACTOR_DATA) ;
EXIT((""));
return 0;
} | false | false | false | false | false | 0 |
NodeImpl(DocumentImplPtr owner, const DOMString &nodeName)
: Node()
{
init();
ownerDocument = owner;
setNodeName(nodeName);
} | false | false | false | false | false | 0 |
cdoDefineGrid(const char *gridfile)
{
FILE *gfp;
char buffer[4];
int gridID = -1;
size_t len;
struct stat filestat;
int fileno;
int isreg = FALSE;
fileno = open(gridfile, O_RDONLY);
if ( fileno >= 0 )
{
if ( fstat(fileno, &filestat) == 0 )
isreg = S_ISREG(filestat.st_mode);
}
if ( f... | true | true | false | false | true | 1 |
setDocCharset(const CharsetInfo &docCharset,
const CharsetInfo &systemCharset)
{
if (!map_.isNull())
buildMap(systemCharset, docCharset);
willNotSetDocCharset();
} | false | false | false | false | false | 0 |
init_strap_condition(struct nvbios_init *init)
{
struct nvkm_bios *bios = init->bios;
u32 mask = nvbios_rd32(bios, init->offset + 1);
u32 value = nvbios_rd32(bios, init->offset + 5);
trace("STRAP_CONDITION\t(R[0x101000] & 0x%08x) == 0x%08x\n", mask, value);
init->offset += 9;
if ((init_rd32(init, 0x101000) & ma... | false | false | false | false | false | 0 |
app_running(PROC_MAP& pm, const char* p) {
PROC_MAP::iterator i;
for (i=pm.begin(); i!=pm.end(); i++) {
PROCINFO& pi = i->second;
//msg_printf(0, MSG_INFO, "running: [%s]", pi.command);
if (!strcasecmp(pi.command, p)) {
return true;
}
}
return false;
} | false | false | false | false | false | 0 |
__ecereMethod___ecereNameSpace__ecere__sys__BufferedFile_Unlock(struct __ecereNameSpace__ecere__com__Instance * this, uint64 start, uint64 length, unsigned int wait)
{
struct __ecereNameSpace__ecere__sys__BufferedFile * __ecerePointer___ecereNameSpace__ecere__sys__BufferedFile = (struct __ecereNameSpace__ecere__sys__Bu... | false | false | false | true | false | 1 |
circle_link_pop(struct circle_link *link)
{
struct single_link_node *node;
pthread_mutex_lock(&link->lock);
node = link->head_node.next;
if (node == &link->head_node)
{
node = NULL;
}
else
{
single_link_remove_base(&link->head_node, node);
}
pthread_mutex_unlock(&link->lock);
return node;
} | false | false | false | false | false | 0 |
vect_recog_pow_pattern (VEC (gimple, heap) **stmts, tree *type_in, tree *type_out)
{
gimple last_stmt = VEC_index (gimple, *stmts, 0);
tree fn, base, exp = NULL;
gimple stmt;
tree var;
if (!is_gimple_call (last_stmt) || gimple_call_lhs (last_stmt) == NULL)
return NULL;
fn = gimple_call_fndecl (last_st... | 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.