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 |
|---|---|---|---|---|---|---|
test_object_commit_commitstagedfile__generate_predictable_object_ids(void)
{
git_index *index;
git_index_entry *entry;
git_oid expected_blob_oid, tree_oid, expected_tree_oid, commit_oid, expected_commit_oid;
git_signature *signature;
git_tree *tree;
char buffer[128];
/*
* The test below replicates the followi... | true | true | false | false | false | 1 |
norm3(vec3_t v, vec3_t out)
{
float l = VectorLength(v);
if(l > 0.0)
{
out[0] = v[0] / l;
out[1] = v[1] / l;
out[2] = v[2] / l;
return;
}
else
{
VectorClear(out);
}
} | false | false | false | false | false | 0 |
expression_op_func__repeat_dly(
expression* expr, /*!< Pointer to expression to perform operation on */
thread* thr, /*!< Pointer to thread containing this expression */
const sim_time* time /*!< Pointer to current simulation time */
) { PROFILE(EXPRESSION_OP_FUNC__REPEAT_DLY);
bool retval = F... | false | false | false | false | false | 0 |
draw_bitmap_2d(GF_Node *node, GF_TraverseState *tr_state)
{
GF_ColorKey *key, keyColor;
DrawableContext *ctx = tr_state->ctx;
BitmapStack *st = (BitmapStack *) gf_node_get_private(node);
/*bitmaps are NEVER rotated (forbidden in spec). In case a rotation was done we still display (reset the skew components)*/
ct... | false | false | false | false | false | 0 |
incrementSpaceAfter(bool bIncrement)
{
double inc = getIncrement(m_SpaceAfterString.c_str());
if(!bIncrement)
{
inc = -inc;
}
UT_Dimension dim = UT_determineDimension(getSpaceAfterString(), DIM_none);
m_SpaceAfterString = UT_incrementDimString(m_SpaceAfterString.c_str(),inc);
double dum = UT_convertToInches(ge... | false | false | false | false | false | 0 |
nv50_gr_intr(struct nvkm_gr *base)
{
struct nv50_gr *gr = nv50_gr(base);
struct nvkm_subdev *subdev = &gr->base.engine.subdev;
struct nvkm_device *device = subdev->device;
struct nvkm_fifo_chan *chan;
u32 stat = nvkm_rd32(device, 0x400100);
u32 inst = nvkm_rd32(device, 0x40032c) & 0x0fffffff;
u32 addr = nvkm_rd3... | true | true | false | false | false | 1 |
volume_id_probe_linux_raid0(struct volume_id *id, uint64_t off, uint64_t size)
{
const uint8_t *buf;
union {
uint32_t ints[4];
uint8_t bytes[16];
} uuid;
info("probing at offset 0x%llx, size 0x%llx",
(unsigned long long) off, (unsigned long long) size);
if (size < 0x10000)
return -1;
buf = volume_id_... | false | false | false | false | false | 0 |
decode_array(JSONData *jsondata) {
PyObject *object, *item;
int c, expect_item, items, result;
char *start;
object = PyList_New(0);
start = jsondata->ptr;
jsondata->ptr++;
expect_item = True;
items = 0;
while (True) {
skipSpaces(jsondata);
c = *jsondata->ptr;
... | false | false | false | false | false | 0 |
ldapopen()
{
int ldrc;
if (my_ldap_fp) return (0);
if (authldap_read_config(&my_ldap) == 0)
{
err("authldaplib: error in LDAP configuration file, aborting");
return (1);
}
my_ldap_fp=ldapconnect();
if (!my_ldap_fp)
{
return (1);
}
#ifdef LDAP_OPT_PROTOCOL_VERSION
/* Set protocol version if sele... | false | false | false | false | false | 0 |
set_temp_max(struct device *dev,
struct device_attribute *devattr,
const char *buf, size_t count)
{
int index = to_sensor_dev_attr(devattr)->index;
struct max1668_data *data = dev_get_drvdata(dev);
struct i2c_client *client = data->client;
long temp;
int ret;
ret = kstrtol(buf, 10, &temp);
if (ret... | false | false | false | false | false | 0 |
toaplan1_create_tilemaps(void)
{
pf1_tilemap = tilemap_create(get_pf1_tile_info,tilemap_scan_rows,TILEMAP_TRANSPARENT,8,8,64,64);
pf2_tilemap = tilemap_create(get_pf2_tile_info,tilemap_scan_rows,TILEMAP_TRANSPARENT,8,8,64,64);
pf3_tilemap = tilemap_create(get_pf3_tile_info,tilemap_scan_rows,TILEMAP_TRANSPARENT,8... | false | false | false | false | false | 0 |
ASN1_STRING_type_new(int type)
{
ASN1_STRING *ret;
ret=(ASN1_STRING *)OPENSSL_malloc(sizeof(ASN1_STRING));
if (ret == NULL)
{
ASN1err(ASN1_F_ASN1_STRING_TYPE_NEW,ERR_R_MALLOC_FAILURE);
return(NULL);
}
ret->length=0;
ret->type=type;
ret->data=NULL;
ret->flags=0;
return(ret);
} | false | false | false | false | false | 0 |
ucbuf_getBuffer(UCHARBUF* buf,int32_t* len,UErrorCode* error){
if(error==NULL || U_FAILURE(*error)){
return NULL;
}
if(buf==NULL || len==NULL){
*error = U_ILLEGAL_ARGUMENT_ERROR;
return NULL;
}
*len = (int32_t)(buf->bufLimit - buf->buffer);
return buf->buffer;
} | false | false | false | false | false | 0 |
precheck (const Proto *pt) {
check(pt->maxstacksize <= MAXSTACK);
check(pt->numparams+(pt->is_vararg & VARARG_HASARG) <= pt->maxstacksize);
check(!(pt->is_vararg & VARARG_NEEDSARG) ||
(pt->is_vararg & VARARG_HASARG));
check(pt->sizeupvalues <= pt->nups);
check(pt->sizelineinfo == pt->sizecode ||... | false | false | false | false | false | 0 |
setEnabled(const QString& strPlayerID, const bool enabled)
{
if(m_tempPlayerSettings.contains(strPlayerID))
{
m_tempPlayerSettings.find(strPlayerID).value().enabled = enabled;
Settings::self()->setDummy(Settings::self()->dummy() + 3);
}
} | false | false | false | false | false | 0 |
Parse_ReplyMemoryRange(gn_data *data, struct gn_statemachine *state)
{
at_driver_instance *drvinst = AT_DRVINST(state);
char *r, *s, *t, *pos;
char key[7];
snprintf(key, 7, "%s%s", "CPBR", gn_memory_type2str(drvinst->memorytype));
r = strdup(map_get(&drvinst->cached_capabilities, key, 0));
s = r + 7;
pos = strc... | true | true | false | false | true | 1 |
plD_polyline_hpgl(PLStream *pls, short *xa, short *ya, PLINT npts)
{
register PLINT i;
PLDev *dev = (PLDev *) pls->dev;
/* Write out old path */
if (xa[0] != dev->xold || ya[0] != dev->yold)
pls->bytecnt += fprintf( OF, "PU%d %d;", xa[0], ya[0] );
/* Add new point to path */
for (i = 1; i < npts; i++)... | false | false | false | false | false | 0 |
vfsub_trunc(struct path *h_path, loff_t length, unsigned int attr,
struct file *h_file)
{
int err;
struct inode *h_inode;
struct super_block *h_sb;
if (!h_file) {
err = vfsub_truncate(h_path, length);
goto out;
}
h_inode = d_inode(h_path->dentry);
h_sb = h_inode->i_sb;
lockdep_off();
sb_start_write(h_s... | false | false | false | false | false | 0 |
bq25890_get_chip_state(struct bq25890_device *bq,
struct bq25890_state *state)
{
int i, ret;
struct {
enum bq25890_fields id;
u8 *data;
} state_fields[] = {
{F_CHG_STAT, &state->chrg_status},
{F_PG_STAT, &state->online},
{F_VSYS_STAT, &state->vsys_status},
{F_BOOST_FAULT, &state->boost_fault},
{... | false | false | false | false | false | 0 |
parser_tokadd(struct parser_params *parser, int c)
{
tokenbuf[tokidx++] = (char)c;
if (tokidx >= toksiz) {
toksiz *= 2;
REALLOC_N(tokenbuf, char, toksiz);
}
} | false | false | false | false | false | 0 |
HandleExtras(void)
{
register int i=0;
register object_t *g;
register WORD xg;
register WORD yg;
while(object_list[i]) {
g=object_list[i];
xg=g->world_x>>3;
yg=g->world_y>>3;
if( xg>(field_x-g->anim->Widths[g->AnimType]) &&
xg<(field_x+WINDOW_WIDTH) ... | false | false | false | false | false | 0 |
server_mkdir (rpcsvc_request_t *req)
{
server_state_t *state = NULL;
call_frame_t *frame = NULL;
gfs3_mkdir_req args = {{0,},};
int ret = -1;
int op_errno = ... | false | false | false | false | false | 0 |
position(InlineBox* box, int from, int len, bool reverse)
{
//kDebug(6040) << "position: from="<<from<<" len="<<len;
reverse = reverse && !style()->visuallyOrdered();
KHTMLAssert(box->isInlineTextBox());
InlineTextBox *s = static_cast<InlineTextBox *>(box);
s->m_start = from;
s->m_len = len;
s... | false | false | false | false | false | 0 |
on_book_selection_changed (GtkTreeSelection *selection,
gpointer data)
{
AddressBookWindow *self = NULL;
GtkTreeModel *model = NULL;
GtkTreeIter iter;
GtkWidget *view = NULL;
gint page = -1;
GtkWidget *menu = NULL;
self = ADDRESSBOOK_WINDOW (data);
if (gtk_tree_selection_get... | false | false | false | false | false | 0 |
setLogNameVar(const char *logName, ...)
{
char arg[2048];
va_list ptr;
va_start(ptr, logName);
vsnprintf(arg, sizeof(arg), logName, ptr);
arg[sizeof(arg) - 1] = '\0';
va_end(ptr);
return setLogName(arg);
} | false | false | false | false | false | 0 |
pd_lower_cf (gnm_float i, gnm_float d)
{
gnm_float f = -42, of, rf = i / d;
gnm_float c1 = 0, c2, c3, c4;
gnm_float a1 = 0, b1 = 1;
gnm_float a2 = i, b2 = d;
#define NEEDED_SCALE \
(b2 > scalefactor) { \
a1 /= scalefactor; \
b1 /= scalefactor; \
a2 /= scalefactor; \
b... | false | false | false | false | false | 0 |
CharRemap(long ch)
{
if (ch < 0)
ch = -ch;
ch = ch % 62;
if (ch < 26)
return 'A' + ch;
ch -= 26;
if (ch < 26)
return 'a' + ch;
ch -= 26;
return '0' + ch;
} | false | false | false | false | false | 0 |
e_fm2_custom_theme_set(Evas_Object *obj, const char *path)
{
EFM_SMART_CHECK();
eina_stringshare_replace(&sd->custom_theme, path);
_e_fm2_theme_edje_object_set(sd, sd->drop, "base/theme/fileman",
"list/drop_between");
_e_fm2_theme_edje_object_set(sd, sd->drop_in, "base/theme/... | false | false | false | false | false | 0 |
SingletonExists(unsigned Opc) {
insn_t Insn0;
insnWithID(Insn0, Opc);
errs() << "Singleton exists: " << nameWithID(Opc)
<< " with its decoding dominating ";
for (unsigned i = 0; i < Opcodes.size(); ++i) {
if (Opcodes[i] == Opc) continue;
errs() << nameWithID(Opcodes[i]) << ' ';
}
errs() <<... | false | false | false | false | false | 0 |
UpdateRadialGradient(GF_TextureHandler *txh)
{
Bool const_a;
GF_STENCIL stencil;
u32 i, *cols;
Fixed a;
M_RadialGradient *rg = (M_RadialGradient*) txh->owner;
GradientStack *st = (GradientStack *) gf_node_get_private(txh->owner);
if (!gf_node_dirty_get(txh->owner)) {
txh->needs_refresh = 0;
return;
}
if (... | false | false | false | false | false | 0 |
git_buf_vprintf(git_buf *buf, const char *format, va_list ap)
{
int len;
const size_t expected_size = buf->size + (strlen(format) * 2);
ENSURE_SIZE(buf, expected_size);
while (1) {
va_list args;
va_copy(args, ap);
len = p_vsnprintf(
buf->ptr + buf->size,
buf->asize - buf->size,
format, args
);
... | false | false | false | false | false | 0 |
deleteRowsInDatabase()
{
if (m_CategoriesToDelete.isEmpty() && m_TemplatesToDelete.isEmpty())
return;
// qWarning() << "deleteRows" << m_CategoriesToDelete << m_TemplatesToDelete;
QSqlDatabase DB = QSqlDatabase::database(Constants::DB_TEMPLATES_NAME);
if (!DB.isOpen()) {
... | false | false | false | false | false | 0 |
highlightBlock(const QString &text)
{
if (!m_syntaxer) return;
if (text.isEmpty()) {
setCurrentBlockState(previousBlockState());
return;
}
setCurrentBlockState(0);
int startCommentIndex = -1;
int startStringIndex = -1;
const CommentInfo * currentCommentInfo = NULL;
int pbs = previousBlockState();
if (pb... | false | false | false | false | false | 0 |
ajStrGetfilter(const AjPStr str)
{
char *ret;
const char* cp;
ret = AJALLOC0(256);
if(!str)
return ret;
if(!str->Len)
return ret;
cp = str->Ptr;
while (*cp)
{
ret[((int)*cp++)] = 1;
}
return ret;
} | false | false | false | false | false | 0 |
getImpliedFileFormat(const char *filename)
{
char *extension;
int i, numext;
l_int32 format = IFF_UNKNOWN;
if (splitPathAtExtension (filename, NULL, &extension))
return IFF_UNKNOWN;
numext = sizeof(extension_map) / sizeof(extension_map[0]);
for (i = 0; i < numext; i++) {
if (!str... | false | false | false | false | false | 0 |
wm8995_set_fll(struct snd_soc_dai *dai, int id,
int src, unsigned int freq_in,
unsigned int freq_out)
{
struct snd_soc_codec *codec;
struct wm8995_priv *wm8995;
int reg_offset, ret;
struct fll_div fll;
u16 reg, aif1, aif2;
codec = dai->codec;
wm8995 = snd_soc_codec_get_drvdata(codec);
aif1 = snd_soc... | false | false | false | false | false | 0 |
sca3000_read_data(struct sca3000_state *st,
u8 reg_address_high,
u8 **rx_p,
int len)
{
int ret;
struct spi_transfer xfer[2] = {
{
.len = 1,
.tx_buf = st->tx,
}, {
.len = len,
}
};
*rx_p = kmalloc(len, GFP_KERNEL);
if (*rx_p == NULL) {
ret = -ENOMEM;
goto error_ret;
}
xf... | false | false | false | false | false | 0 |
extract(uint32_t offset, DataExtractor debug_info_data,
const DWARFAbbreviationDeclarationSet *abbrevs) {
clear();
Offset = offset;
if (debug_info_data.isValidOffset(offset)) {
Length = debug_info_data.getU32(&offset);
Version = debug_info_data.getU16(&offset);
bool abbrevs... | false | false | false | false | false | 0 |
draw_line(uint8_t *buf, int sx, int sy, int ex, int ey, int w, int h, int stride, int color){
int x, y, fr, f;
sx= av_clip(sx, 0, w-1);
sy= av_clip(sy, 0, h-1);
ex= av_clip(ex, 0, w-1);
ey= av_clip(ey, 0, h-1);
buf[sy*stride + sx]+= color;
if(FFABS(ex - sx) > FFABS(ey - sy)){
if(s... | false | false | false | false | false | 0 |
airo_handle_cisco_mic(struct airo_info *ai)
{
if (test_bit(FLAG_MIC_CAPABLE, &ai->flags)) {
set_bit(JOB_MIC, &ai->jobs);
wake_up_interruptible(&ai->thr_wait);
}
} | false | false | false | false | false | 0 |
gst_ogg_demux_read_end_chain (GstOggDemux * ogg, GstOggChain * chain)
{
gint64 begin = chain->end_offset;
gint64 end = begin;
gint64 last_granule = -1;
GstOggPad *last_pad = NULL;
GstFlowReturn ret;
gboolean done = FALSE;
ogg_page og;
gint i;
while (!done) {
begin -= ogg->chunk_size;
if (begi... | false | false | false | false | false | 0 |
ocfs2_clear_journal_error(struct super_block *sb,
journal_t *journal,
int slot)
{
int olderr;
olderr = jbd2_journal_errno(journal);
if (olderr) {
mlog(ML_ERROR, "File system error %d recorded in "
"journal %u.\n", olderr, slot);
mlog(ML_ERROR, "File system on device %s needs checking.... | false | false | false | false | false | 0 |
Compare(const FFState& other) const {
const DistortionState_traditional& o =
static_cast<const DistortionState_traditional&>(other);
if (range.GetEndPos() < o.range.GetEndPos()) return -1;
if (range.GetEndPos() > o.range.GetEndPos()) return 1;
return 0;
} | false | false | false | false | false | 0 |
shutdown_client(struct client *client)
{
if (client->channel) {
MESSAGE("Shutdown client");
g_io_channel_shutdown(client->channel, FALSE, NULL);
}
client->channel = NULL;
client->watcher = FALSE;
client->raw = FALSE;
} | false | false | false | false | false | 0 |
fitstable_new() {
fitstable_t* tab;
tab = calloc(1, sizeof(fitstable_t));
if (!tab)
return tab;
tab->cols = bl_new(8, sizeof(fitscol_t));
return tab;
} | false | false | false | false | false | 0 |
gfs2_blk2rgrpd(struct gfs2_sbd *sdp, u64 blk, bool exact)
{
struct rb_node *n, *next;
struct gfs2_rgrpd *cur;
spin_lock(&sdp->sd_rindex_spin);
n = sdp->sd_rindex_tree.rb_node;
while (n) {
cur = rb_entry(n, struct gfs2_rgrpd, rd_node);
next = NULL;
if (blk < cur->rd_addr)
next = n->rb_left;
else if (blk... | false | false | false | false | false | 0 |
alloc_sdesc(struct crypto_shash *alg)
{
struct sdesc *sdesc;
int size;
size = sizeof(struct shash_desc) + crypto_shash_descsize(alg);
sdesc = kmalloc(size, GFP_KERNEL);
if (!sdesc)
return ERR_PTR(-ENOMEM);
sdesc->shash.tfm = alg;
sdesc->shash.flags = 0x0;
return sdesc;
} | false | false | false | false | false | 0 |
qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
Q_ASSERT(staticMetaObject.cast(_o));
DetailsWidget *_t = static_cast<DetailsWidget *>(_o);
switch (_id) {
case 0: _t->checked((*reinterpret_cast< bool(*)>(_a[1]))); ... | false | false | false | false | false | 0 |
get_proxy_port_w()
{
if( CORE::get_loginp2()->login_now() ) return CONFIG::get_proxy_port_for_data();
const int mode = get_mode_local_proxy_w();
if( mode == DBTREE::PROXY_GLOBAL ) return CONFIG::get_proxy_port_for2ch_w();
else if( mode == DBTREE::PROXY_LOCAL ) return get_local_proxy_port_w();
ret... | false | false | false | false | false | 0 |
AntNormalize(double v[3]) {
double d; /** Temporary value **/
d = sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]);
if (d == 0.0) {
fprintf(stderr,"Zero length vector\n");
return;
} /** Error **/
v[0] = v[0] / d;
v[1] = v[1] / d;
v[2] = v[2] / d;
} | false | false | false | false | false | 0 |
write_pass_finished (double /*when*/)
{
DEBUG_TRACE (DEBUG::ControlList, "write pass finished\n");
if (did_write_during_pass) {
thin ();
did_write_during_pass = false;
}
new_write_pass = true;
_in_write_pass = false;
} | false | false | false | false | false | 0 |
spl_filesystem_file_free_line(spl_filesystem_object *intern TSRMLS_DC) /* {{{ */
{
if (intern->u.file.current_line) {
efree(intern->u.file.current_line);
intern->u.file.current_line = NULL;
}
if (intern->u.file.current_zval) {
zval_ptr_dtor(&intern->u.file.current_zval);
intern->u.file.current_zval = NULL;
... | false | false | false | false | false | 0 |
record_other_ait()
{
int roa_rc = FSCK_OK;
int64_t start_block, end_block;
uint32_t length_in_agg_blocks;
/*
* first extent of the agg inode map
*/
if (agg_recptr->primary_ait_4part1) {
/* primary already recorded */
start_block = addressPXD(&(sb_ptr->s_aim2));
length_in_agg_blocks = lengthPXD(&(sb_ptr-... | false | false | false | false | false | 0 |
connect_signals() {
insert_conn = _text_view.get_buffer()->signal_insert().connect(sigc::mem_fun(this, &Document::on_insert));
erase_conn = _text_view.get_buffer()->signal_erase().connect(sigc::mem_fun(*this, &Document::on_erase));
_text_view.signal_populate_popup().connect(sigc::mem_fun(*this, &Document::on_pop... | false | false | false | false | false | 0 |
threshold_changed_cb(GtkAdjustment *adj,
SimpleControls *controls)
{
SimpleArgs *args = controls->args;
if (controls->in_update)
return;
controls->in_update = TRUE;
args->threshold = gtk_adjustment_get_value(adj);
simple_dialog_update(controls, args);
controls->in_upda... | false | false | false | false | false | 0 |
fix_case(char c)
{
return ((OPT::case_insensitive) ? (static_cast<char>(tolower(c))) : (c));
} | false | false | false | false | false | 0 |
cx23885_risc_vbibuffer(struct pci_dev *pci, struct cx23885_riscmem *risc,
struct scatterlist *sglist, unsigned int top_offset,
unsigned int bottom_offset, unsigned int bpl,
unsigned int padding, unsigned int lines)
{
u32 instructions, fields;
__le32 *rp;
fields = 0;
if (UNSET != top_offset)
fields++;
i... | false | false | false | false | false | 0 |
add_combo_box (GtkWidget *grid,
gint row,
const gchar *text,
const gchar *placeholder,
GtkListStore *model,
GtkWidget **out_combo_box,
GtkWidget **out_entry)
{
GtkStyleContext *context;
GtkWidget *labe... | false | false | false | false | false | 0 |
safe_getenv(const char *arg)
{
uid_t ruid = getuid();
if (ruid != 0 || (ruid != geteuid()) || (getgid() != getegid()))
return NULL;
#ifdef HAVE_PRCTL
if (prctl(PR_GET_DUMPABLE, 0, 0, 0, 0) == 0)
return NULL;
#else
#if (defined(linux) && defined(SYS_prctl))
if (syscall(SYS_prctl, PR_GET_DUMPABLE, 0, 0, 0, 0) ==... | false | false | false | false | false | 0 |
send_as_attachment(G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_UNUSED gpointer gdata)
{
GeanyDocument *doc;
gchar *locale_filename = NULL;
gchar *command = NULL;
GError *error = NULL;
GString *cmd_str = NULL;
GKeyFile *config = g_key_file_new();
gchar *config_dir = g_path_get_dirname(config_file);
gchar *d... | false | false | false | false | false | 0 |
adjust_match (G)
graph *G;
#endif
{
node *n, *b;
int i;
int ncount = G->nnodes;
node *nodelist = G->nodelist;
for (i = 0; i < ncount; i++) {
n = PNODE(i);
if (n->blossom_parent != -1 && nodelist[n->blossom_parent].mark == 0) {
for (b = n; b->blossom_parent != -1 &&
nodelist[b-... | false | false | false | false | false | 0 |
scan(const char** str)
{
do
{
next = **str;
(*str)++;
} while (isspace(next));
} | false | false | false | false | false | 0 |
am_probe_url(request_rec *r, const char *url, int timeout)
{
void *dontcare;
apr_size_t len;
long status;
int error;
status = 0;
if ((error = am_httpclient_get(r, url, &dontcare, &len,
timeout, &status)) != OK)
return error;
if (status != HTTP_OK... | false | false | false | false | false | 0 |
toString() const
{
Operator o = op;
if ( o == alias_all_resolved )
o = alias_all;
ASCString s = propertyName + TextFormatParser::operations[o] + value ;
return s;
} | false | false | false | false | false | 0 |
egalax_ts_suspend(struct device *dev)
{
static const u8 suspend_cmd[MAX_I2C_DATA_LEN] = {
0x3, 0x6, 0xa, 0x3, 0x36, 0x3f, 0x2, 0, 0, 0
};
struct i2c_client *client = to_i2c_client(dev);
int ret;
ret = i2c_master_send(client, suspend_cmd, MAX_I2C_DATA_LEN);
return ret > 0 ? 0 : ret;
} | false | false | false | false | false | 0 |
hfs_close(hfsfile *file)
{
hfsvol *vol = file->vol;
int result = 0;
if (f_trunc(file) == -1 ||
f_flush(file) == -1)
result = -1;
if (file->prev)
file->prev->next = file->next;
if (file->next)
file->next->prev = file->prev;
if (file == vol->files)
vol->files = file->next;
FREE(file... | false | false | false | false | false | 0 |
spif_socket_init_from_urls(spif_socket_t self, spif_url_t surl, spif_url_t durl)
{
ASSERT_RVAL(!SPIF_SOCKET_ISNULL(self), FALSE);
/* ***NOT NEEDED*** spif_obj_init(SPIF_OBJ(self)); */
spif_obj_set_class(SPIF_OBJ(self), SPIF_CLASS_VAR(socket));
self->fd = -1;
self->fam = AF_INET;
self->type = SOC... | false | false | false | false | false | 0 |
rb_io_set_encoding(int argc, VALUE *argv, VALUE io)
{
rb_io_t *fptr;
VALUE v1, v2, opt;
if (TYPE(io) != T_FILE) {
return rb_funcall2(io, id_set_encoding, argc, argv);
}
argc = rb_scan_args(argc, argv, "11:", &v1, &v2, &opt);
GetOpenFile(io, fptr);
io_encoding_set(fptr, v1, v2, opt)... | false | false | false | false | false | 0 |
operator=(const HepRotation &m1) {
if(9!=size_) {
//delete &m;
size_ = 9;
m.resize(size_);
}
nrow = ncol = 3;
mIter mm1;
mm1 = m.begin();
*mm1++ = m1.xx();
*mm1++ = m1.xy();
*mm1++ = m1.xz();
*mm1++ = m1.yx();
*mm1++ = m1.yy();
*mm1++ = m1.yz();
*mm1++ = m1.zx();
*mm1++ = m1.zy();
... | false | false | false | false | false | 0 |
selectionMode() const
{
if (d->itemsCheckable) {
return d->singleSelection ? QTreeWidget::SingleSelection : QTreeWidget::MultiSelection;
} else {
return QTreeWidget::selectionMode();
}
} | false | false | false | false | false | 0 |
send_signal(CPlugin * instance, ListItem * item, const gchar * signal)
{
DBusMessage *message;
const char *localsignal;
gchar *path;
// printf("Sending %s to connection %p\n", signal, instance->connection);
if (instance == NULL)
return;
if (instance->console != NULL) {
path = g... | false | false | false | false | false | 0 |
fill_input_buf (int nowait)
{
int i;
for (i = 0; i < 10000 && npending < sizeof (input_buf); i++)
{
int c;
c = serial_hw_fetch ();
if (c >= 0)
{
input_buf[npending++] = c;
/* Reset the counter to zero, to wait for the same interval. */
i = 0;
}
if (nowait)
break;
... | false | false | false | false | false | 0 |
ecal_test_utils_cal_get_default_object (ECal *cal)
{
GError *error = NULL;
icalcomponent *component = NULL;
if (!e_cal_get_default_object (cal, &component, &error)) {
g_warning ("failed to get default icalcomponent object; %s\n", error->message);
exit (1);
}
if (!icalcomponent_is_valid (component)) {
g_warn... | false | false | false | false | false | 0 |
load_encoding (struct gmt_encoding *enc)
{
char line[GMT_LONG_TEXT], symbol[GMT_LONG_TEXT];
GMT_LONG code = 0, pos;
FILE *in = NULL;
GMT_getsharepath ("pslib", enc->name, ".ps", line);
if ((in = fopen (line, "r")) == NULL) {
perror (line);
GMT_exit (EXIT_FAILURE);
}
while (fgets (line, (int)GMT_LONG_TEXT, ... | false | false | false | false | false | 0 |
SetSecurityLabel(const ObjectAddress *object,
const char *provider, const char *label)
{
Relation pg_seclabel;
ScanKeyData keys[4];
SysScanDesc scan;
HeapTuple oldtup;
HeapTuple newtup = NULL;
Datum values[Natts_pg_seclabel];
bool nulls[Natts_pg_seclabel];
bool replaces[Natts_pg_seclabel];
/* Security... | false | false | false | false | false | 0 |
ath9k_init_firmware_version(struct ath9k_htc_priv *priv)
{
struct ieee80211_hw *hw = priv->hw;
struct wmi_fw_version cmd_rsp;
int ret;
memset(&cmd_rsp, 0, sizeof(cmd_rsp));
WMI_CMD(WMI_GET_FW_VERSION);
if (ret)
return -EINVAL;
priv->fw_version_major = be16_to_cpu(cmd_rsp.major);
priv->fw_version_minor = be... | false | false | false | false | false | 0 |
is_zero(VALUE x)
{
VALUE num;
switch (TYPE(x)) {
case T_FIXNUM:
return FIX2LONG(x) == 0;
case T_BIGNUM:
return Qfalse;
case T_RATIONAL:
num = RRATIONAL(x)->num;
return FIXNUM_P(num) && FIX2LONG(num) == 0;
default:
break;
}
return RTEST(rb_funcall(x, id_eq, 1, INT2FIX(0)... | false | false | false | false | false | 0 |
v_case_item(void)
#else
v_case_item()
#endif
{
#line 1825 "./verilog.g"
zzRULE;
zzBLOCK(zztasp1);
zzMake0;
{
if ( (setwd26[LA(1)]&0x1) ) {
#line 1825 "./verilog.g"
v_explist();
#line 1826 "./verilog.g"
zzmatch(V_COLON); zzCONSUME;
#line 1826 "./verilog.g"
v_statement_or_null();
}
else {
if... | false | false | false | false | false | 0 |
get_moves_aux(int m_idx, int *yp, int *xp)
{
int py = p_ptr->py;
int px = p_ptr->px;
int i, y, x, y1, x1;
int when = 0;
int cost = 999;
monster_type *m_ptr = &mon_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
/* Monster flowing disabled */
if (!OPT(adult_ai_sound)) return (FALSE);
/* Monster ... | false | false | false | false | false | 0 |
sg_load_map_known(struct loaddata *loading)
{
/* Check status and return if not OK (sg_success != TRUE). */
sg_check_ret();
players_iterate(pplayer) {
/* Allocate player private map here; it is needed in different modules
* besides this one ((i.e. sg_load_player_*()). */
player_map_init(pplayer);
... | false | false | false | false | false | 0 |
updateGlSize(const QSize &size)
{
if (size.width() > pbuf->width() ||
size.height() > pbuf->height()) {
QGLFormat format = pbuf->format();
delete pbuf;
pbuf = new QGLPixelBuffer(size, format, dummy);
}
} | false | false | false | false | false | 0 |
editor_sci_notify_cb(G_GNUC_UNUSED GtkWidget *widget, G_GNUC_UNUSED gint scn,
gpointer scnt, gpointer data)
{
GeanyEditor *editor = data;
gboolean retval;
g_return_if_fail(editor != NULL);
g_signal_emit_by_name(geany_object, "editor-notify", editor, scnt, &retval);
} | false | false | false | false | false | 0 |
connectDatabase(const char *dbname, const char *pghost, const char *pgport,
const char *pguser, bool require_password, bool fail_on_error)
{
PGconn *conn;
bool new_pass;
const char *remoteversion_str;
int my_version;
static char *password = NULL;
if (require_password && !password)
password = simple_p... | false | false | false | false | false | 0 |
ExForkChildren ()
{
int pid;
int i;
#ifdef INSTRUMENT
ExAllocateInstrument (nprocs);
#endif
children[0].pid = getpid ();
/*
* Don't fork if we are running uni-processor and were not creating
* any other processes by creating a status window.
*/
if (nprocs == 1 && ! processo... | true | true | false | false | false | 1 |
ifx_spi_create_port(struct ifx_spi_device *ifx_dev)
{
int ret = 0;
struct tty_port *pport = &ifx_dev->tty_port;
spin_lock_init(&ifx_dev->fifo_lock);
lockdep_set_class_and_subclass(&ifx_dev->fifo_lock,
&ifx_spi_key, 0);
if (kfifo_alloc(&ifx_dev->tx_fifo, IFX_SPI_FIFO_SIZE, GFP_KERNEL)) {
ret = -ENOMEM;
goto... | false | false | false | false | false | 0 |
get_device_handle(Bit8u channel, Bit8u device)
{
D(bug("get_device_handle %d %d",channel, device));
if ((channel < BX_MAX_ATA_CHANNEL) && (device < 2)) {
return ((channel*2) + device);
}
return BX_MAX_ATA_CHANNEL*2;
} | false | false | false | false | false | 0 |
value_init (void)
{
size_t i;
for (i = 0; i < G_N_ELEMENTS (standard_errors); i++) {
standard_errors[i].locale_name = _(standard_errors[i].C_name);
standard_errors[i].locale_name_str =
go_string_new (standard_errors[i].locale_name);
}
#if USE_VALUE_POOLS
value_float_pool =
go_mem_chunk_new ("value float ... | false | false | false | false | false | 0 |
DoForAllConstructsInModule(
void *theEnv,
void *theModule,
void (*actionFunction)(void *,struct constructHeader *,void *),
int moduleItemIndex,
int interruptable,
void *userBuffer)
{
struct constructHeader *theConstruct;
struct defmoduleItemHeader *theModuleItem;
/*================... | false | false | false | false | false | 0 |
incr_parse (JSON *self)
{
const char *p = SvPVX (self->incr_text) + self->incr_pos;
/* the state machine here is a bit convoluted and could be simplified a lot */
/* but this would make it slower, so... */
for (;;)
{
/*printf ("loop pod %d *p<%c><%s>, mode %d nest %d\n", p - SvPVX (self->incr_text),... | false | false | false | false | false | 0 |
v5UserPassAuth(fdInfoType *client, char *user,const char *pass, unsigned int flags)
{
int ret=SOCKS5_DENIED;
DBT key,data;
register int dbRes;
key.data = user;
key.size = strlen(user);
dbRes=userDB->get(userDB,&key,&data,0);
if(dbRes<0) {
syslog(LOG_ERR,"userpass: db error on get: %m");
... | false | false | false | false | false | 0 |
debug_write (void *handle, const struct debug_write_fns *fns, void *fhandle)
{
struct debug_handle *info = (struct debug_handle *) handle;
struct debug_unit *u;
/* We use a mark to tell whether we have already written out a
particular name. We use an integer, so that we don't have to
clear the mark fi... | false | false | false | false | false | 0 |
cdromD_handler(void)
{
Bit32u handle = DEV_hd_get_first_cd_handle();
if (BX_GUI_THIS dialog_caps & BX_GUI_DLG_CDROM) {
// instead of just toggling the status, call win32dialog to bring up
// a dialog asking what disk image you want to switch to.
// This code handles the first cdrom only. The cdrom drive... | false | false | false | false | false | 0 |
intel_dsi_enable(struct intel_encoder *encoder)
{
struct drm_device *dev = encoder->base.dev;
struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
enum port port;
DRM_DEBUG_KMS("\n");
if (is_cmd_mode(intel_dsi)) {
for_each_dsi_port(port, intel_d... | false | false | false | false | false | 0 |
segment_create(opal_shmem_ds_t *ds_buf,
const char *file_name,
size_t size)
{
int rc = OPAL_SUCCESS;
pid_t my_pid = getpid();
/* the real size of the shared memory segment. this includes enough space
* to store our segment header.
*/
size_t real_size = size + siz... | true | true | false | false | false | 1 |
Draw()
{
if (visible)
{
//s32 rp[4];
//glGetIntegerv(GL_CURRENT_RASTER_POSITION, rp);
for (s32 i = 0, len = 0; i < maxLines; ++i)
{
if (*lines[i].str)
{
len = (u32)strlen(lines[i].str);
//Printf("(%d, %d, %d, %d)", rp[0], rp[1], rp[2], rp[3]);
//glRasterPos2d(rp[... | false | false | false | false | false | 0 |
Perl_save_svref(pTHX_ SV **sptr)
{
dVAR;
PERL_ARGS_ASSERT_SAVE_SVREF;
SvGETMAGIC(*sptr);
save_pushptrptr(sptr, SvREFCNT_inc(*sptr), SAVEt_SVREF);
return save_scalar_at(sptr, SAVEf_SETMAGIC); /* XXX - FIXME - see #60360 */
} | false | false | false | false | false | 0 |
slot_handle_level_range(struct kvm *kvm, struct kvm_memory_slot *memslot,
slot_level_handler fn, int start_level, int end_level,
gfn_t start_gfn, gfn_t end_gfn, bool lock_flush_tlb)
{
struct slot_rmap_walk_iterator iterator;
bool flush = false;
for_each_slot_rmap_range(memslot, start_level, end_level, start_g... | false | false | false | false | false | 0 |
save_undo (void)
{
long diff_size;
zword stack_size;
undo_t *p;
if (f_setup.undo_slots == 0) /* undo feature unavailable */
return -1;
/* save undo possible */
while (last_undo != curr_undo) {
p = last_undo;
last_undo = last_undo->prev;
free (p);
undo_count--;
}
if (last_undo)
l... | false | true | false | false | false | 1 |
breakLine(char *line, char **piece, char *verb)
{
int i, j;
char *ln = line;
char suf[16];
char pverb[64];
for(i = 0; i < 6; i++)
piece[i][0] = 0;
// get root
i = 0;
while(*ln != ':' && *ln != '\n' && i < 64){
pverb[i] = *ln;
ln++;
i++;
}
pverb[i]... | false | false | false | false | false | 0 |
get_keyfile_wordchars(GKeyFile *config, GKeyFile *configh, gchar **wordchars)
{
*wordchars = utils_get_setting(string, configh, config,
"settings", "wordchars", GEANY_WORDCHARS);
} | 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.