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 |
|---|---|---|---|---|---|---|
nextvar (void)
{
TObject *o = luaA_Address(luaL_nonnullarg(1));
TaggedString *g;
if (ttype(o) == LUA_T_NIL)
g = (TaggedString *)L->rootglobal.next;
else {
luaL_arg_check(ttype(o) == LUA_T_STRING, 1, "variable name expected");
g = tsvalue(o);
/* check whether name is in global var list */
lua... | false | false | false | false | false | 0 |
thread_across_edge (gimple dummy_cond,
edge e,
bool handle_dominating_asserts,
VEC(tree, heap) **stack,
tree (*simplify) (gimple, gimple))
{
gimple stmt;
/* If E is a backedge, then we want to verify that the COND_EXPR,
SWITCH_EXPR or GOTO_EXPR at the end of e->dest is not affected
... | false | false | false | false | false | 0 |
spifmem_x_free_pixmap(const spif_charptr_t var, const spif_charptr_t filename, unsigned long line, Display * d, Pixmap p)
{
D_MEM(("Freeing pixmap %s (0x%08x) at %s:%lu\n", var, p, NONULL(filename), line));
if (p) {
if (DEBUG_LEVEL >= DEBUG_MEM) {
memrec_rem_var(&pixmap_rec, var, SPIF_CAST(c... | false | false | false | false | false | 0 |
asd_propagate_sas_addr(struct asd_ha_struct *asd_ha)
{
int i;
for (i = 0; i < ASD_MAX_PHYS; i++) {
if (asd_ha->hw_prof.phy_desc[i].sas_addr[0] == 0)
continue;
/* Set a phy's address only if it has none.
*/
ASD_DPRINTK("setting phy%d addr to %llx\n", i,
SAS_ADDR(asd_ha->hw_prof.sas_addr));
memcpy... | false | false | false | false | false | 0 |
extractMallocCall(const Value *I,
const TargetLibraryInfo *TLI) {
return isMallocLikeFn(I, TLI) ? dyn_cast<CallInst>(I) : nullptr;
} | false | false | false | false | false | 0 |
create_array(gpointer data, guint len, guint type_size, gboolean free_data)
{
GArray *ret;
ret = g_array_new(FALSE, FALSE, type_size);
g_array_append_vals(ret, data, len);
if (free_data)
g_free(data);
return ret;
} | false | false | false | false | false | 0 |
SetHome( const char * pszNewHome )
{
CPLMutexHolderD( &hDMMutex );
CPLFree( pszHome );
pszHome = CPLStrdup(pszNewHome);
} | false | false | false | false | false | 0 |
writechunk(int fh, char *typ, void *ptr, int len)
{
unsigned int v = htonl(len), crc;
write(fh, &v, 4);
crc = writecrc(fh, typ, 4, ~0);
if (len)
crc = writecrc(fh, ptr, len, crc);
v = htonl(~crc);
write(fh, &v, 4);
} | false | false | false | false | false | 0 |
ClassInitialize()
{
#ifdef __VMS
SetVMSFeature("DECC$FILENAME_UNIX_ONLY", 1);
#endif
// Allocate the translation map first.
SystemTools::TranslationMap = new SystemToolsTranslationMap;
SystemTools::LongPathMap = new SystemToolsTranslationMap;
#ifdef __CYGWIN__
SystemTools::Cyg2Win32Map = new SystemToolsTransl... | false | false | false | false | false | 0 |
pack_shapey(int n)
{
AtomVecEllipsoid::Bonus *bonus = avec_ellipsoid->bonus;
int *ellipsoid = atom->ellipsoid;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if ((mask[i] & groupbit) && ellipsoid[i] >= 0)
buf[n] = bonus[ellipsoid[i]].shape[1];
else buf[n] ... | false | false | false | false | false | 0 |
do_oname(struct obj *obj)
{
char buf[BUFSZ], qbuf[QBUFSZ];
const char *aname;
short objtyp;
sprintf(qbuf, "What do you want to name %s %s?",
is_plural(obj) ? "these" : "this", xname(obj));
getlin(qbuf, buf);
if(!*buf || *buf == '\033') return;
/* strip leading and trailing space... | false | false | false | false | false | 0 |
blinkm_transfer_hw(struct i2c_client *client, int cmd)
{
/* the protocol is simple but non-standard:
* e.g. cmd 'g' (= 0x67) for "get device address"
* - which defaults to 0x09 - would be the sequence:
* a) write 0x67 to the device (byte write)
* b) read the value (0x09) back right after (byte read)
*
... | false | false | false | false | false | 0 |
valid_row (Sheet const *sheet, int r)
{
return r >= 0 && r < gnm_sheet_get_max_rows (sheet);
} | false | false | false | false | false | 0 |
build_vars(struct frame *frame, int wrap_width)
{
GtkWidget *vbox;
struct table *table;
struct loop *loop;
vbox = gtk_vbox_new(FALSE, 0);
for (table = frame->tables; table; table = table->next) {
add_sep(vbox, 3);
build_assignment(vbox, frame, table);
build_table(vbox, frame, table, wrap_width);
}
for (lo... | false | false | false | false | false | 0 |
Check(const Particle & p) {
return abs(p.id()) == ParticleID::t && isLastInShower(p);
} | false | false | false | false | false | 0 |
r852_dma_enable(struct r852_device *dev)
{
uint8_t dma_reg, dma_irq_reg;
/* Set up dma settings */
dma_reg = r852_read_reg_dword(dev, R852_DMA_SETTINGS);
dma_reg &= ~(R852_DMA_READ | R852_DMA_INTERNAL | R852_DMA_MEMORY);
if (dev->dma_dir)
dma_reg |= R852_DMA_READ;
if (dev->dma_state == DMA_INTERNAL) {
dma_... | false | false | false | false | false | 0 |
dirserv_get_routerdescs(smartlist_t *descs_out, const char *key,
const char **msg)
{
*msg = NULL;
if (!strcmp(key, "/tor/server/all")) {
routerlist_t *rl = router_get_routerlist();
SMARTLIST_FOREACH(rl->routers, routerinfo_t *, r,
smartlist_add(descs_out, &(r->... | false | false | false | false | false | 0 |
cavan_display_draw_line_dummy(struct cavan_display_device *display, int x1, int y1, int x2, int y2, cavan_display_color_t color)
{
int diffx, diffy;
x1 = cavan_display_adjust_value(x1, display->xres);
x2 = cavan_display_adjust_value(x2, display->xres);
y1 = cavan_display_adjust_value(y1, display->yres);
y2 = cav... | false | false | false | false | false | 0 |
compose_toss_fetch(susp, snd_list)
register compose_susp_type susp;
snd_list_type snd_list;
{
long final_count = MIN(susp->susp.current + max_sample_block_len,
susp->susp.toss_cnt);
time_type final_time = susp->susp.t0 + final_count / susp->susp.sr;
long n;
/* fetch sampl... | false | false | false | false | false | 0 |
GetMinVersionNumber()
{
int i, nVersion = 300;
/*-----------------------------------------------------------------
* Scan Pen Defs
*----------------------------------------------------------------*/
for(i=0; i< m_numPen; i++)
{
if (m_papsPen[i]->nPointWidth > 0 )
{
... | false | false | false | false | false | 0 |
gletters_config_start(GcomprisBoard *agcomprisBoard,
GcomprisProfile *aProfile)
{
board_conf = agcomprisBoard;
profile_conf = aProfile;
gchar *label;
if (gcomprisBoard)
pause_board(TRUE);
label = g_strdup_printf(_("<b>%s</b> configuration\n for profile <b>%s</b>"),
agcomprisBoard->name, a... | false | false | false | false | false | 0 |
comparisonError(const Token *tok, MathLib::bigint value1, const std::string &op, MathLib::bigint value2, bool result)
{
std::ostringstream expression;
expression << std::hex << "(X & 0x" << value1 << ") " << op << " 0x" << value2;
const std::string errmsg("Expression '" + expression.str() + "' is always " ... | false | false | false | false | false | 0 |
expand_builtin_strlen (exp, target)
tree exp;
rtx target;
{
tree arglist = TREE_OPERAND (exp, 1);
enum machine_mode value_mode = TYPE_MODE (TREE_TYPE (exp));
if (!validate_arglist (arglist, POINTER_TYPE, VOID_TYPE))
return 0;
else
{
rtx pat;
tree src = TREE_VALUE (arglist);
... | false | false | false | false | true | 1 |
buf_LRU_old_ratio_update(
/*=====================*/
uint old_pct,/*!< in: Reserve this percentage of
the buffer pool for "old" blocks. */
ibool adjust) /*!< in: TRUE=adjust the LRU list;
FALSE=just assign buf_pool->LRU_old_ratio
during the initialization of InnoDB */
{
ulint i;
ulint new_ratio = 0;
for (... | false | false | false | false | false | 0 |
fillBuf() {
int c;
int n, i;
if (eof)
return gFalse;
c = str->getChar();
if (c == 0x80 || c == EOF) {
eof = gTrue;
return gFalse;
}
if (c < 0x80) {
n = c + 1;
for (i = 0; i < n; ++i)
buf[i] = (char)str->getChar();
} else {
n = 0x101 - c;
c = str->getChar();
for (i ... | false | false | false | false | false | 0 |
ves_icall_System_Net_Sockets_Socket_Shutdown_internal(SOCKET sock, gint32 how, gint32 *error)
{
int ret;
gboolean interrupted;
*error = 0;
mono_thread_info_install_interrupt (abort_syscall, (gpointer) (gsize) mono_native_thread_id_get (), &interrupted);
if (interrupted) {
*error = WSAEINTR;
return;
}
MONO... | false | false | false | false | false | 0 |
ws_stmt_block(WsCompiler *compiler, WsUInt32 fline,
WsUInt32 lline, WsList *block)
{
WsStatement *stmt = stmt_alloc(compiler, WS_STMT_BLOCK, fline, lline);
if (stmt)
stmt->u.block = block;
return stmt;
} | false | false | false | false | false | 0 |
generic_packard(unsigned int *value, const unsigned int lng)
{
int i;
for(i=1;(i<lng)&&(value[i]!=VAL_STOP);i++) /* Ecrase le "CRC ?" */
{
value[i-1]=get_table_pb(value[i]);
}
value[i-1]=VAL_STOP;
} | false | false | false | false | false | 0 |
sinfo_msg_macro(const char *fct, const char *format, ...)
{
va_list al;
va_start(al, format);
vsnprintf(printbuffer, MAXSTRINGLENGTH - 1, format, al);
va_end(al);
printbuffer[MAXSTRINGLENGTH - 1] = '\0';
if (outlevel < 0 || level <= outlevel)
{
/*
#undef cpl_msg_info
*/
cp... | false | false | false | false | true | 1 |
db_parser_bind_int (sqlite3_stmt *stmt,
const gchar *param,
gint value)
{
gint index;
gint errcode;
GError *error = NULL;
index = sqlite3_bind_parameter_index (stmt, param);
errcode = sqlite3_bind_int (stmt, index, value);
if (err... | false | false | false | false | false | 0 |
lm3533_attr_is_visible(struct kobject *kobj,
struct attribute *attr, int n)
{
struct device *dev = container_of(kobj, struct device, kobj);
struct lm3533 *lm3533 = dev_get_drvdata(dev);
struct device_attribute *dattr = to_dev_attr(attr);
struct lm3533_device_attribute *lattr = to_lm3533_dev_attr(dattr);
... | false | false | false | false | false | 0 |
getChildPath(const std::string& path)
{
std::vector<std::string> node_path;
if(path.find('/') == std::string::npos)
{ return getChild(path); }
else
{ splitStr(path, "/", std::back_inserter(node_path)); }
Node* next_node(this); // The node we are looking at
... | false | false | false | false | false | 0 |
ext2fs_get_num_dirs(ext2_filsys fs, ext2_ino_t *ret_num_dirs)
{
dgrp_t i;
ext2_ino_t num_dirs, max_dirs;
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
num_dirs = 0;
max_dirs = fs->super->s_inodes_per_group;
for (i = 0; i < fs->group_desc_count; i++) {
if (ext2fs_bg_used_dirs_count(fs, i) > max_dirs)
n... | false | false | false | false | false | 0 |
dvb_logging_log_manager_createLogger (DVBLoggingLogManager* self, const gchar* name) {
DVBLoggingLogger* result = NULL;
DVBLoggingLogger* l = NULL;
DVBLoggingLogger* _tmp0_ = NULL;
const gchar* _tmp1_ = NULL;
GeeHashMap* _tmp2_ = NULL;
const gchar* _tmp3_ = NULL;
g_return_val_if_fail (self != NULL, NULL);
g_ret... | false | false | false | false | false | 0 |
sata_search_temperature(const unsigned char* smart_data, int attribute_id) {
int i, n;
n = 3;
i = 0;
while((debug || *(smart_data + n) != attribute_id) && i < 30) {
if(debug && *(smart_data + n))
printf(_("field(%d)\t = %d\n"), *(smart_data + n), *(smart_data + n + 3));
n += 12;
i++;
}
... | false | false | false | false | false | 0 |
dig__fwrite_port_S(short *buf, /* SHORT */
int cnt, GVFILE * fp)
{
int i, j;
unsigned char *c1, *c2;
if (Cur_Head->shrt_quick) {
if (nat_shrt == PORT_SHORT) {
if (dig_fwrite(buf, PORT_SHORT, cnt, fp) == cnt)
return 1;
}
else {
buf_alloc(cnt * PORT_SHORT);
c1 = (unsigned char *)... | false | false | false | false | false | 0 |
applicable0(const solver *ego_, const problem *p_)
{
const problem_dft *p = (const problem_dft *) p_;
UNUSED(ego_);
return (1
&& p->sz->rnk == 1
&& p->vecsz->rnk == 0
&& X(is_prime)(p->sz->dims[0].n)
);
} | false | false | false | false | false | 0 |
rpc_C_SetOperationState (CK_SESSION_HANDLE session, CK_BYTE_PTR operation_state,
CK_ULONG operation_state_len, CK_OBJECT_HANDLE encryption_key,
CK_OBJECT_HANDLE authentication_key)
{
BEGIN_CALL_OR (C_SetOperationState, CKR_SESSION_HANDLE_INVALID);
IN_ULONG (session);... | false | false | false | false | false | 0 |
globus_l_guc_load_alias_file(
char * file_name)
{
FILE * fptr;
char line[1024];
char buf[256];
globus_bool_t ... | false | false | false | false | false | 0 |
init_elim_table (void)
{
bool value_p;
struct elim_table *ep;
#ifdef ELIMINABLE_REGS
const struct elim_table_1 *ep1;
#endif
if (!reg_eliminate)
reg_eliminate = XCNEWVEC (struct elim_table, NUM_ELIMINABLE_REGS);
memset (self_elim_offsets, 0, sizeof (self_elim_offsets));
/* Initiate member values which ... | false | false | false | false | false | 0 |
evtchn_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
int rc, i;
evtchn_port_t *kbuf = (evtchn_port_t *)__get_free_page(GFP_KERNEL);
struct per_user_data *u = file->private_data;
if (kbuf == NULL)
return -ENOMEM;
/* Whole number of ports. */
count &= ~(sizeof(evtchn_port... | false | false | false | false | false | 0 |
axi_solid_metric (const GfsDomain * domain, const FttCell * cell)
{
g_assert (GFS_IS_MIXED (cell));
return GFS_STATE (cell)->solid->ca.y;
} | false | false | false | false | false | 0 |
PatternToRegex(const kwsys_stl::string& pattern,
bool require_whole_string,
bool preserve_case)
{
// Incrementally build the regular expression from the pattern.
kwsys_stl::string regex = require_whole_string? "^" : "";
kwsys_stl::strin... | false | false | false | false | false | 0 |
_dxfcolorfield(float *pts, float *data,int items,int isvector)
{
Field f;
int rank=0,dim=0;
Array pa,da,ca;
pa = NULL; ca = NULL; da = NULL;
f = NULL;
/* make the pts a 1-vector Array, they become the positions */
pa = DXNewArray(TYPE_FLOAT,CATEGORY_REAL,1,1);
if (!pa)
goto error;
if (... | false | false | false | false | false | 0 |
grab_values(struct atom_value *val, int deref, struct object *obj, void *buf, unsigned long sz)
{
grab_common_values(val, deref, obj, buf, sz);
switch (obj->type) {
case OBJ_TAG:
grab_tag_values(val, deref, obj, buf, sz);
grab_sub_body_contents(val, deref, obj, buf, sz);
grab_person("tagger", val, deref, obj, ... | false | false | false | false | false | 0 |
telephony_answer_call_req(void *telephony_device)
{
struct csd_call *call;
call = find_call_with_status(CSD_CALL_STATUS_COMING);
if (!call)
call = find_call_with_status(CSD_CALL_STATUS_MT_ALERTING);
if (!call)
call = find_call_with_status(CSD_CALL_STATUS_PROCEEDING);
if (!call)
call = find_call_with_statu... | false | false | false | false | false | 0 |
add_loop_genr (LOOPSET *loop, int lno,
const char *line,
DATASET *dset)
{
int err = 0;
loop->cmds[lno].genr = genr_compile(line, dset, OPT_NONE, &err);
if (!err) {
loop->cmds[lno].flags |= LOOP_CMD_GENR;
}
return err;
} | false | false | false | false | false | 0 |
add_child_die (die, child_die)
dw_die_ref die;
dw_die_ref child_die;
{
if (die != NULL && child_die != NULL)
{
if (die == child_die)
abort ();
child_die->die_parent = die;
child_die->die_sib = die->die_child;
die->die_child = child_die;
}
} | false | false | false | false | false | 0 |
FindInCodeCache(String* name, Code::Flags flags) {
// Do a lookup if a code cache exists.
if (!code_cache()->IsFixedArray()) {
return CodeCache::cast(code_cache())->Lookup(name, flags);
} else {
return Heap::undefined_value();
}
} | false | false | false | false | false | 0 |
rtl8225_rf_set_channel(struct ieee80211_hw *dev,
struct ieee80211_conf *conf)
{
struct rtl8180_priv *priv = dev->priv;
int chan =
ieee80211_frequency_to_channel(conf->chandef.chan->center_freq);
if (priv->rf->init == rtl8225_rf_init)
rtl8225_rf_set_tx_power(dev, chan);
else
rtl8225z2_rf_set_tx_power(d... | false | false | false | false | false | 0 |
parse_options (int *argc,
char ***argv)
{
GError *error = NULL;
GOptionContext *context;
context = g_option_context_new ("- git config tool");
g_option_context_set_ignore_unknown_options (context, TRUE);
g_option_context_add_main_entries (context, entries, "gitg");
if (!g_option_context_parse (c... | false | false | false | false | false | 0 |
nm_system_iface_flush_routes (int ifindex, int family)
{
guint32 log_level = LOGD_IP4 | LOGD_IP6;
const char *sf = "UNSPEC";
char *iface;
g_return_val_if_fail (ifindex > 0, FALSE);
iface = nm_netlink_index_to_iface (ifindex);
g_return_val_if_fail (iface != NULL, FALSE);
if (family == AF_INET) {
log_level = ... | false | false | false | false | false | 0 |
gst_mms_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
GstMMS *mmssrc = GST_MMS (object);
GST_OBJECT_LOCK (mmssrc);
switch (prop_id) {
case PROP_LOCATION:
if (mmssrc->uri_name)
g_value_set_string (value, mmssrc->uri_name);
break;
case PROP_CON... | false | false | false | false | false | 0 |
is_correct_endfinally (MonoMethodHeader *header, guint offset)
{
int i;
MonoExceptionClause *clause;
for (i = 0; i < header->num_clauses; ++i) {
clause = &header->clauses [i];
if (MONO_OFFSET_IN_HANDLER (clause, offset) && (clause->flags == MONO_EXCEPTION_CLAUSE_FAULT || clause->flags == MONO_EXCEPTION_CLAUSE_F... | false | false | false | false | false | 0 |
set_linefmt(char *linefmt)
{
int i = 0;
int RetCode = -1;
if (lineformats != NULL)
{
while(lineformats[i] != NULL)
{
if (!strcasecmp(linefmt,lineformats[i][0]))
{
lineformat = lineformats[i][1];
RetCode = 0;
break;
}
i++;
}
}
return RetCode;
} | false | false | false | false | false | 0 |
get_encoded_value(void) const {
char buf[2048];
switch (_type) {
case PROFILE_VALUE_TYPE_NULL:
return strdup("null");
case PROFILE_VALUE_TYPE_INT:
snprintf(buf, sizeof(buf), "%d", _int_value);
return strdup(buf);
case PROFILE_VALUE_TYPE_STRING:
... | false | false | false | false | false | 0 |
authtoken_verify(const char *userid, const char *token, time_t *when)
{
time_t tval=0;
const char *p=token;
char *q;
time_t now;
while (*p)
{
int n=nyb(*p);
if (n < 0)
break;
tval *= 16;
tval += n;
++p;
}
if (*p != '-' || p != token + sizeof(tval)*2)
return (-1);
time(&now);
if (tval < now... | false | false | false | false | false | 0 |
mafSliceBeg(const std::string& rAln, const std::string& qAln,
unsigned qBeg, unsigned& qSliceBeg, unsigned& alnBeg) {
if (qSliceBeg < qBeg) {
qSliceBeg = qBeg;
alnBeg = 0;
} else {
alnBeg = nthBasePrefix(strBeg(qAln), qSliceBeg - qBeg);
}
unsigned numInserts = nthBasePrefix(strBeg(rAln) + alnBeg,... | false | false | false | false | false | 0 |
unit_transport_unload_send(struct unit *punit)
{
struct unit *ptrans;
fc_assert_ret(punit);
ptrans = unit_transport_get(punit);
fc_assert_ret(ptrans);
unit_transport_unload(punit);
send_unit_info(NULL, punit);
send_unit_info(NULL, ptrans);
} | false | false | false | false | false | 0 |
lwcompound_deserialize(uchar *serialized)
{
LWCOMPOUND *result;
LWGEOM_INSPECTED *insp;
int type = lwgeom_getType(serialized[0]);
int i;
if(type != COMPOUNDTYPE)
{
lwerror("lwcompound_deserialize called on non compound: %d", type);
return ... | false | true | false | false | false | 1 |
ssb_chipco_timing_init(struct ssb_chipcommon *cc,
unsigned long ns)
{
struct ssb_device *dev = cc->dev;
struct ssb_bus *bus = dev->bus;
u32 tmp;
/* set register for external IO to control LED. */
chipco_write32(cc, SSB_CHIPCO_PROG_CFG, 0x11);
tmp = DIV_ROUND_UP(10, ns) << SSB_PROG_WCNT_3_SHIFT; /* Waitco... | false | false | false | false | false | 0 |
RegisterSerializableTransaction(Snapshot snapshot)
{
Assert(IsolationIsSerializable());
/*
* A special optimization is available for SERIALIZABLE READ ONLY
* DEFERRABLE transactions -- we can wait for a suitable snapshot and
* thereby avoid all SSI overhead once it's running..
*/
if (XactReadOnly && XactDef... | false | false | false | false | false | 0 |
AscWriteLramByte(PortAddr iop_base, ushort addr, uchar byte_val)
{
ushort word_data;
if (isodd_word(addr)) {
addr--;
word_data = AscReadLramWord(iop_base, addr);
word_data &= 0x00FF;
word_data |= (((ushort)byte_val << 8) & 0xFF00);
} else {
word_data = AscReadLramWord(iop_base, addr);
word_data &= 0xFF0... | false | false | false | false | false | 0 |
draw_antic_8(int nchars, const UBYTE *antic_memptr, UWORD *ptr, const ULONG *t_pm_scanline_ptr)
{
lookup2[0x00] = ANTIC_cl[C_BAK];
lookup2[0x40] = ANTIC_cl[C_PF0];
lookup2[0x80] = ANTIC_cl[C_PF1];
lookup2[0xc0] = ANTIC_cl[C_PF2];
CHAR_LOOP_BEGIN
UBYTE screendata = *antic_memptr++;
int kk = 4;
do {
if ((co... | false | false | false | false | false | 0 |
rtoken(const char* list[]) {
assert(in);
assert(list);
next();
for (int i=0; list[i]; ++i)
if (matchToken(list[i]))
return i;
syntaxError("unexpected");
assert(0);
return -1; // not reached
} | false | false | false | false | false | 0 |
pci_bus_restore(struct pci_bus *bus)
{
struct pci_dev *dev;
list_for_each_entry(dev, &bus->devices, bus_list) {
pci_dev_restore(dev);
if (dev->subordinate)
pci_bus_restore(dev->subordinate);
}
} | false | false | false | false | false | 0 |
_send_init_msg()
{
int rc, read_timeout;
Buf buffer;
dbd_init_msg_t req;
int tmp_errno = SLURM_SUCCESS;
errno = tmp_errno;
buffer = init_buf(1024);
pack16((uint16_t) DBD_INIT, buffer);
req.cluster_name = slurmdbd_cluster;
req.rollback = rollback_started;
req.version = SLURMDBD_VERSION;
slurmdbd_pack_init_... | false | false | false | false | false | 0 |
end_of_step()
{
if(fixviscouslb==0)
calc_fluidforce();
if(printrestart>0){
if((update->ntimestep)%printrestart == 0){
write_restartfile();
}
}
} | false | false | false | false | false | 0 |
test_recording_property (Fixture *fixture, gconstpointer data)
{
UcaCamera *camera = UCA_CAMERA (fixture->camera);
gboolean is_recording = FALSE;
uca_camera_start_recording (camera, NULL);
g_object_get (G_OBJECT (camera), "is-recording", &is_recording, NULL);
g_assert (is_recording == TRUE);
g_... | false | false | false | false | false | 0 |
btrfs_init_free_ino_ctl(struct btrfs_root *root)
{
struct btrfs_free_space_ctl *ctl = root->free_ino_ctl;
struct btrfs_free_space_ctl *pinned = root->free_ino_pinned;
spin_lock_init(&ctl->tree_lock);
ctl->unit = 1;
ctl->start = 0;
ctl->private = NULL;
ctl->op = &free_ino_op;
INIT_LIST_HEAD(&ctl->trimming_range... | false | false | false | false | false | 0 |
unescape_data(Octstr *data)
{
long pos = 0;
/* Again, an inplace transformation is used. Because, again, it is
* assumed that only a fraction of chars has to be unescaped.
*/
while (pos < octstr_len(data)) {
int check = octstr_get_char(data, pos);
if (check == ':') {
... | false | false | false | false | false | 0 |
ImgPictInstanceSetSize(instancePtr)
PictInstance *instancePtr; /* Instance whose size is to be
* changed. */
{
PictMaster *masterPtr;
XRectangle validBox;
Pixmap newPixmap;
#ifdef DEBUG
printf("ImgPictInstanceSetSize\n");
#endif
masterPtr = instancePtr->masterPtr;
XClipBox(masterPtr... | false | false | false | false | false | 0 |
getattrcolumn(xp)
int *xp;
{
int x1, x2;
x1 = n_column / 2 - 20;
x2 = n_column / 2;
if (isbestomit()) {
x1 += AW_FILENAME - AW_OMITNAME;
x2 -= 3;
}
#if !defined (_NOEXTRAATTR) && !defined (NOUID)
else if (iswellomit()) {
x1 -= WOWNER / 2;
x2 -= WOWNER / 2;
}
#endif
if (xp) *xp = x1;
return(x2);
} | false | false | false | false | false | 0 |
randomize(unsigned char *a) const
{
do
{
*a = (unsigned char)(rand() % 256);
}
while(*a == SINGLE_MARK || *a == get_low_mark() || *a == get_high_mark());
} | false | false | false | false | false | 0 |
dump(word_t addr)
{
int a, b, c;
for (a = 0;a < 8;a++)
{
cerr << hex << setw(4) << setfill('0') << (addr + 16 * a) << ": ";
for (b = 0;b < 16;b++)
{
cerr << hex << setw(2) << setfill('0') << memRead8(addr + 16 * a + b) << " ";
if (b == 7) cerr << ": ";
}
cerr << " ";
for (b = 0... | false | false | false | false | false | 0 |
create_surface_from_pixbuf (GdkPixbuf *pixbuf)
{
gint width = gdk_pixbuf_get_width (pixbuf);
gint height = gdk_pixbuf_get_height (pixbuf);
guchar *gdk_pixels = gdk_pixbuf_get_pixels (pixbuf);
int gdk_rowstride = gdk_pixbuf_get_rowstride (pixbuf);
int n_channels = gdk_pixbuf_get_n_channels (pixbuf);
int cair... | false | false | false | false | false | 0 |
device_release(struct kobject *kobj)
{
struct device *dev = kobj_to_dev(kobj);
struct device_private *p = dev->p;
/*
* Some platform devices are driven without driver attached
* and managed resources may have been acquired. Make sure
* all resources are released.
*
* Drivers still can add resources into ... | false | false | false | false | false | 0 |
_remove_qos(slurmdb_qos_rec_t *rec)
{
int cnt = 0;
cnt = job_hold_by_qos_id(rec->id);
if (cnt) {
info("Removed QOS:%s held %u jobs", rec->name, cnt);
} else
debug("Removed QOS:%s", rec->name);
} | false | false | false | false | false | 0 |
init(const std::string &stopAgent)
{
t_agents::iterator stop = m_agents.find(stopAgent);
for (t_agents::iterator i = m_agents.begin(); i != stop; ++i) {
if (!i->second->isInitialized()) {
i->second->init();
}
}
} | false | false | false | false | false | 0 |
worn_wield_only(obj)
struct obj *obj;
{
return (obj->oclass == WEAPON_CLASS
|| obj->oclass == ARMOR_CLASS
|| obj->oclass == AMULET_CLASS
|| obj->oclass == RING_CLASS
|| obj->oclass == TOOL_CLASS);
} | false | false | false | false | false | 0 |
do_close_connection(struct st_command *command)
{
DBUG_ENTER("close_connection");
struct st_connection *con;
static DYNAMIC_STRING ds_connection;
const struct command_arg close_connection_args[] = {
{ "connection_name", ARG_STRING, TRUE, &ds_connection,
"Name of the connection to close." }
};
che... | false | false | false | false | false | 0 |
skipBytes(Stream *str,
int width, int height,
int nComps, int nBits)
{
int nVals = width * nComps;
int nLineSize = (nVals * nBits + 7) >> 3;
int nBytes = nLineSize * height;
for (int i = 0; i < nBytes; i++)
... | false | false | false | false | false | 0 |
length() const
{
uint length = m_currentString.m_length;
if (!m_pushedChar1.isNull()) {
++length;
if (!m_pushedChar2.isNull())
++length;
}
if (m_composite) {
QList<TokenizerSubstring>::ConstIterator i = m_substrings.begin();
QList<TokenizerSubstring>::ConstIte... | false | false | false | false | false | 0 |
base_change ( int new_base )
{
if ( incolon && ( INVERSE( in_tokz_esc) ) )
{
emit_literal(new_base );
emit_token("base");
emit_token("!");
} else {
base = new_base;
}
} | false | false | false | false | false | 0 |
purchase_analyze(s32b price, s32b value, s32b guess)
{
/* Item was worthless, but we bought it */
if ((value <= 0) && (price > value))
msgt(MSG_STORE1, "%s", ONE_OF(comment_worthless));
/* Item was cheaper than we thought, and we paid more than necessary */
else if ((value < guess) && (price > value))
msgt(MSG... | false | false | false | false | false | 0 |
AutoAdjustColorDepth(void)
{
SDL_Rect **modes;
SDL_PixelFormat format;
const SDL_VideoInfo *info;
int flags;
if (fullscreen)
{
flags = SDL_FULLSCREEN;
}
else
{
flags = 0;
}
format.BitsPerPixel = screen_bpp;
format.BytesPerPixel = (screen_bpp + 7) / 8;
... | false | false | false | false | false | 0 |
lockBtree(Btree *pBt){
int rc;
if( pBt->page1 ) return SQLITE_OK;
rc = sqlitepager_get(pBt->pPager, 1, (void**)&pBt->page1);
if( rc!=SQLITE_OK ) return rc;
/* Do some checking to help insure the file we opened really is
** a valid database file.
*/
if( sqlitepager_pagecount(pBt->pPager)>0 ){
PageO... | false | false | false | false | false | 0 |
freetuxtv_cellrenderer_channelslist_get_property (GObject *object,
guint param_id,
GValue *value,
GParamSpec *psec)
{
FreetuxTVCellRendererChannelsList *self = FREETUXTV_CELLRENDERER_CHANNELSLIST(object);
switch (param_id){
case PROP_TYPE:
g_value_set_enum (value, self->type);
break;... | false | false | false | false | false | 0 |
env_index(dmy, value)
VALUE dmy, value;
{
char **env;
VALUE str;
StringValue(value);
env = GET_ENVIRON(environ);
while (*env) {
char *s = strchr(*env, '=');
if (s++) {
long len = strlen(s);
if (RSTRING(value)->len == len && strncmp(s, RSTRING(value)->ptr, len) == 0) {
str = env_st... | false | false | false | false | false | 0 |
handle_send_link(int s, char *path, char *buffer)
{
syncmsg msg;
unsigned int len;
int ret;
if(readx(s, &msg.data, sizeof(msg.data)))
return -1;
if(msg.data.id != ID_DATA) {
fail_message(s, "invalid data message: expected ID_DATA");
return -1;
}
len = ltohl(msg.dat... | false | false | false | false | false | 0 |
isl_ast_node_alloc_mark(__isl_take isl_id *id,
__isl_take isl_ast_node *node)
{
isl_ctx *ctx;
isl_ast_node *mark;
if (!id || !node)
goto error;
ctx = isl_id_get_ctx(id);
mark = isl_ast_node_alloc(ctx, isl_ast_node_mark);
if (!mark)
goto error;
mark->u.m.mark = id;
mark->u.m.node = node;
return mark;
e... | false | false | false | false | false | 0 |
samsung_smt_7020_tuner_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct cx8802_dev *dev = fe->dvb->priv;
u8 buf[4];
u32 div;
struct i2c_msg msg = {
.addr = 0x61,
.flags = 0,
.buf = buf,
.len = sizeof(buf) };
div = c->frequency / 125;
buf[0] = (di... | false | false | false | false | false | 0 |
ReadSymlink(const std::string& newName,
std::string& origName)
{
char buf[KWSYS_SYSTEMTOOLS_MAXPATH + 1];
int count = static_cast<int>(
readlink(newName.c_str(), buf, KWSYS_SYSTEMTOOLS_MAXPATH));
if (count >= 0) {
// Add null-terminator.
buf[count] = 0;
origName = buf... | false | false | false | false | false | 0 |
hawki_util_stdstars(
cpl_frameset * framelist)
{
cpl_frameset * rawframes ;
const char * recipe_name = "hawki_util_stdstars" ;
/* Identify the RAW and CALIB frames in the input frameset */
if (hawki_dfs_set_groups(framelist)) {
cpl_msg_error(__func__, "... | true | true | false | false | true | 1 |
parse_defpoint(int off, ubyte *bsp_data)
{
int i, n;
int nverts = w(off+bsp_data+8);
int offset = w(off+bsp_data+16);
int next_norm = 0;
ubyte *normcount = off+bsp_data+20;
vec3d *src = vp(off+bsp_data+offset);
// Get pointer to lights
Interp_lights = off+bsp_data+20+nverts;
#ifndef NDEBUG
modelstats_num_v... | false | false | false | false | false | 0 |
copy_Authenticator(const Authenticator *from, Authenticator *to)
{
memset(to, 0, sizeof(*to));
if(copy_krb5int32(&(from)->authenticator_vno, &(to)->authenticator_vno)) goto fail;
if(copy_Realm(&(from)->crealm, &(to)->crealm)) goto fail;
if(copy_PrincipalName(&(from)->cname, &(to)->cname)) goto fail;
if((from)->cksum) {... | false | false | false | false | false | 0 |
read(void *data, int len)
{
if(_status < 0)
return _status;
if(buffer)
{
if(bufpos + len > bufused)
return -1;
memcpy(data, buffer + bufpos, len);
bufpos += len;
return len;
}
else
{
if(fread(data, len, 1, f) != 1)
return status(-1);
return len;
}
} | false | false | false | false | false | 0 |
TCSP_ReadCurrentTicks_Internal(TCS_CONTEXT_HANDLE hContext,
UINT32* pulCurrentTime,
BYTE** prgbCurrentTime)
{
TSS_RESULT result;
UINT32 paramSize;
UINT64 offset = 0;
BYTE txBlob[TSS_TPM_TXBLOB_SIZE];
if ((result = ctx_verify_context(hContext)))
return result;
if ((re... | false | false | false | false | false | 0 |
fillpatbuf
( mcxIO* xfin
, int shift
, mcxIOpat* md
)
{ int c = 0
; int z = 0
; int patlen = md->patlen
; while (z < shift && (c = mcxIOstep(xfin)) != EOF)
{ int q = (md->circle_last+z+1) % patlen
; md->circle[q] = c
; z++
; }
md->circle_last = (md->circle_last+shift)... | false | false | false | false | false | 0 |
let(int pflag)
{
LVAL newenv,val;
/* protect some pointers */
xlsave1(newenv);
/* create a new environment frame */
newenv = xlframe(xlenv);
/* get the list of bindings and bind the symbols */
if (!pflag) {
xlenv = newenv;
}
dobindings(xlgalist(),newenv);
if (pflag) {
... | 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.