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 |
|---|---|---|---|---|---|---|
canon_propA0(struct exifprop *aprop, struct exifprop *prop,
unsigned char *off, struct exiftags *t)
{
switch (aprop->tag) {
case 9:
exifstralloc(&aprop->str, 32);
snprintf(aprop->str, 31, "%d K", aprop->value);
break;
default:
return (FALSE);
}
return (TRUE);
} | false | false | false | false | false | 0 |
varKind(n) /* return (possibly cached) var */
Int n; { /* function kind */
typeOff = newKindvars(n+1);
if (n>=MAXKINDFUN)
typeIs = makeVarKind(n);
else if (nonNull(varKindCache[n]))
typeIs = varKindCache[n];
else
typeIs = varKindCache[n] = makeVarKind(n);
} | false | false | false | false | true | 1 |
S_save_lines(pTHX_ AV *array, SV *sv)
{
const char *s = SvPVX_const(sv);
const char * const send = SvPVX_const(sv) + SvCUR(sv);
I32 line = 1;
PERL_ARGS_ASSERT_SAVE_LINES;
while (s && s < send) {
const char *t;
SV * const tmpstr = newSV_type(SVt_PVMG);
t = (const char *)memchr(s, '\n', send - s... | false | false | false | false | false | 0 |
cr_parser_dump_err_stack (CRParser * a_this, gboolean a_clear_errs)
{
GList *cur = NULL;
g_return_val_if_fail (a_this && PRIVATE (a_this), CR_BAD_PARAM_ERROR);
if (PRIVATE (a_this)->err_stack == NULL)
return CR_OK;
for (cur = PRIVATE (a_this)->err_stack; cur; cur = cur... | false | false | false | false | false | 0 |
radeon_bo_kunmap(struct radeon_bo *bo)
{
if (bo->kptr == NULL)
return;
bo->kptr = NULL;
radeon_bo_check_tiling(bo, 0, 0);
ttm_bo_kunmap(&bo->kmap);
} | false | false | false | false | false | 0 |
set_use_system_ca_file (SoupSession *session, gboolean use_system_ca_file)
{
SoupSessionPrivate *priv = SOUP_SESSION_GET_PRIVATE (session);
GTlsDatabase *system_default;
priv->tlsdb_use_default = FALSE;
system_default = g_tls_backend_get_default_database (g_tls_backend_get_default ());
if (use_system_ca_file)
... | false | false | false | false | false | 0 |
rpi_pin_get(uint8_t pin)
{
// this will check pin validity as well
int fd = rpi_pin_fd(pin);
if (fd < 0)
return -1;
if (!(pin_flags[pin] & FPIN_DIR_INPUT))
return -1;
return rpi_pin_poll_clear(fd);
} | false | false | false | false | false | 0 |
put_closing(void)
{
fprintf(output_file, "showpage grestore\n");
needed = 1;
if (anim_cur + 1 >= anim_amount) fprintf(output_file, "%%%%EOF\n");
} | false | false | false | false | false | 0 |
print_total()
{
int j;
total = 0;
variance = 0;
for(j = 0; j < cycles; j++)
total += measure[j];
average = total / cycles;
for(j = 0; j < cycles; j++)
variance += (measure[j] - average) * (measure[j] - average);
stddev = sqrt(variance / (cycles - 1));
printf("%9.4f +/- %9.4f ", average, stddev);
if(measu... | false | false | false | false | false | 0 |
btrfs_end_buffer_write_sync(struct buffer_head *bh, int uptodate)
{
if (uptodate) {
set_buffer_uptodate(bh);
} else {
struct btrfs_device *device = (struct btrfs_device *)
bh->b_private;
btrfs_warn_rl_in_rcu(device->dev_root->fs_info,
"lost page write due to IO error on %s",
rcu_str_deref(device-... | false | false | false | false | false | 0 |
rowCount(const QModelIndex &parent) const
{
// prevent trees
if (parent.isValid())
return 0;
return d->_sqlModel->rowCount(parent);
} | false | false | false | false | false | 0 |
mlx4_get_internal_clock_params(struct mlx4_dev *dev,
struct mlx4_clock_params *params)
{
struct mlx4_priv *priv = mlx4_priv(dev);
if (mlx4_is_slave(dev))
return -ENOTSUPP;
if (!params)
return -EINVAL;
params->bar = priv->fw.clock_bar;
params->offset = priv->fw.clock_offset;
params->size = MLX4_CLOCK... | false | false | false | false | false | 0 |
gst_matroska_read_common_tracknumber_unique (GstMatroskaReadCommon * common,
guint64 num)
{
gint i;
g_assert (common->src->len == common->num_streams);
for (i = 0; i < common->src->len; i++) {
GstMatroskaTrackContext *context = g_ptr_array_index (common->src, i);
if (context->num == num)
retur... | false | false | false | false | false | 0 |
setUpDownBonds(int atomNo, int parity, TSimpleMolecule & sm, std::vector<int>& iA1, std::vector<int>& iA2, std::vector<int>& stereoBonds) {
int i,k;
for (i=0; i<sm.nBonds(); i++) if (stereoBonds[i] == -1) {
if ((sm.getBond(i)->at[0] == atomNo) || (sm.getBond(i)->at[1] == atomNo)) {
if (sm.get... | false | false | false | false | false | 0 |
sha256_self_test()
{
int i, j;
char output[65];
context_sha256_T ctx;
char_u buf[1000];
char_u sha256sum[32];
static int failures = 0;
char_u *hexit;
static int sha256_self_tested = 0;
if (sha256_self_tested > 0)
return failures > 0 ? FAIL : OK;
... | true | true | false | false | true | 1 |
png_format_buffer(png_structp png_ptr, png_charp buffer, png_const_charp
error_message)
{
int iout = 0, iin = 0;
while (iin < 4)
{
int c = png_ptr->chunk_name[iin++];
if (isnonalpha(c))
{
buffer[iout++] = PNG_LITERAL_LEFT_SQUARE_BRACKET;
buffer[iout++] = png_digit[(c & 0... | false | false | false | false | false | 0 |
event( StandardEvent eventid , const QString& title, const QString& text,
const QPixmap& pixmap, QWidget *widget, const NotificationFlags &flags)
{
QString message;
switch ( eventid ) {
case Warning:
message = QLatin1String("warning");
break;
case Error:
message = QLatin1String("fatalerror");
break;... | false | false | false | false | false | 0 |
dw_volume_lvf( FMField *out, FMField *bf, FMField *forceQP,
VolumeGeometry *vg, int32 *elList, int32 elList_nRow )
{
int32 ii, iel, dim, nQP, nFEP, ret = RET_OK;
FMField *outQP = 0;
nFEP = bf->nCol;
nQP = vg->det->nLev;
dim = forceQP->nRow;
fmf_createAlloc( &outQP, 1, nQP, dim * nFEP, 1 );
/* ou... | false | false | false | false | false | 0 |
wrapper_hash(wrapperobject *wp)
{
int x, y;
x = _Py_HashPointer(wp->descr);
if (x == -1)
return -1;
y = PyObject_Hash(wp->self);
if (y == -1)
return -1;
x = x ^ y;
if (x == -1)
x = -2;
return x;
} | false | false | false | false | false | 0 |
sw_core_constructed (GObject *object)
{
SwCore *core = SW_CORE (object);
SwCorePrivate *priv = core->priv;
GError *error = NULL;
const char *modules;
priv->banned_uids = sw_ban_load (NULL);
priv->connection = dbus_g_bus_get (DBUS_BUS_STARTER, &error);
if (error) {
g_warning ("Failed to open connecti... | false | false | false | false | false | 0 |
drawPolyline( QPainter *painter, const QPolygonF &polygon )
{
QRectF clipRect;
const bool deviceClipping = isClippingNeeded( painter, clipRect );
QPolygonF cpa = polygon;
if ( deviceClipping )
cpa = QwtClipper::clipPolygonF( clipRect, cpa );
::drawPolyline( painter,
cpa.constData()... | false | false | false | false | false | 0 |
PrintImmediateOp(byte* data) {
bool byte_size_immediate = (*data & 0x02) != 0;
byte modrm = *(data + 1);
int mod, regop, rm;
get_modrm(modrm, &mod, ®op, &rm);
const char* mnem = "Imm???";
switch (regop) {
case 0:
mnem = "add";
break;
case 1:
mnem = "or";
break;
case 2:... | false | false | false | false | false | 0 |
initializeReverse(const ReadTable* pRT)
{
size_t numReads = pRT->getCount();
m_table.reserve(numReads);
for(size_t i = 0; i < numReads; ++i)
{
SeqItem read = pRT->getRead(i);
read.seq.reverse();
addRead(read);
}
} | false | false | false | false | false | 0 |
open_rx(struct atm_vcc *vcc)
{
IADEV *iadev;
u_short __iomem *vc_table;
u_short __iomem *reass_ptr;
IF_EVENT(printk("iadev: open_rx %d.%d\n", vcc->vpi, vcc->vci);)
if (vcc->qos.rxtp.traffic_class == ATM_NONE) return 0;
iadev = INPH_IA_DEV(vcc->dev);
if (vcc->qos.rxtp.traffic_class == ATM_... | false | false | false | false | false | 0 |
selected_line_exists(char *text, char start_char)
{
char *p;
if (!text)
return 0;
while (1) {
if (*text == start_char)
return 1;
p = strchr(text, '\n');
if (p)
text = p+1;
else
break;
}
return 0;
} | false | false | false | false | false | 0 |
ipmi_get_oem(struct ipmi_intf * intf)
{
/* Execute a Get Device ID command to determine the OEM */
struct ipmi_rs * rsp;
struct ipmi_rq req;
struct ipm_devid_rsp *devid;
if (intf->fd == 0) {
if( sel_iana != IPMI_OEM_UNKNOWN ){
return sel_iana;
}
return IPMI_OEM_UNKNOWN;
}
memset(&req, 0, sizeof(req))... | false | false | false | false | false | 0 |
releaseNode(SUnit *SU,
unsigned ReadyCycle) {
if (ReadyCycle < MinReadyCycle)
MinReadyCycle = ReadyCycle;
// Check for interlocks first. For the purpose of other heuristics, an
// instruction that cannot issue appears as if it's not in the ReadyQueue.
if... | false | false | false | false | false | 0 |
i915_hotplug_interrupt_update_locked(struct drm_i915_private *dev_priv,
uint32_t mask,
uint32_t bits)
{
uint32_t val;
assert_spin_locked(&dev_priv->irq_lock);
WARN_ON(bits & ~mask);
val = I915_READ(PORT_HOTPLUG_EN);
val &= ~mask;
val |= bits;
I915_WRITE(PORT_HOTPLUG_EN, val);
} | false | false | false | false | false | 0 |
dropAllReferences() {
for (iterator I = begin(), E = end(); I != E; ++I)
I->dropAllReferences();
// Delete all basic blocks.
while (!BasicBlocks.empty()) {
// If there is still a reference to the block, it must be a 'blockaddress'
// constant pointing to it. Just replace the BlockAddress with unde... | false | false | false | false | false | 0 |
operator<< (const char *str)
{
if (blackhole_mode) return *this;
if (copy_to_stderr) cerr << str;
line_lock.lock();
linequeue.push(str);
line_lock.unlock();
return *this;
} | false | false | false | false | false | 0 |
altivec_indexed_or_indirect_operand_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
#line 717 "../../src/gcc/config/rs6000/predicates.md"
{
op = XEXP (op, 0);
if (VECTOR_MEM_ALTIVEC_OR_VSX_P (mode)
&& GET_CODE (op) == AND
&& GET_CODE (XEXP (op, 1)) == CONST_INT
&& INTVAL (XEXP (op, 1)) == -16)... | false | false | false | false | false | 0 |
scan_for_dirty(struct ubifs_info *c,
int min_space, int pick_free,
int exclude_index)
{
const struct ubifs_lprops *lprops;
struct ubifs_lpt_heap *heap;
struct scan_data data;
int err, i;
/* There may be an LEB with enough dirty space on the free heap */
heap = &c->lpt_heap[LPROPS_FREE - 1];
for (i... | false | false | false | false | false | 0 |
Stmt_addMETA(CTX ctx, kStmtExpr *stmt, tkitr_t *itr)
{
int i, e;
kTerm **ts = itr->ts;
if(itr->meta == -1 || STT_(stmt) == STT_DONE || STT_(stmt) == STT_ERR) {
return ;
}
e = (itr->meta < itr->c) ? itr->c : itr->e;
if(IS_NULL(DP(stmt)->metaDictCaseMap)) {
KNH_SETv(ctx, DP(stmt)->metaDictCaseMap, new_DictMap0(... | false | false | false | false | false | 0 |
operator= (const qmcpit&qpit)
{
spec= qpit.spec;
if(halton)
delete halton;
if(qpit.halton)
halton= new HaltonSequence(*(qpit.halton));
else
halton= NULL;
return*this;
} | false | false | false | false | false | 0 |
idl_firstid( IDList *idl )
{
if ( idl == NULL || idl->b_nids == 0 ) {
return( NOID );
}
if ( ALLIDS( idl ) ) {
return( idl->b_nids == 1 ? NOID : 1 );
}
return( idl->b_ids[0] );
} | false | false | false | false | false | 0 |
saveConfigFile( const QDomDocument& doc,
const QString& filename, const KComponentData &_componentData )
{
KComponentData componentData = _componentData.isValid() ? _componentData : KGlobal::mainComponent();
QString xml_file(filename);
if (QDir::isRelativePath(xml_file)... | false | false | false | false | false | 0 |
load_icons_handler (gpointer data)
{
IconToLoad *icon;
gboolean long_operation = FALSE;
load_icons_handler_again:
if (!icons_to_load) {
load_icons_id = 0;
do_icons_to_add ();
return FALSE;
}
icon = icons_to_load->data;
icons_to_load->data = NULL;
/* pop */
icons_to_load = g_list_delete_link (icons_... | false | false | false | false | false | 0 |
issmp(int verb)
{
vm_offset_t paddr;
mpfps_t mpfps;
verbose_mp=verb;
/* open physical memory for access to MP structures */
if ((pfd = open("/dev/mem", O_RDONLY)) < 0) {
fprintf(stderr, "issmp(): /dev/mem: %s\n", strerror(errno));
return -1;
}
/* probe for MP structures */
if (apic_probe(&paddr) <= 0)
r... | false | false | false | false | false | 0 |
display_external(Object image, int width, int height,
int ox, int oy, struct window *w)
{
Display *dpy;
Window root;
/*int screen;*/
translationP trans = NULL;
XSetWindowAttributes xswa;
XColor cdef, hdef;
/*Visual *vis;*/
/*Colormap xcmap;*/
int border = BORD... | false | false | false | false | false | 0 |
getDefaultHeight(){
FXint th,ih,h1,h2;
th=ih=0;
if(!label.empty()) th=labelHeight(label);
if(icon) ih=icon->getHeight();
if(!(options&(ICON_ABOVE_TEXT|ICON_BELOW_TEXT))) h1=FXMAX(th,ih); else h1=th+ih;
if(!altlabel.empty()) th=labelHeight(altlabel);
if(alticon) ih=alticon->getHeight();
if(!(options&(I... | false | false | false | false | false | 0 |
scm_lfwrite (const char *ptr, size_t size, SCM port)
{
scm_t_port *pt = SCM_PTAB_ENTRY (port);
scm_t_ptob_descriptor *ptob = &scm_ptobs[SCM_PTOBNUM (port)];
if (pt->rw_active == SCM_PORT_READ)
scm_end_input (port);
ptob->write (port, ptr, size);
for (; size; ptr++, size--) {
if (*ptr == '\a') {
... | false | false | false | false | false | 0 |
sshfwd_write(struct ssh_channel *c, char *buf, int len)
{
Ssh ssh = c->ssh;
if (ssh->state == SSH_STATE_CLOSED)
return 0;
if (ssh->version == 1) {
send_packet(ssh, SSH1_MSG_CHANNEL_DATA,
PKT_INT, c->remoteid,
PKT_INT, len, PKTT_DATA, PKT_DATA, buf, len,
PKTT_OTHER, PKT_END);
/*
* In... | false | false | false | false | false | 0 |
direxists (const char *dir)
{
struct_stat64 buf;
return __xstat64 (_STAT_VER, dir, &buf) == 0 && S_ISDIR (buf.st_mode);
} | false | false | false | false | false | 0 |
icon_to_load_free (IconToLoad *icon)
{
if (!icon)
return;
if (icon->pixmap)
g_object_unref (icon->pixmap);
icon->pixmap = NULL;
if (icon->gicon)
g_object_unref (icon->gicon);
icon->gicon = NULL;
g_free (icon->image); icon->image = NULL;
g_free (icon->fallback_image); icon->fallback_image = NULL... | false | false | false | false | false | 0 |
prism2_ioctl_priv_hostapd(local_info_t *local, struct iw_point *p)
{
struct prism2_hostapd_param *param;
int ret = 0;
int ap_ioctl = 0;
if (p->length < sizeof(struct prism2_hostapd_param) ||
p->length > PRISM2_HOSTAPD_MAX_BUF_SIZE || !p->pointer)
return -EINVAL;
param = kmalloc(p->length, GFP_KERNEL);
if... | false | false | false | false | false | 0 |
cont_print_text(char *text, size_t size)
{
size_t textlen = 0;
size_t len;
if (cont.cons == 0 && (console_prev & LOG_NEWLINE)) {
textlen += print_time(cont.ts_nsec, text);
size -= textlen;
}
len = cont.len - cont.cons;
if (len > 0) {
if (len+1 > size)
len = size-1;
memcpy(text + textlen, cont.buf + c... | false | false | false | false | false | 0 |
purgeModelObjects()
{
ModelObjectArray::iterator end_pos = modelObjects->end();
ModelObjectArray::iterator pos = modelObjects->begin();
while (pos != end_pos) {
delete (*pos);
pos++;
}
delete modelObjects;
modelObjects = NULL;
} | false | false | false | false | false | 0 |
reverse_bits(gchar *c, gint n)
{
gint i;
for (i = 0; i < n; i++, c++)
*c = (((*c * 0x0802UL & 0x22110UL) |
(*c * 0x8020UL & 0x88440UL)) * 0x10101UL) >> 16;
} | false | false | false | false | false | 0 |
lookdict_unicode(PyDictObject *mp, PyObject *key,
Py_hash_t hash, PyObject ***value_addr)
{
size_t i;
size_t perturb;
PyDictKeyEntry *freeslot;
size_t mask = DK_MASK(mp->ma_keys);
PyDictKeyEntry *ep0 = &mp->ma_keys->dk_entries[0];
PyDictKeyEntry *ep;
/* Make sure this funct... | false | false | false | false | false | 0 |
idle_timeout_func (gpointer data)
{
GttIdleDialog *idle_dialog = (GttIdleDialog *) data;
GdkWindow *gdk_window = gtk_widget_get_root_window (app_window);
XID drawable = gdk_x11_drawable_get_xid (GDK_DRAWABLE(gdk_window));
Status xss_query_ok = XScreenSaverQueryInfo (idle_dialog->display,
drawable,
... | false | false | false | false | false | 0 |
wi_mutable_string_set_format(wi_mutable_string_t *string, wi_string_t *fmt, ...) {
va_list ap;
WI_RUNTIME_ASSERT_MUTABLE(string);
va_start(ap, fmt);
wi_mutable_string_set_format_and_arguments(string, fmt, ap);
va_end(ap);
} | false | false | false | false | false | 0 |
zapCosts()
{
int iSequence;
double infeasibilityCost = model_->infeasibilityCost();
// zero out all costs
int numberTotal = numberColumns_ + numberRows_;
if (CLP_METHOD1) {
int n = start_[numberTotal];
memset(cost_, 0, n * sizeof(double));
for (iSequence = 0; iSequ... | false | false | false | false | false | 0 |
on_staged_button_press (GtkWidget *widget,
GdkEventButton *event,
GitgCommitView *view)
{
GitgChangedFile *file;
if (event->type != GDK_BUTTON_PRESS)
{
return;
}
if (event->button == 1 &&
column_icon_test (view->priv->tree_view_staged,
... | false | false | false | false | false | 0 |
move( Direction::DirectionEnum dir, bool isDown)
{
// XTRACE();
_moveCam = isDown;
switch( dir)
{
case Direction::eDown:
_cameraMove = 180.0;
break;
case Direction::eUp:
_cameraMove = 0.0;
break;
case Direction::eLeft:
_cameraMove = 90.0;
break;
case Direction::eRight:... | false | false | false | false | false | 0 |
HandleModHitChance(bool apply, bool /*Real*/)
{
Unit* target = GetTarget();
if (target->GetTypeId() == TYPEID_PLAYER)
{
((Player*)target)->UpdateMeleeHitChances();
((Player*)target)->UpdateRangedHitChances();
}
else
{
target->m_modMeleeHitChance += apply ? m_modifier.m_a... | false | false | false | false | false | 0 |
RestoreRolloutRolloutContext(rolloutcontext * prc, const char *sz)
{
char *pc = strstr(sz, "RC");
char szTemp[1024];
int fCubeful, fVarRedn, fInitial, fRotate, fTruncBearoff2, fTruncBearoffOS;
fCubeful = FALSE;
fVarRedn = FALSE;
fInitial = FALSE;
prc->nTruncate = 0;
prc->nTrials = 0;
... | true | true | false | false | false | 1 |
cmd_dedicate (int interactive UNUSED, struct cmdarg **args)
{
rp_frame *f;
f = current_frame();
if (!f) return cmdret_new (RET_SUCCESS, NULL);
if (args[0])
/* Whatever you set it to. */
f->dedicated = ARG(0,number);
else
/* Just toggle it, rather than on or off. */
f->dedicated = !(f->dedica... | false | false | false | false | false | 0 |
free_ice(ICE_S **ice)
{
if(ice && *ice){
if((*ice)->tice)
free_ice(&(*ice)->tice);
clear_ice(ice);
fs_give((void **) ice);
}
} | false | false | false | false | false | 0 |
jbg_buf_free(struct jbg_buf **free_list)
{
struct jbg_buf *tmp;
while (*free_list) {
tmp = (*free_list)->next;
checked_free(*free_list);
*free_list = tmp;
}
return;
} | false | false | false | false | false | 0 |
operator==(const QContactDetail& other) const
{
if (! (d.constData()->m_definitionName == other.d.constData()->m_definitionName))
return false;
if (d.constData()->m_access != other.d.constData()->m_access)
return false;
if (d.constData()->m_values != other.d.constData()->m_values)
... | false | false | false | false | false | 0 |
mouseMoveEvent( QGraphicsSceneMouseEvent *event )
{
QGraphicsItem::mouseMoveEvent( event );
if ( ( mMousePressPoint - event->scenePos() ).toPoint().manhattanLength() > DRAG_THRESHOLD_DISTANCE )
{
//Select this item
setSelected( true );
/*
//Unselect all other items
int index = 0;
while ( scene()->selected... | false | false | false | false | false | 0 |
rc_list_remove(struct rc_list ** list, struct rc_list * rm_value)
{
if (*list == rm_value) {
*list = rm_value->Next;
return;
}
rm_value->Prev->Next = rm_value->Next;
if (rm_value->Next) {
rm_value->Next->Prev = rm_value->Prev;
}
} | false | false | false | false | false | 0 |
ds3234_probe(struct spi_device *spi)
{
struct rtc_device *rtc;
unsigned char tmp;
int res;
spi->mode = SPI_MODE_3;
spi->bits_per_word = 8;
spi_setup(spi);
res = ds3234_get_reg(&spi->dev, DS3234_REG_SECONDS, &tmp);
if (res != 0)
return res;
/* Control settings
*
* CONTROL_REG
* BIT 7 6 5 4 3 2 1 0
... | false | false | false | false | false | 0 |
isapnp_checksum ( struct isapnp_identifier *identifier ) {
unsigned int i, j;
unsigned int lfsr;
unsigned int byte;
lfsr = ISAPNP_LFSR_SEED;
for ( i = 0 ; i < 8 ; i++ ) {
byte = * ( ( ( uint8_t * ) identifier ) + i );
for ( j = 0 ; j < 8 ; j++ ) {
lfsr = isapnp_lfsr_next ( lfsr, byte );
byte >>= 1;
}
... | false | false | false | false | false | 0 |
alloc_str(void)
{
int err;
struct string *str = malloc(sizeof *str);
if (!str)
return NULL;
memset(str, 0, sizeof *str);
err = str_resize(str, INITIAL_CAPACITY);
if (err) {
free(str);
return NULL;
}
memset(str->value, 0, str->capacity);
return str;
} | false | false | false | false | false | 0 |
set_cookie_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct nd_region *nd_region = to_nd_region(dev);
struct nd_interleave_set *nd_set = nd_region->nd_set;
if (is_nd_pmem(dev) && nd_set)
/* pass, should be precluded by region_visible */;
else
return -ENXIO;
return sprintf(buf, "%... | false | true | false | false | false | 1 |
dm_thin_find_block(struct dm_thin_device *td, dm_block_t block,
int can_issue_io, struct dm_thin_lookup_result *result)
{
int r;
__le64 value;
struct dm_pool_metadata *pmd = td->pmd;
dm_block_t keys[2] = { td->id, block };
struct dm_btree_info *info;
down_read(&pmd->root_lock);
if (pmd->fail_io) {
up... | false | false | false | false | false | 0 |
XpatAddLine( X1, Y1, X2, Y2, Layer )
long X1;
long Y1;
long X2;
long Y2;
short Layer;
{
xpatobj_list *Object;
autbegin();
Object = XpatAllocObject();
Object->LAYER = Layer;
Object->TYPE = XPAT_OBJECT_LINE;
Object->NEXT = XpatFigure->OBJECT[ Layer ];
if ( X1 > X2 )
{
SetXpa... | false | false | false | false | false | 0 |
var_eval (CSPARSE *parse, CSTREE *node, CSTREE **next)
{
NEOERR *err = STATUS_OK;
CSARG val;
parse->escaping.current = NEOS_ESCAPE_NONE;
err = eval_expr(parse, &(node->arg1), &val);
if (err) return nerr_pass(err);
if (val.op_type & (CS_TYPE_NUM | CS_TYPE_VAR_NUM))
{
char buf[256];
long int n_val;... | false | false | false | false | false | 0 |
insn_invalid_p (rtx insn)
{
rtx pat = PATTERN (insn);
int num_clobbers = 0;
/* If we are before reload and the pattern is a SET, see if we can add
clobbers. */
int icode = recog (pat, insn,
(GET_CODE (pat) == SET
&& ! reload_completed && ! reload_in_progress)
? &num_clobbers : 0);
... | false | false | false | false | false | 0 |
findTMatches(GTrackLocus& loctrack, int qcount) {
//perform an all vs. all ichain-match for all transcripts across all loctrack[i]->qloci
for (int q=0;q<qcount-1;q++) { //for each qry dataset
if (loctrack[q]==NULL) continue;
for (int qi=0;qi<loctrack[q]->Count();qi++) { // for each transcript in q dataset
GffO... | false | false | false | false | false | 0 |
GetDi (ATR* atr) {
if (UseDefaultBaudrateInSpecificMode(atr))
return 1;
else if (atr->ib[0][ATR_INTERFACE_BYTE_TA].present)
return (atr->ib[0][ATR_INTERFACE_BYTE_TA].value & 0x0F);
else
return 1; /* 1 */
} | false | false | false | false | false | 0 |
get_read_sizes (int fd, int *lines_available, int *bpl, int *total_lines)
{
struct {
Byte reserved1[8];
Byte line_width[2];
Byte total_lines[2];
Byte cur_line[2];
Byte lines_this_block[2];
Byte reserved[8];
} read_sizes;
const Byte scsi_read[] =
{
0x28, 0x00, /* opcode, lun */
... | false | false | false | false | false | 0 |
print() const
{
const CoinPackedVector & cutLbs = lbs();
const CoinPackedVector & cutUbs = ubs();
int i;
std::cout<<"Column cut has "
<<cutLbs.getNumElements()
<<" lower bound cuts and "
<<cutUbs.getNumElements()
<<" upper bound cuts"
<<std::endl;
for ( i=0; i<cutLbs.getNumElements(); i++ ... | false | false | false | false | false | 0 |
_equalRangeTblEntry(RangeTblEntry *a, RangeTblEntry *b)
{
COMPARE_SCALAR_FIELD(rtekind);
COMPARE_SCALAR_FIELD(relid);
COMPARE_SCALAR_FIELD(relkind);
COMPARE_NODE_FIELD(subquery);
COMPARE_SCALAR_FIELD(jointype);
COMPARE_NODE_FIELD(joinaliasvars);
COMPARE_NODE_FIELD(funcexpr);
COMPARE_NODE_FIELD(funccoltypes);
C... | false | false | false | false | false | 0 |
begin_update(struct view *view, bool refresh)
{
if (view->pipe)
end_update(view, TRUE);
if (refresh) {
if (!start_io(&view->io))
return FALSE;
} else {
if (view == VIEW(REQ_VIEW_TREE) && strcmp(view->vid, view->id))
opt_path[0] = 0;
if (!run_io_rd(&view->io, view->ops->argv, FORMAT_ALL))
return F... | false | false | false | false | false | 0 |
Feed(std::string const& obj)
{
// Construct the name of the next object.
this->NextObject =
this->LocalGenerator->Convert(obj.c_str(),
cmLocalGenerator::START_OUTPUT,
cmLocalGenerator::RESPONSE);
// Roll over to next string i... | false | false | false | false | false | 0 |
serviceThisCommand(DUL_NETWORKKEY ** network, DUL_ASSOCIATIONKEY ** association,
DUL_PRESENTATIONCONTEXT * ctx, MSG_TYPE messageType,
void **message, DUL_ASSOCIATESERVICEPARAMETERS * params,
DMAN_HANDLE ** handle)
{
CONDITION
cond;
MSG_GENERAL
* general;
general = *(MSG_GENERAL **) mess... | false | false | false | false | false | 0 |
kf_gammap(double s, double z)
{
return z <= 1. || z < s? _kf_gammap(s, z) : 1. - _kf_gammaq(s, z);
} | false | false | false | false | false | 0 |
GetValueAsString( int argFlags ) const
{
wxString text;
if ( !m_value.IsNull() )
{
wxPropertyGrid::DoubleToString(text,
m_value,
m_precision,
!(argFlags & wxPG_FULL_VALUE),
... | false | false | false | false | false | 0 |
get_body(mail::imap &imapAccount, Token t)
{
if (t == STRING)
next_func= &mail::imapFOLDER_COUNT::get_fetch_item;
if (t == STRING || t == LARGESTRING)
{
string buf=t.text;
size_t cr;
while ((cr=buf.find('\r')) != std::string::npos)
buf.erase(cr, 1);
if (imapAccount.currentFetch)
{
imapAccount.c... | false | false | false | false | false | 0 |
max98925_i2c_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
{
int ret, reg;
u32 value;
struct max98925_priv *max98925;
max98925 = devm_kzalloc(&i2c->dev,
sizeof(*max98925), GFP_KERNEL);
if (!max98925)
return -ENOMEM;
i2c_set_clientdata(i2c, max98925);
max98925->regmap = devm_regmap_... | false | false | false | false | false | 0 |
is_draw_sub(const string& str) {
string subname;
string::size_type i = str.find('.');
if (i != string::npos) {
subname = str.substr(0, i);
} else {
subname = str;
}
str_to_uppercase(subname);
return sub_find((char*)subname.c_str());
} | false | false | false | false | false | 0 |
try_to_optimize_kprobe(struct kprobe *p)
{
struct kprobe *ap;
struct optimized_kprobe *op;
/* Impossible to optimize ftrace-based kprobe */
if (kprobe_ftrace(p))
return;
/* For preparing optimization, jump_label_text_reserved() is called */
jump_label_lock();
mutex_lock(&text_mutex);
ap = alloc_aggr_kprobe... | false | false | false | false | false | 0 |
jpc_dec_mstab_lookup(uint_fast16_t id)
{
jpc_dec_mstabent_t *mstabent;
for (mstabent = jpc_dec_mstab; mstabent->id != 0; ++mstabent) {
if (mstabent->id == id) {
break;
}
}
return mstabent;
} | false | false | false | false | false | 0 |
oom_adjust(void)
{
int fd;
char path[ISCSI_OOM_PATH_LEN];
struct stat statb;
errno = 0;
if (nice(-10) == -1 && errno != 0)
log_debug(1, "Could not increase process priority: %s",
strerror(errno));
snprintf(path, ISCSI_OOM_PATH_LEN, "/proc/%d/oom_score_adj", getpid());
if (stat(path, &statb)) {
/* olde... | false | false | false | false | false | 0 |
gitg_repository_load (GitgRepository *self,
int argc,
gchar const **av,
GError **error)
{
g_return_val_if_fail (GITG_IS_REPOSITORY (self), FALSE);
if (self->priv->git_dir == NULL)
{
if (error)
{
*error = g_error_new_li... | false | false | false | false | false | 0 |
swap_children(Fl_Tree_Item *a, Fl_Tree_Item *b) {
int ax = -1, bx = -1;
for ( int t=0; t<children(); t++ ) { // find index for a and b
if ( _children[t] == a ) { ax = t; if ( bx != -1 ) break; else continue; }
if ( _children[t] == b ) { bx = t; if ( ax != -1 ) break; else continue; }
}
if ( ax == -1 || ... | false | false | false | false | false | 0 |
_cogl_closure_disconnect (CoglClosure *closure)
{
_cogl_list_remove (&closure->link);
if (closure->destroy_cb)
closure->destroy_cb (closure->user_data);
g_slice_free (CoglClosure, closure);
} | false | false | false | false | false | 0 |
cmd_server(cmd_parms *cmd, void *pcfg, const char *addr_and_port)
{
apr_status_t rv;
scgi_cfg *cfg = pcfg;
char *scope_id = NULL; /* A ip6 parameter - not used here. */
if (cmd->path == NULL)
return "not a server command";
rv = apr_parse_addr_port(&cfg->mount.addr, &scope_id, &cfg->mount.p... | false | false | false | false | false | 0 |
reshow_calltip(gpointer data)
{
GeanyDocument *doc;
g_return_val_if_fail(calltip.sci != NULL, FALSE);
SSM(calltip.sci, SCI_CALLTIPCANCEL, 0, 0);
doc = document_get_current();
if (doc && doc->editor->sci == calltip.sci)
{
/* we use the position where the calltip was previously started as SCI_GETCURRENTPOS
... | false | false | false | false | false | 0 |
png_write_png(png_structp png_ptr, png_infop info_ptr,
int transforms, voidp params)
{
if (png_ptr == NULL || info_ptr == NULL)
return;
#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)
/* invert the alpha channel from opacity to transparency */
if (transforms & PNG_TRANSFORM_INVERT_ALPH... | false | false | false | false | false | 0 |
adjleap(void)
{
register int i;
register zic_t last = 0;
/*
** propagate leap seconds forward
*/
for (i = 0; i < leapcnt; ++i) {
trans[i] = tadd(trans[i], last);
last = corr[i] += last;
}
} | false | false | false | false | false | 0 |
record_transform_info (DATASET *dset, double version)
{
int i, p, pv;
for (i=1; i<dset->v; i++) {
if (series_get_transform(dset, i) == LAGS) {
/* already handled */
continue;
}
pv = lag_from_label(i, dset, &p);
if (pv > 0) {
series_set_parent(dset, i, dset->varname[pv]);
series_set_tran... | false | false | false | false | false | 0 |
cpu_detect_cache_sizes(struct cpuinfo_x86 *c)
{
unsigned int n, dummy, ebx, ecx, edx, l2size;
n = c->extended_cpuid_level;
if (n >= 0x80000005) {
cpuid(0x80000005, &dummy, &ebx, &ecx, &edx);
c->x86_cache_size = (ecx>>24) + (edx>>24);
#ifdef CONFIG_X86_64
/* On K8 L1 TLB is inclusive, so don't count it */
c... | false | false | false | false | false | 0 |
xdr_Ganglia_metadata_msg (XDR *xdrs, Ganglia_metadata_msg *objp)
{
register int32_t *buf;
if (!xdr_Ganglia_msg_formats (xdrs, &objp->id))
return FALSE;
switch (objp->id) {
case gmetadata_full:
if (!xdr_Ganglia_metadatadef (xdrs, &objp->Ganglia_metadata_msg_u.gfull))
return FALSE;
break;
case gmetadat... | false | false | false | false | false | 0 |
tekvrom(void)
{
int x;
switch(tkcom[0]&0x18)
{
case 0x00: // 8KB
setchr8(chrlow[0]|(chrhigh[0]<<8));
break;
case 0x08: // 4KB
for(x=0;x<8;x+=4)
setchr4(x<<10,chrlow[x]|(chrhigh[x]<<8));
break;
case 0x10: // 2KB
for(x=0;x<8;x+=2)
setchr2(x... | false | false | false | false | false | 0 |
gx_ht_alloc_cache(gs_memory_t * mem, uint max_tiles, uint max_bits_size)
{
gx_ht_cache *pcache =
gs_alloc_struct(mem, gx_ht_cache, &st_ht_cache,
"alloc_ht_cache(struct)");
byte *tbits =
gs_alloc_bytes(mem, max_bits_size, "alloc_ht_cache(bits)");
gx_ht_tile *ht_tiles =
... | false | false | false | false | false | 0 |
xmlSecNssSignatureFinalize(xmlSecTransformPtr transform) {
xmlSecNssSignatureCtxPtr ctx;
xmlSecAssert(xmlSecNssSignatureCheckId(transform));
xmlSecAssert(xmlSecTransformCheckSize(transform, xmlSecNssSignatureSize));
xmlSecAssert((transform->operation == xmlSecTransformOperationSign) || (transform->oper... | false | false | false | false | false | 0 |
slap_keepalive_parse(
struct berval *val,
void *bc,
slap_cf_aux_table *tab0,
const char *tabmsg,
int unparse )
{
if ( unparse ) {
slap_keepalive *sk = (slap_keepalive *)bc;
int rc = snprintf( val->bv_val, val->bv_len, "%d:%d:%d",
sk->sk_idle, sk->sk_probes, sk->sk_interval );
if ( rc < 0 ) {
return -1... | 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.