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 |
|---|---|---|---|---|---|---|
gt_encseq_col_get_md5_fingerprint(const GtSeqCol *sc,
unsigned long filenum,
unsigned long seqnum)
{
GtEncseqCol *esc;
esc = gt_encseq_col_cast(sc);
gt_assert(esc && filenum < gt_encseq_num_of_files(esc->encs... | false | false | false | false | false | 0 |
_gtk_paned_get_position2 (GtkPaned *paned)
{
GtkRequisition requisition;
int pos;
int size;
if (! gtk_widget_get_visible (GTK_WIDGET (paned)))
return 0;
pos = gtk_paned_get_position (paned);
gtk_window_get_size (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (paned))), &(requisition.wi... | false | false | false | false | false | 0 |
IPrcWrite(pfPrcHelper* prc) {
plLogicModBase::IPrcWrite(prc);
prc->writeSimpleTag("Conditions");
for (size_t i=0; i<fConditionList.getSize(); i++)
fConditionList[i]->prcWrite(prc);
prc->closeTag();
prc->startTag("LogicModifierParams");
prc->writeParam("MyCursor", fMyCursor);
prc->e... | false | false | false | false | false | 0 |
GetCurrentLift (void)
{
int i;
int curlev = CurLevel->levelnum;
int gx, gy;
gx = rintf(Me.pos.x);
gy = rintf(Me.pos.y);
DebugPrintf( 1 , "\nint GetCurrentLift( void ): curlev=%d gx=%d gy=%d" , curlev, gx, gy );
DebugPrintf( 1 , "\nint GetCurrentLift( void ): List of elevators:\n");
for (i = 0; i < cur... | false | false | false | false | false | 0 |
addInfRefreshTime()
{
/* this can be considered a workaround, but for now ask for inf-refresh-time
only when running in stateless mode */
// are there any stateful interfaces?
SPtr<TClntCfgIface> ptr;
firstIface();
while ( ptr = getIface() ) {
if (!ptr->stateless())
retur... | false | false | false | false | false | 0 |
clearAcceptTradeMode(Item** myItems, Item** hisItems)
{
// clear 'in-trade' flag
for (int i = 0; i < TRADE_SLOT_TRADED_COUNT; ++i)
{
if (myItems[i])
myItems[i]->SetInTrade(false);
if (hisItems[i])
hisItems[i]->SetInTrade(false);
}
} | false | false | false | false | false | 0 |
g_mime_object_set_disposition (GMimeObject *object, const char *disposition)
{
GMimeContentDisposition *disp;
g_return_if_fail (GMIME_IS_OBJECT (object));
g_return_if_fail (disposition != NULL);
if (object->disposition) {
g_mime_content_disposition_set_disposition (object->disposition, disposition);
return;... | false | false | false | false | false | 0 |
auth_peer(hbaPort *port)
{
char ident_user[IDENT_USERNAME_MAX + 1];
uid_t uid;
gid_t gid;
struct passwd *pass;
errno = 0;
if (getpeereid(port->sock, &uid, &gid) != 0)
{
/* Provide special error message if getpeereid is a stub */
if (errno == ENOSYS)
ereport(LOG,
(errcode(ERRCODE_FEATURE_NOT_SUPPO... | false | false | false | false | false | 0 |
IWriteBlock( int nBlockXOff, int nBlockYOff,
void * pImage )
{
BMPDataset *poGDS = (BMPDataset *)poDS;
int iInPixel, iOutPixel;
GUInt32 iScanOffset;
CPLAssert( poGDS != NULL
&& nBlockXOff >= 0
&& nBlockYOff >= 0
... | false | false | false | false | false | 0 |
v4l2_start_streaming(struct v4l2_handle *h, int buffers)
{
int disable_overlay = 0;
unsigned int i;
/* setup buffers */
h->reqbufs.count = buffers;
h->reqbufs.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
h->reqbufs.memory = V4L2_MEMORY_MMAP;
if (-1 == xioctl(h->fd, VIDIOC_REQBUFS, &h->reqbufs, 0)... | false | false | false | false | false | 0 |
Pi_h_alpha(const baseFElement & K,KN_<double> & v) const
{
const Triangle & T(K.T);
for (int i=0,k=0;i<3;i++)
{
R2 E(T.Edge(i));
R signe = &T[ (i+1)%3] < &T[ (i+2)%3] ? 1.0 : -1.0 ;
v[k++]= signe*E.x;
v[k++]= signe*E.y;
}
} | false | false | false | false | false | 0 |
update_bitmap_cache (expr_t expr, insn_t insn, bool inside_insn_group,
enum MOVEUP_EXPR_CODE res)
{
int expr_uid = INSN_UID (EXPR_INSN_RTX (expr));
/* Do not cache result of propagating jumps through an insn group,
as it is always true, which is not useful outside the group. */
if (ins... | false | false | false | false | false | 0 |
mv_mlt(MAT * A, VEC * b, VEC * out)
{
u_int i, m, n;
Real **A_v, *b_v /*, *A_row */;
/* register Real sum; */
if ( A==(MAT *)NULL || b==(VEC *)NULL )
error(E_NULL,"mv_mlt");
if ( A->n != b->dim )
error(E_SIZES,"mv_mlt");
if ( b == out )
error(E_INSITU,"mv_mlt");
if ( out == (VEC *)NULL || out->dim != A->m... | false | false | false | true | false | 1 |
f_gamma(union argument *arg)
{
double y;
struct value a;
(void) arg; /* avoid -Wunused warning */
y = GAMMA(real(pop(&a)));
if (y > E_MAXEXP) {
undefined = TRUE;
push(Ginteger(&a, 0));
} else
push(Gcomplex(&a, signgam * gp_exp(y), 0.0));
} | false | false | false | false | false | 0 |
lib3ds_quat_tangent(float c[4], float p[4], float q[4], float n[4]) {
float dn[4], dp[4], x[4];
int i;
lib3ds_quat_ln_dif(dn, q, n);
lib3ds_quat_ln_dif(dp, q, p);
for (i = 0; i < 4; i++) {
x[i] = -1.0f / 4.0f * (dn[i] + dp[i]);
}
lib3ds_quat_exp(x);
lib3ds_quat_mul(c, q, x);
} | false | false | false | false | false | 0 |
g_tls_client_connection_gnutls_finish_handshake (GTlsConnectionGnutls *conn,
GError **inout_error)
{
GTlsClientConnectionGnutls *gnutls = G_TLS_CLIENT_CONNECTION_GNUTLS (conn);
g_assert (inout_error != NULL);
if (g_error_matches (*inout_error, G_TLS_ERROR, G_TLS_ERROR_NOT_TLS) &&
gnu... | false | false | false | false | false | 0 |
mpd_nextListOkCommand(mpd_Connection *connection)
{
mpd_finishListOkCommand(connection);
if (!connection->doneProcessing) {
connection->doneListOk = 0;
}
if (connection->listOks == 0 || connection->doneProcessing) {
return -1;
}
return 0;
} | false | false | false | false | false | 0 |
rs_dotProd(const int *u, const double *v, int dim) const {
double result = 0;
for (int i=0; i < dim; ++i){
result += u[i] * v[i];
}
return(result);
} | false | false | false | false | false | 0 |
qat_alg_ablkcipher_init_dec(struct qat_alg_ablkcipher_ctx *ctx,
int alg, const uint8_t *key,
unsigned int keylen, int mode)
{
struct icp_qat_hw_cipher_algo_blk *dec_cd = ctx->dec_cd;
struct icp_qat_fw_la_bulk_req *req = &ctx->dec_fw_req;
struct icp_qat_fw_comn_req_hdr_cd_pars *cd_pars = &req->cd_pars;
qa... | false | false | false | false | false | 0 |
setQuarters(const UnicodeString* quartersArray, int32_t count, DtContextType context, DtWidthType width)
{
// delete the old list if we own it
// we always own the new list, which we create here (we duplicate rather
// than adopting the list passed in)
switch (context) {
case FORMAT :
switc... | false | false | false | false | false | 0 |
IsSSortPlistDense (
Obj list )
{
Int lenList;
Obj elm1;
Obj elm2;
Int areMut;
Int i;
Obj fam=0; /* initialize to help compiler */
Int isHom;
/* get the length ... | false | false | false | false | false | 0 |
_gsasl_saml20_client_start (Gsasl_session * sctx, void **mech_data)
{
struct saml20_client_state *state;
state = (struct saml20_client_state *) calloc (sizeof (*state), 1);
if (state == NULL)
return GSASL_MALLOC_ERROR;
*mech_data = state;
return GSASL_OK;
} | false | false | false | false | false | 0 |
nilfs_identify(char *data, struct nilfs_super_data *sd)
{
char *p, *options = data;
substring_t args[MAX_OPT_ARGS];
int token;
int ret = 0;
do {
p = strsep(&options, ",");
if (p != NULL && *p) {
token = match_token(p, tokens, args);
if (token == Opt_snapshot) {
if (!(sd->flags & MS_RDONLY)) {
r... | false | false | false | false | false | 0 |
SCQuitGame(int option)
{
MenuActive = false;
askforquit = true;
typeofask = 1; //quit game
if (!netgame && !demoplayback)
{
paused = true;
}
return true;
} | false | false | false | false | false | 0 |
_wrap_findattr(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
Tcl_Obj *CONST *argv = objv+1;
int argc = objc-1;
if (argc == 2) {
int _v;
void *vptr = 0;
int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Agraph_t, 0);
_v = SWIG_CheckState(res);
if (_... | false | false | false | false | false | 0 |
mklong (str, modifiers, mlen)
char *str;
char *modifiers;
size_t mlen;
{
size_t len, slen;
slen = strlen (str);
len = slen + mlen + 1;
if (len > conv_bufsize)
{
conv_bufsize = (((len + 1023) >> 10) << 10);
conv_buf = (char *)xrealloc (conv_buf, conv_bufsize);
}
FASTCOPY (... | false | false | false | false | false | 0 |
egg_toolbars_model_add_toolbar (EggToolbarsModel *t,
int position,
const char *name)
{
GNode *node;
int real_position;
g_return_val_if_fail (EGG_IS_TOOLBARS_MODEL (t), -1);
node = g_node_new (toolbars_toolbar_new (name));
g_node_insert (t->priv->toolbars, position, node);
real... | false | false | false | false | false | 0 |
fso_gsm_plus_clck_real_parseTest (FsoGsmAbstractAtCommand* base, const gchar* response, GError** error) {
FsoGsmPlusCLCK * self;
const gchar* _tmp0_ = NULL;
gchar* _tmp1_ = NULL;
GError * _inner_error_ = NULL;
self = (FsoGsmPlusCLCK*) base;
g_return_if_fail (response != NULL);
_tmp0_ = response;
FSO_GSM_ABSTRAC... | false | false | false | false | false | 0 |
val_nhot(const SORT_NODE *node)
{
SUBJECT *subj = node->first;
SORT_VAL val;
ARTICLE *art;
val.n = 0;
for (art = subj->thread ; art ; art = next_in_thread_preorder(art))
if (art->from && !art->read && art->pixmap != None)
val.n++;
return val;
} | false | true | false | true | true | 1 |
Open(
const string& filename) {
// Recursively create parent directories to the output file.
vector<string> parts;
SplitStringUsing(filename, "/", &parts);
string path_so_far = root_;
for (int i = 0; i < parts.size() - 1; i++) {
path_so_far += parts[i];
if (mkdir(path_so_far.c_str(), 0777) != 0) {... | false | false | false | false | false | 0 |
snd_pcm_hw_free(snd_pcm_t *pcm)
{
int err;
if (! pcm->setup)
return 0;
if (pcm->mmap_channels) {
err = snd_pcm_munmap(pcm);
if (err < 0)
return err;
}
// assert(snd_pcm_state(pcm) == SND_PCM_STATE_SETUP ||
// snd_pcm_state(pcm) == SND_PCM_STATE_PREPARED);
err = pcm->ops->hw_free(pcm->op_arg);
pc... | false | false | false | false | false | 0 |
rb_class_path(VALUE klass)
{
VALUE path = classname(klass);
st_data_t n = (st_data_t)path;
if (!NIL_P(path)) return path;
if (RCLASS_IV_TBL(klass) && st_lookup(RCLASS_IV_TBL(klass),
(st_data_t)tmp_classpath, &n)) {
return (VALUE)n;
}
else {
const char *s = "Class";
if (TYPE(klass) ==... | false | false | false | false | false | 0 |
Swig_VarsetToFunction(Node *n, int flags) {
String *name, *nname;
ParmList *parms;
SwigType *type, *ty;
int varcref = flags & CWRAP_NATURAL_VAR;
name = Getattr(n, "name");
type = Getattr(n, "type");
nname = SwigType_namestr(name);
ty = Swig_wrapped_var_type(type, varcref);
parms = NewParm(ty, name);... | false | false | false | false | false | 0 |
ns_add_disp(_ns_sess * s, int after, char *name)
{
int ret = NS_FAIL;
if (!s) {
return NS_FAIL;
}
D_ESCREEN(("ns_add_disp: add %s after #%d\n", name, after));
switch (s->backend) {
#ifdef NS_HAVE_SCREEN
case NS_MODE_SCREEN:
if (after >= 0)
ns_go2_disp(s, afte... | false | false | false | false | false | 0 |
AddStrips(vtkCellArray *strips, vtkPoints *points,
int geometryFlag,
vtkPolyData *input, vtkPolyData *output)
{
int j;
vtkIdType *ptIds = 0;
vtkIdType numPts = 0;
double pts[3][3];
vtkIdType binIds[3];
int odd; // Used to flip order ... | false | false | false | false | false | 0 |
serio_open(struct serio *serio, struct serio_driver *drv)
{
serio_set_drv(serio, drv);
if (serio->open && serio->open(serio)) {
serio_set_drv(serio, NULL);
return -1;
}
return 0;
} | false | false | false | false | true | 1 |
sfip_ntop(const sfip_t *ip, char *buf, int bufsize)
{
if(!ip)
{
if(buf && bufsize > 0) buf[0] = 0;
return;
}
sfip_raw_ntop(sfip_family(ip), ip->ip32, buf, bufsize);
} | true | true | false | false | false | 1 |
getFmtList(UT_uint32 i)
{
UT_uint32 j = i;
if(i > OTHER_NUMBERED_LISTS)
j -= (OTHER_NUMBERED_LISTS - DASHED_LIST);
return fmt_Lists[i];
} | false | false | false | false | true | 1 |
sortLater()
{
if (!isSorted() || _sort_dirty)
return;
_sort_dirty = true;
g_timeout_add(0, (GSourceFunc)tree_sort_later, this);
} | false | false | false | false | false | 0 |
fetchkey(unsigned nsec) {
fd_set fdset;
struct timeval tv;
FD_ZERO(& fdset);
FD_SET(fileno(stdin), & fdset);
tv.tv_usec = nsec % 1000000;
tv.tv_sec = nsec / 1000000;
if(select(fileno(stdin) + 1, & fdset, NULL, NULL, & tv) > 0) {
char ch = -1;
if(read(fileno(stdin), & ch, sizeof(char)) == sizeof(char))
... | true | true | false | false | true | 1 |
d(double x, PDFType type,
vector<double const *> const &par, bool give_log) const
{
if (type == PDF_PRIOR) {
//Avoid expensive evaluation of gamma function
if (x < 0) {
return give_log ? JAGS_NEGINF : 0;
}
else if (x == 0) {
//Density at zero defined by continuity
return xlog0(SHAPE(par) - 1,... | false | false | false | false | false | 0 |
open_gp_stream (PlotType ptype, GptFlags flags,
int *err)
{
char fname[FILENAME_MAX] = {0};
const char *optname = NULL;
int ci, interactive = 0;
FILE *fp = NULL;
/* ensure we have 'gnuplot_path' in place (file-scope static var) */
if (*gnuplot_path == '\0') {
strcpy(gnuplot_path, gret... | false | false | false | false | false | 0 |
readBlock2Buf(FILE *fp,
unsigned long *buf,
size_t len,
BitString bitstring,
BitOffset offset,
unsigned short bitsPerUlong)
{
if (fread(buf, sizeof (buf[0]), len, fp) != len)
die("short read when reading backing store");
gt_bsStoreUniformUlon... | false | false | false | false | true | 1 |
mpegts_parse_destroy_tspad (MpegTSParse2 * parse, MpegTSParsePad * tspad)
{
if (tspad->tags) {
gst_tag_list_free (tspad->tags);
}
/* free the wrapper */
g_free (tspad);
} | false | false | false | false | false | 0 |
writeClosingTag(const wchar_t* name)
{
if (!File || !name)
return;
--Tabs;
if (Tabs > 0 && !TextWrittenLast)
{
for (int i=0; i<Tabs; ++i)
File->write(L"\t", sizeof(wchar_t));
}
File->write(L"</", 2*sizeof(wchar_t));
File->write(name, wcslen(name)*sizeof(wchar_t));
File->write(L">", size... | false | false | false | false | false | 0 |
file_revertBuffer (int start, int end)
{
int i;
char c;
for (i = 0; i <= (end - start) / 2; i ++)
{
c = file_buffer [start + i];
file_buffer [start + i] = file_buffer [end - i];
file_buffer [end - i] = c;
}
} | false | false | false | false | false | 0 |
poll(unsigned long timeout)
{
// This will throw if someone is using another kind
// of poll, and that's a good thing.
PollDefault &inst = dynamic_cast<PollDefault&>(Poll::instance());
// Prevent reentrancy
static bool already_polling = false;
assert(!already_polling);
already_polling = true;
try {
... | false | false | false | false | false | 0 |
get_nop_from_pool (insn_t insn)
{
insn_t nop;
bool old_p = nop_pool.n != 0;
int flags;
if (old_p)
nop = nop_pool.v[--nop_pool.n];
else
nop = nop_pattern;
nop = emit_insn_before (nop, insn);
if (old_p)
flags = INSN_INIT_TODO_SSID;
else
flags = INSN_INIT_TODO_LUID | INSN_INIT_TODO_SSID;... | false | false | false | false | false | 0 |
FindElementN(Dtd dtd, const Char *name, int namelen)
{
#ifdef FOR_LT
/* Derived from FindElementAndName */
static struct element_definition e;
RHTEntry *entry;
NSL_ElementSummary_I *elsum;
if(!dtd->doctype)
return 0;
entry = rsearch(name, namelen, dtd->doctype->elements);
if(!entry)
ret... | false | false | false | false | false | 0 |
file_exists(char *filename)
{
LHAFileType file_type;
file_type = lha_arch_exists(filename);
if (file_type == LHA_FILE_ERROR) {
fprintf(stderr, "Failed to read file type of '%s'\n", filename);
exit(-1);
}
return file_type != LHA_FILE_NONE;
} | false | false | false | false | false | 0 |
parse_blockcode(struct buf *ob, struct sd_markdown *rndr, uint8_t *data, size_t size)
{
size_t beg, end, pre;
struct buf *work = 0;
work = rndr_newbuf(rndr, BUFFER_BLOCK);
beg = 0;
while (beg < size) {
for (end = beg + 1; end < size && data[end - 1] != '\n'; end++) {};
pre = prefix_code(data + beg, end - beg... | false | false | false | false | false | 0 |
L14()
{register object *base=vs_base;
register object *sup=base+VM14; VC14
vs_reserve(VM14);
check_arg(2);vs_top=sup;
{object V93=base[0]->c.c_cdr;
if(endp(V93))invalid_macro_call();
base[2]= (V93->c.c_car);
V93=V93->c.c_cdr;
base[3]= V93;}
base[4]= list(3,((object)VV[11]),base[2],make_cons(((object)VV[0]),bas... | false | false | false | false | false | 0 |
addElectric(float p[3], float v[3], float clr[4], int age, float size)
{
Explo *newExplo = 0;
Explo *first = 0;
exploPause[Electric][2] = 1; //-- set flag to init explo pause count
newExplo = getNewExplo();
newExplo->init(p, v, clr, age, size);
newExplo->back = exploRoot[Electric];
newExplo->next = exploRoot[... | false | false | false | false | false | 0 |
define_font(char name[],
int num,
int enc)
{
if (enc == 0) /* utf-8 */
fprintf(fout, "/%s-utf8/%s mkfont-utf8\n"
"/F%d{/%s-utf8 exch selectfont}!\n",
name, name, num, name);
else /* native encoding */
fprintf(fout, "/F%d{/%s exch selectfont}!\n",
num, name);
} | false | false | false | false | false | 0 |
do_remove (void)
{ header *hd;
char name[256];
if (*next=='(')
{ hd=scan_value();
if (error) return;
if (hd->type!=s_string)
{ output("String value expected!\n");
error=1; return;
}
strcpy(name,stringof(hd));
}
else
{ scan_namemax(name,256);
}
if (error) return;
remove(name);
} | false | false | false | false | false | 0 |
EFUSE_ShadowMapUpdate23a(struct rtw_adapter *pAdapter, u8 efuseType)
{
struct eeprom_priv *pEEPROM = GET_EEPROM_EFUSE_PRIV(pAdapter);
u16 mapLen = 0;
EFUSE_GetEfuseDefinition23a(pAdapter, efuseType,
TYPE_EFUSE_MAP_LEN, (void *)&mapLen);
if (pEEPROM->bautoload_fail_flag == true)
memset(pEEPROM->efuse_eeprom... | false | false | false | false | false | 0 |
DXTraceTime(int t)
{
static int been_here;
if (!been_here) {
DXinitdx();
been_here = 1;
}
if (ti)
ti->trace = t;
} | false | false | false | false | false | 0 |
iperf_set_test_role(struct iperf_test *ipt, char role)
{
ipt->role = role;
if (role == 'c')
ipt->sender = 1;
else if (role == 's')
ipt->sender = 0;
if (ipt->reverse)
ipt->sender = ! ipt->sender;
check_sender_has_retransmits(ipt);
} | false | false | false | false | false | 0 |
show_mpm_settings(void)
{
int mpm_query_info;
apr_status_t retval;
printf("Server MPM: %s\n", ap_show_mpm());
retval = ap_mpm_query(AP_MPMQ_IS_THREADED, &mpm_query_info);
if (retval == APR_SUCCESS) {
printf(" threaded: ");
if (mpm_query_info == AP_MPMQ_DYNAMIC) {
... | false | false | false | false | false | 0 |
write_ScreeningData(icmScreeningData *p, char *d) {
int rv;
if ((rv = write_S15Fixed16Number(p->frequency, d + 0)) != 0)
return rv;
if ((rv = write_S15Fixed16Number(p->angle, d + 4)) != 0)
return rv;
if ((rv = write_SInt32Number((int)p->spotShape, d + 8)) != 0)
return rv;
return 0;
} | false | false | false | false | false | 0 |
g4x_update_wm(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
static const int sr_latency_ns = 12000;
struct drm_i915_private *dev_priv = dev->dev_private;
int planea_wm, planeb_wm, cursora_wm, cursorb_wm;
int plane_sr, cursor_sr;
unsigned int enabled = 0;
bool cxsr_enabled;
if (g4x_compute_wm0(de... | false | false | false | false | false | 0 |
time_richcompare(PyObject *self, PyObject *other, int op)
{
PyObject *result = NULL;
PyObject *offset1, *offset2;
int diff;
if (! PyTime_Check(other))
Py_RETURN_NOTIMPLEMENTED;
if (GET_TIME_TZINFO(self) == GET_TIME_TZINFO(other)) {
diff = memcmp(((PyDateTime_Time *)self)->data,
... | false | false | false | false | false | 0 |
acct_storage_p_commit(pgsql_conn_t *pg_conn, bool commit)
{
DEF_VARS;
int rc = SLURM_SUCCESS;
if (check_db_connection(pg_conn) != SLURM_SUCCESS)
return ESLURM_DB_CONNECTION;
debug4("as/pg: commit: got %d commits",
list_count(pg_conn->update_list));
if(pg_conn->rollback) {
if(!commit) {
if(pgsql_d... | false | false | false | false | true | 1 |
new_symbol(
SymbolTable * symtab, /* symbol table */
const char *name, /* symbol name */
const char *value, /* symbol value */
int flags) /* symbol attributes */
{
Symbol *sym;
unsigned i;
if ((sym = find_symbol(symtab, name)) == NULL) {
sym = NEW(Symbol);
sym->name = xstrdup(... | false | false | false | false | false | 0 |
loadalltextfiles ( )
{
tfindfile ff ( "*.asctxt" );
ASCString c = ff.getnextname();
while( !c.empty() ) {
dataLoaderTicker();
tnfilestream s ( c, tnstream::reading );
displayLogMessage ( 6, "loadalltextfiles :: loading " + s.getLocation() + ", " );
TextFormatParser tfp ( &s );
... | false | false | false | false | false | 0 |
get_battery_idx(const char *bat)
{
int idx;
for (idx = 0; idx < MAX_BATTERY_COUNT; idx++) {
if (!strlen(batteries[idx]) || !strcmp(batteries[idx], bat)) {
break;
}
}
/* if not found, enter a new entry */
if (!strlen(batteries[idx])) {
snprintf(batteries[idx], 31, "%s", bat);
}
return idx;
} | false | false | false | false | false | 0 |
hex_dump(const char *str, const void *data, ssize_t len, const struct debug_strings *decode)
{
size_t i;
const uint8_t *p = data;
const char *decodedval;
if (opt_debug < 3)
return;
printf(" ");
switch (len) {
case DUMP_UINT8:
decodedval = val_to_string(*(uint8_t *)p, decode);
printf("%s: %02x%s\n", str... | false | false | false | false | false | 0 |
nv31_bus_intr(struct nvkm_bus *bus)
{
struct nvkm_subdev *subdev = &bus->subdev;
struct nvkm_device *device = subdev->device;
u32 stat = nvkm_rd32(device, 0x001100) & nvkm_rd32(device, 0x001140);
u32 gpio = nvkm_rd32(device, 0x001104) & nvkm_rd32(device, 0x001144);
if (gpio) {
struct nvkm_gpio *gpio = device->g... | false | false | false | false | false | 0 |
ParseTokenAsInt(const Token& t, const char*& err_out)
{
err_out = NULL;
if (t.Type() != TokenType_DATA) {
err_out = "expected TOK_DATA token";
return 0;
}
if(t.IsBinary())
{
const char* data = t.begin();
if (data[0] != 'I') {
err_out = "failed to parse I(nt), unexpected data type (binary)";
return ... | false | false | false | false | false | 0 |
gethostname(char *name,size_t len) {
struct utsname u;
int res=uname(&u);
if (res==0) {
size_t i;
if (len>=_UTSNAME_NODENAME_LENGTH)
len=_UTSNAME_NODENAME_LENGTH;
for (i=0; i<len; i++)
name[i]=u.nodename[i];
}
return res;
} | false | false | false | false | false | 0 |
flush_fdary(FdAry *fdp)
{
int i;
aClient *cptr;
for (i = 0; i <= fdp->highest; i++)
{
if (!(cptr = local[fdp->fd[i]]))
continue;
if (!IsRegistered(cptr)) /* is this needed?? -kalt */
continue;
... | false | false | false | false | false | 0 |
H5Sget_select_hyper_blocklist(hid_t spaceid, hsize_t startblock,
hsize_t numblocks, hsize_t buf[/*numblocks*/])
{
H5S_t *space; /* Dataspace to modify selection of */
herr_t ret_value; /* return value */
FUNC_ENTER_API(H5Sget_select_hyper_blocklist, FAIL)
H5TRACE4("e", "ihh*... | false | false | false | false | false | 0 |
print_color_very_fast(const stpi_dither_t *d, stpi_dither_channel_t *dc,
int val, int x, int y, unsigned bit, int length)
{
int i, j;
unsigned char *tptr = dc->ptr + d->ptr_offset;
/*
* Lay down all of the bits in the pixel.
*/
set_row_ends(dc, x);
for (i = 0, j = 1; i < dc->signif_bits; i++, j... | false | false | false | false | false | 0 |
tracehook(struct cli_bc_ctx *ctx, unsigned event)
{
dbg_state.directory = ctx->directory;
if (*ctx->file == '?')
return;
switch (event) {
case trace_func:
fprintf(stderr, "[trace] %s:%u:%u -> %s:%u:%u Entered function %s\n",
dbg_state.file, dbg_state.line, dbg_state.col,
ctx->file, ctx->lin... | false | false | false | false | false | 0 |
SetTarget(
MIDI::Message msg,
unsigned char chn,unsigned char firstData,
MIDIIn* inp)
{
if (msg==MIDI::eNoteOnOff)
{
SetTarget(MIDI::eNoteOn, chn, firstData, inp);
SetTarget(MIDI::eNoteOff,chn, firstData, inp);
return;
}
if (firstData==0x80)
{
for (firstData=0;firstData<128;firstData++)
{
SetTarge... | false | false | false | false | false | 0 |
FcFreeTypeGlyphNameIndex (FT_Face face, const FcChar8 *name)
{
FT_UInt gindex;
FcChar8 name_buf[FC_GLYPHNAME_BUFLEN + 2];
for (gindex = 0; gindex < (FT_UInt) face->num_glyphs; gindex++)
{
if (FT_Get_Glyph_Name (face, gindex, name_buf, FC_GLYPHNAME_BUFLEN+1) == 0)
if (!strcmp ((char *) name, (char... | false | false | false | false | false | 0 |
ensure_buffer(GwyGrainQuantity quantity,
gdouble **quantity_data,
guint ngrains,
gdouble fillvalue,
GList **buffers)
{
gdouble *buf, *b;
guint gno;
if (quantity_data[quantity]) {
buf = quantity_data[quantity];
if (!fillvalue)
... | false | false | false | false | false | 0 |
find_candidates_in_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
basic_block bb)
{
bool speed = optimize_bb_for_speed_p (bb);
gimple_stmt_iterator gsi;
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
gimple gs = gsi_stmt (gsi);
if (gimple_vuse (gs) && gimple_as... | false | false | false | false | false | 0 |
dynv_handler_map_get_handler(struct dynvHandlerMap* handler_map, const char* handler_name){
dynvHandlerMap::HandlerMap::iterator i;
i=handler_map->handlers.find(handler_name);
if (i!=handler_map->handlers.end()){
return (*i).second;
}else{
return 0;
}
} | false | false | false | false | false | 0 |
gtk_form_get_type(void)
{
static GtkType form_type = 0;
if (!form_type)
{
GtkTypeInfo form_info;
vim_memset(&form_info, 0, sizeof(form_info));
form_info.type_name = "GtkForm";
form_info.object_size = sizeof(GtkForm);
form_info.class_size = sizeof(GtkFormClass);
form_info.class_init_func = (GtkClassI... | false | false | false | false | false | 0 |
cpool_probe(void) {
unsigned int i, dead=0;
struct CP_ENTRY *cpe = cp->pool;
time_t now = time(NULL);
for(i=1; i<=cp->entries; i++) {
if((cpe->dead && (cpe->last_poll < now - 120 || !cp->alive)) || cpe->last_poll < now - 15*60*60) {
cpe->last_poll = time(NULL);
nc_ping_entry(cpe);
logg(... | false | false | false | false | false | 0 |
menu_rfind(const void
*(*function) (struct entry * item),
const char *root)
{
struct entry *item = firstitem;
const void *r;
while (item != NULL) {
if (!strcmp(root, item->item->menuname)) {
if ((r = function(item)) != NULL)
return r;
if (item->item->type == MENU_SUBMENU
&& ... | false | false | false | false | false | 0 |
bound_difference_of_offsetted_base (tree type, mpz_t x, mpz_t y,
bounds *bnds)
{
int rel = mpz_cmp (x, y);
bool may_wrap = !nowrap_type_p (type);
mpz_t m;
/* If X == Y, then the expressions are always equal.
If X > Y, there are the following possibilities:
a) neither of var + X and var + Y ... | false | false | false | false | false | 0 |
_toolbar_item_prio_compare_cb(const void *i1, const void *i2)
{
const Elm_Toolbar_Item *eti1 = i1;
const Elm_Toolbar_Item *eti2 = i2;
if (!eti2) return 1;
if (!eti1) return -1;
if (eti2->prio.priority == eti1->prio.priority)
return -1;
return eti2->prio.priority - eti1->prio.priority;
} | false | false | false | false | false | 0 |
e1000e_setup_copper_link_ich8lan(struct e1000_hw *hw)
{
u32 ctrl;
s32 ret_val;
u16 reg_data;
ctrl = er32(CTRL);
ctrl |= E1000_CTRL_SLU;
ctrl &= ~(E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX);
ew32(CTRL, ctrl);
/*
* Set the mac to wait the maximum time between each iteration
* and increase the max iterations whe... | false | false | false | false | false | 0 |
write_fs(struct file *file, struct kobject *kobj,
struct bin_attribute *attr,
char *buf, loff_t off, size_t count)
{
struct esas2r_adapter *a = esas2r_adapter_from_kobj(kobj);
int length = min(sizeof(struct esas2r_ioctl_fs), count);
int result = 0;
result = esas2r_write_fs(a, buf, off, count);
if (result <... | false | false | false | false | false | 0 |
do_translocation( int32_t pos_1, int32_t pos_2, int32_t pos_3, int32_t pos_4, bool invert )
{
// Provided that OriC must be at position 0
//
// 1) Note that in Case 1 (without inversion), whichever position comes first, translocating segment [pos_1->pos_2]
// to pos_4 through pos_3 is always equivalen... | false | false | false | false | false | 0 |
get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec)
{
NMPolicy *policy = NM_POLICY (object);
NMPolicyPrivate *priv = NM_POLICY_GET_PRIVATE (policy);
switch (prop_id) {
case PROP_DEFAULT_IP4_DEVICE:
g_value_set_object (value, priv->default_device4);
break;
case PROP_DE... | false | false | false | false | false | 0 |
CL_WriteConfiguration (void)
{
FILE *f;
char path[MAX_QPATH];
if (cls.state == ca_uninitialized)
return;
Com_sprintf (path, sizeof(path),"%s/aprconfig.cfg",FS_Gamedir());
f = fopen (path, "w");
if (!f) {
Com_Printf ("Couldn't write aprconfig.cfg.\n");
return;
}
fprintf (f, "// generated by AprQ2, do no... | false | false | false | false | false | 0 |
header_canvas_size_allocate (GtkWidget *widget,
GtkAllocation *alloc,
ETree *tree)
{
GtkAllocation allocation;
set_header_canvas_width (tree);
widget = GTK_WIDGET (tree->priv->header_canvas);
gtk_widget_get_allocation (widget, &allocation);
/* When the h... | false | false | false | false | false | 0 |
selectAndProcess(void)
{
struct timeval timeout;
struct timeval *tvpnext;
struct timeval *tvp;
int rc;
// Merging MSTK and Dap File Descriptors
// Copy Enabled to Abled
MSChannel::fds()->fdsor(fds_r,MSChannel::fds()->r(),MSChannel::fds()->ra());
MSChannel::fds()->fdsor(fds_w,MSChannel::fds()->w(),MSC... | false | false | false | false | false | 0 |
SetConstraintStateAddItem(SetConstraintState state,
Oid tgoid, bool tgisdeferred)
{
if (state->numstates >= state->numalloc)
{
int newalloc = state->numalloc * 2;
newalloc = Max(newalloc, 8); /* in case original has size 0 */
state = (SetConstraintState)
repalloc(state,
sizeof(SetConstraintS... | false | false | false | false | false | 0 |
addarg(const char *arg)
{
if(*arg!='\"') {
int plain=strcspn(arg, "\t\n ;=");
if(!arg[plain]) {
addunquoted(arg, plain);
return;
} else if(arg[plain]=='=') {
addunquoted(arg, plain);
addunquoted("=", 1);
arg+=plain+1;
if(!*arg)
return;
}
}
addquoted(arg);
} | false | false | false | false | false | 0 |
nlm4_unlock_fd_resume (void *carg)
{
int ret = -EFAULT;
nfs_user_t nfu = {0, };
nfs3_call_state_t *cs = NULL;
struct gf_flock flock = {0, };
if (!carg)
return ret;
cs = (nfs3_c... | false | false | false | false | false | 0 |
ClassInit()
{
static bool inited;
if(inited)
return;
inited=true;
#if INET6
const char *ipv6=ResMgr::Query("torrent:ipv6",0);
if(!*ipv6)
{
ipv6=FindGlobalIPv6Address();
if(ipv6) {
ProtoLog::LogNote(9,"found IPv6 address: %s",ipv6);
ResMgr::Set("torrent:ipv6",0,ipv6);
}
... | false | false | false | false | false | 0 |
process_print (void) {
if ( is_beat && !is_silence ) {
outmsg("%f\n", aubio_tempo_get_last_s(tempo) );
}
} | false | false | false | false | false | 0 |
typhoon_test_mmio(struct pci_dev *pdev)
{
void __iomem *ioaddr = pci_iomap(pdev, 1, 128);
int mode = 0;
u32 val;
if(!ioaddr)
goto out;
if(ioread32(ioaddr + TYPHOON_REG_STATUS) !=
TYPHOON_STATUS_WAITING_FOR_HOST)
goto out_unmap;
iowrite32(TYPHOON_INTR_ALL, ioaddr + TYPHOON_REG_INTR_MASK);
iowrite32(TYP... | false | false | false | false | false | 0 |
sercos3_handler(int irq, struct uio_info *info)
{
struct sercos3_priv *priv = info->priv;
void __iomem *isr0 = info->mem[3].internal_addr + ISR0_OFFSET;
void __iomem *ier0 = info->mem[3].internal_addr + IER0_OFFSET;
if (!(ioread32(isr0) & ioread32(ier0)))
return IRQ_NONE;
spin_lock(&priv->ier0_cache_lock);
se... | false | false | false | false | false | 0 |
convertAddressToViewerPos(Address *a, viewer_pos *p)
{
if (a && a->isValid()) {
clear_viewer_pos(p);
p->u.sub = analy_sub;
uint64 u;
a->putIntoUInt64(u);
p->u.line_id.id1 = u >> 32;
p->u.line_id.id2 = u;
p->u.line_id.id3 = 0;
return true;
} else {
return false;
}
} | false | false | false | false | false | 0 |
open_persist_pipe(int iindex, char *command)
{
static int recurse = 0; /* used to allow one level of recursion */
DEBUGMSGTL(("ucd-snmp/pass_persist", "open_persist_pipe(%d,'%s') recurse=%d\n",
iindex, command, recurse));
/*
* Open if it's not already open
*/
if (... | 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.