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 |
|---|---|---|---|---|---|---|
g3d_stream_open_file(const gchar *filename, const gchar *mode)
{
G3DStreamFile *sf;
struct stat stats;
guint32 flags = 0;
sf = g_new0(G3DStreamFile, 1);
/* open file; may be moved to some GLib interface */
sf->f = fopen(filename, mode);
if(sf->f == NULL) {
g_free(sf);
return NULL;
}
/* get file size */
... | false | false | false | false | true | 1 |
r8712_joinbss_reset(struct _adapter *padapter)
{
int i;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct ht_priv *phtpriv = &pmlmepriv->htpriv;
/* todo: if you want to do something io/reg/hw setting before join_bss,
* please add code here */
phtpriv->ampdu_enable = false;/*reset to disabled*/
for (i ... | false | false | false | false | false | 0 |
negchan_middle(aim_session_t *sess, aim_frame_t *fr)
{
aim_tlvlist_t *tlvlist;
char *msg = NULL;
fu16_t code = 0;
aim_rxcallback_t userfunc;
int ret = 1;
if (aim_bstream_empty(&fr->data) == 0) {
/* XXX should do something with this */
return 1;
}
/* Used only by the older login protocol */
/* XXX remove ... | false | false | false | false | false | 0 |
from_surrogate_pair(uint16_t uc, uint16_t lc, uchar_t *unicode)
{
if (uc >= 0xD800 && uc <= 0xDBFF && lc >= 0xDC00 && lc <= 0xDFFF) {
*unicode = 0x10000 + ((((uchar_t)uc & 0x3FF) << 10) | (lc & 0x3FF));
return true;
} else {
return false;
}
} | false | false | false | false | false | 0 |
rb_autoload(mod, id, file)
VALUE mod;
ID id;
const char *file;
{
VALUE av, fn;
struct st_table *tbl;
if (!rb_is_const_id(id)) {
rb_raise(rb_eNameError, "autoload must be constant name", rb_id2name(id));
}
if (!file || !*file) {
rb_raise(rb_eArgError, "empty file name");
}
if ... | false | false | false | false | false | 0 |
_ecore_main_fd_handler_add(int fd,
Ecore_Fd_Handler_Flags flags,
Ecore_Fd_Cb func,
const void *data,
Ecore_Fd_Cb buf_func,
const void... | false | false | false | false | false | 0 |
mips64_trigger_irq(cpu_mips_t *cpu)
{
if (unlikely(cpu->irq_disable)) {
cpu->irq_pending = 0;
return;
}
cpu->irq_count++;
if (mips64_update_irq_flag_fast(cpu))
mips64_trigger_exception(cpu,MIPS_CP0_CAUSE_INTERRUPT,0);
else
cpu->irq_fp_count++;
} | false | false | false | false | false | 0 |
strtold (const char *buffer, char **)
{
longdouble r;
real_from_string3 (&r.rv(), buffer, TYPE_MODE (long_double_type_node));
return r;
} | false | false | false | false | false | 0 |
set_all_nodma_rtail(struct hfi1_devdata *dd)
{
int i;
for (i = 0; i < dd->first_user_ctxt; i++)
dd->rcd[i]->do_interrupt =
&handle_receive_interrupt_nodma_rtail;
} | false | false | false | false | false | 0 |
display_output()
{
FILE *outf;
printf("<TITLE>Biassed Blocks Results</TITLE>\n");
printf("<H1>Biassed Blocks Results</H1>\n");
printf("<HR>\n") ;
if ((outf = fopen(program_output, "r")) == NULL)
{
printf("Error opening program output file.\n") ;
clean_temp_files() ;
exit(1) ;
}
... | false | false | false | false | true | 1 |
SiS_SetTVSpecial(struct SiS_Private *SiS_Pr, unsigned short ModeNo)
{
if(!(SiS_Pr->SiS_VBType & VB_SIS30xBLV)) return;
if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoHiVision)) return;
if(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p | TVSetYPbPr750p)) return;
if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) {
if(SiS_Pr->SiS_TVMode &... | false | false | false | false | false | 0 |
psb_intel_lvds_set_power(struct drm_device *dev, bool on)
{
struct drm_psb_private *dev_priv = dev->dev_private;
struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev;
u32 pp_status;
if (!gma_power_begin(dev, true)) {
dev_err(dev->dev, "set power, chip off!\n");
return;
}
if (on... | false | false | false | false | false | 0 |
WXMPMeta_GetProperty_Int_1 ( XMPMetaRef xmpObjRef,
XMP_StringPtr schemaNS,
XMP_StringPtr propName,
XMP_Int32 * propValue,
XMP_OptionBits * options,
WXMP_Result * wResult ) /* const */
{
XMP_ENTER_ObjRead ( XMPMeta, "WXMPMeta_GetProperty_Int_1" )
if ( (schemaNS ==... | false | false | false | false | false | 0 |
log_seat_removed_event (CkManager *manager,
CkSeat *seat)
{
CkLogEvent event;
gboolean res;
GError *error;
char *sid;
CkSeatKind seat_kind;
memset (&event, 0, sizeof (CkLogEvent));
ev... | false | false | false | false | false | 0 |
base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len)
{
std::string ret;
int i = 0;
int j = 0;
unsigned char char_array_3[3];
unsigned char char_array_4[4];
while (in_len--) {
char_array_3[i++] = *(bytes_to_encode++);
if (i == 3) {
char_array_4[0] = (char_array_3[0] & 0xfc)... | false | false | false | false | false | 0 |
initHeap(PairHeap * h, double *place, int *ordering, int n)
{
int i;
Pair edge;
int j;
h->heapSize = n - 1;
#ifdef REDO
if (h->heapSize > h->maxSize) {
h->maxSize = h->heapSize;
h->data = (Pair *) realloc(h->data, h->maxSize * sizeof(Pair));
}
#else
h->maxSize = h->heapSize;
h->data =... | false | false | false | false | false | 0 |
H5O_attr_iterate(hid_t loc_id, hid_t dxpl_id,
H5_index_t idx_type, H5_iter_order_t order, hsize_t skip,
hsize_t *last_attr, const H5A_attr_iter_op_t *attr_op, void *op_data)
{
H5G_loc_t loc; /* Object location */
herr_t ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
/*... | false | false | false | false | false | 0 |
gth_main_get_all_filters (void)
{
GthFilterFile *filter_file;
GList *filters;
GList *registered_tests;
GList *scan;
gboolean changed = FALSE;
filter_file = gth_main_get_default_filter_file ();
filters = gth_filter_file_get_tests (filter_file);
registered_tests = gth_main_get_regi... | false | false | false | false | false | 0 |
ixgbe_obtain_mbx_lock_pf(struct ixgbe_hw *hw, u16 vf_number)
{
u32 p2v_mailbox;
/* Take ownership of the buffer */
IXGBE_WRITE_REG(hw, IXGBE_PFMAILBOX(vf_number), IXGBE_PFMAILBOX_PFU);
/* reserve mailbox for vf use */
p2v_mailbox = IXGBE_READ_REG(hw, IXGBE_PFMAILBOX(vf_number));
if (p2v_mailbox & IXGBE_PFMAILBO... | false | false | false | false | false | 0 |
c4_peek(avmcard *card, unsigned long off, unsigned long *valuep)
{
if (wait_for_doorbell(card, HZ / 10) < 0)
return -1;
c4outmeml(card->mbase + MBOX_PEEK_POKE, off);
c4outmeml(card->mbase + DOORBELL, DBELL_RNWR | DBELL_ADDR);
if (wait_for_doorbell(card, HZ / 10) < 0)
return -1;
*valuep = c4inmeml(card->mba... | false | false | false | false | false | 0 |
cmp(VALUE x, VALUE y)
{
if (FIXNUM_P(x) && FIXNUM_P(y)) {
if ((long)x < (long)y)
return -1;
if ((long)x > (long)y)
return 1;
return 0;
}
return rb_cmpint(rb_funcall(x, id_cmp, 1, y), x, y);
} | false | false | false | false | false | 0 |
evalfiledesc(s)
CONST char *s;
{
int i, n;
i = 0;
if ((n = getnum(s, &i)) < 0) return(-1);
i = Xgetdtablesize();
if (n > i) n = i;
return(n);
} | false | false | false | false | false | 0 |
prefer_and_bit_test (enum machine_mode mode, int bitnum)
{
if (and_test == 0)
{
/* Set up rtxes for the two variations. Use NULL as a placeholder
for the BITNUM-based constants. */
and_reg = gen_rtx_REG (mode, FIRST_PSEUDO_REGISTER);
and_test = gen_rtx_AND (mode, and_reg, NULL);
shift_... | false | false | false | false | false | 0 |
fillBuf() {
int n;
bufPos += bufEnd - buf;
bufPtr = bufEnd = buf;
if (limited && bufPos >= start + length) {
return gFalse;
}
if (limited && bufPos + fileStreamBufSize > start + length) {
n = start + length - bufPos;
} else {
n = fileStreamBufSize;
}
n = file->read(buf, n, offset);
if (... | false | false | false | false | false | 0 |
xdndSrcReceiveFinished(DragSource *ds, XEvent *xev) {
/* data.l[0] : XID of target window
data.l[1] : Reserved for future use. */
if (xev->xclient.data.l[0]!=ds->dropTargWin) {
return;
}
XDeleteProperty(ds->display,ds->dragSrcWin,ds->dropTargProperty);/*ds->dropTargProperty*/
ds->state = 0;
} | false | false | false | false | false | 0 |
get_cmd (void)
{
struct uae_xcmd *cmd;
TCHAR *s;
if (!first)
return NULL;
s = first->cmd;
cmd = first;
first = first->next;
if (!first)
last = NULL;
free (cmd);
return s;
} | false | false | false | false | false | 0 |
ct_stored_block(s, buf, stored_len, eof)
deflate_state *s;
charf *buf; /* input block */
ulg stored_len; /* length of input block */
int eof; /* true if this is the last block for a file */
{
send_bits(s, (STORED_BLOCK<<1)+eof, 3); /* send block type */
s->compressed_len = (s->... | false | false | false | false | false | 0 |
initialize_imt_slot (MonoVTable *vtable, MonoDomain *domain, MonoImtBuilderEntry *imt_builder_entry, gpointer fail_tramp)
{
if (imt_builder_entry != NULL) {
if (imt_builder_entry->children == 0 && !fail_tramp) {
/* No collision, return the vtable slot contents */
return vtable->vtable [imt_builder_entry->value... | false | false | false | false | false | 0 |
printPolyline(xdot_polyline * p, pf print, void *info)
{
int i;
char buf[512];
sprintf(buf, " %d", p->cnt);
print(buf, info);
for (i = 0; i < p->cnt; i++) {
sprintf(buf, " %.02f", p->pts[i].x);
trim(buf);
print(buf, info);
sprintf(buf, " %.02f", p->pts[i].y);
trim(buf);
print(buf, info);
... | true | true | false | false | false | 1 |
fqdn_encode(unsigned char *dst, int dstlen, const unsigned char *src,
int srclen)
{
unsigned char *out;
int i, j, len, outlen=0;
out = dst;
for (i = 0, j = 0 ; i < srclen ; i = j) {
while ((j < srclen) && (src[j] != '.') && (src[j] != '\0'))
j++;
len = j - i;
if ((outlen + 1 + len) > dstlen)
retu... | false | false | false | false | true | 1 |
unix_localtime(value t)
{
time_t clock;
struct tm * tm;
clock = (time_t) Double_val(t);
tm = localtime(&clock);
if (tm == NULL) unix_error(EINVAL, "localtime", Nothing);
return alloc_tm(tm);
} | false | false | false | false | false | 0 |
get_type_attrs(const qpol_type_t * type_datum, const apol_policy_t * policydb)
{
qpol_iterator_t *iter = NULL;
const char *attr_name = NULL;
const qpol_type_t *attr_datum = NULL;
qpol_policy_t *q = apol_policy_get_qpol(policydb);
if (qpol_type_get_attr_iter(q, type_datum, &iter))
goto cleanup;
PyObject *list =... | false | false | false | false | true | 1 |
P_SpawnPhasedLight(sector_t * sector, int base, int index)
{
phase_t *phase;
phase = Z_Malloc(sizeof(*phase), PU_LEVSPEC, 0);
P_AddThinker(&phase->thinker);
phase->sector = sector;
if (index == -1)
{ // sector->lightlevel as the index
phase->index = sector->lig... | false | false | false | false | false | 0 |
SendGMTicketGetTicket(uint32 status, GMTicket* ticket /*= NULL*/)
{
std::string text = ticket ? ticket->GetText() : "";
if (ticket && ticket->HasResponse())
{
text += "\n\n";
std::string textFormat = GetMangosString(LANG_COMMAND_TICKETRESPONSE);
char textBuf[1024];
snprintf... | false | false | false | false | false | 0 |
get_scsiId(struct lib_context *lc, char *path)
{
int fd;
Sg_scsi_id sg_id;
memset(&sg_id, 0, sizeof(sg_id));
if ((fd = open(path, O_RDONLY)) == -1)
return UNKNOWN_SCSI_ID;
if (!get_scsi_id(lc, fd, &sg_id)) {
close(fd);
return UNKNOWN_SCSI_ID;
}
close(fd);
return (sg_id.host_no << 16) | (sg_id.scsi_id ... | false | false | false | false | false | 0 |
parseSound(Object *obj)
{
// let's try to see if this Object is a Sound, according to the PDF specs
// (section 9.2)
Stream *str = NULL;
// the Object must be a Stream
if (obj->isStream()) {
str = obj->getStream();
} else {
return NULL;
}
// the Stream must have a Dict
Dict *dict = str->getDic... | false | false | false | false | false | 0 |
production_menu_shown(GtkWidget *widget, gpointer data)
{
GtkWidget *menu, *item;
GtkMenuItem *parent_item;
GCallback callback;
int count = 0;
parent_item = data;
fc_assert_ret(parent_item != NULL);
fc_assert_ret(GTK_IS_MENU_ITEM(parent_item));
callback = g_object_get_data(G_OBJECT(parent_item), "item... | false | false | false | false | false | 0 |
snd_es1968_free_memory(struct es1968 *chip, struct esm_memory *buf)
{
struct esm_memory *chunk;
mutex_lock(&chip->memory_mutex);
buf->empty = 1;
if (buf->list.prev != &chip->buf_list) {
chunk = list_entry(buf->list.prev, struct esm_memory, list);
if (chunk->empty) {
chunk->buf.bytes += buf->buf.bytes;
li... | false | false | false | false | false | 0 |
ms_obj_attr_get_uint (MSObjAttrBag *attrs, MSObjAttrID id, guint32 default_value)
{
MSObjAttr *attr;
g_return_val_if_fail (attrs != NULL, default_value);
g_return_val_if_fail (id & MS_OBJ_ATTR_IS_INT_MASK, default_value);
attr = ms_obj_attr_bag_lookup (attrs, id);
if (attr == NULL)
return default_value;
retur... | false | false | false | false | false | 0 |
gs_rectappend_compat(gs_state * pgs, const gs_rect * pr, uint count, bool clip)
{
bool CPSI_mode = gs_currentcpsimode(pgs->memory);
for (; count != 0; count--, pr++) {
floatp px = pr->p.x, py = pr->p.y, qx = pr->q.x, qy = pr->q.y;
int code;
if (CPSI_mode) {
/* We believe th... | false | false | false | false | false | 0 |
whitelist_periodic_dns(void *unused_obj)
{
time_t now = tm_time();
GSList *sl;
(void) unused_obj;
GM_SLIST_FOREACH(sl_whitelist, sl) {
struct whitelist *item = sl->data;
/*
* Use this opportunity to refresh the TLS cache.
*/
if (item->use_tls && item->port != 0 && is_host_addr(item->addr))
tls... | false | false | false | false | false | 0 |
alias_template_specialization_p (tree t)
{
if (t == NULL_TREE)
return false;
return (primary_template_instantiation_p (t)
&& DECL_ALIAS_TEMPLATE_P (TYPE_TI_TEMPLATE (t)));
} | false | false | false | true | false | 1 |
tps6507x_i2c_write_device(struct tps6507x_dev *tps6507x, char reg,
int bytes, void *src)
{
struct i2c_client *i2c = tps6507x->i2c_client;
/* we add 1 byte for device register */
u8 msg[TPS6507X_MAX_REGISTER + 1];
int ret;
if (bytes > TPS6507X_MAX_REGISTER)
return -EINVAL;
msg[0] = reg;
memcpy(&msg[1],... | false | false | false | false | false | 0 |
instantiate_scev_name (basic_block instantiate_below,
struct loop *evolution_loop, struct loop *inner_loop,
tree chrec,
bool fold_conversions, htab_t cache, int size_expr)
{
tree res;
struct loop *def_loop;
basic_block def_bb = gimple_bb (SSA_NAME_DEF_STMT (chrec));
/* A parameter (o... | false | false | false | false | false | 0 |
parse_boolean (cfile)
struct parse *cfile;
{
const char *val;
int rv;
(void)next_token(&val, NULL, cfile);
if (!strcasecmp (val, "true")
|| !strcasecmp (val, "on"))
rv = 1;
else if (!strcasecmp (val, "false")
|| !strcasecmp (val, "off"))
rv = 0;
else {
parse_warn (cfile,
"boolean val... | false | false | false | false | false | 0 |
reiserfs_insert_item(struct reiserfs_transaction_handle *th,
struct treepath *path, const struct cpu_key *key,
struct item_head *ih, struct inode *inode,
const char *body)
{
struct tree_balance s_ins_balance;
int retval;
int fs_gen = 0;
int quota_bytes = 0;
BUG_ON(!th->t_trans_id);
if (inode) { /* ... | false | false | false | false | false | 0 |
lookup_incoming(const struct sockaddr_atmsvc *addr)
{
ENTRY *walk;
for (walk = unknown_incoming; walk; walk = walk->next)
if (walk->addr && atm_equal((struct sockaddr *) walk->addr,
(struct sockaddr *) addr,0,0)) break;
return walk;
} | false | false | false | false | false | 0 |
getBorderDir() const
{
V2 loc = m_model->getLocation();
const Shape *shape = m_model->shape();
Shape::const_iterator end = shape->marksEnd();
for (Shape::const_iterator i = shape->marksBegin(); i != end; ++i) {
V2 mark = loc.plus(*i);
if (mark.getX() == 0 && canGo(Dir::DIR_LEFT)) {
... | false | false | false | false | false | 0 |
posix_fchown(PyObject *self, PyObject *args)
{
int fd;
long uid, gid;
int res;
if (!PyArg_ParseTuple(args, "ill:fchown", &fd, &uid, &gid))
return NULL;
Py_BEGIN_ALLOW_THREADS
res = fchown(fd, (uid_t) uid, (gid_t) gid);
Py_END_ALLOW_THREADS
if (res < 0)
return posix_error(... | false | false | false | false | false | 0 |
lgdt3306a_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
{
struct lgdt3306a_state *state = fe->demodulator_priv;
*ucblocks = 0;
#if 1
/* FGR - FIXME - I don't know what value is expected by dvb_core
* what happens when value wraps? */
*ucblocks = read_reg(state, 0x00f4); /* TPIFTPERRCNT[0-7] */
dbg_info(... | false | false | false | false | false | 0 |
readMsg(int sockfd, donkeyMsg *m) {
int n, i;
unsigned long sizeRead;
char buf[4];
unsigned char c;
m->size = 0;
sizeRead = 0;
while (sizeRead != 4) {
n = read(sockfd, buf + sizeRead, 4 - sizeRead);
if (n <= 0) {
/* printf("ERROR reading payload from socket : %d\n", n);*/
return n;
}
sizeRead += n... | false | false | false | false | false | 0 |
ath6kl_cfg80211_vif_cleanup(struct ath6kl_vif *vif)
{
struct ath6kl *ar = vif->ar;
struct ath6kl_mc_filter *mc_filter, *tmp;
aggr_module_destroy(vif->aggr_cntxt);
ar->avail_idx_map |= BIT(vif->fw_vif_idx);
if (vif->nw_type == ADHOC_NETWORK)
ar->ibss_if_active = false;
list_for_each_entry_safe(mc_filter, tmp... | false | false | false | false | false | 0 |
__mlx4_ib_cq_clean(struct mlx4_ib_cq *cq, u32 qpn, struct mlx4_ib_srq *srq)
{
u32 prod_index;
int nfreed = 0;
struct mlx4_cqe *cqe, *dest;
u8 owner_bit;
int cqe_inc = cq->buf.entry_size == 64 ? 1 : 0;
/*
* First we need to find the current producer index, so we
* know where to start cleaning from. It doesn'... | false | false | false | false | false | 0 |
op_rla(/*@unused@*/ uint32_t op, const struct opinfo *oi)
{
uint8_t res;
DPRINTF(" %s", oi->name);
res = gbcpu_regs.rn.a;
res = res << 1;
res |= (gbcpu_regs.rn.f & CF) >> 4;
gbcpu_regs.rn.f = (gbcpu_regs.rn.a >> 7) << 4;
if (res == 0) gbcpu_regs.rn.f |= ZF;
gbcpu_regs.rn.a = res;
} | false | false | false | false | false | 0 |
load_funcs()
{
if(options.verbose) cout << "Loading functions..." << endl;
#ifdef LOAD_SPEED_TEST
dbg::DateDiff dd;
dbg::timeDateDiff(cout);
dd.start();
#endif
bool eof=false;
while( !eof )
{
UCFunc *ucfunc = new UCFunc();
if(options.game_bg() || options.game_si())
readbin_U7UCFunc(_file, *ucfunc, ... | false | false | false | false | false | 0 |
mupdate_synchronize_remote(mupdate_handle *handle,
struct mbent_queue *remote_boxes,
struct mpool *pool)
{
struct sync_rock rock;
if(!handle || !handle->saslcompleted) return 1;
rock.pool = pool;
/* ask mupdate master for updates and set nonblocking */
prot_printf(handle->... | false | false | false | false | false | 0 |
_normalize_hostlist(const char *hostlist)
{
char *buf = NULL;
hostlist_t hl = hostlist_create(hostlist);
if (hl) {
buf = hostlist_ranged_string_xmalloc(hl);
hostlist_destroy(hl);
}
if (!buf)
return xstrdup(hostlist);
return buf;
} | false | false | false | false | false | 0 |
pbcwhere(const char *text, int *line, int *col )
{
int loc_line = *line;
int loc_col = *col;
char c;
while ( (c = *text++) ) {
if ( c == '\t' ) {
loc_col += 8 - (loc_col % 8);
} else if ( c == '\n' ) {
loc_line++;
loc_col = 1;
} else
loc_col++;
}
*line = loc_line;
*col = loc_col;
} | false | false | false | false | false | 0 |
ibus_observed_path_deserialize (IBusObservedPath *path,
GVariant *variant)
{
gint retval;
retval = IBUS_SERIALIZABLE_CLASS (ibus_observed_path_parent_class)->deserialize ((IBusSerializable *)path, variant);
g_return_val_if_fail (retval, 0);
g_variant_get_child (... | false | false | false | false | false | 0 |
em_pop_sreg(struct x86_emulate_ctxt *ctxt)
{
int seg = ctxt->src2.val;
unsigned long selector;
int rc;
rc = emulate_pop(ctxt, &selector, 2);
if (rc != X86EMUL_CONTINUE)
return rc;
if (ctxt->modrm_reg == VCPU_SREG_SS)
ctxt->interruptibility = KVM_X86_SHADOW_INT_MOV_SS;
if (ctxt->op_bytes > 2)
rsp_incremen... | false | false | false | false | false | 0 |
zend_call_destructors(TSRMLS_D) /* {{{ */
{
zend_try {
shutdown_destructors(TSRMLS_C);
} zend_end_try();
} | false | false | false | false | false | 0 |
getRecvInfo(const fxStr& qfile, const struct stat& sb)
{
RecvInfo* rip = recvq[qfile];
if (!rip) {
rip = new RecvInfo(qfile);
if (!getRecvDocStatus(*rip)) {
delete rip;
return (NULL);
}
// NB: this will be wrong if the file is copied
rip->recvTime = sb.st_mtime; // time recv completed
recvq[qfi... | false | false | false | false | false | 0 |
GetFullName() const
{
std::string Full = FirstName;
if( Full.size() && LastName.size() )
Full += " ";
Full += LastName;
return Full;
} | false | false | false | false | false | 0 |
get(src, dest)
struct rec_entry **src;
char *dest;
{
FILE *volatile outfile; /* "volatile" to preserve outfile across setjmp */
if (src == NULL || dest == NULL)
return;
if (dest == tty)
outfile = stdout;
else {
if ((outfile = fopen(dest, "wb")) == NULL) {
printf("recover: cannot create %s.\n", dest);
... | false | false | false | false | false | 0 |
exitstatus(List *status) {
Term *term;
char *s;
unsigned long n;
if (status == NULL)
return 0;
if (status->next != NULL)
return istrue(status) ? 0 : 1;
term = status->term;
if (term->closure != NULL)
return 1;
s = term->str;
if (*s == '\0')
return 0;
n = strtol(s, &s, 0);
if (*s != '\0' || n > 255)... | false | false | false | false | false | 0 |
expr_constant(expr_ty e)
{
switch (e->kind) {
case Num_kind:
return PyObject_IsTrue(e->v.Num.n);
case Str_kind:
return PyObject_IsTrue(e->v.Str.s);
case Name_kind:
/* __debug__ is not assignable, so we can optimize
* it away in if and while statements */
if (strc... | false | false | false | false | false | 0 |
chirp_reli_pwrite( struct chirp_file *file, const void *data, INT64_T length, INT64_T offset, time_t stoptime )
{
const char *cdata = data;
INT64_T result = 0;
INT64_T actual = 0;
while(length>0) {
actual = chirp_reli_pwrite_buffered(file,cdata,length,offset,stoptime);
if(actual<=0) break;
result += actual;... | false | false | false | false | false | 0 |
gigaset_skb_sent(struct bc_state *bcs, struct sk_buff *dskb)
{
struct cardstate *cs = bcs->cs;
struct gigaset_capi_ctr *iif = cs->iif;
struct gigaset_capi_appl *ap = bcs->ap;
unsigned char *req = skb_mac_header(dskb);
u16 flags;
/* update statistics */
++bcs->trans_up;
if (!ap) {
gig_dbg(DEBUG_MCMD, "%s: ap... | false | false | false | false | false | 0 |
fs_row_copy(fs_row *r,int cols) {
fs_row *res = malloc(cols * sizeof(fs_row));
for (int i = 0; i < cols; i++) {
res[i].name = g_strdup(r[i].name);
res[i].rid = r[i].rid;
res[i].type = r[i].type;
res[i].lex = g_strdup(r[i].lex);
res[i].dt = g_strdup(r[i].dt);
res[i... | false | false | false | false | false | 0 |
property_mixed(void)
{
PRECOND(prop_ok);
char body[1024];
sprintf(body,XML_DECL "<D:propertyupdate xmlns:D='DAV:'><D:set><D:prop xml:lang=\"en\">"
"<x:author xmlns:x='http://example.com/ns'>"
"<x:name>Sharad</x:name>"
"<x:uri type='email' "
... | true | true | false | false | true | 1 |
krb5_db_check_transited_realms(krb5_context kcontext,
const krb5_data *tr_contents,
const krb5_data *client_realm,
const krb5_data *server_realm)
{
krb5_error_code status;
kdb_vftabl *v;
status = get_vftabl(kcontex... | false | false | false | false | false | 0 |
val_str(String* str)
{
THD *thd= current_thd;
if (cache_present && thd->query_id == used_query_id)
{
if (cache_present & GET_SYS_VAR_CACHE_STRING)
{
null_value= cached_null_value;
return null_value ? NULL : &cached_strval;
}
else if (cache_present & GET_SYS_VAR_CACHE_LONG)
{
... | false | false | false | false | false | 0 |
main(int ac, char *av[])
{
const char *binding = NULL;
unsigned short port = HTTP_DEFAULT_PORT;
int ssl = 0, threads = 0;
int i;
for (i = 1; i < ac; i++)
{
char tmpbuf[256];
tmpbuf[0] = 0;
unsigned tmp = 0;
if (!strncmp(av[i], "--port=", 7))
{
sscanf(av[i], "%*[^=]=%u", &tmp);
port = (short)tmp;... | true | true | true | false | true | 1 |
tp_base_channel_reopened_with_requested (TpBaseChannel *chan,
gboolean requested,
TpHandle initiator)
{
TpBaseChannelPrivate *priv = chan->priv;
/* Take a ref to ourself: the 'closed' handler might drop its reference on us.
*/
g_object_ref (chan);
if (priv->initiator != initiator)
priv->initiat... | false | false | false | false | false | 0 |
CompileDebuggerScript(int index) {
HandleScope scope;
// Bail out if the index is invalid.
if (index == -1) {
return false;
}
// Find source and name for the requested script.
Handle<String> source_code = Bootstrapper::NativesSourceLookup(index);
Vector<const char> name = Natives::GetScriptName(inde... | false | false | false | false | false | 0 |
bfa_fcs_rport_sm_online(struct bfa_fcs_rport_s *rport, enum rport_event event)
{
bfa_trc(rport->fcs, rport->pwwn);
bfa_trc(rport->fcs, rport->pid);
bfa_trc(rport->fcs, event);
switch (event) {
case RPSM_EVENT_FAB_SCN:
if (bfa_fcs_fabric_is_switched(rport->port->fabric)) {
bfa_sm_set_state(rport,
bfa_fc... | false | false | false | false | false | 0 |
_mesa_pack_float_z_row(mesa_format format, GLuint n,
const GLfloat *src, void *dst)
{
switch (format) {
case MESA_FORMAT_S8_UINT_Z24_UNORM:
case MESA_FORMAT_X8Z24_UNORM:
{
/* don't disturb the stencil values */
GLuint *d = ((GLuint *) dst);
const GLdouble... | false | true | false | false | false | 1 |
GraalAddInstance( InstanceMbk )
phins_list *InstanceMbk;
{
rdsins_list *InstanceRds;
rdsrec_list *Rectangle;
char Layer;
rdsbegin();
delphfig( InstanceMbk->FIGNAME );
if ( Graalgetphfig( InstanceMbk->FIGNAME, 'P' ) == (phfig_list *)NULL )
{
rdsend();
return( (rdsins_list *)NULL );
... | false | false | false | false | false | 0 |
brasero_layout_combo_changed_cb (GtkComboBox *combo,
BraseroLayout *layout)
{
BraseroLayoutObject *source;
BraseroLayoutItem *item;
GtkTreeModel *model;
gboolean is_visible;
GtkAction *action;
GtkTreeIter iter;
model = gtk_combo_box_get_model (combo);
if (!gtk_combo_box_get_active_iter (combo, &iter))
r... | false | false | false | false | false | 0 |
CRDestroy(closure)
void *closure;
{
CRInfo *cr = (CRInfo *)closure;
CRStop(cr);
if (cr->buffer != NULL) free_mem(cr->buffer);
if (cr->mh != NULL) MIMEDestroyHeader(cr->mh);
MPDestroy(cr->mp);
return;
} | false | false | false | false | false | 0 |
test_cmd_fifo_depth_check(void)
{
int len;
unsigned int flags = comedi_get_subdevice_flags(device,subdevice);
if(!(flags&SDF_CMD) || (comedi_get_read_subdevice(device)!=subdevice)){
printf("not applicable\n");
return 0;
}
for(len=64;len<65536;len<<=1){
printf("%d, %d\n",len,get_chunks_per_length(len));
}
... | false | false | false | false | false | 0 |
turn_report_allocation_delete(void *a)
{
if(a) {
ts_ur_super_session *ss = (ts_ur_super_session*)(((allocation*)a)->owner);
if(ss) {
turn_turnserver *server = (turn_turnserver*)ss->server;
if(server) {
ioa_engine_handle e = turn_server_get_engine(server);
if(e && e->verbose) {
TURN_LOG_FUNC(TURN... | true | true | false | false | false | 1 |
emblems() const
{
QStringList res;
if (!m_storageAccess) {
FstabDevice* d = const_cast<FstabDevice *>(this);
d->m_storageAccess = new FstabStorageAccess(d);
}
if (m_storageAccess->isAccessible()) {
res << "emblem-mounted";
} else {
res << "emblem-unmounted";
}
... | false | false | false | false | false | 0 |
gk20a_pllg_slide(struct gk20a_clk *clk, u32 n)
{
struct nvkm_subdev *subdev = &clk->base.subdev;
struct nvkm_device *device = subdev->device;
u32 val;
int ramp_timeout;
/* get old coefficients */
val = nvkm_rd32(device, GPCPLL_COEFF);
/* do nothing if NDIV is the same */
if (n == ((val >> GPCPLL_COEFF_N_SHIFT)... | false | false | false | false | false | 0 |
RetryJob(unsigned id)
{
wxMutexLocker lock(s_mutex);
for (std::list<ConvertJob*>::iterator it = s_jobs.begin(); it != s_jobs.end(); ++it) {
if ((*it)->id == id && (*it)->state != CONV_INPROGRESS && (*it)->state != CONV_OK) {
(*it)->state = CONV_QUEUE;
Notify_ConvertUpdateJobInfo(*it);
StartThread();
bre... | false | false | false | false | false | 0 |
msgq_clear(struct msgq_head *qh)
{
register struct msgq *q, *qq;
for (q = qh->head; q; q = qq) {
qq = q->next;
nfree(q->msg);
nfree(q);
}
qh->head = qh->last = NULL;
qh->tot = qh->warned = 0;
} | false | false | false | false | false | 0 |
VerifyPrime(RandomNumberGenerator &rng, const Integer &p, unsigned int level)
{
bool pass = IsPrime(p) && RabinMillerTest(rng, p, 1);
if (level >= 1)
pass = pass && RabinMillerTest(rng, p, 10);
return pass;
} | false | false | false | false | false | 0 |
knocker_core_portscan_tcp_connnect (knocker_core_portscan_data_t * data, unsigned int port)
{
#ifdef DEBUG
fprintf (stderr, "debug: function knocker_core_portscan_tcp_connnect (...) called\n");
fprintf (stderr, "debug: connecting to port: %d\n", port);
#endif
if (knocker_core_open_socket (&data->socket, data->ho... | false | true | false | false | false | 1 |
xfs_dir3_data_reada_verify(
struct xfs_buf *bp)
{
struct xfs_dir2_data_hdr *hdr = bp->b_addr;
switch (hdr->magic) {
case cpu_to_be32(XFS_DIR2_BLOCK_MAGIC):
case cpu_to_be32(XFS_DIR3_BLOCK_MAGIC):
bp->b_ops = &xfs_dir3_block_buf_ops;
bp->b_ops->verify_read(bp);
return;
case cpu_to_be32(XFS_DIR2_DATA_MAGIC)... | false | false | false | false | false | 0 |
create_sfr_map()
{
if(verbose)
cout << "creating c71 registers \n";
add_sfr_register(&adcon0, 0x08, RegisterValue(0,0));
add_sfr_register(&adcon1, 0x88, RegisterValue(0,0));
add_sfr_register(&adres, 0x09, RegisterValue(0,0));
adcon1.setValidCfgBits(ADCON1::PCFG0 | ADCON1::PCFG1,0);
adcon1.setNumbe... | false | false | false | false | false | 0 |
pkix_List_BubbleSort(
PKIX_List *fromList,
PKIX_List_SortComparatorCallback comparator,
PKIX_List **pSortedList,
void *plContext)
{
PKIX_List *sortedList = NULL;
PKIX_PL_Object *cmpObj = NULL;
PKIX_PL_Object *leastObj = NULL;
PKIX_Int32 cmpResult = 0;
... | false | false | false | false | false | 0 |
_internalFileOpen(Stream_t *Dir, unsigned int first,
size_t size, direntry_t *entry)
{
Stream_t *Stream = GetFs(Dir);
DeclareThis(Fs_t);
File_t Pattern;
File_t *File;
init_hash();
This->refs++;
if(first != 1){
/* we use the illegal cluster 1 to mark newly created files.
* do not manage those by has... | false | false | false | false | false | 0 |
partysock(char *bot, char *nick)
{
int i;
for (i = 0; i < parties; i++) {
if ((!egg_strcasecmp(party[i].bot, bot)) &&
(!egg_strcasecmp(party[i].nick, nick)))
return party[i].sock;
}
return 0;
} | false | false | false | false | false | 0 |
gvir_config_object_attach_replace(GVirConfigObject *parent,
const char *child_name,
GVirConfigObject *child)
{
g_return_if_fail(child_name != NULL);
if (child == NULL)
gvir_config_object_delete_children(parent, child_name, NULL);
e... | false | false | false | false | false | 0 |
ReleaseALBuffers(ALCdevice *device)
{
ALsizei i;
for(i = 0;i < device->BufferMap.size;i++)
{
ALbuffer *temp = device->BufferMap.array[i].value;
device->BufferMap.array[i].value = NULL;
free(temp->data);
FreeThunkEntry(temp->buffer);
memset(temp, 0, sizeof(ALbuffer))... | false | false | false | false | false | 0 |
f2fs_ioc_abort_volatile_write(struct file *filp)
{
struct inode *inode = file_inode(filp);
int ret;
if (!inode_owner_or_capable(inode))
return -EACCES;
ret = mnt_want_write_file(filp);
if (ret)
return ret;
f2fs_balance_fs(F2FS_I_SB(inode));
clear_inode_flag(F2FS_I(inode), FI_ATOMIC_FILE);
clear_inode_fl... | false | false | false | false | false | 0 |
GetPropertyPage ()
{
gcugtk::UIBuilder *builder = new gcugtk::UIBuilder (UIDIR"/orbital.ui", GETTEXT_PACKAGE);
m_CoefBtn = GTK_SPIN_BUTTON (builder->GetWidget ("coef-btn"));
gtk_spin_button_set_value (m_CoefBtn, m_Coef);
g_signal_connect_swapped (m_CoefBtn, "value-changed", G_CALLBACK (CoefChanged), this);
m_Rotat... | false | false | false | false | false | 0 |
reiserfs_read_bitmap_block(struct super_block *sb,
unsigned int bitmap)
{
b_blocknr_t block = (sb->s_blocksize << 3) * bitmap;
struct reiserfs_bitmap_info *info = SB_AP_BITMAP(sb) + bitmap;
struct buffer_head *bh;
/*
* Way old format filesystems had the bitmaps pack... | false | false | false | false | false | 0 |
c_pp_lookup_pragma (unsigned int id, const char **space, const char **name)
{
const int n_omp_pragmas = sizeof (omp_pragmas) / sizeof (*omp_pragmas);
int i;
for (i = 0; i < n_omp_pragmas; ++i)
if (omp_pragmas[i].id == id)
{
*space = "omp";
*name = omp_pragmas[i].name;
return;
}
if (id >= PR... | false | false | false | false | false | 0 |
iscsi_scsi_cmd_execute(struct iscsi_task *task)
{
struct iscsi_connection *conn = task->conn;
struct iscsi_cmd *req = (struct iscsi_cmd *) &task->req;
int ret = 0;
if ((req->flags & ISCSI_FLAG_CMD_WRITE) && task->r2t_count) {
if (!task->unsol_count)
list_add_tail(&task->c_list, &task->conn->tx_clist);
goto ... | 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.