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 |
|---|---|---|---|---|---|---|
get_blame_tag_from_iter (GitgRevisionFilesView *files_view,
GtkTextIter *iter)
{
GtkTextTag *tag = NULL;
GSList *tags, *l;
tags = gtk_text_iter_get_tags (iter);
for (l = tags; l != NULL; l = g_slist_next (l))
{
if (g_object_get_data (l->data, BLAME_DATA) != NULL)
{
tag =... | false | false | false | false | false | 0 |
print_job_render_image(PrintWindow *pw)
{
FileData *fd = NULL;
switch (pw->source)
{
case PRINT_SOURCE_SELECTION:
fd = g_list_nth_data(pw->source_selection, pw->job_page);
break;
case PRINT_SOURCE_ALL:
fd = g_list_nth_data(pw->source_list, pw->job_page);
break;
case PRINT_SOURCE_IMAGE:
default:... | false | false | false | false | false | 0 |
_g_str_get_last_field (const char *line,
int last_field)
{
const char *field;
int i;
if (line == NULL)
return NULL;
last_field--;
field = _g_str_eat_spaces (line);
for (i = 0; i < last_field; i++) {
if (field == NULL)
return NULL;
field = strchr (field, ' ');
field = _g_str_e... | false | false | false | false | false | 0 |
find_notebook_at_pointer (gint abs_x, gint abs_y)
{
GdkDeviceManager *manager;
GdkDevice *pointer;
GdkWindow *win_at_pointer, *toplevel_win;
gpointer toplevel = NULL;
gint x, y;
/* FIXME multi-head */
manager = gdk_display_get_device_manager (gdk_display_get_default ());
pointer = gdk_device_manager_get_client... | false | false | false | false | false | 0 |
istgt_lu_disk_scsi_set_target_port_groups(ISTGT_LU_DISK *spec, CONN_Ptr conn, uint8_t *cdb, uint8_t *data, int len)
{
ISTGT_LU_Ptr lu;
int pg_tag;
int aas;
int pg;
int rc;
int i;
if (len < 4) {
return -1;
}
lu = spec->lu;
aas = BGET8W(&data[0], 3, 4);
pg = DGET16(&data[2]);
ISTGT_TRACELOG(ISTGT_TRACE_... | false | false | false | false | false | 0 |
reload(void)
{
struct ast_calendar_tech *iter;
ast_mutex_lock(&reloadlock);
/* Mark existing calendars for deletion */
ao2_callback(calendars, OBJ_NODATA | OBJ_MULTIPLE, cb_pending_deletion, NULL);
load_config(1);
AST_LIST_LOCK(&techs);
AST_LIST_TRAVERSE(&techs, iter, list) {
if (load_tech_calendars(iter)) ... | false | false | false | false | false | 0 |
rgblocks2bitblocks(const unsigned int bsize, const uint32_t rgblocks, uint32_t *ri_data)
{
uint32_t mappable = 0;
uint32_t bitblocks = 0;
/* Number of blocks mappable by bitmap blocks with these header types */
const uint32_t blks_rgrp = GFS2_NBBY * (bsize - sizeof(struct gfs2_rgrp));
const uint32_t blks_meta = GF... | false | false | false | false | false | 0 |
fxrstor_fixup(struct x86_emulate_ctxt *ctxt,
struct fxregs_state *new)
{
int rc = X86EMUL_CONTINUE;
struct fxregs_state old;
rc = asm_safe("fxsave %[fx]", , [fx] "+m"(old));
if (rc != X86EMUL_CONTINUE)
return rc;
/*
* 64 bit host will restore XMM 8-15, which is not correct on non-64
* bit guests. Load t... | false | true | false | false | false | 1 |
Java_ncsa_hdf_hdflib_HDFLibrary_GRwritelut
( JNIEnv *env,
jclass cls,
jint pal_id,
jint ncomp,
jint data_type,
jint interlace,
jint num_entries,
jbyteArray pal_data) /* IN: byte[] */
{
intn rval;
jbyte *arr;
jboolean bb;
arr = ENVPTR->GetByteArrayElements(ENVPAR pal_data,&bb);
rval = GRwritelut(... | false | false | false | false | false | 0 |
pan_queue_thumb_done_cb(ThumbLoader *tl, gpointer data)
{
PanWindow *pw = data;
if (pw->queue_pi)
{
PanItem *pi;
gint rc;
pi = pw->queue_pi;
pw->queue_pi = NULL;
pi->queued = FALSE;
if (pi->pixbuf) g_object_unref(pi->pixbuf);
pi->pixbuf = thumb_loader_get_pixbuf(tl);
rc = pi->refcount;
image_... | false | false | false | false | false | 0 |
yy_Reference(yycontext *ctx)
{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 3, 0);
yyprintf((stderr, "%s\n", "Reference")); if (!yy_NonindentSpace(ctx)) goto l1507;
{ int yypos1508= ctx->pos, yythunkpos1508= ctx->thunkpos; if (!yymatchString(ctx, "[]")) goto l1508; goto l1507;
l1508:;... | false | false | false | false | false | 0 |
indicator_keyboard_ibus_menu_update_property (IndicatorKeyboardIBusMenu* self, IBusProperty* property) {
GeeHashMap* _tmp0_ = NULL;
g_return_if_fail (self != NULL);
g_return_if_fail (property != NULL);
indicator_keyboard_ibus_menu_remove_actions (self);
_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_... | false | false | false | false | false | 0 |
addNetwork()
{
NetworkConfig *nc = new NetworkConfig();
if (nc == NULL)
return;
nc->setWpaGui(this);
nc->newNetwork();
nc->show();
nc->exec();
} | false | false | false | false | false | 0 |
DrawState( void ) {
short group1 = att->GroupSize(), group2 = def->GroupSize();
MapView *mv = mapwin->GetMapView();
for ( int i = NORTH; i <= NORTHWEST; ++i ) {
if ( i < startgroup1 ) {
mv->DrawTerrain( IMG_RECESSED_HEX, this, clock[0][i].x, clock[0][i].y, clock[0][i] );
mv->DrawUnit( att->BaseI... | false | false | false | false | false | 0 |
gradspline3d_Wessel_Bercovici (double r, double par[], double *G)
{
double cx;
if (r == 0.0) return (0.0);
cx = par[0] * r;
return ((1.0 - exp (-cx) * (cx + 1.0))/ (cx * r));
} | false | false | false | false | false | 0 |
bcf_p1_indel_prior(bcf_p1aux_t *ma, double x)
{
int i;
for (i = 0; i < ma->M; ++i)
ma->phi_indel[i] = ma->phi[i] * x;
ma->phi_indel[ma->M] = 1. - ma->phi[ma->M] * x;
} | false | false | false | false | false | 0 |
ParseRecord()
{
double dfLat, dfLon;
CPLString osName;
RET_IF_FAIL(readLatLon(&dfLat, &dfLon, 0));
osName = readStringUntilEnd(2);
if (poFIXLayer)
poFIXLayer->AddFeature(osName, dfLat, dfLon);
} | false | false | false | false | false | 0 |
_tenEvecRGBComp_d(double conf, double aniso, double comp,
const tenEvecRGBParm *rgbp) {
double X;
X = AIR_ABS(comp);
X = pow(X, 1.0/rgbp->gamma);
X = AIR_LERP(rgbp->maxSat*aniso, rgbp->isoGray, X);
return conf > rgbp->confThresh ? X : rgbp->bgGray;
} | false | false | false | false | false | 0 |
krb5_dbe_cpw(krb5_context kcontext, krb5_keyblock *master_key,
krb5_key_salt_tuple *ks_tuple, int ks_tuple_count, char *passwd,
int new_kvno, krb5_boolean keepold, krb5_db_entry *db_entry)
{
krb5_error_code status = 0;
kdb_vftabl *v;
status = get_vftabl(kcontext, &v);
if (stat... | false | false | false | false | false | 0 |
drop_schema_events(THD *thd, char *db)
{
LEX_STRING const db_lex= { db, strlen(db) };
DBUG_ENTER("Events::drop_schema_events");
DBUG_PRINT("enter", ("dropping events from %s", db));
/*
Sic: no check if the scheduler is disabled or system tables
are damaged, as intended.
*/
if (event_queue)
eve... | false | false | false | false | false | 0 |
out_x (FILE * out, u_char * buf, int buflen)
/* hexdump */
{
register int pos = 0; /* first character is position 0 */
color(c_HEXOFF0, out, "0x%-8.4x", 0);
while( pos < buflen ) {
do {
if( pos < buflen )
/* print hex stuff */
if ( isgraph( *( buf + pos ) ) )
fprintf(out, pos % 2 ? "%2.2x " : "%2... | false | false | false | false | false | 0 |
extract_field(char *text, char *out, int n, char *token)
{
int i, k, l;
g_return_if_fail(out != NULL);
if (text == NULL || token == NULL)
return;
l = strlen(token);
*out = 0;
i = 0;
while (text[i] != 0) {
if (!strncasecmp(token, text+i, l))
break;
i++;
}
if (text[i] == 0)
return;
i+= l;
k = 0;
wh... | false | false | false | false | false | 0 |
remove_key(struct usbnet *usbdev, u8 index, const u8 *bssid)
{
struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev);
struct ndis_80211_remove_key remove_key;
__le32 keyindex;
bool is_wpa;
int ret;
if (index >= RNDIS_WLAN_NUM_KEYS)
return -ENOENT;
if (priv->encr_keys[index].len == 0)
return 0;
is... | false | false | false | false | false | 0 |
draw_overlay() {
glut_window = this;
if (!valid()) {reshape(w(),h()); valid(1);}
overlaydisplay();
} | false | false | false | false | false | 0 |
textFileWrite(char *fn, char *s) {
FILE *fp;
int status = 0;
if (fn != NULL) {
fp = fopen(fn,"w");
if (fp != NULL) {
if (fwrite(s,sizeof(char),strlen(s),fp) == strlen(s))
status = 1;
fclose(fp);
}
}
return(status);
} | false | false | false | false | false | 0 |
beh_viewbiabl( BiAbl )
biabl_list *BiAbl;
{
if ( BiAbl == (biabl_list *)0 )
{
fprintf( stdout, "NULL\n" );
}
else
{
while ( BiAbl != (biabl_list *)0 )
{
fprintf( stdout, "--> biabl_list\n" );
fprintf( stdout, " LABEL : %s\n", BiAbl->LABEL );
fprintf( stdout, " CNDABL : ... | false | false | false | false | false | 0 |
setdbit(DBM *db, long int dbit)
{
long c;
long dirb;
c = dbit / BYTESIZ;
dirb = c / DBLKSIZ;
if (dirb != db->dirbno) {
int got;
if (lseek(db->dirf, OFF_DIR(dirb), SEEK_SET) < 0
|| (got=read(db->dirf, db->dirbuf, DBLKSIZ)) < 0)
return 0;
if (got==0)
memset(db->dirbuf,0,DBLKSIZ);
db->dirbno = ... | false | false | false | false | false | 0 |
parse_args(int argc, const char **argv)
{
const char * const * usage_str = revert_or_cherry_pick_usage();
int noop;
struct option options[] = {
OPT_BOOLEAN('n', "no-commit", &no_commit, "don't automatically commit"),
OPT_BOOLEAN('e', "edit", &edit, "edit the commit message"),
OPT_BOOLEAN('r', NULL, &noop, "no-... | false | false | false | false | false | 0 |
visitClassDefStart(const ClassDefPtr& p)
{
string name = p->name();
ClassList bases = p->bases();
string package = getPackage(p);
string absolute = getAbsolute(p, "", "", "Prx");
if(!open(absolute))
{
return false;
}
Output& out = output();
//
// Generate a Java interf... | false | false | false | false | false | 0 |
cycleColorMode(MSCycleColorMode mode_)
{
A r=aplus_nl;
char *str;
if ((str = (char *)cycleColorModeEnumHashTable()->lookup((unsigned long)mode_))!=0)
r = (A)MS(si(str));
return r;
} | false | false | false | false | false | 0 |
asyncCloseClientOnOutputBufferLimitReached(redisClient *c) {
if (c->reply_bytes == 0 || c->flags & REDIS_CLOSE_ASAP) return;
if (checkClientOutputBufferLimits(c)) {
sds client = getClientInfoString(c);
freeClientAsync(c);
redisLog(REDIS_WARNING,"Client %s scheduled to be closed ASAP for... | false | false | false | false | false | 0 |
ap_abstract0_is_dimension_unconstrained(ap_manager_t* man, ap_abstract0_t* a,
ap_dim_t dim)
{
if (ap_abstract0_checkman1(AP_FUNID_IS_DIMENSION_UNCONSTRAINED,man,a) &&
ap_abstract0_check_dim(AP_FUNID_IS_DIMENSION_UNCONSTRAINED,man,_ap_abstract0_dimension(a),dim)){
bool (*ptr)(ap_manager_t*,...) = m... | false | false | false | false | false | 0 |
python_build_session(char * name)
{
ekg_sessionObj *pysession;
char buf[100];
session_t *s;
debug("[python] checking for '%s' session\n", name);
s = session_find((const char *) name);
if (!s) {
snprintf(buf, 99, "Can't find session '%s'", name);
PyErr_SetString(PyExc_KeyError, buf);
return NULL;
}
deb... | false | false | false | false | false | 0 |
clear_queue(void)
{
struct oops *oops, *next;
struct oops *queue;
queue = queued_oopses;
queued_oopses = NULL;
barrier();
oops = queue;
while (oops) {
next = oops->next;
free(oops->text);
free(oops);
oops = next;
}
unlink_detail_file();
write_logfile(0, NULL);
} | false | false | false | false | false | 0 |
kill_cleanup(void)
{
long n;
free_kill_file(global_kill_file);
global_kill_file = NULL;
for (n = 0 ; n < n_files ; n++)
free_kill_file(kill_files[n]);
XtFree((char *)kill_files);
kill_files = NULL;
n_files = 0;
n_alloc = 0;
} | false | false | false | false | false | 0 |
enable_iommus_v2(void)
{
struct amd_iommu *iommu;
for_each_iommu(iommu) {
iommu_enable_ppr_log(iommu);
iommu_enable_gt(iommu);
}
} | false | false | false | false | false | 0 |
uwb_est_grow(void)
{
size_t actual_size = uwb_est_size * sizeof(uwb_est[0]);
void *new = kmalloc(2 * actual_size, GFP_ATOMIC);
if (new == NULL)
return -ENOMEM;
memcpy(new, uwb_est, actual_size);
memset(new + actual_size, 0, actual_size);
kfree(uwb_est);
uwb_est = new;
uwb_est_size *= 2;
return 0;
} | false | false | false | false | false | 0 |
load_from_document()
{
m_model->clear(); //Remove all rows.
Document* document = get_document();
if(!document)
return;
//std::cout << "document->get_translation_original_locale()=" << document->get_translation_original_locale() << std::endl;
Glib::ustring original_locale_name = IsoCodes::get_locale_name... | false | false | false | false | false | 0 |
oe_decode_erlang_binary(CORBA_Environment *ev, char *_first, int* _index, erlang_binary *binary) {
long _length = 0;
int _error = 0;
if((char*) binary == _first)
*_index = ((*_index + sizeof(erlang_binary))+sizeof(double)-1)&~(sizeof(double)-1);
binary->_buffer = (CORBA_octet *)(_first+*_index);
... | false | false | false | false | false | 0 |
R2Distance(const R2Box& box1, const R2Box& box2)
{
// Find axial distances from box1 to box2
RNLength dx, dy;
if (RNIsGreater(box1.XMin(), box2.XMax())) dx = box1.XMin() - box2.XMax();
else if (RNIsGreater(box2.XMin(), box1.XMax())) dx = box2.XMin() - box1.XMax();
else dx = 0.0;
if (RNIsGreater(... | false | false | false | false | false | 0 |
set_depth( double d )
{
float f = (float) d;
config_t c;
c.pan_1 = -0.6f * f;
c.pan_2 = 0.6f * f;
c.reverb_delay = 880 * 0.1f;
c.echo_delay = 610 * 0.1f;
if ( f > 0.5 )
f = 0.5; // TODO: more linear reduction of extreme reverb/echo
c.reverb_level = 0.5f * f;
c.echo_l... | false | false | false | false | false | 0 |
spanw_new(Query *query, Searcher *searcher)
{
HashSetEntry *hse;
Weight *self = w_new(SpanWeight, query);
HashSet *terms = SpQ(query)->get_terms(query);
SpW(self)->terms = terms;
self->scorer = &spansc_new;
self->explain = &spanw_explain;
self->to_s = &s... | false | false | false | false | false | 0 |
unit_dataset(struct block_list *bl)
{
struct unit_data *ud;
unsigned int tick = gettick();
nullpo_retr(0, ud = unit_bl2ud(bl));
memset(ud, 0, sizeof(struct unit_data));
ud->bl = bl;
ud->walktimer = -1;
ud->skilltimer = -1;
ud->attacktimer = -1;
ud->attackabletime = tick;
ud->canact_t... | false | false | false | false | false | 0 |
h_V_option(opt, arg)
/*ARGSUSED*/
char *opt;
char *arg;
{
static int nvars = 0;
Bool addplus = FALSE;
char *vnp;
/* activate a variant from the command line */
if (nvars == MAXCMDLINEVARS) {
warning (99, "Too many variant activations from command line");
return 1;
}
if (!(arg && *... | false | false | false | true | false | 1 |
load_filter_internal(HASH * h, const char *file)
{
char path[_POSIX_PATH_MAX];
char buf[128], *token;
int len;
int fd;
snprintf(path, sizeof(path), "%s/%s", global.varDir, file);
if((fd = open(path, O_RDONLY))==-1)
{
if(errno != ENOENT)
log_message_level(LO... | true | true | false | false | true | 1 |
kasan_map_early_shadow(pgd_t *pgd)
{
int i;
unsigned long start = KASAN_SHADOW_START;
unsigned long end = KASAN_SHADOW_END;
for (i = pgd_index(start); start < end; i++) {
pgd[i] = __pgd(__pa_nodebug(kasan_zero_pud)
| _KERNPG_TABLE);
start += PGDIR_SIZE;
}
} | false | false | false | false | false | 0 |
snd_via82xx_modem_pcm_open(struct via82xx_modem *chip, struct viadev *viadev,
struct snd_pcm_substream *substream)
{
struct snd_pcm_runtime *runtime = substream->runtime;
int err;
static unsigned int rates[] = { 8000, 9600, 12000, 16000 };
static struct snd_pcm_hw_constraint_list hw_constra... | false | false | false | false | false | 0 |
mpfr_ui_sub (mpfr_ptr y, unsigned long int u, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
{
mpfr_t uu;
mp_limb_t up[1];
unsigned long cnt;
MPFR_LOG_FUNC
(("u=%lu x[%Pu]=%.*Rg rnd=%d",
u, mpfr_get_prec(x), mpfr_log_prec, x, rnd_mode),
("y[%Pu]=%.*Rg", mpfr_get_prec(y), mpfr_log_prec, y));
if (MPFR_UNL... | false | false | false | false | false | 0 |
js_Stringify(JSContext *cx, jsval *vp, JSObject *replacer, jsval space,
JSCharBuffer &cb)
{
StringifyContext scx(cx, cb, replacer);
if (!InitializeGap(cx, space, scx.gap))
return JS_FALSE;
JSObject *obj = js_NewObject(cx, &js_ObjectClass, NULL, NULL);
if (!obj)
return JS_FA... | false | false | false | false | false | 0 |
show_state_variable_details (GUPnPServiceStateVariableInfo *info)
{
char *details[32];
GValue str_value;
int i = 0;
memset (&str_value, 0, sizeof (GValue));
g_value_init (&str_value, G_TYPE_STRING);
details[i++] = _("Name");
details[i++] = g_strdup (info->na... | false | false | false | false | false | 0 |
deserialize_flash (GstExifReader * exif_reader,
GstByteReader * reader, const GstExifTagMatch * exiftag,
GstExifTagData * tagdata)
{
guint16 value = 0;
guint mode = 0;
const gchar *mode_str = NULL;
GST_LOG ("Starting to parse %s tag in exif 0x%x", exiftag->gst_tag,
exiftag->exif_tag);
if (exif... | false | false | false | false | false | 0 |
do_show(int argc, char **argv)
{
struct ip6_tnl_parm2 p;
ll_init_map(&rth);
ip6_tnl_parm_init(&p, 0);
p.proto = 0; /* default to any */
if (parse_args(argc, argv, SIOCGETTUNNEL, &p) < 0)
return -1;
if (!p.name[0] || show_stats)
do_tunnels_list(&p);
else {
if (tnl_get_ioctl(p... | false | false | false | false | false | 0 |
rep_getpass(const char *prompt)
{
FILE *in, *out;
int echo_off;
static char buf[256];
static size_t bufsize = sizeof(buf);
size_t nread;
/* Catch problematic signals */
catch_signal(SIGINT, SIGNAL_CAST gotintr_sig);
/* Try to write to and read from the terminal if we can.
If we can't open the terminal, use ... | false | false | false | false | true | 1 |
ShowErr()
{
Window *err_wind,
*buf_wind;
NeedErrors();
if (!ErrorHasReferents()) {
rbell();
return;
}
err_wind = windbp(perr_buf);
buf_wind = windbp(cur_error->er_buf);
if (err_wind == NULL) {
if (buf_wind != NULL) {
SetWind(buf_wind);
pop_wind(perr_buf->b_name, NO, -1);
err_wind = curwind;
... | true | true | false | false | false | 1 |
Square ()
{
IsotopicPattern *pat = new IsotopicPattern (2 * m_min, 2 * m_max);
pat->m_mono = 2 * m_mono;
pat->m_mono_mass = m_mono_mass * 2;
int i, j, k, imax = pat->m_max - pat->m_min + 1, jmax = m_values.size () - 1;
for (i = 0; i < imax; i++) {
pat->m_values[i] = 0.;
for (j = max (0, i - jmax), k = i - j; k... | false | false | false | false | false | 0 |
usif_notify_get(struct drm_file *f, void *data, u32 size, void *argv, u32 argc)
{
struct nouveau_cli *cli = nouveau_cli(f);
struct nvif_client *client = &cli->base;
union {
struct nvif_ioctl_ntfy_del_v0 v0;
} *args = data;
struct usif_notify *ntfy;
int ret;
if (nvif_unpack(args->v0, 0, 0, true)) {
if (!(ntf... | false | false | false | false | false | 0 |
JunctionFindExact(Junction *juncPtr, char *seq, int id, int flags, int fast)
{
char *p;
int l;
int i;
int depth;
void *data;
depth = 0;
/*
* Set p to the last element of the sequence, and
* depth to the number of elements in the sequence.
*/
for (p = seq; p[l ... | false | false | false | false | false | 0 |
CWIDGET_check(void *_object)
{
return WIDGET == NULL || CWIDGET_test_flag(THIS, WF_DELETED);
} | false | false | false | false | false | 0 |
pmc_setup_dev(struct pci_dev *pdev, const struct pci_device_id *ent)
{
struct pmc_dev *pmc = &pmc_device;
const struct pmc_reg_map *map = (struct pmc_reg_map *)ent->driver_data;
int ret;
/* Obtain ACPI base address */
pci_read_config_dword(pdev, ACPI_BASE_ADDR_OFFSET, &acpi_base_addr);
acpi_base_addr &= ACPI_BAS... | false | false | false | false | false | 0 |
mmsh_streaming_close(struct stream_t *stream)
{
if(stream->netsock->sock > 0) {
close(stream->netsock->sock);
}
free_mmsh_ctrl_t(stream->stream_ctrl->mmsh_ctrl);
streaming_close_common(stream);
} | false | false | false | false | false | 0 |
getSysFileValue(const char *group, int value, const char *file) {
static int shownError = 0;
char th_file[ ACPIFILENAMELENGTHMAX ];
char input_buf[ 100 ];
snprintf(th_file, sizeof(th_file), "/sys/class/thermal/%s%d/%s",group, value, file);
int fd = open(th_file, O_RDONLY);
if (fd < 0) {
... | false | false | false | false | false | 0 |
start_game(struct state *st)
{
/*Init the ball*/
st->ball.x = PONG_W/2;
st->ball.y = PONG_H/2;
st->bx = st->m_unit;
st->by = st->m_unit;
/* jwz: perhaps not totally accurate, but randomize things a little bit
so that games on multiple screens are not identical. */
if (random() & 1) st->by = -st->by;... | false | false | false | false | true | 1 |
InListAbbreviated(const char *s, const char marker) {
if (0 == words)
return false;
if (!sorted) {
sorted = true;
SortWordList(words, len);
for (unsigned int k = 0; k < (sizeof(starts) / sizeof(starts[0])); k++)
starts[k] = -1;
for (int l = len - 1; l >= 0; l--) {
unsigned char indexChar = words[l][0]... | false | false | false | false | false | 0 |
cgit_close_filter(struct cgit_filter *filter)
{
chk_non_negative(dup2(filter->old_stdout, STDOUT_FILENO),
"Unable to restore STDOUT");
close(filter->old_stdout);
if (filter->pid < 0)
return 0;
waitpid(filter->pid, &filter->exitstatus, 0);
if (WIFEXITED(filter->exitstatus) && !WEXITSTATUS(filter->exitstatus))
... | false | false | false | false | false | 0 |
header_str(INDEXDATA_S *idata, HEADER_TOK_S *hdrtok, ICE_S *ice)
{
IFIELD_S *ourifield = NULL;
IELEM_S *ielem = NULL;
char *fieldval = NULL;
if(ice && ice->ifield){
/* move to last ifield, the one we're working */
for(ourifield = ice->ifield;
ourifield && ourifield->next;
o... | false | false | false | false | false | 0 |
wm8350_gpio_direction_out(struct gpio_chip *chip,
unsigned offset, int value)
{
struct wm8350_gpio_data *wm8350_gpio = to_wm8350_gpio(chip);
struct wm8350 *wm8350 = wm8350_gpio->wm8350;
int ret;
ret = wm8350_clear_bits(wm8350, WM8350_GPIO_CONFIGURATION_I_O,
1 << offset);
if (ret < 0)
return ret;
... | false | false | false | false | false | 0 |
country_limits_changed(property_t prop)
{
char *limits;
limits = gnet_prop_get_string(prop, NULL, 0);
ctl_parse(GNET_PROPERTY(ancient_version) ? NULL : limits);
G_FREE_NULL(limits);
return FALSE;
} | false | false | false | false | false | 0 |
main () {
vector<fastjet::PseudoJet> input_particles;
// read in input particles
double px, py , pz, E;
while (cin >> px >> py >> pz >> E) {
// create a fastjet::PseudoJet with these components and put it onto
// back of the input_particles vector
input_particles.push_back(fastjet::PseudoJet(p... | false | false | false | false | false | 0 |
netxen_p3_has_mn(struct netxen_adapter *adapter)
{
u32 capability, flashed_ver;
capability = 0;
/* NX2031 always had MN */
if (NX_IS_REVISION_P2(adapter->ahw.revision_id))
return 1;
netxen_rom_fast_read(adapter,
NX_FW_VERSION_OFFSET, (int *)&flashed_ver);
flashed_ver = NETXEN_DECODE_VERSION(flashed_ver);
... | false | false | false | false | false | 0 |
findBlockAtPositionReverse(PT_DocPosition pos) const
{
fl_BlockLayout* pBL = NULL;
fl_ContainerLayout* sfh = 0;
PT_DocPosition posBOD;
bool bRes;
bRes = m_pDoc->getBounds(false, posBOD);
UT_ASSERT(bRes);
if(m_pDoc->isEndFootnoteAtPos(pos))
{
xxx_UT_DEBUGMSG(("End footnote found at %d \n",pos));
pos--;
}
... | false | false | false | false | false | 0 |
createJIT(Module *M,
std::string *ErrorStr,
JITMemoryManager *JMM,
CodeGenOpt::Level OptLevel,
bool GVsWithCode,
... | false | false | false | false | false | 0 |
op_div(unsigned int a, unsigned int b)
{
if ((!b)||(b==1)||(a%b)) return -1;
return a / b;
} | false | false | false | false | false | 0 |
Initialize(int argc, char **argv, deque<reqAtom> & memTrace)
{
if(!_gConfiguration.read(argc, argv)) {
cerr << "USAGE: <tracefilename> <AlgName> <TestName> <L1Size> <WindowSize>" << endl;
exit(-1);
}
readTrace(memTrace);
assert(memTrace.size() != 0);
// lru_stl< uint64_t , cacheAtom> LRUCache(cacheAll, _gConf... | false | false | false | false | false | 0 |
decode_AlgorithmIdentifier(const unsigned char *p HEIMDAL_UNUSED_ATTRIBUTE, size_t len HEIMDAL_UNUSED_ATTRIBUTE, AlgorithmIdentifier *data, size_t *size)
{
size_t ret = 0;
size_t l HEIMDAL_UNUSED_ATTRIBUTE;
int e HEIMDAL_UNUSED_ATTRIBUTE;
memset(data, 0, sizeof(*data));
{
size_t Top_datalen, Top_oldlen;
Der_type Top_t... | false | false | false | false | false | 0 |
na_tray_manager_handle_begin_message (NaTrayManager *manager,
XClientMessageEvent *xevent)
{
GtkSocket *socket;
GList *p;
PendingMessage *msg;
long timeout;
long len;
long id;
socket = g_hash_table_lookup (manager->socket_table,
... | false | false | false | false | false | 0 |
execlp(const char* file, const char* arg, ...)
{
int ret;
uint32_t tid = VT_MASTER_THREAD;
va_list ap;
const char* argv[EXECWRAP_EXECL_MAX_ARGS];
/* initialize this wrapper function */
EXECWRAP_FUNC_INIT("execlp", int, (const char*, const char*, ...));
/* suspend LIBC memory (de)allocation tracing */
... | false | false | false | false | false | 0 |
Socket_close(CTX ctx, ksfp_t* sfp _RIX)
{
knh_Socket_t *so = (knh_Socket_t*)sfp[0].o;
if (so->sd != IO_NULL) {
close((int)so->sd);
so->sd = IO_NULL;
}
} | false | false | false | false | false | 0 |
is_duplicated_entry (STRLIST list, STRLIST item)
{
for(; list && list != item; list = list->next) {
if ( !strcmp (list->d, item->d) )
return 1;
}
return 0;
} | false | false | false | false | false | 0 |
I_variance(double sum, double sum2, int n)
{
if (n < 2)
return ((double)0.0);
else
return ((sum2 - sum * sum / n) / (n - 1));
} | false | false | false | false | false | 0 |
i915_gem_shrinker_count(struct shrinker *shrinker, struct shrink_control *sc)
{
struct drm_i915_private *dev_priv =
container_of(shrinker, struct drm_i915_private, mm.shrinker);
struct drm_device *dev = dev_priv->dev;
struct drm_i915_gem_object *obj;
unsigned long count;
bool unlock;
if (!i915_gem_shrinker_loc... | false | false | false | false | false | 0 |
uv__udp_destroy(uv_udp_t* handle) {
uv_udp_send_t* req;
ngx_queue_t* q;
uv__udp_run_completed(handle);
while (!ngx_queue_empty(&handle->write_queue)) {
q = ngx_queue_head(&handle->write_queue);
ngx_queue_remove(q);
req = ngx_queue_data(q, uv_udp_send_t, queue);
if (req->send_cb) {
/* FI... | false | false | false | false | false | 0 |
dumpTimestamp(char *msg)
{
char buf[256];
time_t now = time(NULL);
/*
* We don't print the timezone on Win32, because the names are long and
* localized, which means they may contain characters in various random
* encodings; this has been seen to cause encoding errors when reading
* the dump script.
*/
... | true | true | true | false | false | 1 |
of_pwmchip_add(struct pwm_chip *chip)
{
if (!chip->dev || !chip->dev->of_node)
return;
if (!chip->of_xlate) {
chip->of_xlate = of_pwm_simple_xlate;
chip->of_pwm_n_cells = 2;
}
of_node_get(chip->dev->of_node);
} | false | false | false | false | false | 0 |
pong_type(gnutella_init_response_t *pong)
{
uint32 kbytes;
kbytes = gnutella_init_response_get_kbytes_count(pong);
/*
* Ultra pongs are marked by having their kbytes count be an
* exact power of two, and greater than 8.
*/
return (kbytes >= 8 && is_pow2(kbytes)) ? HOST_ULTRA : HOST_ANY;
} | false | false | false | false | false | 0 |
get_label(Glib::ustring& dst_str, const Glib::ustring& line_str, const Glib::ustring& name)
{
size_t pos = line_str.find(name);
if(pos == std::string::npos)
return false;
pos = line_str.find_first_of("\"");
if(pos == std::string::npos)
return false;
Glib::ustring tmp = line_str.substr(pos+1,std::string::npos)... | false | false | false | false | false | 0 |
s_testFloatingPoint( void )
{
float fRef = 10.0f/30.0f;
double dRef = 10.0/30.0;
posh_byte_t dbuf[ 8 ];
float fTmp;
double dTmp;
fTmp = POSH_FloatFromLittleBits( POSH_LittleFloatBits( fRef ) );
if ( fTmp != fRef )
{
return "*ERROR: POSH little endian floating point conversion failed. Pl... | false | false | false | false | false | 0 |
getOperandDef(const MachineOperand &MO) {
MachineInstr *DefInstr = nullptr;
// We need a virtual register definition.
if (MO.isReg() && TargetRegisterInfo::isVirtualRegister(MO.getReg()))
DefInstr = MRI->getUniqueVRegDef(MO.getReg());
// PHI's have no depth etc.
if (DefInstr && DefInstr->isPHI())
DefI... | false | false | false | false | false | 0 |
PrintFullHM_SgName(const T_TabSgName *tsgn, int space, FILE *fpout)
{
int n;
const char *lbl;
lbl = tsgn->SgLabels;
if (tsgn->SgNumber >= 3 && tsgn->SgNumber < 16)
while (*lbl) if (*lbl++ == '=') break;
SkipWhite(lbl);
n = 0;
PrintSgLabel(lbl, space, &n, fpout);
lbl = tsgn->Extension... | false | false | false | false | false | 0 |
LoadProgramFile(Processor **pcpu,
const char *filename,
FILE *pFile,
const char *pProcessorName)
{
int error_code= SUCCESS;
Processor *ccpu = 0;
codefile = pFile;
if(codefile == 0) {... | false | false | false | false | false | 0 |
check_first_occurrence(const boost::any& value)
{
if (!value.empty())
boost::throw_exception(
multiple_occurrences());
} | false | false | false | false | false | 0 |
ApplyEventStrings(){
for(list<SCFGRule>::iterator it = filtered_rules_.begin(); it!= filtered_rules_.end();it++){
SCFGRule& rule = *it;
int startF = rule.rhs_target.front().index_start;
int endF = rule.rhs_target.back().index_end;
set<string> events = get_events(startF, endF);
rule.events.insert(... | false | false | false | false | false | 0 |
file_cpy(FILE * from, FILE * to)
{
char buf[BUFSIZ];
long size;
int written = 0;
while (1) {
size = fread(buf, 1, BUFSIZ, from);
if (!size) {
if (written) {
fflush(to);
fseek(to, 0l, 0);
}
return (0);
}
if (!fwrite(buf, 1, size, to)) {
G_warning(_("Failed to copy file"));
... | true | true | false | false | true | 1 |
deleteAllShots() {
vector<Shot *>::iterator i;
for (i = shots.begin(); i != shots.end(); ++i) {
delete *i;
}
shots.clear();
} | false | false | false | false | false | 0 |
GetProtocolFromPrefix(const wxString& prefix)
{
for (unsigned int i = 0; protocolInfos[i].protocol != UNKNOWN; ++i)
{
if (!protocolInfos[i].prefix.CmpNoCase(prefix))
return protocolInfos[i].protocol;
}
return UNKNOWN;
} | false | false | false | false | false | 0 |
CountUserBackends(Oid roleid)
{
ProcArrayStruct *arrayP = procArray;
int count = 0;
int index;
LWLockAcquire(ProcArrayLock, LW_SHARED);
for (index = 0; index < arrayP->numProcs; index++)
{
volatile PGPROC *proc = arrayP->procs[index];
if (proc->pid == 0)
continue; /* do not count prepared xacts */... | false | false | false | false | true | 1 |
_swrast_add_spec_terms_triangle(struct gl_context *ctx, const SWvertex *v0,
const SWvertex *v1, const SWvertex *v2)
{
SWvertex *ncv0 = (SWvertex *)v0; /* drop const qualifier */
SWvertex *ncv1 = (SWvertex *)v1;
SWvertex *ncv2 = (SWvertex *)v2;
GLfloat rSum, gSum, bSum;
GLc... | false | false | false | false | false | 0 |
StringTokenizer( const std::string& str, const char delim )
{
std::list< std::string > list_str;
size_t i = 0, i2 = 0, lng = str.length();
for(;;){
while( i2 < lng && str[ i2++ ] != delim );
int tmp = ( str[ i2-1 ] == delim || str[ i2 -1 ] == '\n' ) ? 1 : 0;
if( i2 - i ) list_str.p... | false | false | false | false | false | 0 |
setup_connection (BaconMessageConnection *conn)
{
g_return_val_if_fail (conn->chan == NULL, FALSE);
conn->chan = g_io_channel_unix_new (conn->fd);
if (!conn->chan) {
return FALSE;
}
g_io_channel_set_line_term (conn->chan, "\n", 1);
conn->conn_id = g_io_add_watch (conn->chan, G_IO_IN, se... | false | false | false | false | false | 0 |
phantom_poll(struct file *file, poll_table *wait)
{
struct phantom_device *dev = file->private_data;
unsigned int mask = 0;
pr_debug("phantom_poll: %d\n", atomic_read(&dev->counter));
poll_wait(file, &dev->wait, wait);
if (!(dev->status & PHB_RUNNING))
mask = POLLERR;
else if (atomic_read(&dev->counter))
ma... | false | false | false | false | false | 0 |
option_lexer_init(char* filename) {
option_lloc.first_line = 1;
option_lloc.first_column = 1;
option_lloc.last_line = 1;
option_lloc.last_column = 1;
if ((option_in = fopen(filename, "r"))) {
option_filename = strdup(filename);
}
} | false | false | false | false | true | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.