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 |
|---|---|---|---|---|---|---|
replaySolution(const std::string &codename)
{
static LevelStatus *levelStatus = NULL;
static DescFinder *desc = NULL;
if (levelStatus == NULL) {
levelStatus = new LevelStatus();
desc = new WorldMap();
}
levelStatus->prepareRun(codename, "", 0, "");
std::string moves = levelStatu... | false | false | false | false | false | 0 |
get_reply(int fd, char *buff, struct mpc_parameters *params)
{
int retval;
uint32_t type;
uint8_t length, *tlvs, *end_of_tlvs;
struct le_config_frame *frame;
retval = read(fd, buff, MAXFRAME);
if (retval < 0) return -1;
frame = (struct le_config_frame *)buff;
... | false | false | false | false | false | 0 |
script_by_name(const char *name) {
int i;
int l;
if (name == NULL) {
return(num_scripts == 1 ? 0 : -1);
}
/* Parse script number */
if (isdigit(*name)) {
i = atoi(name);
--i;
if (i >= 0 && i < num_scripts)
return(i);
}
/* Parse script name *... | false | false | false | false | false | 0 |
ttl_model_class_new (const gchar *classname)
{
OntologyClass *def = NULL;
def = g_new0 (OntologyClass, 1);
def->classname = g_strdup (classname);
def->superclasses = NULL;
def->subclasses = NULL;
def->in_domain_of = NULL;
def->in_range_of = NULL;
def->description = NULL;
def->instances = NULL;
def->notify =... | false | false | false | false | false | 0 |
encrypt_cmd (int argc, char *argv[])
{
struct encryptlist *c;
if (argc < 2)
{
fprintf (stderr,
"Need an argument to 'encrypt' command. 'encrypt ?' for help.\n");
return 0;
}
c = (struct encryptlist *)
genget (argv[1], (char **) EncryptList, sizeof (struct encryptlist));
if (c ... | false | false | false | false | false | 0 |
_buildMapBoneByHandle(const Skeleton* src,
BoneHandleMap& boneHandleMap) const
{
ushort numSrcBones = src->getNumBones();
boneHandleMap.resize(numSrcBones);
for (ushort handle = 0; handle < numSrcBones; ++handle)
{
boneHandleMap[handle] = handle;
}
} | false | false | false | false | false | 0 |
verify_changes (int num)
{
int i;
rtx last_validated = NULL_RTX;
/* The changes have been applied and all INSN_CODEs have been reset to force
rerecognition.
The changes are valid if we aren't given an object, or if we are
given a MEM and it still is a valid address, or if this is in insn
and... | false | false | false | true | true | 1 |
csv_export_custom_entry_cb (GtkWidget *widget, gpointer user_data )
{
CsvExportInfo *info = user_data;
const gchar *custom_str;
GtkAssistant *assistant = GTK_ASSISTANT(info->window);
gint num = gtk_assistant_get_current_page (assistant);
GtkWidget *page = gtk_assistant_get_nth_page (assistant, num)... | false | false | false | false | false | 0 |
clearvalues (global_State *g, GCObject *l, GCObject *f) {
for (; l != f; l = gco2t(l)->gclist) {
Table *h = gco2t(l);
Node *n, *limit = gnodelast(h);
int i;
for (i = 0; i < h->sizearray; i++) {
TValue *o = &h->array[i];
if (iscleared(g, o)) /* value was collected? */
setnilvalue(o... | false | false | false | false | false | 0 |
test_diff_rename__rejected_match_can_match_others_two(void)
{
git_reference *head, *selfsimilar;
git_index *index;
git_tree *tree;
git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;
git_diff *diff;
git_diff_options diffopts = GIT_DIFF_OPTIONS_INIT;
git_diff_find_options findopts = GIT_DIFF_FIND_OPTIONS_INIT;... | false | false | false | false | false | 0 |
PopFrame() {
size_t prev_size = pxmlnsDepthStack_->back();
pxmlnsDepthStack_->pop_back();
if (prev_size < pxmlnsStack_->size()) {
pxmlnsStack_->erase(pxmlnsStack_->begin() + prev_size,
pxmlnsStack_->end());
}
} | false | false | false | false | false | 0 |
PackBitsDecode(TIFF* tif, tidata_t op, tsize_t occ, tsample_t s)
{
char *bp;
tsize_t cc;
long n;
int b;
(void) s;
bp = (char*) tif->tif_rawcp;
cc = tif->tif_rawcc;
while (cc > 0 && (long)occ > 0) {
n = (long) *bp++, cc--;
/... | false | false | false | false | false | 0 |
cut_buf(mud_channel *pc, char *buf, int size)
{
int len;
if (pc->rcnt > size)
{
/* Return part of rbuf. */
len = size;
memcpy(buf, &pc->rbuf[pc->rindex], len);
pc->rindex += len;
pc->rcnt -= len;
}
else
{
/* Return all of rbuf. */
len = pc->rcnt;
memcpy... | false | false | false | false | false | 0 |
finish_struct_anon (tree t)
{
tree field;
for (field = TYPE_FIELDS (t); field; field = DECL_CHAIN (field))
{
if (TREE_STATIC (field))
continue;
if (TREE_CODE (field) != FIELD_DECL)
continue;
if (DECL_NAME (field) == NULL_TREE
&& ANON_AGGR_TYPE_P (TREE_TYPE (field)))
{
bool is_union ... | false | false | false | false | false | 0 |
cb_addclientuser()
{
struct remote dummr;
struct cluhost_ddata ddata;
GtkWidget *dlg;
dlg = make_cluhost_dlg(toplevel, "Create new Client user record", &ddata);
dummr.hostname[0] = '\0';
dummr.alias[0] = '\0';
dummr.dosuser[0] = '\0';
dummr.hostid = 0;
while (gtk_dialog_run(GTK_DIALOG(dlg)) == GTK_RESPO... | false | false | false | false | false | 0 |
string_write_xml(output::pointer fp, const char *name, const nstring &value)
{
if (!name)
name = "string";
fp->fprintf("<%s>", name);
fp->fputs_xml(value);
fp->fprintf("</%s>\n", name);
} | false | false | false | false | false | 0 |
printSSECC(const MCInst *MI, unsigned Op,
raw_ostream &O) {
switch (MI->getOperand(Op).getImm()) {
default: assert(0 && "Invalid ssecc argument!");
case 0: O << "eq"; break;
case 1: O << "lt"; break;
case 2: O << "le"; break;
case 3: O << "unord"; break;
case 4: O << "ne... | false | false | false | false | false | 0 |
retain_large_bitmap (StgPtr p, StgLargeBitmap *large_bitmap, nat size,
StgClosure *c, retainer c_child_r)
{
nat i, b;
StgWord bitmap;
b = 0;
bitmap = large_bitmap->bitmap[b];
for (i = 0; i < size; ) {
if ((bitmap & 1) == 0) {
retainClosure((StgClosure *)*p, c, c_child_r);
}
i++;
... | false | false | false | false | false | 0 |
skip_comment(
FILE * f)
{
int i = getc (f);
switch (i)
{
case '/':
i = skip_cpp_comment(f);
break;
case '*':
i = skip_c_comment(f);
break;
default:
WARNING (_("Profile contains unpalatable characters"), 0, 0);
}... | false | false | false | false | false | 0 |
xsltXPathFunctionLookup (xmlXPathContextPtr ctxt,
const xmlChar *name, const xmlChar *ns_uri) {
xmlXPathFunction ret;
if ((ctxt == NULL) || (name == NULL) || (ns_uri == NULL))
return (NULL);
#ifdef WITH_XSLT_DEBUG_FUNCTION
xsltGenericDebug(xsltGenericDebugContext,
"Lookup function {%s}%s\... | false | false | false | false | false | 0 |
Apply(HighlightLanguage lang, cbStyledTextCtrl* control, bool isC)
{
if (!control)
return;
control->StyleClearAll();
if (lang == HL_NONE)
return;
// first load the default colours to all styles used by the actual lexer (ignoring some built-in styles)
OptionColour* defaults = GetDef... | false | false | false | false | false | 0 |
emitForm_C(const Instruction *i, uint32_t opc, uint8_t ctg)
{
code[0] = ctg;
code[1] = opc << 20;
emitPredicate(i);
defId(i->def(0), 2);
switch (i->src(0).getFile()) {
case FILE_MEMORY_CONST:
code[1] |= 0x4 << 28;
setCAddress14(i->src(0));
break;
case FILE_GPR:
code[1] |=... | false | false | false | false | false | 0 |
arbitraryAxis(const dimeVec3f &givenaxis, dimeVec3f &newaxis)
{
dimeVec3f yaxis(0.0, 1.0, 0.0);
dimeVec3f zaxis(0.0, 0.0, 1.0);
if (fabs(givenaxis[0]) < ARBBOUND &&
fabs(givenaxis[1]) < ARBBOUND)
newaxis = yaxis.cross(givenaxis);
else
newaxis = zaxis.cross(givenaxis);
newaxis.normalize();... | false | false | false | false | false | 0 |
vmemmap_populate_basepages(unsigned long start,
unsigned long end, int node)
{
unsigned long addr = start;
pgd_t *pgd;
pud_t *pud;
pmd_t *pmd;
pte_t *pte;
for (; addr < end; addr += PAGE_SIZE) {
pgd = vmemmap_pgd_populate(addr, node);
if (!pgd)
return -ENOMEM;
pud = vmemmap_pud_populate(pgd, addr,... | false | false | false | false | false | 0 |
_nm_client_is_object_path (const char *string)
{
gsize i;
if (!g_utf8_validate (string, -1, NULL))
return FALSE;
/* The path must begin with an ASCII '/' (integer 47) character */
if (string[0] != '/')
return FALSE;
for (i = 1; string[i]; i++) {
/* Each element must only contain the ASCII characters
* ... | false | false | false | false | false | 0 |
verify_pfn(ulong pfn)
{
int i;
physaddr_t mask;
if (!machdep->max_physmem_bits)
return TRUE;
mask = 0;
for (i = machdep->max_physmem_bits; i < machdep->bits; i++)
mask |= ((physaddr_t)1 << i);
if (mask & PTOB(pfn))
return FALSE;
return TRUE;
} | false | false | false | false | false | 0 |
fs_read (struct fs_filehandle *fsf, void *b, unsigned int size)
{
if (fsf->fstype == FS_ARCHIVE)
return zfile_read_archive (fsf->zf, b, size);
else if (fsf->fstype == FS_DIRECTORY)
return my_read (fsf->of, b, size);
else if (fsf->fstype == FS_CDFS)
return isofs_read (fsf->isof, b, size);
return 0;
} | false | false | false | false | false | 0 |
mwl8k_sta_add(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_sta *sta)
{
struct mwl8k_priv *priv = hw->priv;
int ret;
int i;
struct mwl8k_vif *mwl8k_vif = MWL8K_VIF(vif);
struct ieee80211_key_conf *key;
if (!priv->ap_fw) {
ret = mwl8k_cmd_update_stadb_add(hw, vif, sta);
if (ret ... | false | false | false | false | false | 0 |
ecbpvalloc(pEpoint, buf, buflen, nlen, pbound)
EPOINT *pEpoint;
word2 *buf;
size_t buflen;
int nlen;
unsigned *pbound;
{
word2 *xx, *yy;
size_t totsize, anz0;
int maxdiff, k, m, n;
unsigned bound;
k = ECMAXIDX - 1;
bound = *pbound;
if(bound > ECbpbound[k]) {
bound = ECbpbound[k];
... | false | false | false | false | false | 0 |
bound_holder_changed_cb (GdaHolder *alias_of, GdaHolder *holder)
{
gda_holder_lock ((GdaLockable*) holder);
gda_holder_lock ((GdaLockable*) alias_of);
g_assert (alias_of == holder->priv->simple_bind);
const GValue *cvalue;
GError *lerror = NULL;
cvalue = gda_holder_get_value (alias_of);
if (! gda_holder_set_val... | false | false | false | false | false | 0 |
_midgard_user_set_property (GObject *object, guint property_id,
const GValue *value, GParamSpec *pspec)
{
MidgardUser *self = MIDGARD_USER(object);
switch (property_id) {
case MIDGARD_USER_LOGIN:
g_free (self->priv->login);
self->priv->login = g_value_dup_string (value);
break;
case MIDGARD_US... | false | false | false | false | false | 0 |
asn1p_oid_compare(asn1p_oid_t *a, asn1p_oid_t *b) {
int i;
for(i = 0; ; i++) {
asn1c_integer_t cmp;
if(b->arcs_count > i) {
if(a->arcs_count <= i)
return -1;
} else if(a->arcs_count > i) {
if(b->arcs_count <= i)
return 1;
} else if(b->arcs_count <= i && a->arcs_count <= i) {
cmp = b->arcs_c... | false | false | false | false | false | 0 |
mdio_write(struct nic *nic __unused, int phy_id, int location, int value)
{
int i;
int cmd = (0x5002 << 16) | (phy_id << 23) | (location<<18) | value;
long mdio_addr = ioaddr + CSR9;
#ifdef TULIP_DEBUG_WHERE
whereami("mdio_write\n");
#endif
if (tp->chip_id == LC82C168) {
int i = 1000;
outl(cmd, ... | false | false | false | false | false | 0 |
GL_FindImage (char *name, imagetype_t type)
{
image_t *image = NULL;
int len;
byte *pic, *palette;
int width, height;
char shortname[MAX_QPATH];
if (!name)
goto ret_image; // Com_Error (ERR_DROP, "GL_FindImage: NULL name");
len = strlen(name);
if (len < 5)
goto ret_image; // Com_Error (ERR... | false | false | false | false | false | 0 |
cifs_fscache_release_page(struct page *page, gfp_t gfp)
{
if (PageFsCache(page)) {
struct inode *inode = page->mapping->host;
struct cifsInodeInfo *cifsi = CIFS_I(inode);
cifs_dbg(FYI, "%s: (0x%p/0x%p)\n",
__func__, page, cifsi->fscache);
if (!fscache_maybe_release_page(cifsi->fscache, page, gfp))
retu... | false | false | false | false | false | 0 |
init_expr_once ()
{
rtx insn, pat;
enum machine_mode mode;
int num_clobbers;
rtx mem, mem1;
rtx reg;
/* Try indexing by frame ptr and try by stack ptr.
It is known that on the Convex the stack ptr isn't a valid index.
With luck, one or the other is valid on any machine. */
mem = gen_rtx_MEM (V... | false | false | false | false | false | 0 |
rt_overlay_update_sizes(RendererTiles *rt)
{
GList *work;
work = rt->overlay_list;
while (work)
{
OverlayData *od = work->data;
work = work->next;
if (!od->window) rt_overlay_init_window(rt, od);
if (od->flags & OVL_RELATIVE)
{
gint x, y, w, h;
rt_overlay_get_position(rt, od, &x, &y, &w, &... | false | false | false | false | false | 0 |
editcust(VOID_A)
{
int n;
switch (custno) {
case 0:
n = (basiccustom) ? basicenv[cs_item] : cs_item;
n = editenv(n);
cs_max = (basiccustom) ? nbasic : ENVLISTSIZ;
break;
case 1:
if ((n = editbind(cs_item))) cs_max = maxbind + 1;
break;
# ifndef _NOKEYMAP
case 2:
n = editkeymap(cs_item);
... | false | false | false | false | false | 0 |
fl_get_string_width( int style,
int size,
const char * s,
int len )
{
XFontStruct *fs = fl_get_font_struct( style, size );
return fli_no_connection ? ( len * size ) : XTextWidth( fs, s, len );
} | false | false | false | false | false | 0 |
reloc_symbols (MonoImageWriter *acfg, ElfSymbol *symbols, ElfSectHeader *sheaders, ElfStrTable *strtab, gboolean dynamic)
{
BinSection *section;
BinSymbol *symbol;
int i;
i = 1;
if (dynamic) {
for (section = acfg->sections; section; section = section->next) {
if (section->parent)
continue;
symbols [i]... | false | false | false | false | false | 0 |
formatMIME(FILE* fd, MIMEState& mime, MsgFmt& msg)
{
fxStr emsg;
if (mime.parse(msg, emsg)) {
if (verbose)
mime.trace(stderr);
// XXX anything but us-ascii is treated as ISO-8859-1
setISO8859(mime.getCharset() != CS_USASCII);
/*
* Check first for any external script/command to
* use in converting... | false | false | false | false | false | 0 |
tetravex_pause_cb (Tetravex* self, GSimpleAction* action, GVariant* parameter) {
Puzzle* _tmp0_;
Puzzle* _tmp1_;
gboolean _tmp2_;
gboolean _tmp3_;
GAction* _tmp4_ = NULL;
GSimpleAction* _tmp5_;
GSimpleAction* solve;
GSimpleAction* _tmp6_;
Puzzle* _tmp7_;
gboolean _tmp8_;
gboolean _tmp9_;
Puzzle* _tmp10_;
g... | false | false | false | false | false | 0 |
xi(C* argv0)
{
ovliInstall();
dyldSlowInstall(argv0); /* both dyme 0 and dyme 2 */
esfInstall();
#if !defined(_INTERPRETER_ONLY)
CppInstall();
#endif
cInstall();
sysInstall();
binaryInstall();
#if !defined(_INTERPRETER_ONLY)
/* TK set backing store */
s_backingStoreOption(_backing_store);
XaInstall();
if (_l... | false | false | false | false | true | 1 |
picolcd_debug_flash_write(struct file *f, const char __user *u,
size_t s, loff_t *off)
{
struct picolcd_data *data = f->private_data;
ssize_t err, ret = 0;
int report_erase, report_write;
if (s == 0)
return -EINVAL;
if (*off > 0x5fff)
return -ENOSPC;
if (s & 0x3f)
return -EINVAL;
if (*off & 0x3f)
retu... | false | false | false | false | false | 0 |
dw_dma_tasklet(unsigned long data)
{
struct dw_dma *dw = (struct dw_dma *)data;
struct dw_dma_chan *dwc;
u32 status_block;
u32 status_xfer;
u32 status_err;
int i;
status_block = dma_readl(dw, RAW.BLOCK);
status_xfer = dma_readl(dw, RAW.XFER);
status_err = dma_readl(dw, RAW.ERROR);
dev_vdbg(dw->dma.dev, "%s:... | false | false | false | false | false | 0 |
compensate_drift(GwyContainer *data, GwyRunType run)
{
DriftArgs args;
GwyDataField *dfield, *mfield, *sfield;
gint id;
g_return_if_fail(run & DRIFT_RUN_MODES);
drift_load_args(gwy_app_settings_get(), &args);
gwy_app_data_browser_get_current(GWY_APP_DATA_FIELD, &dfield,
... | false | false | false | false | false | 0 |
mkey (header *hd)
{ int scan,key;
key=wait_key(&scan);
if (scan==escape) { output("Interrupt\n"); error=1; return; }
if (key) new_real(key,"");
else new_real(scan,"");
} | false | false | false | false | false | 0 |
buildNormalizedQueryHash(double inPositiveRelevanceSum,
double inNegativeRelevanceSum,
CWeightingFunctionPointerHash& inoutQFW) const{
//Just to make sure...
mWeighter->getQueryNormalizer()->reset();
mWeighter->getDocumentNormalizer()->reset();
/* for every weighting function, meaning for every eleme... | false | false | false | false | false | 0 |
libssh2_publickey_remove_ex(LIBSSH2_PUBLICKEY * pkey,
const unsigned char *name, unsigned long name_len,
const unsigned char *blob, unsigned long blob_len)
{
LIBSSH2_CHANNEL *channel;
LIBSSH2_SESSION *session;
/* 22 = packet_len(4) + remove_len(4) + "r... | false | true | false | false | false | 1 |
vt_omp_parallel_begin(uint32_t tid)
{
GET_THREAD_ID(tid);
#if 0 /* it's not clear whether it's necessary to restart hardware counters
(e.g. PAPI) for new parallel regions, but it's definitely very
expensive; disabled for now */
#if defined(VT_METR)
if ( tid > 0 && vt_metric_num() > 0 && !VTTHRD_M... | false | false | false | false | false | 0 |
configure_notify(Window* w, XConfigureEvent& xe) {
moved_ = true;
if (resized_) {
if (xe.width != canvas_->pwidth() || xe.height != canvas_->pheight()) {
resize(w, xe.width, xe.height);
}
} else {
canvas_->psize(xe.width, xe.height);
needs_resize_ = true;
}
} | false | false | false | false | false | 0 |
os_get_sysinfo(int code, void *param, long *result)
{
switch (code)
{
case SYSINFO_TEXT_HILITE:
*result = 1;
return TRUE;
case SYSINFO_BANNERS:
*result = 1;
return TRUE;
case SYSINFO_TEXT_COLORS:
*result = SYSINFO_TXC... | false | false | false | false | false | 0 |
uip_match_alternatives (sc_ptnoderef_t node)
{
sc_ptnoderef_t child;
sc_int start_posn, extent;
sc_bool matched;
/* Note the start position for rewind between tries. */
start_posn = uip_posn;
/*
* Try a match on each of the children, looking to see which one moves the
* position on the furthest. Ma... | false | false | false | false | false | 0 |
writeall(const char * buf)
{
int i;
for (i = 0; i < fcnt; i++) {
fprintf(ufiles[i].fp, "%s\n", buf);
fflush(ufiles[i].fp);
}
} | false | false | false | false | false | 0 |
mono_decimalCompare(/*[In]*/decimal_repr* pA, /*[In]*/decimal_repr* pB)
{
int log2a, log2b, delta, sign;
decimal_repr aa;
MONO_ARCH_SAVE_REGS;
sign = (pA->signscale.sign) ? -1 : 1;
if (pA->signscale.sign ^ pB->signscale.sign) {
return (decimalIsZero(pA) && decimalIsZero(pB)) ? 0 : sign;
... | false | false | false | false | false | 0 |
setup_camera (CheeseWidget *widget)
{
CheeseWidgetPrivate *priv = widget->priv;
gchar *webcam_device = NULL;
gint x_resolution;
gint y_resolution;
gdouble brightness;
gdouble contrast;
gdouble saturation;
gdouble hue;
g_settings_get (priv->settings, "photo-x-resolution", "i", &x_resolution);
g_sett... | false | false | false | false | false | 0 |
setGrid( AbstractGrid* grid )
{
QAbstractItemModel* model = d->grid->model();
if ( grid == 0 ) grid = &d->default_grid;
if ( d->grid ) disconnect( d->grid );
d->grid = grid;
connect( d->grid, SIGNAL(gridChanged()), this, SLOT(slotGridChanged()) );
d->grid->setModel( model );
slotGridChanged(... | false | false | false | false | false | 0 |
read_char(ScmObj port)
{
const ScmSpecialCharInfo *info;
size_t len;
scm_ichar_t c, next;
#if SCM_USE_R6RS_CHARS
scm_ichar_t unicode;
#endif
int err;
char buf[CHAR_LITERAL_LEN_MAX + sizeof("")];
DECLARE_INTERNAL_FUNCTION("read");
/* raw char (multibyte-ready) */
c = scm_port_get_cha... | true | true | false | false | false | 1 |
print_header(struct ifstat_list *ifs, int options) {
struct ifstat_data *ptr, *start;
int len, pos, line;
if (options & OPT_TIMESTAMP)
fputs(" Time " SPACE, stdout);
else if (options & OPT_WRAP)
putc(' ', stdout);
pos = 0;
line = 0;
start = ifs->first;
for (ptr = ifs->first; ptr != NULL; ptr... | false | false | false | false | false | 0 |
DLOpen(const v8::Arguments& args) {
HandleScope scope;
char symbol[1024], *base, *pos;
uv_lib_t lib;
node_module_struct compat_mod;
uv_err_t err;
int r;
if (args.Length() < 2) {
Local<Value> exception = Exception::Error(
String::New("process.dlopen takes exactly 2 arguments."));
return Th... | false | false | false | false | false | 0 |
glade_widget_pack_property_reset (GladeWidget * widget,
const gchar * id_property)
{
GladeProperty *property;
g_return_val_if_fail (GLADE_IS_WIDGET (widget), FALSE);
if ((property = glade_widget_get_pack_property (widget, id_property)) != NULL)
{
glade_property_reset ... | false | false | false | false | false | 0 |
check_new(struct state *st, const void *const p) {
unsigned int bits = 8 * sizeof(void*);
const size_t raw_p = PTR2nat(p);
/* This effectively rotates the value right by the number of low always-0
bits in an aligned pointer. The assmption is that most (if not all)
pointers are aligned, and the... | false | false | false | false | false | 0 |
nvme_dev_remove_admin(struct nvme_dev *dev)
{
if (dev->ctrl.admin_q && !blk_queue_dying(dev->ctrl.admin_q)) {
/*
* If the controller was reset during removal, it's possible
* user requests may be waiting on a stopped queue. Start the
* queue to flush these to completion.
*/
blk_mq_start_stopped_hw_queu... | false | false | false | false | false | 0 |
memory_repr(PyMemoryViewObject *self)
{
if (self->flags & _Py_MEMORYVIEW_RELEASED)
return PyUnicode_FromFormat("<released memory at %p>", self);
else
return PyUnicode_FromFormat("<memory at %p>", self);
} | false | false | false | false | false | 0 |
load_self2_seq_start(struct seq_file *s, loff_t *pos)
{
struct task_smack *tsp = current_security();
return smk_seq_start(s, pos, &tsp->smk_rules);
} | false | false | false | false | false | 0 |
_ecore_evas_ews_init(void)
{
_ecore_evas_init_count++;
if (_ecore_evas_init_count > 1) return _ecore_evas_init_count;
_ecore_evas_ews_env_setup();
return _ecore_evas_init_count;
} | false | false | false | false | false | 0 |
__ecereMethod_HTMLView_OnOpen(struct __ecereNameSpace__ecere__com__Instance * this, char * href)
{
struct HTMLView * __ecerePointer_HTMLView = (struct HTMLView *)(this ? (((char *)this) + __ecereClass_HTMLView->offset) : 0);
char newLocation[797];
strcpy(newLocation, __ecerePointer_HTMLView->location ? __ecerePointer_... | false | false | false | true | true | 1 |
loop_has_blocks_with_irreducible_flag (struct loop *loop)
{
unsigned i;
basic_block *bbs = get_loop_body_in_dom_order (loop);
bool res = true;
for (i = 0; i < loop->num_nodes; i++)
if (bbs[i]->flags & BB_IRREDUCIBLE_LOOP)
goto end;
res = false;
end:
free (bbs);
return res;
} | false | false | false | false | false | 0 |
mceusb_cmd_datasize(u8 cmd, u8 subcmd)
{
int datasize = 0;
switch (cmd) {
case MCE_CMD_NULL:
if (subcmd == MCE_CMD_PORT_SYS)
datasize = 1;
break;
case MCE_CMD_PORT_SYS:
switch (subcmd) {
case MCE_RSP_GETPORTSTATUS:
datasize = 5;
break;
case MCE_RSP_EQWAKEVERSION:
datasize = 4;
break;
cas... | false | false | false | false | false | 0 |
L26()
{register object *base=vs_base;
register object *sup=base+VM26; VC26
vs_check;
{object V121;
object V122;
V121=(base[0]);
V122=(base[1]);
vs_top=sup;
goto TTL;
TTL:;
{object V123;
object V124;
register object V125;
register object V126;
V123= Cnil;
V124= Cnil;
V125= Cnil;
V126= Cnil;
V124= (V121)... | false | false | false | false | false | 0 |
tdb_brunlock(struct tdb_context *tdb,
int rw_type, tdb_off_t offset, size_t len)
{
if (tdb->flags & TDB_NOLOCK) {
return TDB_SUCCESS;
}
if (!check_lock_pid(tdb, "tdb_brunlock", true))
return TDB_ERR_LOCK;
if (unlock(tdb, rw_type, offset, len) == -1) {
return tdb_logerr(tdb, TDB_ERR_LOCK, TDB_LOG_ERRO... | false | false | false | false | false | 0 |
statbuf_eq(const uv_stat_t* a, const uv_stat_t* b) {
return a->st_ctim.tv_nsec == b->st_ctim.tv_nsec
&& a->st_mtim.tv_nsec == b->st_mtim.tv_nsec
&& a->st_birthtim.tv_nsec == b->st_birthtim.tv_nsec
&& a->st_ctim.tv_sec == b->st_ctim.tv_sec
&& a->st_mtim.tv_sec == b->st_mtim.tv_sec
&& a->s... | false | false | false | false | false | 0 |
add_index_entry_with_check(struct index_state *istate, struct cache_entry *ce, int option)
{
int pos;
int ok_to_add = option & ADD_CACHE_OK_TO_ADD;
int ok_to_replace = option & ADD_CACHE_OK_TO_REPLACE;
int skip_df_check = option & ADD_CACHE_SKIP_DFCHECK;
cache_tree_invalidate_path(istate->cache_tree, ce->name);
... | false | false | false | false | false | 0 |
flam3_print_to_string(flam3_genome *cp) {
FILE *tmpflame;
long stringbytes;
char *genome_string;
tmpflame = tmpfile();
flam3_print(tmpflame,cp,NULL,flam3_dont_print_edits);
stringbytes = ftell(tmpflame);
fseek(tmpflame,0L, SEEK_SET);
genome_string = (char *)calloc(stringbytes+1,1);
if (s... | false | false | false | false | true | 1 |
tryrearr(node *p, boolean *success)
{
/* evaluates one rearrangement of the tree.
if the new tree has greater "likelihood" than the old
one sets success = TRUE and keeps the new tree.
otherwise, restores the old tree */
node *forknode, *newfork, *other, *oldthere;
double oldlike;
boolean oldmulf;... | false | true | false | false | false | 1 |
OTF_Reader_readCollopCountSnapshot( OTF_RBuffer* buffer,
OTF_HandlerArray* handlers ) {
uint32_t communicator;
uint64_t count;
if ( handlers->pointer[OTF_COLLOPCOUNTSNAPSHOT_RECORD] == NULL ) {
return OTF_RBuffer_readNewline( buffer );
}
communicat... | false | false | false | false | false | 0 |
format_output(const char *arg, char *string, char *format)
{
char *pos1, *pos2, buffer[bsize];
pos1 = &format[0];
strncpy(buffer, string, bsize);
string[0] = '\0';
while((pos2 = strstr(pos1, "%")) != NULL)
{
strncat(string, pos1, (size_t)(pos2-pos1));
... | false | false | false | false | false | 0 |
getMd5FromFile(string filename) {
if (!gcry_check_version (GCRYPT_VERSION)) {
Log::err("Unable to use GNU Crypt library to calculate MD5 - wrong version!");
return "";
}
if (!gcry_control (GCRYCTL_INITIALIZATION_FINISHED_P)) {
gcry_control (GCRYCTL_DISABLE_SECMEM, 0); /* Disable s... | false | false | false | false | false | 0 |
tr(char *str, char *orig, char *sub, char *del, int squeezeRep)
{
char c, a[1024], b[1024], d[1024];
int tab[256], i, cc, s1, s2;
char *q, *p=str;
for (i = 0; i < 256; ++i) {
tab[i] = i;
}
strcpy(a, expand(orig));
strcpy(b, expand(sub));
strcpy(d, expand(del));
s1 = strlen(a... | true | true | false | false | false | 1 |
display_target_options ()
{
int undoc, i;
static bool displayed = false;
/* Avoid double printing for --help --target-help. */
if (displayed)
return;
displayed = true;
if (ARRAY_SIZE (target_switches) > 1
#ifdef TARGET_OPTIONS
|| ARRAY_SIZE (target_options) > 1
#endif
)
{
int do... | true | true | false | false | true | 1 |
gaussFunc(float anX, float coeffs[], float *yFit, float derY[],
int nTerms)
{
float z, ez;
if (coeffs[3] != 0.0)
{
/* get z */
z = (anX - coeffs[2]) / coeffs[3];
/* gaussian part */
ez = exp( -(pow(z,2.)) / 2.);
}
else
{
z = 100.;
ez = 0.0;
}
switch... | false | false | false | true | false | 1 |
snd_ctl_subscribe_events(struct snd_ctl_file *file, int __user *ptr)
{
int subscribe;
if (get_user(subscribe, ptr))
return -EFAULT;
if (subscribe < 0) {
subscribe = file->subscribed;
if (put_user(subscribe, ptr))
return -EFAULT;
return 0;
}
if (subscribe) {
file->subscribed = 1;
return 0;
} else if... | false | false | false | false | false | 0 |
resolve(const std::string& symbol)
{
#ifdef USE_DYN
// Just in case the handle has been corrupted
if(handle == 0)
return 0;
// Lookup the symbol name
void *adr = dlsym(handle,symbol.c_str());
const char *error = dlerror();
// If the error is not NULL, then the dlsym call failed
if(error != 0)
{
if(last_e... | false | false | false | false | false | 0 |
rtl_p2p_info(struct ieee80211_hw *hw, void *data, unsigned int len)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
struct ieee80211_hdr *hdr = data;
if (!mac->p2p)
return;
if (mac->link_state != MAC80211_LINKED)
return;
/* min. beacon length + FCS_LEN */
if (len <= 4... | false | false | false | false | false | 0 |
_cmsInstallAllocFunctions(cmsPluginMemHandler* Plugin, _cmsMemPluginChunkType* ptr)
{
if (Plugin == NULL) {
memcpy(ptr, &_cmsMemPluginChunk, sizeof(_cmsMemPluginChunk));
}
else {
ptr ->MallocPtr = Plugin -> MallocPtr;
ptr ->FreePtr = Plugin -> FreePtr;
ptr ->ReallocPtr ... | false | true | false | false | false | 1 |
slurmdbd_unpack_acct_coord_msg(dbd_acct_coord_msg_t **msg,
uint16_t rpc_version, Buf buffer)
{
uint32_t uint32_tmp;
int i;
char *acct = NULL;
uint32_t count = 0;
dbd_acct_coord_msg_t *msg_ptr = xmalloc(sizeof(dbd_acct_coord_msg_t));
*msg = msg_ptr;
safe_unpack32(&count, buffer);
if (count) {
msg_pt... | false | false | false | false | false | 0 |
hmm_Q(const hmm_par_t *hp, const hmm_exp_t *he)
{
FLOAT sum = 0.0;
int bb, k, l;
for (bb = 0; bb != he->m; ++bb) {
FLOAT *eb = hp->e[bb], *Eb = he->E[bb];
for (k = 0; k != hp->n; ++k) {
if (eb[k] <= 0.0) return -HMM_INF;
sum += Eb[k] * log(eb[k]);
}
}
for (k = 0; k != he->n; ++k) {
FLOAT *Ak = he->A[... | false | false | false | false | false | 0 |
dict_get(PyDictObject *mp, PyObject *args)
{
PyObject *key;
PyObject *failobj = Py_None;
PyObject *val = NULL;
Py_hash_t hash;
PyDictKeyEntry *ep;
PyObject **value_addr;
if (!PyArg_UnpackTuple(args, "get", 1, 2, &key, &failobj))
return NULL;
if (!PyUnicode_CheckExact(key) ||
... | false | false | false | false | false | 0 |
translate( char * buf)
{
switch ( myterm )
{
case IBM_TERM :
StrIBM ( buf );
break ;
case ASCII_TERM :
StrAscii( buf );
break ;
case ISO_TERM :
StrISO ( buf );
break ;
}
} | false | false | false | false | false | 0 |
createPascalTag (tagEntryInfo* const tag,
const vString* const name, const int kind,
const char *arglist, const char *vartype)
{
if (PascalKinds [kind].enabled && name != NULL && vStringLength (name) > 0)
{
initTagEntry (tag, vStringValue (name));
tag->kindName = PascalKinds... | false | false | false | false | false | 0 |
PrintSymbolTable(const ObjectFile *o) {
outs() << "SYMBOL TABLE:\n";
if (const COFFObjectFile *coff = dyn_cast<const COFFObjectFile>(o))
PrintCOFFSymbolTable(coff);
else {
error_code ec;
for (symbol_iterator si = o->begin_symbols(),
se = o->end_symbols(); si != se; si.increme... | false | false | false | false | false | 0 |
gkm_sexp_unref (gpointer data)
{
GkmSexp *sexp = data;
g_return_if_fail (sexp);
if (--(sexp->refs) == 0) {
g_assert (sexp->real);
gcry_sexp_release (sexp->real);
g_slice_free (GkmSexp, sexp);
}
} | false | false | false | false | false | 0 |
heap_xlog_clean(XLogRecPtr lsn, XLogRecord *record, bool clean_move)
{
xl_heap_clean *xlrec = (xl_heap_clean *) XLogRecGetData(record);
Buffer buffer;
Page page;
OffsetNumber *end;
OffsetNumber *redirected;
OffsetNumber *nowdead;
OffsetNumber *nowunused;
int nredirected;
int ndead;
int nunused;
Size ... | false | false | false | false | false | 0 |
getFileName()
{
QString ret = mPath.c_str();
ret += "/";
ret += sFileName;
outDebug(4,std::cout << "file name=" << ret.toStdString() << std::endl);
return ret;
} | false | false | false | false | false | 0 |
hex_document_redo(HexDocument *doc)
{
if(doc->undo_stack == NULL || doc->undo_top == doc->undo_stack)
return FALSE;
g_signal_emit(G_OBJECT(doc), hex_signals[REDO], 0);
return TRUE;
} | false | false | false | false | false | 0 |
duration_units_changed_cb (GtkWidget* widget, Application* self) {
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
application_save_duration (self);
} | false | false | false | false | false | 0 |
iwl_force_rf_reset(struct iwl_priv *priv, bool external)
{
struct iwl_rf_reset *rf_reset;
if (test_bit(STATUS_EXIT_PENDING, &priv->status))
return -EAGAIN;
if (!iwl_is_any_associated(priv)) {
IWL_DEBUG_SCAN(priv, "force reset rejected: not associated\n");
return -ENOLINK;
}
rf_reset = &priv->rf_reset;
rf... | false | false | false | false | false | 0 |
RrMinHeight(RrAppearance *a)
{
gint i;
gint l, t, r, b;
RrSize *m;
gint h = 0;
RrMargins(a, &l, &t, &r, &b);
for (i = 0; i < a->textures; ++i) {
switch (a->texture[i].type) {
case RR_TEXTURE_NONE:
break;
case RR_TEXTURE_MASK:
h = MAX(h, a->textur... | false | false | false | false | false | 0 |
table_ATANH (struct GMTMATH_INFO *info, double **stack[], GMT_LONG *constant, double *factor, GMT_LONG last, GMT_LONG col, GMT_LONG n_row)
/*OPERATOR: ATANH 1 1 atanh (A). */
{
GMT_LONG i;
double a = 0.0;
if (gmtdefs.verbose && constant[last] && fabs (factor[last]) >= 1.0) fprintf (stderr, "%s: Warning, |operand| ... | false | false | false | false | false | 0 |
ns_cprint(register const u_char *cp)
{
register u_int i;
if (!TTEST2(*cp, 1))
return (NULL);
i = *cp++;
if (fn_printn(cp, i, snapend))
return (NULL);
return (cp + i);
} | 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.