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 |
|---|---|---|---|---|---|---|
sum_square_rows() const
{
REPORT
GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate();
int nr = gm->nrows();
ColumnVector ssq(nr);
if (gm->size() == 0) { REPORT ssq = 0.0; }
else
{
MatrixRow mr(gm, LoadOnEntry);
for (int i = 1; i <= nr; ++i)
{
Real sum = 0.0;
int ... | false | false | false | false | false | 0 |
zsetdevice(i_ctx_t *i_ctx_p)
{
gx_device *dev = gs_currentdevice(igs);
os_ptr op = osp;
int code = 0;
check_write_type(*op, t_device);
if (dev->LockSafetyParams) { /* do additional checking if locked */
if(op->value.pdevice != dev) /* don't allow a different device */
r... | false | false | false | false | false | 0 |
isxqt_file (puuconf, argc, argv, pvar, pinfo)
pointer puuconf ATTRIBUTE_UNUSED;
int argc;
char **argv;
pointer pvar ATTRIBUTE_UNUSED;
pointer pinfo ATTRIBUTE_UNUSED;
{
if (argc != 2 && argc != 3)
return UUCONF_CMDTABRET_CONTINUE;
/* If this file is not in the spool directory, just igno... | false | false | false | false | false | 0 |
JAM_ReadMsgHeader( s_JamBase* Base_PS,
ulong MsgNo_I,
s_JamMsgHeader* Header_PS,
s_JamSubPacket** SubfieldPack_PPS )
{
s_JamIndex Index_S;
if ( !Base_PS || !Header_PS )
return JAM_BAD_PARAM;
/* find index record */
if ( fseek( Base_PS->IdxFile_PS, MsgNo_I *... | false | false | false | false | false | 0 |
e100_free(struct nic *nic)
{
if (nic->mem) {
pci_free_consistent(nic->pdev, sizeof(struct mem),
nic->mem, nic->dma_addr);
nic->mem = NULL;
}
} | false | false | false | false | false | 0 |
write_router_file(RouterT *r, FILE *f, ErrorHandler *errh)
{
if (!r)
return;
String config_str = r->configuration_string();
// create archive if necessary
const Vector<ArchiveElement> &archive = r->archive();
if (archive.size()) {
Vector<ArchiveElement> narchive;
// add configuration
... | false | false | false | false | false | 0 |
errorfb (lua_State *L) {
int level = 1; /* skip level 0 (it's this function) */
int firstpart = 1; /* still before eventual `...' */
lua_Debug ar;
luaL_Buffer b;
luaL_buffinit(L, &b);
luaL_addstring(&b, "error: ");
luaL_addstring(&b, luaL_check_string(L, 1));
luaL_addstring(&b, "\n");
while (lua_get... | true | true | false | false | false | 1 |
baselinePosition( bool f ) const
{
if (m_useListBox)
return RenderFormElement::baselinePosition(f);
int bTop = shouldDisableNativeBorders() ? borderTop() : 0;
int bBottom = shouldDisableNativeBorders() ? borderBottom() : 0;
int ret = (height()-RenderWidget::paddingTop()-RenderWidget::paddingBot... | false | false | false | false | false | 0 |
dlist_get(dlist_head_t *head, dlist_t *dlist) {
dlist_t *tmp = dlist_getl(head, dlist);
void *data;
if (!tmp)
return NULL;
else {
data = tmp->data;
dlist_free(tmp);
return data;
}
} | false | false | false | false | false | 0 |
bfa_rport_send_fwspeed(struct bfa_rport_s *rp)
{
struct bfa_rport_speed_req_s *m;
/*
* check for room in queue to send request now
*/
m = bfa_reqq_next(rp->bfa, BFA_REQQ_RPORT);
if (!m) {
bfa_trc(rp->bfa, rp->rport_info.speed);
return BFA_FALSE;
}
bfi_h2i_set(m->mh, BFI_MC_RPORT, BFI_RPORT_H2I_SET_SPEED... | false | false | false | false | false | 0 |
Curl_resolver_is_resolved(struct connectdata *conn,
struct Curl_dns_entry **entry)
{
struct SessionHandle *data = conn->data;
struct thread_data *td = (struct thread_data*) conn->async.os_specific;
int done = 0;
*entry = NULL;
if(!td) {
DEBUGASSERT(td);
return CU... | false | false | false | false | false | 0 |
do_sigtimedwait(const sigset_t *which, siginfo_t *info,
const struct timespec *ts)
{
struct task_struct *tsk = current;
long timeout = MAX_SCHEDULE_TIMEOUT;
sigset_t mask = *which;
int sig;
if (ts) {
if (!timespec_valid(ts))
return -EINVAL;
timeout = timespec_to_jiffies(ts);
/*
* We can be close to... | false | false | false | false | false | 0 |
Evaluate(int32 indexA, int32 indexB, qreal t) const
{
b2Transform xfA, xfB;
m_sweepA.GetTransform(&xfA, t);
m_sweepB.GetTransform(&xfB, t);
switch (m_type)
{
case e_points:
{
b2Vec2 axisA = b2MulT(xfA.R, m_axis);
b2Vec2 axisB = b2MulT(xfB.R, -m_axis);
b2Vec2 localPointA = m_proxyA->GetVer... | false | false | false | false | false | 0 |
glade_gtk_assistant_get_children (GladeWidgetAdaptor *adaptor,
GObject *container)
{
GtkAssistant *assist = GTK_ASSISTANT (container);
gint i, n_pages = gtk_assistant_get_n_pages (assist);
GList *children = NULL, *parent_children;
/* Chain up */
if (GWA_GET_CLASS (GTK_TYPE_W... | false | false | false | false | false | 0 |
doDebug(QJDns *jdns, int index)
{
QStringList lines = jdns->debugLines();
if(db)
db->d->addDebug(dbname + QString::number(index), lines);
} | false | false | false | false | false | 0 |
__ecereConstructor___ecereNameSpace__ecere__net__ServerNameCache(struct __ecereNameSpace__ecere__com__Instance * this)
{
struct __ecereNameSpace__ecere__net__ServerNameCache * __ecerePointer___ecereNameSpace__ecere__net__ServerNameCache = (struct __ecereNameSpace__ecere__net__ServerNameCache *)(this ? (((char *)this) +... | false | false | false | false | false | 0 |
resolve_on_symbol(int symbol, Topform c1, Topform c2)
{
Plist resolvents = NULL;
Literals l1, l2;
for (l1 = c1->literals; l1; l1 = l1->next)
for (l2 = c2->literals; l2; l2 = l2->next) {
if (l1->sign != l2->sign &&
SYMNUM(l1->atom) == symbol &&
SYMNUM(l2->atom) == symbol) {
Topform res;
if (c1->i... | false | false | false | false | false | 0 |
strio_each(int argc, VALUE *argv, VALUE self)
{
struct StringIO *ptr = StringIO(self);
VALUE line;
RETURN_ENUMERATOR(self, argc, argv);
if (argc > 0 && !NIL_P(argv[argc-1]) && NIL_P(rb_check_string_type(argv[argc-1])) &&
NUM2LONG(argv[argc-1]) == 0) {
rb_raise(rb_eArgError, "invalid limit: 0 for eac... | false | false | false | false | false | 0 |
random_level()
{
const double P = 0.5;
int lvl = (int)(log(frand())/log(1.-P));
return lvl < max_level ? lvl : max_level;
} | false | false | false | false | false | 0 |
reLoad( bool show )
{
int orgx = -1;
int orgy = -1;
if ( scrollWidget ) {
orgx = scrollWidget->GetScrollPosX();
orgy = scrollWidget->GetScrollPosY();
}
delete scrollWidget;
scrollWidget = new PG_ScrollWidget( this , PG_Rect( 0, 0, Width(), Height() - 30 ));
scrollWidget->SetTransparenc... | false | false | false | false | false | 0 |
make_ranged_throw(object_type *o_ptr, int y, int x) {
struct attack_result result = {FALSE, 0, 0, "hit"};
monster_type *m_ptr = cave_monster(cave, cave->m_idx[y][x]);
monster_race *r_ptr = &r_info[m_ptr->r_idx];
int bonus = p_ptr->state.to_h + o_ptr->to_h;
int chance = p_ptr->state.skills[SKILL_TO_HIT_THROW] + b... | false | false | false | false | false | 0 |
gt_nextEnumpatterniterator(unsigned long *patternlen,
Enumpatterniterator *epi)
{
unsigned long start;
unsigned long j;
GtUchar cc;
if (epi->minpatternlen == epi->maxpatternlen)
{
*patternlen = epi->minpatternlen;
} else
{
*patternlen = (unsigned long) (epi-... | false | false | false | false | false | 0 |
init_fore(void)
{
UINT8 *fore_gfxdata = memory_region(REGION_GFX2);
int fore_length = memory_region_length(REGION_GFX2);
UINT16 *dst;
UINT8 *src;
int i, j;
/* allocate the expanded foreground data */
fore_expanded_data = auto_malloc(fore_length);
if (!fore_expanded_data)
return 1;
/* expand th... | false | false | false | false | false | 0 |
find_client(Port * port, int response, int qp, uint64_t trid)
{
Client *cl, *e;
DEBUG("port %" PRIx64 " res %d qp %d trid %" PRIx64,
port->portguid, response, qp, trid);
// response - match trids
if (response && (cl = client_by_trid(port, trid)))
return cl;
for (cl = clients, e = cl + IBSIM_MAX_CLIENTS; ... | false | false | false | false | false | 0 |
gsserb(real_t **a, int n, real_t aux[], int ri[], int ci[])
{
void gsselm(real_t **, int, real_t [], int [], int []);
real_t onenrminv(real_t **, int);
void erbelm(int, real_t [], real_t);
gsselm(a,n,aux,ri,ci);
if (aux[3] == n) erbelm(n,aux,onenrminv(a,n));
} | false | false | false | false | false | 0 |
gregorio_build_char_list_from_buf (char *buf)
{
int i = 0;
size_t len;
grewchar *gwstring;
gregorio_character *current_character = NULL;
if (buf == NULL)
{
return NULL;
}
len = strlen (buf); //to get the length of the syllable in ASCII
gwstring = (grewchar *) malloc ((len + 1) * sizeof (gre... | false | true | false | false | false | 1 |
combine_mtext(mtext_t *tail, mtext_t *mtp)
{
if(!tail)
return mtp;
if(!mtp)
return tail;
if(tail->type == exp_text && mtp->type == exp_text)
{
char *new_text;
new_text = pp_xrealloc(tail->subst.text, strlen(tail->subst.text)+strlen(mtp->subst.text)+1);
if(!new_text)
return mtp;
tail->subst.text = n... | false | false | false | false | false | 0 |
input(FILE *fp, int *maxlength, wchar_t ***list, int *entries)
{
static int maxentry = DEFNUM;
int len, lineno = 1, reportedline = 0, eval = 0;
wchar_t *p, buf[MAXLINELEN];
wchar_t **local_list = *list;
int local_entries = *entries;
if (!local_list)
local_list = xcalloc(maxentry, sizeof(wchar_t *));
while (f... | false | false | false | true | false | 1 |
_xfs_buf_read(
xfs_buf_t *bp,
xfs_buf_flags_t flags)
{
ASSERT(!(flags & XBF_WRITE));
ASSERT(bp->b_maps[0].bm_bn != XFS_BUF_DADDR_NULL);
bp->b_flags &= ~(XBF_WRITE | XBF_ASYNC | XBF_READ_AHEAD);
bp->b_flags |= flags & (XBF_READ | XBF_ASYNC | XBF_READ_AHEAD);
if (flags & XBF_ASYNC) {
xfs_buf_submit(bp);
re... | false | false | false | false | false | 0 |
calcNstats(unsigned long key, unsigned long long value,
void *data)
{
Nstats *nstats = data;
unsigned int i;
nstats->current_len += (key * value);
nstats->current_num += value;
for (i = 0; i < (unsigned int) NOF_LIMITS; i++)
{
if ((unsigned long long) key > nstats->limit[i])
... | false | false | false | false | false | 0 |
free_vginfo_list(
vg_info_t **nodelist,
int32 num_items )
{
intn i;
/* if the list is not NULL, free each node then reset the list to NULL */
if (nodelist != NULL)
{
for (i = 0; i < num_items; i++)
if (nodelist[i] != NULL)
nodelist[i] = free_node_vg_info_t(nodelist[i]);
... | false | false | false | false | false | 0 |
bsbufflength (struct bStream * s, int sz) {
int oldSz;
if (s == NULL || sz < 0) return BSTR_ERR;
oldSz = s->maxBuffSz;
if (sz > 0) s->maxBuffSz = sz;
return oldSz;
} | false | false | false | false | false | 0 |
Pointer_ass_item(PyObject *_self, Py_ssize_t index, PyObject *value)
{
CDataObject *self = (CDataObject *)_self;
Py_ssize_t size;
Py_ssize_t offset;
StgDictObject *stgdict, *itemdict;
PyObject *proto;
if (value == NULL) {
PyErr_SetString(PyExc_TypeError,
"Pointer... | false | false | false | false | false | 0 |
fnet_get(struct fpga_model* model, net_idx_t net_i)
{
// function must work even if model->rc is set
if (net_i <= NO_NET
|| net_i > model->highest_used_net) {
fprintf(stderr, "%s:%i net_i %i highest_used %i\n", __FILE__,
__LINE__, net_i, model->highest_used_net);
return 0;
}
return &model->nets[net_i-1]... | false | false | false | false | false | 0 |
_ds_get_spamrecord (
DSPAM_CTX * CTX,
unsigned long long token,
struct _ds_spam_stat *stat)
{
int (*ptr)(DSPAM_CTX *, unsigned long long, struct _ds_spam_stat *);
ptr = (int (*)(DSPAM_CTX *, unsigned long long, struct _ds_spam_stat *))(intptr_t)dlsym(_drv_handle, "_ds_get_spamrecord");
if (!ptr) {
LOG(L... | false | false | false | false | false | 0 |
lua_isnumber (lua_State *L, int idx) {
TValue n;
const TValue *o = index2adr(L, idx);
return tonumber(o, &n);
} | false | false | false | false | false | 0 |
each_timing_pattern_pixel(int *x,int *y)
{
if(this->_timing_c<this->cells_par_side){
*x=6;
*y=this->_timing_c;
}
else if(this->_timing_c<this->cells_par_side*2){
*x=this->_timing_c-this->cells_par_side;
*y=6;
}
else
... | false | false | false | false | false | 0 |
compute_table(Table *tb)
{
// delta = table spacing in angle for N-1 bins
int tlm1 = tablength-1;
tb->delta = MY_PI / tlm1;
tb->invdelta = 1.0/tb->delta;
tb->deltasq6 = tb->delta*tb->delta / 6.0;
// N-1 evenly spaced bins in angle from 0 to PI
// ang,e,f = value at lower edge of bin
// de,df values = ... | false | false | false | false | false | 0 |
Python(void)
{
int i;
printf(
"/* This code is automatically generated. "
"Changes made here will be lost. */\n#define NO_IMPORT_ARRAY\n"
"#include \"pygetdata.h\"\n"
"const struct gdpy_constant_t gdpy_constant_list[] = {\n");
for (i = 0; constant_list[i].lname != NULL; ++i)
if (c... | false | false | false | false | false | 0 |
createToleranceWindow(GtkWidget* win, GabeditSignalFunc myFunc)
{
GtkWidget *dialogWindow = NULL;
GtkWidget *button;
GtkWidget *frame;
GtkWidget *hbox;
gchar title[BSIZE];
dialogWindow = gtk_dialog_new();
gtk_widget_realize(GTK_WIDGET(dialogWindow));
sprintf(title, _("Tolerance for computing the point group"... | false | true | false | false | false | 1 |
pair_get_wx (struct hash_table_s * table, const char * key)
{
struct pair * item, token;
token.key = (char *) key;
item = (struct pair *) hash_find_item (table, &token);
if (item)
return item->wx;
else
return -1;
} | false | false | false | false | false | 0 |
vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *buf)
{
struct s5p_mfc_ctx *ctx = fh_to_ctx(priv);
if (ctx->state == MFCINST_ERROR) {
mfc_err("Call on QBUF after unrecoverable error\n");
return -EIO;
}
if (buf->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
if (ctx->state == MFCINST_FINISHING) {
... | false | false | false | false | false | 0 |
inf_session_close(InfSession* session)
{
g_return_if_fail(INF_IS_SESSION(session));
g_return_if_fail(inf_session_get_status(session) != INF_SESSION_CLOSED);
g_signal_emit(G_OBJECT(session), session_signals[CLOSE], 0);
} | false | false | false | false | false | 0 |
b44_set_pauseparam(struct net_device *dev,
struct ethtool_pauseparam *epause)
{
struct b44 *bp = netdev_priv(dev);
spin_lock_irq(&bp->lock);
if (epause->autoneg)
bp->flags |= B44_FLAG_PAUSE_AUTO;
else
bp->flags &= ~B44_FLAG_PAUSE_AUTO;
if (epause->rx_pause)
bp->flags |= B44_FLAG_RX_PAUSE;
else
bp->fl... | false | false | false | false | false | 0 |
getResourceInt(const string& resource_path)
{
return atoi(getResourceStr(resource_path).c_str());
} | false | false | false | false | false | 0 |
eepro_poll(struct nic *nic, int retrieve)
{
unsigned int rcv_car = rx_start;
unsigned int rcv_event, rcv_status, rcv_next_frame, rcv_size;
/* return true if there's an ethernet packet ready to read */
/* nic->packet should contain data on return */
/* nic->packetlen should contain length of data */
#if 0
if ((in... | false | false | false | false | false | 0 |
vinflate_stored()
/* "decompress" an inflated type 0 (stored) block. */
{
unsigned n; /* number of bytes in block */
unsigned w; /* current window position */
register ulg b; /* bit buffer */
register unsigned k; /* number of bits in bit buffer */
/* make local copies of globals *... | false | false | false | false | false | 0 |
xfs_pathconf( XfsCookie *fc, int16 which )
{
char fpathName[MAXPATHNAMELEN];
cookie2Pathname(fc, NULL, fpathName);
int oldErrno = errno;
// FIXME: Has to be different for .XFS and for HOSTFS.
D(bug("HOSTFS: fs_pathconf (%s,%d)", fpathName, which));
STATVFS buff;
int32 res = host_statvfs( fpathName, &buff);
... | false | false | false | false | false | 0 |
glfs_chdir (struct glfs *fs, const char *path)
{
int ret = -1;
xlator_t *subvol = NULL;
loc_t loc = {0, };
struct iatt iatt = {0, };
int reval = 0;
__glfs_entry_fs (fs);
subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
goto out;
}
... | false | false | false | false | false | 0 |
clear_space(Space* space) {
FOR_ALL_AREAS(space->small_area, s48_free_area(area)); space->small_area = NULL;
FOR_ALL_AREAS(space->large_area, s48_free_area(area)); space->large_area = NULL;
FOR_ALL_AREAS(space->weaks_area, s48_free_area(area)); space->weaks_area = NULL;
} | false | false | false | false | false | 0 |
ptraInsert(L_PTRA *pa,
l_int32 index,
void *item,
l_int32 shiftflag)
{
l_int32 i, ihole, imax;
l_float32 nexpected;
PROCNAME("ptraInsert");
if (!pa)
return ERROR_INT("pa not defined", procName, 1);
if (index < 0 || index > pa->nalloc)
return ERROR... | false | false | false | false | false | 0 |
linear(Home home, const BoolVarArgs& x, IntRelType irt, IntVar y,
Reify r, IntConLevel icl) {
if (home.failed()) return;
int n=x.size();
Region re(home);
Linear::Term<BoolView>* t = re.alloc<Linear::Term<BoolView> >(n);
for (int i=n; i--; ) {
t[i].a=1; t[i].x=x[i];
}
Linear:... | false | false | false | false | false | 0 |
ReadBinary(P_WBXML_INFO buffer, FILE* file)
{
char buf[4096];
int m = 1;
long n;
if (buffer && file)
{
if (file != stdin)
{
buffer->m_length = FileSize(file);
buffer->m_start = (P_WBXML) malloc(buffer->m_length);
buffer->m_curpos = buffer->m_start;
if (!buffer->m_start)
{
fclose(file);
... | false | false | false | false | true | 1 |
btl_openib_async_command_done(int exp)
{
int comp;
if (read(mca_btl_openib_component.async_comp_pipe[0], &comp,
sizeof(int)) < 0){
BTL_ERROR(("Failed to read from pipe"));
return OMPI_ERROR;
}
if (exp != comp){
BTL_ERROR(("Get wrong completion on async command. Wa... | false | true | false | false | true | 1 |
virtqueue_enable_cb_prepare(struct virtqueue *_vq)
{
struct vring_virtqueue *vq = to_vvq(_vq);
u16 last_used_idx;
START_USE(vq);
/* We optimistically turn back on interrupts, then check if there was
* more to do. */
/* Depending on the VIRTIO_RING_F_EVENT_IDX feature, we need to
* either clear the flags bit ... | false | false | false | false | false | 0 |
mono_reflection_method_on_tb_inst_get_handle (MonoReflectionMethodOnTypeBuilderInst *m)
{
MonoClass *klass;
MonoGenericContext tmp_context;
MonoType **type_argv;
MonoGenericInst *ginst;
MonoMethod *method, *inflated;
int count, i;
init_type_builder_generics ((MonoObject*)m->inst);
method = inflate_method (m->... | false | false | false | false | false | 0 |
conn_pool_get(Octstr *host, int port, int ssl, Octstr *certkeyfile,
Octstr *our_host)
{
Octstr *key;
List *list = NULL;
Connection *conn = NULL;
int retry;
do {
retry = 0;
key = conn_pool_key(host, port, ssl, certkeyfile, our_host);
mutex_lock(conn_pool_lock);
list... | false | false | false | false | false | 0 |
_MIDI_SendProgramChange
(
int channel,
int c1
)
{
int status;
if ( _MIDI_RerouteFunctions[ channel ] != NULL )
{
status = _MIDI_RerouteFunctions[ channel ]( 0xC0 + channel,
c1, 0 );
if ( status == MIDI_DONT_PLAY )
{
return( MIDI_Ok );
}
... | false | false | false | false | false | 0 |
flush_old_maps(void) {
mapstruct *m, *oldmap;
long sec;
sec = seconds();
m = first_map;
while (m) {
/* There can be cases (ie death) where a player leaves a map and the timeout
* is not set so it isn't swapped out.
*/
if ((m->in_memory == MAP_IN_MEMORY)
&& ... | false | false | false | false | false | 0 |
copy_NameConstraints(const NameConstraints *from, NameConstraints *to)
{
memset(to, 0, sizeof(*to));
if((from)->permittedSubtrees) {
(to)->permittedSubtrees = malloc(sizeof(*(to)->permittedSubtrees));
if((to)->permittedSubtrees == NULL) goto fail;
if((((to)->permittedSubtrees)->val = malloc(((from)->permittedSubtrees)-... | false | true | false | false | false | 1 |
REgetc()
{
ZXchar c;
if ((c = REpeekc) != EOF)
REpeekc = EOF;
else if (*REptr != '\0')
c = ZXC(*REptr++);
else
c = EOF;
return c;
} | true | true | false | false | false | 1 |
DiskFileToVirtualFile(
const string& disk_file,
string* virtual_file,
string* shadowing_disk_file) {
int mapping_index = -1;
string canonical_disk_file = CanonicalizePath(disk_file);
for (int i = 0; i < mappings_.size(); i++) {
// Apply the mapping in reverse.
if (ApplyMapping(canonical_disk_... | false | false | false | false | false | 0 |
btree_printhead(btree_head* head)
{
UInt32 attr;
printf(" depth : %#X\n", head->depth);
printf(" root : %#lX\n", head->root);
printf(" leaf_count : %#lX\n", head->leaf_count);
printf(" leaf_head : %#lX\n", head->leaf_head);
printf(" leaf_tail : %#lX\n", head->leaf_tail);
... | false | false | false | false | false | 0 |
psgen_end_job(GVJ_t * job)
{
gvputs(job, "%%Trailer\n");
if (job->render.id != FORMAT_EPS)
gvprintf(job, "%%%%Pages: %d\n", job->common->viewNum);
if (job->common->show_boxes == NULL)
if (job->render.id != FORMAT_EPS)
gvprintf(job, "%%%%BoundingBox: %d %d %d %d\n",
job->boundin... | false | false | false | false | false | 0 |
nlRowParameterd(NLenum pname, NLdouble param) {
nlCheckState(NL_STATE_MATRIX) ;
switch(pname) {
case NL_RIGHT_HAND_SIDE: {
nlCurrentContext->right_hand_side = param ;
} break ;
case NL_ROW_SCALING: {
nlCurrentContext->row_scaling = param ;
} break ;
}
} | false | false | false | false | false | 0 |
export_hkl_data( const HKL_data_base& cdata, const String mtzpath )
{
if ( mode != WRITE && mode != APPEND )
Message::message( Message_fatal( "CCP4MTZfile: export_hkl_data - no file open for write/append" ) );
// add the exported data columns to the local list
int ncols = cdata.data_size();
std::vector<S... | false | false | false | false | false | 0 |
get_sparsemem_vmemmap_info(struct kcore_list *ent, struct list_head *head)
{
unsigned long pfn = __pa(ent->addr) >> PAGE_SHIFT;
unsigned long nr_pages = ent->size >> PAGE_SHIFT;
unsigned long start, end;
struct kcore_list *vmm, *tmp;
start = ((unsigned long)pfn_to_page(pfn)) & PAGE_MASK;
end = ((unsigned long)p... | false | false | false | false | false | 0 |
getTrackPoint ( D303 * p)
{
TcxTrackpoint * singlePoint = new TcxTrackpoint(GpsFunctions::print_dtime(p->time));
if (( p->posn.lat != 0x7fffffff ) && ( p->posn.lon != 0x7fffffff )) {
stringstream lat;
lat.precision(10); // default 4 decimal chars which is not enough
stringstream lon;
... | false | false | false | false | false | 0 |
kvm_arch_async_page_present(struct kvm_vcpu *vcpu,
struct kvm_async_pf *work)
{
struct x86_exception fault;
if (work->wakeup_all)
work->arch.token = ~0; /* broadcast wakeup */
else
kvm_del_async_pf_gfn(vcpu, work->arch.gfn);
trace_kvm_async_pf_ready(work->arch.token, work->gva);
if ((vcpu->arch.apf.msr_... | false | false | false | false | false | 0 |
icg_user_is_impatient (GnmIOContextGtk *icg)
{
gdouble t = g_timer_elapsed (icg->timer, NULL);
double progress = icg->progress;
double forecast_delay = ICG_POPUP_DELAY / 3.0;
gboolean ret = FALSE;
if (icg->progress == 0. && icg->files_done == 0)
icg->latency = t;
if (t >= forecast_delay) {
if (icg->files_to... | false | false | false | false | false | 0 |
internalWriteString(const QString &s, TrackItem::Type t, int id)
{
QString out=sanitizeForStream(s);
Q3CString cs = s.utf8();
QByteArray a(cs.length());
memcpy(a.data(), cs.data(), a.size());
return internalWriteData(a, t, id);
} | false | false | false | false | false | 0 |
breakLines(char *string)
{
char *tmpstr;
char *lastspace = NULL;
int curlen = 0;
int c;
tmpstr = string;
while ( ( c = *tmpstr ) != '\0' ) {
switch ( c ) {
case ' ':
lastspace = tmpstr;
break;
case '\n':
lastspace = NULL;
curlen = 0;
break;
}
if ( ( curl... | false | false | false | false | false | 0 |
_dfb_layer_region_surface_listener( const void *msg_data, void *ctx )
{
CoreSurfaceNotificationFlags flags;
CoreSurface *surface;
CoreLayer *layer;
CoreLayerShared *shared;
const DisplayLayerFuncs *funcs;
const CoreSurfaceNotifica... | false | false | false | false | false | 0 |
alloc_timespec_pair(double sec, long nsec) {
CAMLparam0();
CAMLlocal1(tsout);
tsout = alloc(2,0);
Store_field(tsout, 0, caml_copy_double(sec));
Store_field(tsout, 1, Val_long(nsec));
CAMLreturn(tsout);
} | false | false | false | false | false | 0 |
BuildMessage(SSL* ssl, byte* output, const byte* input, int inSz,
int type)
{
word32 digestSz = ssl->specs.hash_size;
word32 sz = RECORD_HEADER_SZ + inSz + digestSz;
word32 pad = 0, i;
word32 idx = RECORD_HEADER_SZ;
word32 ivSz = 0; /* TLSv1.1 IV */
... | false | false | false | false | false | 0 |
show_away(gchar *a_message, void *unused)
{
LList *list;
eb_local_account *ela = NULL;
if (!is_away) {
GtkWidget *label;
GtkWidget *vbox;
GtkTextBuffer *buffer;
awaybox = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_realize(awaybox);
vbox = gtk_vbox_new(FALSE, 0);
label = gtk_label_new(_
("Yo... | false | false | false | false | false | 0 |
broker_check(int event_type, void *data)
{
int result = NEB_OK;
if (event_type == NEBCALLBACK_SERVICE_CHECK_DATA) {
if (g_livecheck_enabled)
result = broker_service_livecheck(event_type, data);
nebstruct_service_check_data *c = (nebstruct_service_check_data *)data;
if (c->ty... | false | false | false | false | false | 0 |
gamgi_mesa_text_horizontal_move (FT_Vector* to, gamgi_extruded* extruded)
{
if (extruded->open == TRUE) gluTessEndContour (extruded->tesselator);
extruded->last[0] = to->x;
extruded->last[1] = to->y;
extruded->last[2] = 0.0;
gluTessBeginContour (extruded->tesselator);
extruded->open = TRUE;
return 0;
} | false | false | false | false | false | 0 |
x86_mov16_imm( struct x86_function *p, struct x86_reg dst, uint16_t imm )
{
DUMP_RI( dst, imm );
emit_1ub(p, 0x66);
if(dst.mod == mod_REG)
{
emit_1ub(p, 0xb8 + dst.idx);
emit_2ub(p, imm & 0xff, imm >> 8);
}
else
{
emit_1ub(p, 0xc7);
emit_modrm_noreg(p, 0, dst);
emit_2u... | false | false | false | false | false | 0 |
dh_generate_parameters_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{/* (PrimeLen, Generator) */
int prime_len, generator;
DH* dh_params;
int p_len, g_len;
unsigned char *p_ptr, *g_ptr;
ERL_NIF_TERM ret_p, ret_g;
if (!enif_get_int(env, argv[0], &prime_len)
|| !enif_get_int(env, arg... | false | false | false | false | false | 0 |
gfx_v8_0_cp_gfx_enable(struct amdgpu_device *adev, bool enable)
{
int i;
u32 tmp = RREG32(mmCP_ME_CNTL);
if (enable) {
tmp = REG_SET_FIELD(tmp, CP_ME_CNTL, ME_HALT, 0);
tmp = REG_SET_FIELD(tmp, CP_ME_CNTL, PFP_HALT, 0);
tmp = REG_SET_FIELD(tmp, CP_ME_CNTL, CE_HALT, 0);
} else {
tmp = REG_SET_FIELD(tmp, CP_... | false | false | false | false | false | 0 |
detect_imximage_version(struct imx_header *imx_hdr)
{
imx_header_v1_t *hdr_v1 = &imx_hdr->header.hdr_v1;
imx_header_v2_t *hdr_v2 = &imx_hdr->header.hdr_v2;
flash_header_v1_t *fhdr_v1 = &hdr_v1->fhdr;
flash_header_v2_t *fhdr_v2 = &hdr_v2->fhdr;
/* Try to detect V1 */
if ((fhdr_v1->app_code_barker == APP_CODE_BARK... | false | false | false | false | false | 0 |
mprGetPortablePath(cchar *path)
{
char *result, *cp;
result = mprTransformPath(path, 0);
for (cp = result; *cp; cp++) {
if (*cp == '\\') {
*cp = '/';
}
}
return result;
} | false | false | false | false | false | 0 |
ffunc_inv(const double t)
{
if (t > 0.206893F)
{
return (t * t * t);
}
else
{
return ((t - 16.0F/116.0F) / 7.787F);
}
} | false | false | false | false | false | 0 |
new_rdataset(dns_rbtdb_t *rbtdb, isc_mem_t *mctx)
{
rdatasetheader_t *h;
h = isc_mem_get(mctx, sizeof(*h));
if (h == NULL)
return (NULL);
#if TRACE_HEADER
if (IS_CACHE(rbtdb) && rbtdb->common.rdclass == dns_rdataclass_in)
fprintf(stderr, "allocated header: %p\n", h);
#endif
init_rdataset(rbtdb, h);
return (... | false | false | false | false | false | 0 |
onScrobbled( const QList<TrackInfo>& tracks )
{
Q_DEBUG_BLOCK << tracks.count() << "tracks were successfully scrobbled";
Q_ASSERT( sender() );
//////
Scrobbler* scrobbler = static_cast<Scrobbler*>(sender());
ScrobbleCache cache( scrobbler->username() );
if (tracks.count() > 2)
//do a backu... | false | false | false | false | false | 0 |
chan_cleanup(struct ast_channel *chan)
{
struct ast_datastore *msg_ds, *ds;
struct varshead *headp;
struct ast_var_t *vardata;
ast_channel_lock(chan);
/*
* Remove the msg datastore. Free its data but keep around the datastore
* object and just reuse it.
*/
if ((msg_ds = ast_channel_datastore_find(chan, &... | false | false | false | false | false | 0 |
iscsit_clear_tpg_np_login_thread(
struct iscsi_tpg_np *tpg_np,
struct iscsi_portal_group *tpg,
bool shutdown)
{
if (!tpg_np->tpg_np) {
pr_err("struct iscsi_tpg_np->tpg_np is NULL!\n");
return;
}
if (shutdown)
tpg_np->tpg_np->enabled = false;
iscsit_reset_np_thread(tpg_np->tpg_np, tpg_np, tpg, shutdown);
} | false | false | false | false | false | 0 |
brasero_data_project_load_contents (BraseroDataProject *self,
GSList *grafts,
GSList *excluded)
{
GSList *iter;
GSList *folders = NULL;
BraseroDataProjectPrivate *priv;
priv = BRASERO_DATA_PROJECT_PRIVATE (self);
priv->is_loading_contents = 1;
for (iter = grafts; iter; iter = iter->next) {
Bra... | false | false | false | false | false | 0 |
hostap_remove_interface(struct net_device *dev, int rtnl_locked,
int remove_from_list)
{
struct hostap_interface *iface;
if (!dev)
return;
iface = netdev_priv(dev);
if (remove_from_list) {
list_del(&iface->list);
}
if (dev == iface->local->ddev)
iface->local->ddev = NULL;
else if (dev == iface-... | false | false | false | false | false | 0 |
zxid_sp_slo_redir(zxid_conf* cf, zxid_cgi* cgi, zxid_ses* ses)
{
zxid_get_ses_sso_a7n(cf, ses);
if (ses->a7n) {
struct zx_sp_LogoutRequest_s* r;
struct zx_str* rs;
struct zx_str* loc;
zxid_entity* idp_meta;
struct zx_str* ses_ix;
ses_ix = ses->a7n->AuthnStatement?&ses->a7n->AuthnStatement->... | false | false | false | false | false | 0 |
startVoice(int note, int velocity) { /* start playing a voice */
int i;
voice* newVoice; /* voice to use */
if (actVoices < voiceCount) { /* not all voices are playing -> use the next free */
for (i = 0; i < voiceCount; i++) {
if (voices[i].act == 0) {
newVoice = &(voices[i]);
break;
}
}
if (ac... | false | false | false | false | true | 1 |
skk_rom_kana_converter_set_rule (SkkRomKanaConverter* self, SkkRomKanaMapFile* value) {
SkkRomKanaMapFile* _tmp0_;
SkkRomKanaMapFile* _tmp1_;
SkkRomKanaMapFile* _tmp2_;
SkkRomKanaNode* _tmp3_;
SkkRomKanaNode* _tmp4_;
g_return_if_fail (self != NULL);
_tmp0_ = value;
_tmp1_ = _g_object_ref0 (_tmp0_);
_g_object_u... | false | false | false | false | false | 0 |
read_seqretry (GstClock * clock, gint seq)
{
/* no retry if the seqnum did not change */
if (G_LIKELY (seq == g_atomic_int_get (&clock->ABI.priv->pre_count)))
return FALSE;
/* wait for the writer to finish and retry */
GST_OBJECT_LOCK (clock);
GST_OBJECT_UNLOCK (clock);
return TRUE;
} | false | false | false | false | false | 0 |
operator+(ulong128& other)
{
ulong128 ret1;
memcpy(ret1.bytes,this->bytes,16);
unsigned int c=0;
for (int j=0;j<16;j++)
{
unsigned int i=c+(unsigned int)other.bytes[j]+
(unsigned int)this->bytes[j];
ret1.bytes[j]=(i&0xFF);
c=i>>8;
}
return r... | false | false | false | false | false | 0 |
smtp_check_thread(thread_t *thread)
{
checker_t *checker = THREAD_ARG(thread);
smtp_checker_t *smtp_checker = CHECKER_ARG(checker);
smtp_host_t *smtp_host = smtp_checker->host_ptr;
int status;
status = tcp_socket_state(thread->u.fd, thread, smtp_check_thread);
switch (status) {
case connect_error:
smtp_fina... | false | false | false | false | false | 0 |
percent_complete(int permill){
static int lastOutput = -1;
if( permill>lastOutput ){
fossil_print(" %d.%d%% complete...\r", permill/10, permill%10);
fflush(stdout);
lastOutput = permill;
}
} | false | false | false | false | false | 0 |
roll_work(struct work *work)
{
uint32_t *work_ntime;
uint32_t ntime;
work_ntime = (uint32_t *)(work->data + 68);
ntime = be32toh(*work_ntime);
ntime++;
*work_ntime = htobe32(ntime);
local_work++;
work->rolls++;
work->blk.nonce = 0;
applog(LOG_DEBUG, "Successfully rolled work");
/* This is now a different w... | false | false | false | false | false | 0 |
gnc_split_register_needs_conv_rate (SplitRegister *reg,
Transaction *txn, Account *acc)
{
gnc_commodity *txn_cur, *acc_com;
/* If there is not a RATE_CELL, then don't do anything */
if (!gnc_split_reg_has_rate_cell (reg->type))
return FALSE;
/* if txn->curre... | false | false | false | false | false | 0 |
isns_registration_add_object_list(isns_simple_t *reg, isns_object_list_t *list)
{
unsigned int i;
for (i = 0; i < list->iol_count; ++i) {
isns_object_extract_writable(list->iol_data[i],
®->is_operating_attrs);
}
} | 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.