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 |
|---|---|---|---|---|---|---|
galois_single_divide(int a, int b, int w)
{
int sum_j;
if (mult_type[w] == TABLE) {
if (galois_div_tables[w] == NULL) {
if (galois_create_mult_tables(w) < 0) {
fprintf(stderr, "ERROR -- cannot make multiplication tables for w=%d\n", w);
exit(1);
}
}
return galois_div_tables[... | false | false | false | false | false | 0 |
cbz_read_zip_entry(cbz_document *doc, int offset, int *sizep)
{
fz_context *ctx = doc->ctx;
fz_stream *file = doc->file;
int sig, method, namelength, extralength;
unsigned long csize, usize;
unsigned char *cdata;
int code;
fz_seek(file, offset, 0);
sig = getlong(doc->file);
if (sig != ZIP_LOCAL_FILE_SIG)
f... | false | false | false | false | false | 0 |
init_aamix_paths(struct hda_codec *codec)
{
struct hda_gen_spec *spec = codec->spec;
if (!spec->have_aamix_ctl)
return;
if (!has_aamix_out_paths(spec))
return;
update_aamix_paths(codec, spec->aamix_mode, spec->out_paths[0],
spec->aamix_out_paths[0],
spec->autocfg.line_out_type);
update_aamix_paths... | false | false | false | false | false | 0 |
chunkHeader(char *buf, int buflen, int i)
{
int n;
if(i <= 0)
return 0;
n = snprintf(buf, buflen, "%x\r\n", i);
return n;
} | false | false | false | false | false | 0 |
rocker_flow_tbl_add(struct rocker_port *rocker_port,
struct switchdev_trans *trans, int flags,
struct rocker_flow_tbl_entry *match)
{
struct rocker *rocker = rocker_port->rocker;
struct rocker_flow_tbl_entry *found;
size_t key_len = match->key_len ? match->key_len : sizeof(found->key);
unsigned ... | false | false | false | false | false | 0 |
__blob_file_delete(dbc, blob_id)
DBC *dbc;
uintmax_t blob_id;
{
ENV *env;
char *blob_name, *full_path;
int ret;
env = dbc->dbp->env;
blob_name = full_path = NULL;
if ((ret = __blob_id_to_path(
env, dbc->dbp->blob_sub_dir, blob_id, &blob_name)) != 0) {
__db_errx(env, DB_STR_A("0229",
"Failed to con... | false | false | false | false | false | 0 |
set_local_varlist(DLLIST * destlist, DLLIST * varlist, ULONG mci)
{
BOOL ok = TRUE;
if (MCI_ERROR != mci) {
DLNODE *nd = varlist->first;
HSCATTR *var;
while (nd && ok) {
var = set_local_var(destlist, (HSCATTR *) (nd->data), mci);
ok &= (BOOL) (var != NULL);
... | false | false | false | false | false | 0 |
__alloc_is_cval(int32 wlen)
{
int32 wi;
if (__contabwi + 2*wlen >= __contabwsiz) __grow_contab(2*wlen);
wi = __contabwi;
__contabwi += 2*wlen;
return(wi);
} | false | false | false | false | false | 0 |
aa_dfa_next(struct aa_dfa *dfa, unsigned int state,
const char c)
{
u16 *def = DEFAULT_TABLE(dfa);
u32 *base = BASE_TABLE(dfa);
u16 *next = NEXT_TABLE(dfa);
u16 *check = CHECK_TABLE(dfa);
unsigned int pos;
/* current state is <state>, matching character *str */
if (dfa->tables[YYTD_ID_EC]) {
/* Equivalen... | false | false | false | false | false | 0 |
NT_mark_all_cb(AW_window *, AW_CL cl_ntw, AW_CL cl_mark_mode)
// Bits 0 and 1 of mark_mode:
//
// mark_mode&3 == 0 -> unmark
// mark_mode&3 == 1 -> mark
// mark_mode&3 == 2 -> toggle mark
//
// Bits 2 .. 4 of mark_mode:
//
// mark_mode&12 == 4 -> affect only full sequences
// mar... | false | false | false | false | false | 0 |
getDssslSpecFromPi(const Char *s, size_t n,
const Location &loc)
{
static struct {
const char *key;
Boolean (DssslApp::*handler)(const Char *s, size_t, const Location &);
} pis[] = {
{ "xml-stylesheet", &DssslApp::handleAttlistPi },
{ "xml:stylesheet", &DssslApp::handleAttlistPi },
{ "s... | false | false | false | false | false | 0 |
_e_mod_comp_shaped_check(int w,
int h,
const Ecore_X_Rectangle *rects,
int num)
{
if ((!rects) || (num < 1)) return EINA_FALSE;
if (num > 1) return EINA_TRUE;
if ((rects[0].x == 0) && (rects[0].y == 0) &&
((int)rects[0].width == ... | false | false | false | false | false | 0 |
dma_buf_map_attachment(struct dma_buf_attachment *attach,
enum dma_data_direction direction)
{
struct sg_table *sg_table = ERR_PTR(-EINVAL);
might_sleep();
if (WARN_ON(!attach || !attach->dmabuf))
return ERR_PTR(-EINVAL);
sg_table = attach->dmabuf->ops->map_dma_buf(attach, direction);
if (!sg_table)
sg... | false | false | false | false | false | 0 |
luaO_str2d (const char *s, Number *result) { /* LUA_NUMBER */
char *endptr;
Number res = lua_str2number(s, &endptr);
if (endptr == s) return 0; /* no conversion */
while (isspace((unsigned char)*endptr)) endptr++;
if (*endptr != '\0') return 0; /* invalid trailing characters? */
*result = res;
return 1... | false | false | false | false | false | 0 |
e1000_init_function_pointers_82540(struct e1000_hw *hw)
{
DEBUGFUNC("e1000_init_function_pointers_82540");
hw->mac.ops.init_params = e1000_init_mac_params_82540;
hw->nvm.ops.init_params = e1000_init_nvm_params_82540;
hw->phy.ops.init_params = e1000_init_phy_params_82540;
} | false | false | false | false | false | 0 |
location_has_really_changed (NautilusWindowSlot *slot)
{
NautilusWindow *window;
GFile *location;
window = nautilus_window_slot_get_window (slot);
/* Switch to the new content view. */
nautilus_window_slot_switch_new_content_view (slot);
if (slot->details->pending_location != NULL) {
/* Tell the window we ar... | false | false | false | false | false | 0 |
fitfight_drawsprites( struct mame_bitmap *bitmap, const struct rectangle *cliprect )
{
const struct GfxElement *gfx = Machine->gfx[3];
data16_t *source = fitfight_spriteram;
data16_t *finish = source + 0x800/2;
while( source<finish )
{
int xpos, ypos, number,xflip,yflip, end, colr;
ypos = source[0]... | false | false | false | false | false | 0 |
convert_no_alpha (guchar *dest_data,
int dest_stride,
guchar *src_data,
int src_stride,
int src_x,
int src_y,
int width,
int height)
{
int x, y;
src_data += src_... | false | false | false | false | false | 0 |
IQM_CullModel( void )
{
int i;
vec3_t vectors[3];
vec3_t angles;
trace_t r_trace;
vec3_t dist;
vec3_t bbox[8];
if (r_worldmodel )
{
//occulusion culling - why draw entities we cannot see?
r_trace = CM_BoxTrace(r_origin, currententity->origin, currentmodel->maxs, currentmodel->mins, r_worldmo... | false | false | false | false | false | 0 |
parse_time_double_args(PyObject *args, char *format, double *pwhen)
{
PyObject *ot = NULL;
if (!PyArg_ParseTuple(args, format, &ot))
return 0;
if (ot == NULL || ot == Py_None)
*pwhen = floattime();
else {
double when = PyFloat_AsDouble(ot);
if (PyErr_Occurred())
... | false | false | false | false | false | 0 |
ecv_max_width (ECellView *ecell_view,
gint model_col,
gint view_col)
{
ECellVboxView *vbox_view = (ECellVboxView *) ecell_view;
gint max_width = 0;
gint i;
for (i = 0; i < vbox_view->subcell_view_count; i++) {
gint width = e_cell_max_width (vbox_view->subcell_views[i], vbox_view->mo... | false | false | false | false | false | 0 |
thumb_set_frame_pointer (arm_stack_offsets *offsets)
{
HOST_WIDE_INT amount;
rtx insn, dwarf;
amount = offsets->outgoing_args - offsets->locals_base;
if (amount < 1024)
insn = emit_insn (gen_addsi3 (hard_frame_pointer_rtx,
stack_pointer_rtx, GEN_INT (amount)));
else
{
emit_insn (gen_movsi... | false | false | false | false | false | 0 |
getVSTMUseCycle(const InstrItineraryData *ItinData,
const MCInstrDesc &UseMCID,
unsigned UseClass,
unsigned UseIdx, unsigned UseAlign) const {
int RegNo = (int)(UseIdx+1) - UseMCID.getNumOperands() + 1;
if (RegNo <... | false | false | false | false | false | 0 |
socket_free(struct gnutella_socket *s)
{
socket_check(s);
if (s->flags & SOCK_F_EOF)
bws_sock_closed(s->type, TRUE);
else if (s->flags & SOCK_F_ESTABLISHED)
bws_sock_closed(s->type, FALSE);
else
bws_sock_connect_timeout(s->type);
if (s->flags & SOCK_F_UDP) {
struct udpctx *uctx = s->resource.udp;
if (u... | false | false | false | false | false | 0 |
snd_azf3328_pcm(struct snd_azf3328 *chip)
{
/* pcm devices */
enum { AZF_PCMDEV_STD, AZF_PCMDEV_I2S_OUT, NUM_AZF_PCMDEVS };
struct snd_pcm *pcm;
int err;
err = snd_pcm_new(chip->card, "AZF3328 DSP", AZF_PCMDEV_STD,
1, 1, &pcm);
if (err < 0)
return err;
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK,
... | false | true | false | false | false | 1 |
i2c_w(struct sd *sd, u8 reg, u8 value)
{
if (sd->sensor_reg_cache[reg] == value)
return;
switch (sd->bridge) {
case BRIDGE_OV511:
case BRIDGE_OV511PLUS:
ov511_i2c_w(sd, reg, value);
break;
case BRIDGE_OV518:
case BRIDGE_OV518PLUS:
case BRIDGE_OV519:
ov518_i2c_w(sd, reg, value);
break;
case BRIDGE_OVF... | false | false | false | false | false | 0 |
show_detectors (void)
{
enum tliberr err ;
integer i ;
tonedetstat *pd ;
tonectrlstat *pc ;
string7 s1, s2, s3, s4 ;
printf ("\n") ;
err = lib_get_detstat (context, addr(detstat)) ;
if ((err != LIBERR_NOERR) lor (detstat.count < 1))
then
begin
printf ("Status not available\n") ;
... | false | false | false | false | false | 0 |
ethi_remove_drop_marker (ETableHeaderItem *ethi)
{
if (ethi->drag_mark == -1)
return;
gtk_widget_hide (arrow_up);
gtk_widget_hide (arrow_down);
ethi->drag_mark = -1;
} | false | false | false | false | false | 0 |
convert_A1R5G5B5toR5G6B5(const void* sP, s32 sN, void* dP)
{
u16* sB = (u16*)sP;
u16* dB = (u16*)dP;
for (s32 x = 0; x < sN; ++x)
*dB++ = A1R5G5B5toR5G6B5(*sB++);
} | false | false | false | false | false | 0 |
CreateCompressor (unsigned int RasterSize)
{
/*
* There is some problem printing in grayscale. When the inputwidth is less than the full
* page width, printer replicates the image across the width. To fix this, make the width of
* each strip the width of the printable page size. Note that this does not create an... | false | false | false | false | false | 0 |
_raid_in_sync(struct logical_volume *lv)
{
percent_t sync_percent;
if (!lv_raid_percent(lv, &sync_percent)) {
log_error("Unable to determine sync status of %s/%s.",
lv->vg->name, lv->name);
return 0;
}
return (sync_percent == PERCENT_100) ? 1 : 0;
} | false | false | false | false | false | 0 |
conv_interact(int what, const char *prompt)
{
char *ret;
int tag;
gSendInt(grqs[what].vcode);
if (what == GCONV_BINARY) {
unsigned const char *up = (unsigned const char *)prompt;
int len = up[3] | (up[2] << 8) | (up[1] << 16) | (up[0] << 24);
gSendArr(len, prompt);
gSend... | false | false | false | false | false | 0 |
doRead(void)
{
int n;
MSBuffer *db=headBuffer();
if (isSet(MSProtocolConnection<MSString>::Reset)==MSTrue) return;
if((n=readTheBuffer(db,MaxReadSize))<0) return;
if((n=db->put()-db->get())>0)
{
unset(MSProtocolConnection<MSString>::Read);
MSString d(db->get(),n);
db->get(db->get()+n);
... | false | false | false | false | false | 0 |
clutter_stage_show_all (ClutterActor *self)
{
ClutterActorIter iter;
ClutterActor *child;
/* we don't do a recursive show_all(), to maintain the old
* invariants from ClutterGroup
*/
clutter_actor_iter_init (&iter, self);
while (clutter_actor_iter_next (&iter, &child))
clutter_actor_show (child);
... | false | false | false | false | false | 0 |
GC_new_kind_inner(fl, descr, adjust, clear)
void **fl;
GC_word descr;
int adjust;
int clear;
{
int result = GC_n_kinds++;
if (GC_n_kinds > MAXOBJKINDS) ABORT("Too many kinds");
GC_obj_kinds[result].ok_freelist = (ptr_t *)fl;
GC_obj_kinds[result].ok_reclaim_list = 0;
GC_obj_kinds[result].ok_descript... | false | false | false | false | false | 0 |
cat_is_expanded (NemoPlacesSidebar *sidebar,
SectionType section_type)
{
switch (section_type) {
case SECTION_COMPUTER:
return sidebar->my_computer_expanded;
case SECTION_DEVICES:
return sidebar->devices_expanded;
case SECTION_NETWORK:
ret... | false | false | false | false | false | 0 |
PQfireResultCreateEvents(PGconn *conn, PGresult *res)
{
int i;
if (!res)
return FALSE;
for (i = 0; i < res->nEvents; i++)
{
if (!res->events[i].resultInitialized)
{
PGEventResultCreate evt;
evt.conn = conn;
evt.result = res;
if (!res->events[i].proc(PGEVT_RESULTCREATE, &evt,
res->ev... | false | false | false | false | false | 0 |
gf_bt_get_node_tag(GF_BTParser *parser, char *node_name)
{
u32 tag;
/*if VRML and allowing non MPEG4 nodes, use X3D*/
if (parser->is_wrl && !(parser->load->flags & GF_SM_LOAD_MPEG4_STRICT)) {
#ifndef GPAC_DISABLE_X3D
tag = gf_node_x3d_type_by_class_name(node_name);
if (!tag)
#endif
tag = gf_node_mpeg4_type_b... | true | true | true | false | false | 1 |
dom_evt_get_handler(GF_Node *n)
{
XMLRI *iri;
GF_FieldInfo info;
if (!n || (n->sgprivate->tag!=TAG_SVG_handler)) return n;
if (!n || (gf_node_get_attribute_by_tag(n, TAG_XLINK_ATT_href, 0, 0, &info) != GF_OK)) {
return n;
}
iri = (XMLRI *)info.far_ptr;
if (!iri->target && iri->string) {
iri->target = gf_sg... | false | false | false | false | false | 0 |
brasero_normalize_start (BraseroJob *job,
GError **error)
{
BraseroNormalizePrivate *priv;
BraseroBurnResult result;
priv = BRASERO_NORMALIZE_PRIVATE (job);
priv->album_gain = -1.0;
priv->album_peak = -1.0;
/* get tracks */
brasero_job_get_tracks (job, &priv->tracks);
if (!priv->tracks)
return BRASERO_... | false | false | false | false | false | 0 |
est_node_set_link(ESTNODE *node, const char *url, const char *label, int credit){
CBLIST *reqheads;
CBDATUM *reqbody, *resbody;
const char *kbuf;
char myurl[ESTPATHBUFSIZ], *vbuf;
int rescode, err;
assert(node && url && label);
err = FALSE;
sprintf(myurl, "%s/_set_link", node->url);
reqheads = cblisto... | true | true | false | false | true | 1 |
add_bullet(Unit* parentUnit, short xLoc, short yLoc)
{
//------------------------------------------------------//
// define parameters
//------------------------------------------------------//
AttackInfo *attackInfo = parentUnit->attack_info_array+parentUnit->cur_attack;
short attackXLoc = parentUnit->range_attac... | false | false | false | false | false | 0 |
ibus_proxy_dispose (GObject *object)
{
if (! (IBUS_PROXY_FLAGS (object) & IBUS_IN_DESTRUCTION)) {
IBUS_PROXY_SET_FLAGS (object, IBUS_IN_DESTRUCTION);
if (! (IBUS_PROXY_FLAGS (object) & IBUS_DESTROYED)) {
g_signal_emit (object, proxy_signals[DESTROY], 0);
IBUS_PROXY_SET_FLAGS ... | false | false | false | false | false | 0 |
parallels_probe(const uint8_t *buf, int buf_size, const char *filename)
{
const struct parallels_header *ph = (const void *)buf;
if (buf_size < HEADER_SIZE)
return 0;
if (!memcmp(ph->magic, HEADER_MAGIC, 16) &&
(le32_to_cpu(ph->version) == HEADER_VERSION))
return 100;
return 0;
} | false | false | false | false | false | 0 |
external_acl_grace_expired(external_acl * def, external_acl_entry * entry)
{
int ttl;
ttl = entry->result == 1 ? def->ttl : def->negative_ttl;
ttl = (ttl * (100 - def->grace)) / 100;
if (entry->date + ttl < squid_curtime)
return 1;
else
return 0;
} | false | false | false | false | false | 0 |
convert(String& str, char value)
{
str = String(1, Char(value));
} | false | false | false | false | false | 0 |
parse(const std::string & looksstr)
{
m_options.clear();
std::string strippedlooks = pystring::strip(looksstr);
if(strippedlooks.empty())
{
return m_options;
}
std::vector<std::string> options;
pystring::split(strippedlooks, optio... | false | false | false | false | false | 0 |
CopyErrorData(void)
{
ErrorData *edata = &errordata[errordata_stack_depth];
ErrorData *newedata;
/*
* we don't increment recursion_depth because out-of-memory here does not
* indicate a problem within the error subsystem.
*/
CHECK_STACK_DEPTH();
Assert(CurrentMemoryContext != ErrorContext);
/* Copy the... | false | true | false | false | false | 1 |
acid(game *g, monster *z)
{
int junk;
if (rl_dist(z->posx, z->posy, g->u.posx, g->u.posy) > 10 ||
!g->sees_u(z->posx, z->posy, junk))
return; // Out of range
z->moves = -300; // It takes a while
z->sp_timeout = z->type->sp_freq; // Reset timer
g->sound(z->posx, z->posy, 4, "a spitting noise.");
int hitx ... | false | false | false | false | false | 0 |
vmw_mmap(struct file *filp, struct vm_area_struct *vma)
{
struct drm_file *file_priv;
struct vmw_private *dev_priv;
if (unlikely(vma->vm_pgoff < VMWGFX_FILE_PAGE_OFFSET)) {
DRM_ERROR("Illegal attempt to mmap old fifo space.\n");
return -EINVAL;
}
file_priv = filp->private_data;
dev_priv = vmw_priv(file_priv... | false | false | false | false | false | 0 |
get (pANTLR3_TREE_NODE_STREAM tns, ANTLR3_INT32 k)
{
if (tns->ctns->p == -1)
{
fillBufferRoot(tns->ctns);
}
return tns->ctns->nodes->get(tns->ctns->nodes, k);
} | false | false | false | false | false | 0 |
ConvertBGRAToBGR(const uint32_t* src,
int num_pixels, uint8_t* dst) {
const __m128i mask_l = _mm_set_epi32(0, 0x00ffffff, 0, 0x00ffffff);
const __m128i mask_h = _mm_set_epi32(0x00ffffff, 0, 0x00ffffff, 0);
const __m128i* in = (const __m128i*)src;
const uint8_t* const end = dst + num... | false | false | false | false | false | 0 |
new_frame
(
)
{
if (selected < 0)
return;
int shnum = info[selected].shapenum,
frnum = info[selected].framenum;
Vga_file *ifile = file_info->get_ifile();
// Read entire shape.
Shape *shape = ifile->extract_shape(shnum);
if (!shape || // Shouldn't happen.
// We'll insert AFTER frnum.
frnu... | false | false | false | false | false | 0 |
snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol);
struct snd_soc_card *card = dapm->card;
struct soc_mixer_control *mc =
(struct soc_mixer_control *)kcontrol->private_value;
int reg = mc->reg;
un... | false | false | false | false | false | 0 |
gda_server_operation_prepare_drop_table (GdaConnection *cnc, const gchar *table_name, GError **error)
{
GdaServerOperation *op;
GdaServerProvider *server;
server = gda_connection_get_provider (cnc);
op = gda_server_provider_create_operation (server, cnc,
GDA_SERVER_OPERATION_DROP_TABLE, NULL, error);
i... | false | false | false | false | false | 0 |
dm_rh_inc_pending(struct dm_region_hash *rh, struct bio_list *bios)
{
struct bio *bio;
for (bio = bios->head; bio; bio = bio->bi_next) {
if (bio->bi_rw & (REQ_FLUSH | REQ_DISCARD))
continue;
rh_inc(rh, dm_rh_bio_to_region(rh, bio));
}
} | false | false | false | false | false | 0 |
header_handler_metamarshal (GClosure *closure, GValue *return_value,
guint n_param_values, const GValue *param_values,
gpointer invocation_hint, gpointer marshal_data)
{
SoupMessage *msg = g_value_get_object (¶m_values[0]);
SoupMessagePrivate *priv = SOUP_MESSAGE_GET_PRIVATE (msg);
const char *head... | false | false | false | false | false | 0 |
draw (Canvas* c, Graphic* gs) {
PSBrush* br = gs->GetBrush();
if (!br->None()) {
Coord x0 = _x0, y0 = _y0, x1 = _x1, y1 = _y1;
if (Head()) _head->CorrectedTip(x0, y0, br, gs->GetTransformer());
if (Tail()) _tail->CorrectedTip(x1, y1, br, gs->GetTransformer());
update(gs);
#if ... | false | false | false | false | false | 0 |
msg_init_ns(struct ipc_namespace *ns)
{
ns->msg_ctlmax = MSGMAX;
ns->msg_ctlmnb = MSGMNB;
ns->msg_ctlmni = MSGMNI;
atomic_set(&ns->msg_bytes, 0);
atomic_set(&ns->msg_hdrs, 0);
ipc_init_ids(&ns->ids[IPC_MSG_IDS]);
} | false | false | false | false | false | 0 |
w_nbyte(s, n, arg)
char *s;
int n;
struct dump_arg *arg;
{
VALUE buf = arg->str;
rb_str_buf_cat(buf, s, n);
if (arg->dest && RSTRING(buf)->len >= BUFSIZ) {
if (arg->taint) OBJ_TAINT(buf);
rb_io_write(arg->dest, buf);
rb_str_resize(buf, 0);
}
} | false | false | false | false | false | 0 |
progress(int counter, progress_counter_t *pc){
/* we try to save computing time, so we skip early */
if ((!fp) || counter - pc->lastprintcount <= pc->numskip) return 0;
{
char cr='\n';
time_t now = time(NULL);
#if 0 /* debugging */
if (counter)
fprintf(fp," progress %s %3d / %d time %d skip %d\n... | false | false | false | false | false | 0 |
CVideoModeList()
{
#ifdef _DEBUG
setDebugName("CVideoModeList");
#endif
Desktop.depth = 0;
Desktop.size = core::dimension2d<u32>(0,0);
} | false | false | false | false | false | 0 |
dump_configuration (const gchar *filename,
FILE *file,
GError **error)
{
GKeyFile *key_file;
gchar *data;
gsize length;
gboolean success;
if (!write_string (
filename, file,
"\n\n"
"This configuration for the debug log can be re-created\n"
"by putting the following ... | false | false | false | false | false | 0 |
persistentOutput(PersistentOStream & os) const {
os << min_active_flavours_ << max_active_flavours_ << matched_ << scale_factor_;
for (size_t f = 0; f < 7; ++f)
os << ounit(quark_masses_squared_[f],MeV2)
<< ounit(lambda_squared_[f],MeV2);
os << alpha_s_in_ << ounit(scale_in_,GeV)
<< ounit(lambda_... | false | false | false | false | false | 0 |
getCookie(const char *cookie)
{
String line;
// TODO - do away with loop here somehow, or otherwise speed it up?
for (std::deque<String>::iterator i = header.begin(); i != header.end(); i++) {
if (i->startsWithLower("cookie:")) {
line = i->after(": ");
if (line.contains(cookie)) { // We know we have the cook... | false | false | false | false | false | 0 |
gx_ht_complete_threshold_order(gx_ht_order * porder)
{
int num_levels = porder->num_levels;
uint *levels = porder->levels;
uint size = porder->num_bits;
gx_ht_bit *bits = porder->bit_data;
uint i, j;
/* The caller has set bits[i] = max(1, thresholds[i]). */
gx_sort_ht_order(bits, size);
... | false | false | false | false | false | 0 |
kmo_image_get_stdev_badpix(const cpl_image *data,
const cpl_image *bad_pix_mask)
{
int nr_valid_pix = 0,
nx = 0,
ny = 0,
i = 0,
j = 0;
const float *... | false | false | false | false | false | 0 |
getString() const
{
return getStrError() + std::string(": ") + mLocalDesc;
} | false | false | false | false | false | 0 |
mwifiex_set_uap_rates(struct mwifiex_uap_bss_param *bss_cfg,
struct cfg80211_ap_settings *params)
{
struct ieee_types_header *rate_ie;
int var_offset = offsetof(struct ieee80211_mgmt, u.beacon.variable);
const u8 *var_pos = params->beacon.head + var_offset;
int len = params->beacon.head_len - var_offset;
u... | false | true | false | false | false | 1 |
gwlist_search_equal(List *list, void *item)
{
long i;
long ret = -1;
lock(list);
for (i = 0; i < list->len; i++) {
if (GET(list, i) == item) {
ret = i;
break;
}
}
unlock(list);
return ret;
} | false | false | false | false | false | 0 |
emulator_pio_in_out(struct kvm_vcpu *vcpu, int size,
unsigned short port, void *val,
unsigned int count, bool in)
{
vcpu->arch.pio.port = port;
vcpu->arch.pio.in = in;
vcpu->arch.pio.count = count;
vcpu->arch.pio.size = size;
if (!kernel_pio(vcpu, vcpu->arch.pio_data)) {
vcpu->arch.pio.coun... | false | false | false | false | false | 0 |
CDB___lock_dump_locker(lt, lip, fp)
DB_LOCKTAB *lt;
DB_LOCKER *lip;
FILE *fp;
{
struct __db_lock *lp;
fprintf(fp, "L %lx [%ld]", (u_long)lip->id, (long)lip->dd_id);
fprintf(fp, " %s ", F_ISSET(lip, DB_LOCKER_DELETED) ? "(D)" : " ");
if ((lp = SH_LIST_FIRST(&lip->heldby, __db_lock)) == NULL)
fprintf(fp, "\n... | false | false | false | false | false | 0 |
adf_devmgr_rm_dev(struct adf_accel_dev *accel_dev,
struct adf_accel_dev *pf)
{
mutex_lock(&table_lock);
if (!accel_dev->is_vf || (accel_dev->is_vf && !pf)) {
num_devices--;
} else if (accel_dev->is_vf && pf) {
struct vf_id_map *map, *next;
map = adf_find_vf(adf_get_vf_num(accel_dev));
if (!map) {
... | false | false | false | false | false | 0 |
invert_ptrans(double *iptrans, double *ptrans) {
double scale = ptrans[0] * ptrans[4] - ptrans[1] * ptrans[3];
if (fabs(scale) < 1e-6)
return 1;
scale = 1.0/scale;
iptrans[0] = scale * (ptrans[4] - ptrans[5] * ptrans[7]);
iptrans[1] = scale * (ptrans[2] * ptrans[7] - ptrans[1]);
iptrans[2] = scale * (ptrans[... | false | false | false | false | false | 0 |
set_event_null_with_user_data( gpointer data, gpointer user_data )
{
event_t *event = data;
event_t *template = user_data;
if( event->type == template->type && event->user_data == template->user_data )
event->type = event_type_null;
} | false | false | false | false | false | 0 |
ib_sa_service_rec_query(struct ib_sa_client *client,
struct ib_device *device, u8 port_num, u8 method,
struct ib_sa_service_rec *rec,
ib_sa_comp_mask comp_mask,
int timeout_ms, gfp_t gfp_mask,
void (*callback)(int status,
struct ib_sa_service_rec *resp,
void *conte... | false | false | false | false | false | 0 |
workoutTreeWidgetSelectionChanged()
{
QModelIndex current = workoutTree->currentIndex();
QModelIndex target = sortModel->mapToSource(current);
QString filename = workoutModel->data(workoutModel->index(target.row(), 0), Qt::DisplayRole).toString();
// wip away the current selected workout
if (ergFil... | false | false | false | false | false | 0 |
i_names(UChar* key ARG_UNUSED, NameEntry* e, INamesArg* arg)
{
int r = (*(arg->func))(e->name,
e->name + e->name_len,
e->back_num,
(e->back_num > 1 ? e->back_refs : &(e->back_ref1)),
arg->reg, arg->arg);
if (r != 0) {
arg->ret = r;
return ST_STOP;
... | false | false | false | false | false | 0 |
space_init (AmitkSpace * space) {
AmitkAxis i_axis;
space->offset = zero_point;
for (i_axis=0; i_axis<AMITK_AXIS_NUM; i_axis++)
space->axes[i_axis] = base_axes[i_axis];
} | false | false | false | false | false | 0 |
write_settings_bookmarks(GigoloSettings *settings)
{
GKeyFile *k;
const gchar *name;
gsize i;
GigoloBookmark *bm;
GigoloBookmarkList *bml;
GigoloSettingsPrivate *priv = GIGOLO_SETTINGS_GET_PRIVATE(settings);
if (! g_file_test(priv->config_path, G_FILE_TEST_IS_DIR))
g_mkdir_with_parents(priv->config_path, 0700... | false | false | false | false | false | 0 |
gtex_write_begin (FILE * f, unsigned char style)
{
if (style == gregoriotex_ignore_style)
{
return;
}
switch (style)
{
case ST_ITALIC:
fprintf (f, "\\greitalic{");
break;
case ST_SMALL_CAPS:
fprintf (f, "\\gresmallcaps{");
break;
case ST_BOLD:
fprintf (f, ... | false | false | false | false | false | 0 |
add_temp_log(int min_severity)
{
log_severity_list_t *s = tor_malloc_zero(sizeof(log_severity_list_t));
set_log_severity_config(min_severity, LOG_ERR, s);
LOCK_LOGS();
add_stream_log_impl(s, "<temp>", fileno(stdout));
tor_free(s);
logfiles->is_temporary = 1;
UNLOCK_LOGS();
} | false | false | false | false | false | 0 |
remove_all_aux(const path& p, fs::file_type type,
error_code* ec)
{
boost::uintmax_t count = 1;
if (type == fs::directory_file) // but not a directory symlink
{
for (fs::directory_iterator itr(p);
itr != end_dir_itr; ++itr)
{
fs::file_type tmp_type = query_file_type(i... | false | false | false | false | false | 0 |
cray_skel_SetColorAt(int sel, Geom *geom, va_list *args)
{
ColorA *color;
int vindex, findex, *eindex;
color = va_arg(*args, ColorA *);
vindex = va_arg(*args, int);
findex = va_arg(*args, int);
eindex = va_arg(*args, int *);
if (crayHasVColor(geom, NULL)) {
if (vindex != -1)
return (void *)(lon... | false | false | false | false | false | 0 |
getDiagrams() const {
tcPDPtr gamma = getParticleData(ParticleID::gamma);
tcPDPtr Z0 = getParticleData(ParticleID::Z0);
for ( PDVector::const_iterator l = theLeptonFlavours.begin();
l != theLeptonFlavours.end(); ++l )
for ( PDVector::const_iterator q = theQuarkFlavours.begin();
q != theQuarkFlavours.end... | false | false | false | false | false | 0 |
add_ex_def(Quadruple* qptr, IntSet ex_def, Quadruple** last_send, int var_num)
{
for (; qptr != NULL; qptr = qptr->next) {
switch (qptr->ope) {
case OPE_STORE:
if (qptr->op[0]->kind == KIND_VAR
&& qptr->op[0]->entry < var_num) {
add1_IntSet(ex_def, qptr->op[0]->entry);
}
break;
case OPE_SEND... | false | false | false | false | false | 0 |
copy_existing_file(FILE *f, char *infname)
{
FILE *in = fopen(infname, "r");
char buffer[1024];
size_t l;
if (in == NULL) {
fprintf(stderr, "genarch.c: can't open %s for reading\n", infname);
fclose(f);
return exit_FAILED;
}
while (!feof(in)) {
l = fread(buffer, ... | false | false | false | false | true | 1 |
vgetcpu_cpu_notifier(struct notifier_block *n, unsigned long action, void *arg)
{
long cpu = (long)arg;
if (action == CPU_ONLINE || action == CPU_ONLINE_FROZEN)
smp_call_function_single(cpu, vgetcpu_cpu_init, NULL, 1);
return NOTIFY_DONE;
} | false | false | false | false | false | 0 |
type2_sbw(gs_type1_state * pcis, cs_ptr csp, cs_ptr cstack, ip_state_t * ipsp,
bool explicit_width)
{
t1_hinter *h = &pcis->h;
fixed sbx = fixed_0, sby = fixed_0, wx, wy = fixed_0;
int code;
if (explicit_width) {
wx = cstack[0] + pcis->pfont->data.nominalWidthX;
memmove(cstack... | false | true | false | false | false | 1 |
fg_iptables(struct filter *filter, int flags)
{
long feat = 0;
int r = 0;
struct fg_misc misc = { flags, &feat };
fg_callback cb_iptables = {
rule: cb_iptables_rule,
group: cb_iptables_group,
};
const int nchains = 3;
filter_unroll(&filter);
filter_apply_flags(filter, flags);
if(... | false | false | false | false | false | 0 |
search_for_mapped_con(void)
{
int i, retval = 0;
for (i = first_fb_vc; i <= last_fb_vc; i++) {
if (con2fb_map[i] != -1)
retval = 1;
}
return retval;
} | false | false | false | false | false | 0 |
can_schedule(RESULT* rp, ACTIVE_TASK* atp) {
double wss;
if (max_concurrent_exceeded(rp)) return false;
if (atp) {
// don't schedule if something's pending
//
switch (atp->task_state()) {
case PROCESS_ABORT_PENDING:
case PROCESS_QUIT_PENDING:
return false;
}
if ... | false | false | false | false | false | 0 |
goo_canvas_crossing (GtkWidget *widget,
GdkEventCrossing *event)
{
GooCanvas *canvas = GOO_CANVAS (widget);
if (event->window != canvas->canvas_window)
return FALSE;
/* This will result in synthesizing focus_in/out events as appropriate. */
update_pointer_item (canvas, (GdkEvent*) eve... | false | false | false | false | false | 0 |
AllocateInNewSpace(Register object_size,
Register result,
Register result_end,
Register scratch,
Label* gc_required,
All... | false | false | false | false | false | 0 |
RedrawBackground(const PG_Rect& rect) {
if(GetBulkMode()) {
return;
}
PG_Rect fillrect = rect;
if(!my_background || !enableBackground) {
SDL_FillRect(screen, const_cast<PG_Rect*>(&fillrect), my_backcolor.MapRGB(screen->format));
return;
}
if(my_backmode == PG_Draw::STRETCH &&
(my_background->w !=... | false | false | false | false | false | 0 |
PGTYPESinterval_from_asc(char *str, char **endptr)
{
interval *result = NULL;
fsec_t fsec;
struct tm tt,
*tm = &tt;
int dtype;
int nf;
char *field[MAXDATEFIELDS];
int ftype[MAXDATEFIELDS];
char lowstr[MAXDATELEN + MAXDATEFIELDS];
char *realptr;
char **ptr = (endptr != NULL) ? endptr : ... | true | true | false | false | false | 1 |
execute( Chuck_VM * vm, Chuck_VM_Shred * shred )
{
t_CKUINT *& reg_sp = (t_CKUINT *&)shred->reg->sp;
Chuck_String * lhs = NULL;
Chuck_String ** rhs_ptr = NULL;
// pop word from reg stack
pop_( reg_sp, 2 );
// the previous reference
rhs_ptr = (Chuck_String **)(*(reg_sp+1));
// copy poppe... | false | false | false | false | false | 0 |
mark_related(dns_name_t *name, dns_rdataset_t *rdataset,
isc_boolean_t external, isc_boolean_t gluing)
{
name->attributes |= DNS_NAMEATTR_CACHE;
if (gluing) {
rdataset->trust = dns_trust_glue;
/*
* Glue with 0 TTL causes problems. We force the TTL to
* 1 second to prevent this.
*/
if (rdataset->... | false | false | false | false | false | 0 |
ipmi_ek_display_chassis_info_area(FILE * input_file, long offset)
{
size_t file_offset;
int ret = 0;
unsigned char data = 0;
unsigned char ch_len = 0;
unsigned char ch_type = 0;
unsigned int len;
if (input_file == NULL) {
lprintf(LOG_ERR, "No file stream to read.");
return (-1);
}
printf("%s\n", EQUAL_LIN... | false | false | false | false | false | 0 |
pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error)
{
GDataGDWhenPrivate *priv = GDATA_GD_WHEN (parsable)->priv;
xmlChar *start_time, *end_time;
gint64 start_time_int64, end_time_int64;
gboolean is_date = FALSE;
/* Start time */
start_time = xmlGetProp (ro... | 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.