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 |
|---|---|---|---|---|---|---|
render(render_guts_t* guts, int indentation) const {
rope_t ret;
bool padding = true;
ret += this->_childNodes.front()->render(guts, indentation);
if (guts->pretty) {
padding = false;
if (this->op != COMMA) {
ret += " ";
}
}
switch (this->op) {
case COMMA:
ret += ",";
break;
... | false | false | false | false | false | 0 |
compute_influence_values( clsf_DS clsf)
{
int n_atts = clsf->database->n_atts, n_classes = clsf->n_classes, n_class, n_att;
class_DS class;
rpt_DS reports = clsf->reports;
float curr_influence_value, class_influence_value_max, influence_sum,
global_influence_value_max = 0.0, *influence_sums,
*all_class... | false | true | false | false | true | 1 |
OnItemSelected(wxTreeEvent& event)
// ----------------------------------------------------------------------------
{ //(pecan 2006/9/12)
// User selected a tree item. Memorize the selection for
// other routines.
//CodeSnippetsTreeCtrl* pTree = (Cod... | false | false | false | false | false | 0 |
strlcat(dest, src, len)
char *dest;
const char *src;
size_t len;
{
size_t dlen = strlen(dest);
return dlen + strlcpy(dest + dlen, src, (len > dlen? len - dlen: 0));
} | false | false | false | false | false | 0 |
brcmf_pcie_remove(struct pci_dev *pdev)
{
struct brcmf_pciedev_info *devinfo;
struct brcmf_bus *bus;
brcmf_dbg(PCIE, "Enter\n");
bus = dev_get_drvdata(&pdev->dev);
if (bus == NULL)
return;
devinfo = bus->bus_priv.pcie->devinfo;
devinfo->state = BRCMFMAC_PCIE_STATE_DOWN;
if (devinfo->ci)
brcmf_pcie_intr_... | false | false | false | false | false | 0 |
AddRow(GtkSheet *tbl, gint nrows)
{
gint i;
if(nrows == -1 && tbl->maxrow == 0)
{
nrows = 1;
}
else
{
tbl->maxrow += nrows;
tbl->row = (GtkSheetRow *)g_realloc(tbl->row,(tbl->maxrow+1)*
sizeof(GtkSheetRow));
}
for(i=tbl->... | false | false | false | false | false | 0 |
sne_next_match(SpanEnum *self)
{
SpanNearEnum *sne = SpNEn(self);
SpanEnum *se_curr, *se_next;
if (!sne->first_time) {
if (!sne_init(sne)) {
return false;
}
sne->first_time = false;
}
se_curr = sne->span_enums[sne->current];
se_next = sne->span_enums[(sne->cu... | false | false | false | false | false | 0 |
qp_detatch_guest_work(struct vmci_handle handle)
{
int result;
struct qp_guest_endpoint *entry;
u32 ref_count = ~0; /* To avoid compiler warning below */
mutex_lock(&qp_guest_endpoints.mutex);
entry = qp_guest_handle_to_entry(handle);
if (!entry) {
mutex_unlock(&qp_guest_endpoints.mutex);
return VMCI_ERROR_... | false | false | false | false | false | 0 |
fmpz_poly_scalar_mul_fmpz(fmpz_poly_t output,
const fmpz_poly_t input, const fmpz_t x)
{
if ((input->length == 0) || (x[0] == 0))
{
_fmpz_poly_zero(output);
return;
}
unsigned long limbs, bits, max_limbs, max_bits, x_bits, top_bits;
max_bits = ((input-... | false | false | false | false | false | 0 |
_delayed_action_key_add(E_Object *obj, const char *params, Ecore_Event_Key *ev)
{
Delayed_Action *da;
da = E_NEW(Delayed_Action, 1);
if (!da) return;
if (obj)
{
da->obj = obj;
e_object_ref(da->obj);
}
da->mouse = 0;
da->keyname = eina_stringshare_add(ev->keyname);
if (par... | false | false | false | false | false | 0 |
LI4__C1DOWNWARD_FUNCTION__cmplam(V5)
register object V5;
{ VMB4 VMS4 VMV4
goto TTL;
TTL:;
{register object V6;
object V7;
V8= list(2,((object)VV[3]),CMPcar((V5)));
V6= (*(LnkLI86))(/* INLINE-ARGS */V8);
V7= CMPcadr((V6));
if(!(type_of((V5))==t_cons)){
goto T4;}
if(!(type_of(CMPcar((V5)))==t_cons)){
goto T4;... | false | false | false | false | false | 0 |
DAdel_elem(dynarr_p arr_ptr, /* IN: Array to access */
intn elem /* IN: Array element to retrieve */
)
{
CONSTR(FUNC, "DAdel_elem"); /* for HERROR */
dynarr_t *arr; /* ptr to the dynarray */
VOIDP ret_value=NULL;
HEclear();
arr=(dynarr_t *)arr_ptr;
... | false | false | false | false | false | 0 |
is_path_hidden (const gchar * path)
{
gint results = FALSE;
gchar * sub_str;
gchar * hidden_path_substr = g_strconcat (G_DIR_SEPARATOR_S, ".", NULL);
sub_str = g_strstr_len (path, strlen (path), hidden_path_substr);
if (sub_str != NULL) {
gchar * gnome_desktop_str;
gnome_desktop_str = g_strconcat (G_DIR_SEP... | false | false | false | false | false | 0 |
activate_variant (varname) char *varname; {
char lvarname[64];
int curi, new_activations = 0, varpos;
if (varname && (*varname == '+'))
strcpy (lvarname, varname+1);
else
return new_activations;
curi = 0;
while (curi < variants_active) {
if (!strcmp (curvar[curi], lvarname))
return new_a... | false | false | false | false | false | 0 |
s2255_create_sys_buffers(struct s2255_vc *vc)
{
unsigned long i;
unsigned long reqsize;
vc->buffer.dwFrames = SYS_FRAMES;
/* always allocate maximum size(PAL) for system buffers */
reqsize = SYS_FRAMES_MAXSIZE;
if (reqsize > SYS_FRAMES_MAXSIZE)
reqsize = SYS_FRAMES_MAXSIZE;
for (i = 0; i < SYS_FRAMES; i++) {... | false | false | false | false | false | 0 |
aio_read_events(struct kioctx *ctx, long min_nr, long nr,
struct io_event __user *event, long *i)
{
long ret = aio_read_events_ring(ctx, event + *i, nr - *i);
if (ret > 0)
*i += ret;
if (unlikely(atomic_read(&ctx->dead)))
ret = -EINVAL;
if (!*i)
*i = ret;
return ret < 0 || *i >= min_nr;
} | false | false | false | false | false | 0 |
waterfall_set_max_size (Waterfall *waterfall,
gdouble max_size)
{
if (max_size == waterfall->max_size)
return;
waterfall->max_size = max_size;
queue_redraw (waterfall);
} | false | false | false | false | false | 0 |
R2Distance(const R2Point& point, const R2Line& line)
{
// Return distance from point to line
RNLength d = point.X() * line.A() + point.Y() * line.B() + line.C();
return (d < 0.0) ? -d : d;
} | false | false | false | false | false | 0 |
chk_non_negative(int result, char *msg)
{
if (result < 0)
die("%s: %s",msg, strerror(errno));
return result;
} | false | false | false | false | false | 0 |
getCredentials(std::string& scheme, std::string& authInfo) const
{
scheme.clear();
authInfo.clear();
if (has(AUTHORIZATION))
{
const std::string& auth = get(AUTHORIZATION);
std::string::const_iterator it = auth.begin();
std::string::const_iterator end = auth.end();
while (it != end && Poco::Ascii::isSpace(... | false | false | false | false | false | 0 |
gkm_object_real_get_attribute (GkmObject *self, GkmSession *session, CK_ATTRIBUTE* attr)
{
CK_OBJECT_HANDLE handle = 0;
CK_RV rv;
switch (attr->type)
{
case CKA_CLASS:
g_warning ("Derived class should have overridden CKA_CLASS");
return CKR_GENERAL_ERROR;
case CKA_MODIFIABLE:
return gkm_attribute_set_bool ... | false | false | false | false | false | 0 |
countLeadingOnes() const {
if (isSingleWord())
return llvm::countLeadingOnes(VAL << (APINT_BITS_PER_WORD - BitWidth));
unsigned highWordBits = BitWidth % APINT_BITS_PER_WORD;
unsigned shift;
if (!highWordBits) {
highWordBits = APINT_BITS_PER_WORD;
shift = 0;
} else {
shift = APINT_BITS_PER_WO... | false | false | false | false | false | 0 |
ipehr_is_semaphore_wait(struct drm_device *dev, u32 ipehr)
{
if (INTEL_INFO(dev)->gen >= 8) {
return (ipehr >> 23) == 0x1c;
} else {
ipehr &= ~MI_SEMAPHORE_SYNC_MASK;
return ipehr == (MI_SEMAPHORE_MBOX | MI_SEMAPHORE_COMPARE |
MI_SEMAPHORE_REGISTER);
}
} | false | false | false | false | false | 0 |
writeSession(std::ostream& ostr)
{
if (page().has("page.session"))
{
std::string session = page().get("page.session");
std::string sessionCode;
if (session.empty()) return;
if (session[0] == '@')
sessionCode = "context()->thisBundle()->properties().getString(\"" + session.substr(1) + "\")";
else
sessi... | false | false | false | false | false | 0 |
joydev_0x_read(struct joydev_client *client,
struct input_dev *input,
char __user *buf)
{
struct joydev *joydev = client->joydev;
struct JS_DATA_TYPE data;
int i;
spin_lock_irq(&input->event_lock);
/*
* Get device state
*/
for (data.buttons = i = 0; i < 32 && i < joydev->nkey; i++)
data.... | false | false | false | false | false | 0 |
qh_printstats (FILE *fp, int index, int *nextindex) {
int j, nexti;
if (qh_newstats (index, &nexti)) {
for (j=index; j<nexti; j++)
qh_printstatlevel (fp, qhstat id[j], 0);
fprintf (fp, "\n");
}
if (nextindex)
*nextindex= nexti;
} | false | false | false | false | false | 0 |
build1 (code, type, node)
enum tree_code code;
tree type;
tree node;
{
int length;
#ifdef GATHER_STATISTICS
tree_node_kind kind;
#endif
tree t;
#ifdef GATHER_STATISTICS
if (TREE_CODE_CLASS (code) == 'r')
kind = r_kind;
else
kind = e_kind;
#endif
#ifdef ENABLE_CHECKING
if (TREE_CODE_... | false | false | false | false | false | 0 |
PromoteMemToReg(const std::vector<AllocaInst*> &Allocas,
DominatorTree &DT, AliasSetTracker *AST) {
// If there is nothing to do, bail out...
if (Allocas.empty()) return;
PromoteMem2Reg(Allocas, DT, AST).run();
} | false | false | false | false | false | 0 |
afd_close(AFFILE *af)
{
struct afd_private *ap = AFD_PRIVATE(af);
/* Close all of the subfiles, then free the memory, then close this file */
for(int i=0;i<ap->num_afs;i++){
ap->afs[i]->image_size = af->image_size; // set each to have correct imagesize
af_close(ap->afs[i]); // and close each file
}
... | false | false | false | false | false | 0 |
build_datatype(HeapTuple typeTup, int32 typmod, Oid collation)
{
Form_pg_type typeStruct = (Form_pg_type) GETSTRUCT(typeTup);
PLpgSQL_type *typ;
if (!typeStruct->typisdefined)
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("type \"%s\" is only a shell",
NameStr(typeStruct->typname))));
... | false | false | false | true | false | 1 |
uvc_queue_next_buffer(struct uvc_video_queue *queue,
struct uvc_buffer *buf)
{
struct uvc_buffer *nextbuf;
unsigned long flags;
if ((queue->flags & UVC_QUEUE_DROP_CORRUPTED) && buf->error) {
buf->error = 0;
buf->state = UVC_BUF_STATE_QUEUED;
buf->bytesused = 0;
vb2_set_plane_payload(&buf->buf.vb2_buf, 0, ... | false | false | false | false | false | 0 |
new_endif()
#endif
{
if (ctlstack->ctltype == CTLIF || ctlstack->ctltype == CTLIFX)
pushctl(CTLIFX);
else
err("new_endif bug");
} | false | false | false | false | false | 0 |
set_offset_condition(int startX, int startY, int destX, int destY)
{
//-------------------------------------------------------------//
// the offset is used to determine what the methods is used to
// do the path-reuse
//-------------------------------------------------------------//
err_when(leader_path_num>=cur_... | false | false | false | false | false | 0 |
test_man_frag_2nd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
hid_t dxpl = H5P_DATASET_XFER_DEFAULT; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Inter... | false | false | false | false | false | 0 |
__bt_defcmp(a, b)
const DBT *a, *b;
{
register size_t len;
register u_char *p1, *p2;
/*
* XXX
* If a size_t doesn't fit in an int, this routine can lose.
* What we need is a integral type which is guaranteed to be
* larger than a size_t, and there is no such thing.
*/
len = MIN(a->size, b->size);
for (... | false | false | false | false | false | 0 |
flatArityExpr (expr)
chain_list *expr;
{
long oper;
chain_list *expr1, *expr2, *exprBefore;
if (!ATOM (expr))
{
oper = OPER (expr);
if (oper == NOT || oper == STABLE)
flatArityExpr (CADR (expr));
else if (oper == NOR || oper == NAND || oper == NXOR)
{
expr1 = expr;
while ((expr... | false | false | false | false | false | 0 |
fusion_skirmish_dismiss (FusionSkirmish *skirmish)
{
D_ASSERT( skirmish != NULL );
skirmish->single.count--;
if (pthread_mutex_unlock( &skirmish->single.lock ))
return errno2result( errno );
return DR_OK;
} | false | false | false | false | false | 0 |
PK11_Logout(PK11SlotInfo *slot)
{
CK_RV crv;
/* force a logout */
PK11_EnterSlotMonitor(slot);
crv = PK11_GETTAB(slot)->C_Logout(slot->session);
slot->lastLoginCheck = 0;
PK11_ExitSlotMonitor(slot);
if (crv != CKR_OK) {
PORT_SetError(PK11_MapError(crv));
return SECFailure;
}
retur... | false | false | false | false | false | 0 |
xsh_key_bin_div_by_fct(cpl_propertylist** plist,const char* kname,const int fct)
{
int value=0;
if(cpl_propertylist_has(*plist,kname) > 0) {
xsh_get_property_value(*plist,kname,CPL_TYPE_INT,&value);
if(value>1) {
check(cpl_propertylist_set_int(*plist,kname,value/fct));
}
} else {
if(fct>1) ... | false | false | false | false | false | 0 |
build_rdma_recv(struct iwch_qp *qhp, union t3_wr *wqe,
struct ib_recv_wr *wr)
{
int i, err = 0;
u32 pbl_addr[T3_MAX_SGE];
u8 page_size[T3_MAX_SGE];
err = iwch_sgl2pbl_map(qhp->rhp, wr->sg_list, wr->num_sge, pbl_addr,
page_size);
if (err)
return err;
wqe->recv.pagesz[0] = page_size[0];
wqe->recv.... | false | false | false | false | true | 1 |
getVarPtr(int rpt_index, int lev_index, int var_index) {
if (var_index < 0 || var_index > variables.size() - 1 ||
rpt_index < 0 || rpt_index > reports->number_of_rows() - 1) {
return NULL;
}
if (var_index < numIVars) { // level independent
return reports->var_value(rpt_index, var_index);
} else... | false | false | false | false | false | 0 |
EmptyFlags(const StringPiece& text, const char* p) {
int flags = 0;
// ^ and \A
if (p == text.begin())
flags |= kEmptyBeginText | kEmptyBeginLine;
else if (p[-1] == '\n')
flags |= kEmptyBeginLine;
// $ and \z
if (p == text.end())
flags |= kEmptyEndText | kEmptyEndLine;
else if (p < text.end(... | false | false | false | false | true | 1 |
addKVBoolean(const char* key, CORBA::Boolean value,
orbOptions::sequenceString& result) {
CORBA::String_var kv;
CORBA::ULong l;
l = strlen(key) + 4;
kv = CORBA::string_alloc(l);
sprintf(kv,"%s = %s",key,(value ? "1" : "0"));
l = result.length();
result.length(l+1);
result[l] = kv._retn();
} | false | false | false | false | false | 0 |
pk_strpad (const gchar *data, guint length)
{
gint size;
guint data_len;
gchar *text;
gchar *padding;
if (data == NULL)
return g_strnfill (length, ' ');
/* ITS4: ignore, only used for formatting */
data_len = strlen (data);
/* calculate */
size = (length - data_len);
if (size <= 0)
return g_strdup (dat... | false | false | false | false | false | 0 |
dir_signing_key_is_trusted(crypto_pk_t *key)
{
char digest[DIGEST_LEN];
if (!key) return 0;
if (crypto_pk_get_digest(key, digest) < 0) {
log_warn(LD_DIR, "Error computing dir-signing-key digest");
return 0;
}
if (!router_digest_is_trusted_dir(digest)) {
log_warn(LD_DIR, "Listed dir-signing-key is ... | false | false | false | false | false | 0 |
load_from_vech (gretl_matrix *targ, const gretl_matrix *src,
int n, int t, int mod)
{
int i, j, m = 0;
double x;
for (i=0; i<n; i++) {
for (j=i; j<n; j++) {
x = gretl_matrix_get(src, t, m++);
if (mod == GRETL_MOD_DECREMENT) {
x = gretl_matrix_get(targ, i, j) - x;
}
gretl_matri... | false | false | false | false | false | 0 |
main(int argc, char *argv[])
{
//QTranslator translator;
//translator.load("clustalx_la");
// Note the path to the executable is usually passed in as argv[0]
// This will be used if we cannot find the help or the xml files in current dir.
Resources *resources = Resources::Instance();
resour... | false | false | false | false | false | 0 |
tcp_do_send(int fd,const void *data,int size)
{
int wrote;
wrote = write(fd,data,size);
if (wrote < 0) {
perror("write to TCP");
exit(1);
}
if (!wrote) exit(0); /* EOF */
if (wrote != size) {
fprintf(stderr,"bad write (%d != %d)\n",wrote,size);
exit(1);
}
} | false | false | false | false | false | 0 |
Map_SetPath(Crossfire_Map *whoptr, PyObject *value, void *closure) {
const char *val;
MAPEXISTCHECK_INT(whoptr);
if (!PyArg_Parse(value, "s", &val))
return -1;
cf_map_set_string_property(whoptr->map, CFAPI_MAP_PROP_PATH, val);
return 0;
} | false | false | false | false | false | 0 |
marshalWString(cdrStream& stream,
_CORBA_ULong bound,
_CORBA_ULong len,
const omniCodeSet::UniChar* us)
{
// The CORBA 2.4 spec says that for UTF-16, if there is no BOM,
// values are sent big-endian, regardless of the endianness of the
// rest of the stream. This will cause errors with 2.... | false | false | false | false | false | 0 |
read_client_leases ()
{
int file;
isc_result_t status;
struct parse *cfile;
const char *val;
int token;
/* Open the lease file. If we can't open it, just return -
we can safely trust the server to remember our state. */
if ((file = open (path_dhclient_db, O_RDONLY)) < 0)
return;
cfile = NULL;
status ... | false | false | false | false | false | 0 |
mapinsert (Tobj fmo, Tobj too) {
mapentry_t **lp;
mapentry_t *cep;
lp = &map.list[(unsigned long) fmo % MAPLISTN];
if (!(cep = Mallocate (MAPENTRYSIZE)))
panic1 (POS, "mapinsert", "cannot allocate mapentry");
cep->fmo = fmo, cep->too = too;
cep->next = *lp, *lp = cep;
} | false | false | false | true | false | 1 |
value(double v) {
clear_changed();
if (v == value_) return 0;
value_ = v;
value_damage();
return 1;
} | false | false | false | false | false | 0 |
drm_gtf2_k(struct edid *edid)
{
u8 *r = NULL;
drm_for_each_detailed_block((u8 *)edid, find_gtf2, &r);
return r ? r[16] : 0;
} | false | false | false | false | false | 0 |
l1sp_printn(g, n)
l1sp_ctx *g;
size_t n;
{
if(!ioallocp(g, (size_t)L1SP_HEX)) l1sp_flush(g);
g->l1_iosize+=l1sp_fmthex(g->l1_iobuffer+g->l1_iosize, n);
} | false | false | false | false | false | 0 |
xfer_work(struct work_struct *work)
{
struct usbhs_pkt *pkt = container_of(work, struct usbhs_pkt, work);
struct usbhs_pipe *pipe = pkt->pipe;
struct usbhs_fifo *fifo;
struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe);
struct dma_async_tx_descriptor *desc;
struct dma_chan *chan;
struct device *dev = usbhs_priv_... | false | false | false | false | false | 0 |
trigraphize_char(char c)
{
char *p;
switch (c) {
case '[':
p = "\?\?(";
break;
case ']':
p = "\?\?)";
break;
case '{':
p = "\?\?<";
break;
case '}':
p = "\?\?>";
break;
case '^':
p = "\?\?'";
break;
case '|':
p = "\?\?!";
break;
case '~':
p = "\?\?-";
break;
default:
p = yytext;... | false | false | false | false | false | 0 |
addFilter(HTTPFilterBase *filter)
{
if (!last)
{
first = filter;
}
else
{
disconnect(last, SIGNAL(output(QByteArray)), 0, 0);
filter->chain(last);
}
last = filter;
connect(filter, SIGNAL(output(QByteArray)),
this, SIGNAL(output(QByteArray)));
connect(filter, SIGNA... | false | false | false | false | false | 0 |
gamgi_engine_remove_arrow (gamgi_arrow *arrow)
{
gamgi_dlist *dlist;
gamgi_arrow *arrow_next, *arrow_before;
/*********************************
* remove arrow global selection *
*********************************/
gamgi_global_selection_clean (GAMGI_ENGINE_ARROW,
&gamgi->arrows, "button_arrow", arrow->object.select... | false | false | false | false | false | 0 |
threshold(QImage &img, unsigned int threshold)
{
int i, count;
unsigned int *data;
if(img.depth() > 8){ // DirectClass
count = img.width()*img.height();
data = (unsigned int *)img.bits();
}
/*else{ // PsudeoClass
count = img.numColors();
data = (unsigned int *)img.col... | false | false | false | false | false | 0 |
ilIsImage(ILuint Image)
{
//iFree *Temp = FreeNames;
if (ImageStack == NULL)
return IL_FALSE;
if (Image >= LastUsed || Image == 0)
return IL_FALSE;
/*do {
if (Temp->Name == Image)
return IL_FALSE;
} while ((Temp = Temp->Next));*/
if (ImageStack[Image] == NULL) // Easier check.
return IL_FALSE;
re... | false | false | false | false | false | 0 |
vecm_print_restrictions (GRETL_VAR *vecm, PRN *prn)
{
if (vecm->jinfo->R != NULL) {
pputs(prn, "\n\n");
pputs(prn, _("Restrictions on beta:"));
pputc(prn, '\n');
print_restriction_from_matrices(vecm->jinfo->R, vecm->jinfo->q,
'b', gretl_VECM_n_beta(vecm),
prn);
pputc(prn, '\n');
}
if (vecm... | false | false | false | false | false | 0 |
unpackstr_array(char ***valp, uint32_t * size_valp, Buf buffer)
{
int i;
uint32_t ns;
uint32_t uint32_tmp;
if (remaining_buf(buffer) < sizeof(ns))
return SLURM_ERROR;
memcpy(&ns, &buffer->head[buffer->processed], sizeof(ns));
*size_valp = ntohl(ns);
buffer->processed += sizeof(ns);
if (*size_valp > MAX_PAC... | false | false | false | false | false | 0 |
decode_theora(bgav_stream_t * s, gavl_video_frame_t * frame)
{
int i;
bgav_packet_t * p;
ogg_packet op;
th_ycbcr_buffer yuv;
theora_priv_t * priv;
priv = s->data.video.decoder->priv;
while(1)
{
p = bgav_stream_get_packet_read(s);
if(!p)
return 0;
memset(&op, 0, sizeof(op));
... | false | false | false | false | false | 0 |
aclinit_search_and_update_aci ( int thisbeonly, const Slapi_DN *base,
char *be_name, int scope, int op,
acl_lock_flag_t lock_flag )
{
char *attrs[2] = { "aci", NULL };
/* Tell __aclinit_handler whether it's an add or a delete */
Slapi_PBlock *aPb;
LDAPControl **ctrls=NULL;
struct berval *bval... | true | true | false | false | false | 1 |
dCreateCapsule (dSpaceID space, dReal radius, dReal length)
{
return new dxCapsule (space,radius,length);
} | false | false | false | false | false | 0 |
xtoX (creal * u1, creal * u2, float *dt, float *x, float *y, int *k)
// Solves X' = -u, X(0)=x from t=0 to dt
// x is triangle k and on output X is in new k
// ERROR code: <=0: noErr,
{
int j, kold = *k, kl, k0, k1, k2, k3;
int count = 0;
int next[3] ={1, 2, 0};
double... | false | false | false | false | false | 0 |
ajStrMatchC(const AjPStr str, const char* txt2)
{
if(!str || !txt2)
return ajFalse;
if(!strcmp(str->Ptr, txt2))
return ajTrue;
return ajFalse;
} | false | false | false | false | false | 0 |
endRedoBuffer(void)
{
if (!myHitEnd)
{
// now we get rid of the extra readings on the end
beginInvalidationSweep();
while (myRedoIt != myBuffer.end())
{
invalidateReading(myRedoIt);
myRedoIt++;
}
endInvalidationSweep();
}
} | false | false | false | false | false | 0 |
collect_sge_port_stats(struct adapter *adapter,
struct port_info *p, int idx)
{
int i;
unsigned long tot = 0;
for (i = p->first_qset; i < p->first_qset + p->nqsets; ++i)
tot += adapter->sge.qs[i].port_stats[idx];
return tot;
} | false | false | false | false | false | 0 |
calc_mxmy(struct Togl *togl)
{
float mx, my;
struct cbData *cb = (struct cbData *)Togl_GetClientData(togl);
mx = 2.0f * ((float)cb->mouse.x / (float)Togl_Width(togl)) - 1.0f;
my = 2.0f * ((float)cb->mouse.y / (float)Togl_Height(togl)) - 1.0f;
if (mx < -cb->fly.dx)
mx += cb->fly.dx;
else if (m... | false | false | false | false | false | 0 |
get_interface_address6(int severity, sa_family_t family, tor_addr_t *addr)
{
/* XXX really, this function should yield a smartlist of addresses. */
smartlist_t *addrs;
int sock=-1, r=-1;
struct sockaddr_storage my_addr, target_addr;
socklen_t addr_len;
tor_assert(addr);
/* Try to do this the smart way if... | false | false | false | false | false | 0 |
ComputeForces()
{
for(int i=0; i<this->Particles->GetNumberOfItems(); i++)
{
vtkParticle * particle = this->Particles->GetParticle(i);
//Reset Forces
particle->SetForce(0, 0, 0);
//Gravitational Force
double g[3];
this->GetGravity(g);
vtkMath::MultiplyScalar(g, particle->GetMass());
... | false | false | false | false | false | 0 |
parse (const ACE_TCHAR *buf, ACE_TString &cap)
{
while (*buf != ACE_TEXT ('\0') && *buf != ACE_TEXT (','))
{
if (*buf == ACE_TEXT ('\\'))
{
++buf;
if (*buf == ACE_TEXT ('E') || *buf == ACE_TEXT ('e'))
{
cap += ACE_ESC;
++buf;
... | false | false | false | false | false | 0 |
mlx4_buddy_alloc(struct mlx4_buddy *buddy, int order)
{
int o;
int m;
u32 seg;
spin_lock(&buddy->lock);
for (o = order; o <= buddy->max_order; ++o)
if (buddy->num_free[o]) {
m = 1 << (buddy->max_order - o);
seg = find_first_bit(buddy->bits[o], m);
if (seg < m)
goto found;
}
spin_unlock(&buddy-... | false | false | false | false | false | 0 |
globus_gram_job_manager_seg_parse_condor_id(
globus_gram_jobmanager_request_t * request,
char ** condor_idp)
{
char * condor_name;
char * condor_data;
globus_fifo_t events;
int ... | false | true | false | false | true | 1 |
worker_thread_listener(apr_thread_t * thread, void *selfv) {
apr_status_t status;
int nolistener;
char *last;
char *portname;
char *scope_id;
char *value;
int threads = 0;
worker_t *worker = selfv;
worker->mythread = thread;
worker->flags |= FLAGS_SERVER;
worker->which = get_tot_threads(worker->... | false | false | false | false | false | 0 |
vidioc_g_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct cx23885_dev *dev = video_drvdata(file);
if (dev->tuner_type == TUNER_ABSENT)
return -EINVAL;
f->type = V4L2_TUNER_ANALOG_TV;
f->frequency = dev->freq;
call_all(dev, tuner, g_frequency, f);
return 0;
} | false | false | false | false | false | 0 |
set_string_attribute(Attribute a, int id, char *val)
{
if (Attribute_names[id].type != STRING_ATTRIBUTE)
fatal_error("set_string_attribute, bad ID");
if (a == NULL) {
int sn = str_to_sn(val, 0); /* insert into symbol table */
char *str = sn_to_str(sn); /* get the symbol table copy of string */
A... | false | false | false | false | false | 0 |
create_probe_design_window( AW_root *root, AW_CL cl_genome_db) {
AW_window_simple *aws = new AW_window_simple;
int is_genom_db = (int)cl_genome_db;
aws->init( root, "PROBE_DESIGN","PROBE DESIGN");
aws->load_xfig("pd_main.fig");
aws->callback( (AW_CB0)AW_POPDOWN);
aws->a... | false | false | false | false | false | 0 |
lpfc_aer_cleanup_state(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
struct Scsi_Host *shost = class_to_shost(dev);
struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
struct lpfc_hba *phba = vport->phba;
int val, rc = -1;
if (!isdigit(buf[0]))
ret... | false | false | false | false | false | 0 |
stk8312_read_accel(struct stk8312_data *data, u8 address)
{
int ret;
struct i2c_client *client = data->client;
if (address > 2)
return -EINVAL;
ret = i2c_smbus_read_byte_data(client, address);
if (ret < 0)
dev_err(&client->dev, "register read failed\n");
return ret;
} | false | false | false | false | false | 0 |
verify_eh_tree (struct function *fun)
{
eh_region r, outer;
int nvisited_lp, nvisited_r;
int count_lp, count_r, depth, i;
eh_landing_pad lp;
bool err = false;
if (!fun->eh->region_tree)
return;
count_r = 0;
for (i = 1; vec_safe_iterate (fun->eh->region_array, i, &r); ++i)
if (r)
{
if (r... | false | false | false | false | false | 0 |
Java_ncsa_hdf_hdf5lib_H5_H5Dvlen_1get_1buf_1size_1long
(JNIEnv *env, jclass clss, jint dataset_id, jint type_id, jint space_id)
{
herr_t status;
hsize_t sz;
status = (jint)H5Dvlen_get_buf_size((hid_t)dataset_id, (hid_t)type_id,
(hid_t)space_id, (hsize_t*)&sz);
if (status... | false | false | false | false | false | 0 |
ipvs_cmp_dests(ipvs_dest_entry_t *d1, ipvs_dest_entry_t *d2)
{
int r = 0, i;
if (d1->af == AF_INET6)
for (i = 0; !r && (i < 4); i++)
r = ntohl(d1->addr.in6.s6_addr32[i]) -
ntohl(d2->addr.in6.s6_addr32[i]);
else
r = ntohl(d1->addr.ip) - ntohl(d2->addr.ip);
if (r != 0)
return r;
return ntohs(d1->po... | false | false | false | false | false | 0 |
era_message(struct dm_target *ti, unsigned argc, char **argv)
{
struct era *era = ti->private;
if (argc != 1) {
DMERR("incorrect number of message arguments");
return -EINVAL;
}
if (!strcasecmp(argv[0], "checkpoint"))
return in_worker0(era, metadata_checkpoint);
if (!strcasecmp(argv[0], "take_metadata_sna... | false | false | false | false | false | 0 |
OnItemActivated( wxListEvent& evt )
{
CPartFile* file = ((FileCtrlItem_Struct*)GetItemData( evt.GetIndex()))->GetFile();
if ((!file->IsPartFile() || file->IsCompleted()) && file->PreviewAvailable()) {
PreviewFile( file );
}
} | false | false | false | false | false | 0 |
csr1212_generate_tree_subdir(struct csr1212_keyval *dir,
u_int32_t *data_buffer)
{
struct csr1212_dentry *dentry;
struct csr1212_keyval *last_extkey_spec = NULL;
struct csr1212_keyval *last_extkey = NULL;
int index = 0;
for (dentry = dir->value.directory.dentries_head; dentry; dentry = dentry->next) {
str... | false | false | false | false | false | 0 |
normalize_algorithm(char *s)
{
char c = *s;
while(c) {
if(c=='_') *s='-';
else if((c>='a')&&(c<='z')) {
*s = c - 'a' + 'A';
}
++s;
c = *s;
}
} | false | false | false | false | false | 0 |
try_create_tested_existence (SoupSession *session, SoupMessage *msg,
gpointer user_data)
{
GVfsJob *job = G_VFS_JOB (user_data);
GOutputStream *stream;
SoupMessage *put_msg;
SoupURI *uri;
if (SOUP_STATUS_IS_SUCCESSFUL (msg->status_code))
{
g_vfs_job_failed... | false | false | false | false | false | 0 |
parseInstanceName(const QByteArray &name)
{
// needs to be at least X + '.' + typeAndDomain
if(name.length() < typeAndDomain.length() + 2)
return QByteArray();
// index of the '.' character
int at = name.length() - typeAndDomain.length() - 1;
if(name[at] != '.')
return QByteArray();
if(name.mid(at ... | false | false | false | false | false | 0 |
WaitSync()
{
// Suspend itself: wait on the input synchro
if (GetGraphManager()->SuspendRefNum(GetClientControl(), fSynchroTable, 0x7FFFFFFF) < 0) {
jack_error("SuspendRefNum error");
return false;
} else {
return true;
}
} | false | false | false | false | false | 0 |
svcxdr_dupstr(struct nfsd4_compoundargs *argp, void *buf, u32 len)
{
char *p = svcxdr_tmpalloc(argp, len + 1);
if (!p)
return NULL;
memcpy(p, buf, len);
p[len] = '\0';
return p;
} | false | false | false | false | false | 0 |
__ecereMethod___ecereNameSpace__ecere__gui__controls__StatusField_SetTextf(struct __ecereNameSpace__ecere__com__Instance * this, char * format, ...)
{
struct __ecereNameSpace__ecere__gui__controls__StatusField * __ecerePointer___ecereNameSpace__ecere__gui__controls__StatusField = (struct __ecereNameSpace__ecere__gui__c... | false | false | false | false | false | 0 |
OnUpdateMinTotalConnectionCount(Packet *packet)
{
RakNet::BitStream bsIn(packet->data,packet->length,false);
bsIn.IgnoreBytes(sizeof(MessageID));
unsigned int newMin;
bsIn.Read(newMin);
IncrementTotalConnectionCount(newMin);
} | false | false | false | false | false | 0 |
__test_page_isolated_in_pageblock(unsigned long pfn, unsigned long end_pfn,
bool skip_hwpoisoned_pages)
{
struct page *page;
while (pfn < end_pfn) {
if (!pfn_valid_within(pfn)) {
pfn++;
continue;
}
page = pfn_to_page(pfn);
if (PageBuddy(page))
/*
* If the page is on a free list, it has to ... | false | false | false | false | false | 0 |
_limnQN10octa_VtoQN_f(const float *vec) {
double L, x, y, z;
unsigned int xi, yi;
_EVEN_OCTA_VtoQ(5, vec);
} | false | false | false | false | false | 0 |
nextgtag()
{
struct tag *tp;
if (curtag == NULL)
/* No tag loaded */
return NULL;
tp = curtag->next;
if (tp == TAG_END)
{
if (!circular)
return NULL;
/* Wrapped around to the head of the queue */
curtag = taglist.tl_first;
curseq = 1;
} else
{
curtag = tp;
curseq++;
}
return (curtag->tag_f... | false | false | false | false | false | 0 |
ajp14_marshal_context_state_into_msgb(jk_msg_buf_t *msg,
jk_context_t *c,
char *cname, jk_logger_t *l)
{
jk_context_item_t *ci;
int i;
JK_TRACE_ENTER(l);
/* To be on the safe side */
jk_b_reset(msg);
/*
*... | false | false | false | false | false | 0 |
mca_memheap_ptmalloc_realloc(size_t new_size,
void *p_buff,
void **p_new_buff)
{
if (new_size > memheap_ptmalloc.max_alloc_size) {
*p_new_buff = 0;
return OSHMEM_ERR_OUT_OF_RESOURCE;
}
OPAL_THREAD_LOCK(&memheap_ptmalloc.lock)... | 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.