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 |
|---|---|---|---|---|---|---|
GetRGBAPalette(FIBITMAP *dib, RGBQUAD * const buffer) {
// clone the palette
const unsigned ncolors = FreeImage_GetColorsUsed(dib);
if (ncolors == 0) {
return NULL;
}
memcpy(buffer, FreeImage_GetPalette(dib), ncolors * sizeof(RGBQUAD));
// merge the transparency table
const unsigned ntransp = MIN(ncolo... | false | false | false | false | false | 0 |
d_near(struct deco_elt *de)
{
struct SYMBOL *s;
struct deco_def_s *dd;
int y, up;
s = de->s;
dd = &deco_def_tb[de->t];
up = s->stem > 0 ? 0 : 1;
if (s->multi)
up = !up;
if (up)
y = s->ymx;
else
y = s->ymn - dd->h;
if (y > -6 && y < 24) {
if (up)
y += 3;
y = (y + 6) / 6 * 6 - 6; /* between lines ... | false | false | false | false | false | 0 |
cifs_dump_detail(void *buf)
{
#ifdef CONFIG_CIFS_DEBUG2
struct smb_hdr *smb = (struct smb_hdr *)buf;
cifs_dbg(VFS, "Cmd: %d Err: 0x%x Flags: 0x%x Flgs2: 0x%x Mid: %d Pid: %d\n",
smb->Command, smb->Status.CifsError,
smb->Flags, smb->Flags2, smb->Mid, smb->Pid);
cifs_dbg(VFS, "smb buf %p len %u\n", smb, smbCalc... | false | false | false | false | false | 0 |
check_set_bool (const char *setobj, const char *setarg)
{
if (boolean_on(setarg)) {
return libset_set_bool(setobj, 1);
} else if (boolean_off(setarg)) {
return libset_set_bool(setobj, 0);
} else {
gretl_errmsg_sprintf(_("%s: invalid value '%s'"), setobj, setarg);
return E_PARSE;
}
} | false | false | false | false | false | 0 |
parseCleanup()
{
if (haveText)
{
record.append(field->trimmed());
_model.append(record);
}
if (_parent->firstRowHeaders() && ! _model.isEmpty())
{
_header = _model.at(0);
_model.takeFirst();
}
delete field;
return true;
} | false | false | false | false | false | 0 |
snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
{
if (dai->driver == NULL)
return -EINVAL;
if (dai->driver->ops->set_fmt == NULL)
return -ENOTSUPP;
return dai->driver->ops->set_fmt(dai, fmt);
} | false | false | false | false | false | 0 |
len (Tree l)
{
int n = 0;
while (isList(l)) { l = tl(l); n++; }
return n;
} | false | false | false | false | false | 0 |
mma8452_read_thresh(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir,
enum iio_event_info info,
int *val, int *val2)
{
struct mma8452_data *data = iio_priv(indio_dev);
int ret, us;
switch (info) {
c... | false | false | false | false | false | 0 |
skl_tplg_mixer_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *k, int event)
{
struct snd_soc_dapm_context *dapm = w->dapm;
struct skl *skl = get_skl_ctx(dapm->dev);
switch (event) {
case SND_SOC_DAPM_PRE_PMU:
return skl_tplg_mixer_dapm_pre_pmu_event(w, skl);
case SND_SOC_DAPM_POST_PMU:
return ... | false | false | false | false | false | 0 |
_id3v1_str_get(struct lms_string_size *s, const char *buf, int maxlen, lms_charset_conv_t *cs_conv)
{
int start, len;
const char *p, *p_end, *p_last;
start = 0;
p_last = NULL;
p_end = buf + maxlen;
for (p = buf; *p != '\0' && p < p_end; p++) {
if (!isspace(*p))
p_last = p;
... | false | false | false | false | false | 0 |
FindTIFFOffset(FILE *file, unsigned short num_entries,
unsigned short tiff_tag, unsigned short tiff_type)
{
unsigned short tag = 0;
unsigned short type = 0;
unsigned int offset = 0;
int i;
for (i = 0; i < num_entries; i++) {
//get tag 2 bytes
tag = (fgetc(f... | false | false | false | false | false | 0 |
FuncIO_stat(Obj self,Obj filename)
{
Int res;
Obj rec;
if (!IS_STRING(filename) || !IS_STRING_REP(filename)) {
SyClearErrorNo();
return Fail;
} else {
res = stat((char *) CHARS_STRING(filename),&ourstatbuf);
if (res < 0) {
SySetErrorNo();
return Fail;
}
rec = ... | false | false | false | false | false | 0 |
vcc_tx_add_aal5_descriptor(struct lanai_vcc *lvcc,
u32 flags, int len)
{
int pos;
APRINTK((((unsigned long) lvcc->tx.buf.ptr) & 15) == 0,
"vcc_tx_add_aal5_descriptor: bad ptr=%p\n", lvcc->tx.buf.ptr);
lvcc->tx.buf.ptr += 4; /* Hope the values REALLY don't matter */
pos = ((unsigned char *) lvcc->tx.buf.ptr) -... | false | false | false | false | false | 0 |
addValueFloat(const std::string& name, const std::string& type,
long double value)
{
addValueString(name, type, convert<String>(value));
} | false | false | false | false | false | 0 |
_update_multi_song(sfx_state_t *self)
{
song_t *oldfirst = self->song;
song_t *oldseeker;
song_t *newsong = song_lib_find_active(self->songlib);
song_t *newseeker;
song_t not_playing_anymore; /* Dummy object, referenced by
** songs which are no longer
** active. */
GTimeVal tv;
sci_get_current_t... | false | false | false | true | false | 1 |
qla2x00_write_ram_word(scsi_qla_host_t *vha, uint32_t risc_addr, uint32_t data)
{
int rval;
mbx_cmd_t mc;
mbx_cmd_t *mcp = &mc;
ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x1100,
"Entered %s.\n", __func__);
if (!IS_FWI2_CAPABLE(vha->hw))
return QLA_FUNCTION_FAILED;
mcp->mb[0] = MBC_WRITE_RAM_WORD_EXTENDED... | false | false | false | false | false | 0 |
mono_image_load_names (MonoImage *image)
{
/* modules don't have an assembly table row */
if (image->tables [MONO_TABLE_ASSEMBLY].rows) {
image->assembly_name = mono_metadata_string_heap (image,
mono_metadata_decode_row_col (&image->tables [MONO_TABLE_ASSEMBLY],
0, MONO_ASSEMBLY_NAME));
}
/* Portable pd... | false | false | false | false | false | 0 |
cx_vsnprintf(cxchar *string, cxsize n, const cxchar *format,
va_list args)
{
if (n != 0 && string == NULL)
return 0;
if (format == NULL)
return 0;
/*
* No availablility checks needed here. If the system does not provide
* a vsnprintf() function with C99 seman... | false | false | false | false | false | 0 |
getVertexProgramName(
const SM2Profile* prof, const Terrain* terrain, TechniqueType tt)
{
String progName = terrain->getMaterialName() + "/sm2/vp";
switch(tt)
{
case HIGH_LOD:
progName += "/hlod";
break;
case LOW_LOD:
progN... | false | false | false | false | false | 0 |
glade_fixed_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
GladeFixed *fixed = GLADE_FIXED (object);
switch (prop_id)
{
case PROP_X_PROP:
g_free (fixed->x_prop);
fixed->x... | false | false | false | false | false | 0 |
mvs_interrupt(int irq, void *opaque)
{
u32 core_nr;
u32 stat;
struct mvs_info *mvi;
struct sas_ha_struct *sha = opaque;
#ifndef CONFIG_SCSI_MVSAS_TASKLET
u32 i;
#endif
core_nr = ((struct mvs_prv_info *)sha->lldd_ha)->n_host;
mvi = ((struct mvs_prv_info *)sha->lldd_ha)->mvi[0];
if (unlikely(!mvi))
return IRQ... | false | false | false | false | false | 0 |
parse_uac_endpoint_attributes(struct snd_usb_audio *chip,
struct usb_host_interface *alts,
int protocol, int iface_no)
{
/* parsed with a v1 header here. that's ok as we only look at the
* header first which is the same for both versions */
struct uac_iso_endpoint_descriptor *csep;
struct usb_interface... | false | false | false | false | false | 0 |
GMT_dump_contour (double *xx, double *yy, GMT_LONG nn, double cval, GMT_LONG id, GMT_LONG interior, char *file)
{
GMT_LONG i;
static GMT_LONG int_cont_count = 0, ext_cont_count = 0;
char fname[BUFSIZ], format[GMT_TEXT_LEN], suffix[4];
double out[3];
FILE *fp = NULL;
if (nn < 2) return;
out[2] = cval;
(GMT_io.... | false | false | false | false | false | 0 |
CheckCycle(JSContext *cx, JSXML *xml, JSXML *kid)
{
JS_ASSERT(kid->xml_class != JSXML_CLASS_LIST);
do {
if (xml == kid) {
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
JSMSG_CYCLIC_VALUE, js_XML_str);
return JS_FALSE;
}
} while (... | false | false | false | false | false | 0 |
stop(NDns *self)
{
Item *i = d->find(self);
if(!i)
return;
// disassociate
i->ndns = 0;
#ifndef HAVE_GETHOSTBYNAME_R
// cancel
workerCancelled->lock();
i->worker->cancelled = true;
workerCancelled->unlock();
#endif
} | false | false | false | false | false | 0 |
has_additional_savefile_information() const
{
CYG_REPORT_FUNCNAMETYPE("CdlNode::has_additional_savefile_information", "result %d");
CYG_REPORT_FUNCARG1XV(this);
CYG_PRECONDITION_THISC();
bool result = (0 != unsupported_savefile_strings.size());
CYG_REPORT_RETVAL(result);
return result;
} | false | false | false | false | false | 0 |
ReadConfig()
{
//IMPORT SETTINGS FROM LEGACY SHELLEXTENSIONS PLUGIN - TODO: REMOVE IN NEXT VERSION
ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("ShellExtensions"));
if(!cfg->Exists(_("FileExplorer/ShowHidenFiles")))
cfg = Manager::Get()->GetConfigManager(_T("FileManager"));
int len=0... | false | false | false | false | false | 0 |
pwent_passwd_valid_p (const char *typed_passwd, Bool verbose_p)
{
if (encrypted_user_passwd &&
passwds_match_p (typed_passwd, encrypted_user_passwd))
return True;
#ifdef ALLOW_ROOT_PASSWD
/* do not allow root to have a null password. */
else if (typed_passwd[0] &&
encrypted_root_passwd &&
... | false | false | false | false | false | 0 |
CopyTo( TiXmlDocument* target ) const
{
TiXmlNode::CopyTo( target );
target->error = error;
target->errorDesc = errorDesc.c_str ();
TiXmlNode* node = 0;
for ( node = firstChild; node; node = node->NextSibling() )
{
target->LinkEndChild( node->Clone() );
}
} | false | false | false | false | false | 0 |
afp_getsessiontoken_reply(struct afp_server *server, char *buf,
unsigned int size, void * other) {
struct afp_token * token = other;
struct {
struct dsi_header header __attribute__((__packed__));
uint32_t token_len;
} * reply = (void *)buf;
char * token_data = buf + sizeof(*reply);
unsigned int token_len;
... | false | false | false | false | false | 0 |
s48_make_record(s48_value type_shared_binding)
{
long i, number_of_fields;
s48_value record = S48_FALSE;
s48_value record_type = S48_FALSE;
S48_DECLARE_GC_PROTECT(1);
S48_GC_PROTECT_1(record_type);
S48_SHARED_BINDING_CHECK(type_shared_binding);
S48_SHARED_BINDING_CHECK(s48_deref(the_record... | false | false | false | false | false | 0 |
wordtris_getmove_kb (Pos *pos, int key, byte **movp, int **rmovp)
{
static int rmove[10];
static byte move[10];
byte *mp = move;
int *rp = rmove;
if (key == GDK_Right)
{
*rp++ = wordtris_curx;
*rp++ = 0;
*rp++ = 0;
if (++wordtris_curx == WORDTRIS_LEN) wordtris_curx = 0;
*rp++ = wordtris_curx;
*rp++ = ... | true | true | false | false | false | 1 |
translate(const double xDist, const double yDist)
{
for (size_t i = 0; i < size(); ++i)
{
ps[i].x += xDist;
ps[i].y += yDist;
}
} | false | false | false | false | false | 0 |
encode(const char *aws_secret_access_key,string str)
{
unsigned char md[20];
unsigned int md_len = sizeof(md);
/* Note: This MUST be sha1() */
HMAC(EVP_sha1(),aws_secret_access_key,strlen(aws_secret_access_key),
(const unsigned char *)str.c_str(),str.size(),
md,&md_len);
/* Now encode this to b... | false | false | false | false | false | 0 |
is_owner(cnr room, jid user)
{
char ujid[2048];
char cjid[2048];
if(room == NULL || user == NULL)
{
log_warn(NAME, "[%s] ERR: Missing variable in is_owner", FZONE);
return 0;
}
snprintf(ujid, sizeof(ujid), "%s@%s", user->user, user->server);
if(room->creator)
{
snprintf(cjid, sizeof(cjid),... | false | false | false | false | false | 0 |
ErrorMsg() const
{
const char *msg = m_functionParser->ErrorMsg();
if (!msg)
return wxEmptyString;
return wxConvUTF8.cMB2WX(msg);
} | false | false | false | false | false | 0 |
ajDomainDel(AjPDomain *Pdomain)
{
AjPDomain domain = NULL;
if(!Pdomain || !*Pdomain)
return;
domain = *Pdomain;
if(domain->Type == ajEDomainTypeSCOP)
ajScopDel(&domain->Scop);
else
ajCathDel(&domain->Cath);
AJFREE(domain);
*Pdomain = NULL;
return;
} | 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));
HomeScene *_t = static_cast<HomeScene *>(_o);
switch (_id) {
case 0: _t->keyPressed((*reinterpret_cast< int(*)>(_a[1]))); break;... | false | false | false | false | false | 0 |
qib_6120_free_irq(struct qib_devdata *dd)
{
if (dd->cspec->irq) {
free_irq(dd->cspec->irq, dd);
dd->cspec->irq = 0;
}
qib_nomsi(dd);
} | false | false | false | false | false | 0 |
partname(const char *dev, int pno, int lth)
{
const char *p;
int w, wp;
int bufsiz;
char *bufp;
bufp = partname_buffer;
bufsiz = sizeof(partname_buffer);
w = strlen(dev);
p = "";
if (isdigit(dev[w-1]))
p = "p";
/* devfs kludge - note: fdisk partition names are not supposed
to equal kernel names, so ... | false | false | false | false | false | 0 |
esl_rsq_XShuffleWindows(ESL_RANDOMNESS *r, const ESL_DSQ *dsq, int L, int w, ESL_DSQ *shuffled)
{
ESL_DSQ x;
int i, j, k;
if (dsq != shuffled) esl_abc_dsqcpy(dsq, L, shuffled);
for (i = 1; i <= L; i += w)
for (j = ESL_MIN(L, i+w-1); j > i; j--)
{
k = i + esl_rnd_Roll(r, j-i+1);
x ... | false | false | false | false | false | 0 |
skl_setup_out_format(struct skl_sst *ctx,
struct skl_module_cfg *mconfig,
struct skl_audio_data_format *out_fmt)
{
struct skl_module_fmt *format = &mconfig->out_fmt;
out_fmt->number_of_channels = (u8)format->channels;
out_fmt->s_freq = format->s_freq;
out_fmt->bit_depth = format->bit_depth;
out_fmt->valid_b... | false | false | false | false | false | 0 |
fslbasename(const string& filename)
{
// does string() copy safely and dispose of temporary c-string storage?
return string(FslMakeBaseName(filename.c_str()));
} | false | false | false | false | false | 0 |
go1(int from,int field)
{
from=internal(from);
field=internal(field);
to=field;
if(checkCapture1())
{
bool capture=false;
switch(board[from])
{
case MAN1:
if(manCapture1(from,UL,capture)) return true;
if(manCapture1(from,UR,capture)) return t... | false | false | false | false | false | 0 |
zzn2_sadd(_MIPD_ zzn2 *x,big y,zzn2 *w)
{
#ifdef MR_OS_THREADS
miracl *mr_mip=get_mip();
#endif
if (mr_mip->ERNUM) return;
MR_IN(169)
nres_modadd(_MIPP_ x->a,y,w->a);
MR_OUT
} | false | false | false | false | false | 0 |
connection_handle_client_message(connection_data *connection, void* in_message, int player_id) {
player_data *player = &(connection->players[player_id]);
char *user_message = (char *) calloc(MAX_MSG_SIZE, sizeof(char));
int char_index = 0;
int destination_id = 0;
log_debug("receiving message from pl... | false | false | false | false | false | 0 |
set_fan_min(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
int nr = to_sensor_dev_attr(attr)->index;
struct lm85_data *data = dev_get_drvdata(dev);
struct i2c_client *client = data->client;
unsigned long val;
int err;
err = kstrtoul(buf, 10, &val);
if (err)
return err;
... | false | false | false | false | false | 0 |
PrintSubst(CONSFILE *pcf, char *pcMach, char *string, char *subst)
#else
PrintSubst(pcf, pcMach, string, subst)
CONSFILE *pcf;
char *pcMach;
char *string;
char *subst;
#endif
{
if (string == (char *)0)
return;
if (subst != (char *)0) {
char *str;
if ((str = StrDup(string)) == (char *)0)
... | false | false | false | false | false | 0 |
append(char* buf, bin_t::uint_t x)
{
char* l = buf;
char* r = buf;
do {
*r++ = '0' + x % 10;
x /= 10;
} while (x);
char* e = r--;
while (l < r) {
const char t = *l;
*l++ = *r;
*r-- = t;
}
*e = '\0';
return e;
} | false | false | false | false | false | 0 |
GetDocuParagraph()
{
xmlNode * node;
if ( iterator == NULL ) {
node = messageNode->children;
while ( node->type != XML_ELEMENT_NODE ) { node = node->next; }
// jump over the error message - we only want the docu itself
node = node->next;
}
else {
node = iterator->next;... | false | false | false | false | false | 0 |
write_reinf(void) {
/* get path for reinforcements */
reinfrc = output_file;
if (!reinfrc && within_source_tree) {
reinfrc = srcdir_path_from_bindir(in_place_reinfrc);
/* FIXME: leaks a string */
}
if (!save_reinf())
abortf("Saving changes to %s failed\n", reinfrc);
} | false | false | false | false | false | 0 |
hfi1_process_ib_mad(struct ib_device *ibdev, int mad_flags, u8 port,
const struct ib_wc *in_wc,
const struct ib_grh *in_grh,
const struct ib_mad *in_mad,
struct ib_mad *out_mad)
{
int ret;
switch (in_mad->mad_hdr.mgmt_class) {
case IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE:
case IB_... | false | false | false | false | false | 0 |
_vala_gee_tree_map_sub_map_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
GeeTreeMapSubMap * self;
self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TREE_MAP_TYPE_SUB_MAP, GeeTreeMapSubMap);
switch (property_id) {
case GEE_TREE_MAP_SUB_MAP_SIZE:
g_value_set_int (value, gee_... | false | false | false | false | false | 0 |
entry_match_pointer_p (tree type, int i)
{
tree t = TREE_VEC_ELT (compression_table, i);
while (TREE_CODE (type) == POINTER_TYPE
&& TREE_CODE (t) == POINTER_TYPE)
{
t = TREE_TYPE (t);
type = TREE_TYPE (type);
}
return (TREE_CODE (type) == RECORD_TYPE
&& TREE_CODE (t) == RECORD_TYPE
... | false | false | false | false | false | 0 |
iterate_tables(struct frame *frame, struct table *table,
struct coord base, int active)
{
int found_before, ok;
if (!table)
return run_loops(frame, frame->loops, base, active);
for (table->curr_row = table->rows; table->curr_row;
table->curr_row = table->curr_row->next) {
found_before = found;
if (ta... | false | false | false | false | false | 0 |
read_cookies( FILE *fp, int fmt )
{
long lines, cbuflen, offset, ignored = 0;
char *cptr;
offset = listed; /* may or may not be 0 */
printf( "Reading cookies..." );
fflush( stdout );
while( (cptr = read_cookie( fp, fmt, &cbuflen, &lines, NULL )) != NULL )
{
if( li... | false | false | false | false | false | 0 |
__wctype_l (const char *property, __locale_t locale)
{
const char *names;
unsigned int result;
size_t proplen = strlen (property);
size_t i;
names = locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_CLASS_NAMES)].string;
for (result = 0; ; result++)
{
size_t nameslen = strlen (names);... | false | false | false | false | false | 0 |
ToLower (byte c )
{
return ( c >='A' && c <= 'Z' ? c + 32 : c );
} | false | false | false | false | false | 0 |
MakeDeterministic() {
State *state;
bool changed;
lastSimState = lastState->nr;
maxStates = 2 * lastSimState; // heuristic for set size in Melted.set
FindCtxStates();
for (state = firstState; state != NULL; state = state->next)
do {changed = MakeUnique(state);} while (changed);
for (state = firstState; state !... | false | false | false | false | false | 0 |
__ecereMethod___ecereNameSpace__ecere__gui__controls__DataBox_OnDestroy(struct __ecereNameSpace__ecere__com__Instance * this)
{
struct __ecereNameSpace__ecere__gui__controls__DataBox * __ecerePointer___ecereNameSpace__ecere__gui__controls__DataBox = (struct __ecereNameSpace__ecere__gui__controls__DataBox *)(this ? (((c... | false | false | false | true | false | 1 |
unmap(const char* subject) {
if(pool_handle_ == -1) return false;
FileLock lock(pool_handle_);
if(!lock) return false;
if(unlink((dir_+subject).c_str()) == 0) return true;
if(errno == ENOENT) return true;
return false;
} | false | false | false | false | false | 0 |
ring_buffer_free(struct ring_buffer *buffer)
{
int cpu;
#ifdef CONFIG_HOTPLUG_CPU
cpu_notifier_register_begin();
__unregister_cpu_notifier(&buffer->cpu_notify);
#endif
for_each_buffer_cpu(buffer, cpu)
rb_free_cpu_buffer(buffer->buffers[cpu]);
#ifdef CONFIG_HOTPLUG_CPU
cpu_notifier_register_done();
#endif
kf... | false | false | false | false | false | 0 |
ib_sa_path_rec_callback(struct ib_sa_query *sa_query,
int status,
struct ib_sa_mad *mad)
{
struct ib_sa_path_query *query =
container_of(sa_query, struct ib_sa_path_query, sa_query);
if (mad) {
struct ib_sa_path_rec rec;
ib_unpack(path_rec_table, ARRAY_SIZE(path_rec_table),
mad->data, &re... | false | false | false | false | false | 0 |
stonith_copy_hostlist(const char * const * hostlist)
{
int hlleng = 1;
const char * const * here = hostlist;
char ** hret;
char ** ret;
for (here = hostlist; *here; ++here) {
++hlleng;
}
ret = (char**)MALLOC(hlleng * sizeof(char *));
if (ret == NULL) {
return ret;
}
hret = ret;
for (here = hostlist; *... | false | false | false | false | false | 0 |
get_child_size (ClutterActor *actor,
ClutterOrientation orientation,
gfloat for_size,
gfloat *min_size_p,
gfloat *natural_size_p)
{
if (orientation == CLUTTER_ORIENTATION_HORIZONTAL)
clutter_actor_get_preferred_width (actor, for_size, min_size_p, natural_size_p)... | false | false | false | false | false | 0 |
LUKS_keyslot_area(struct luks_phdr *hdr,
int keyslot,
uint64_t *offset,
uint64_t *length)
{
if(keyslot >= LUKS_NUMKEYS || keyslot < 0)
return -EINVAL;
*offset = hdr->keyblock[keyslot].keyMaterialOffset * SECTOR_SIZE;
*length = AF_split_sectors(hdr->keyBytes, LUKS_STRIPES) * SECTOR_SIZE;
return 0;
} | false | false | false | false | false | 0 |
WidenVecOp_CONCAT_VECTORS(SDNode *N) {
// If the input vector is not legal, it is likely that we will not find a
// legal vector of the same size. Replace the concatenate vector with a
// nasty build vector.
EVT VT = N->getValueType(0);
EVT EltVT = VT.getVectorElementType();
DebugLoc dl = N->getDebugLoc();
... | false | false | false | false | false | 0 |
gdImageString16 (gdImagePtr im, gdFontPtr f,
int x, int y, unsigned short *s, int color)
{
int i;
int l;
l = strlen16 (s);
for (i = 0; (i < l); i++) {
gdImageChar (im, f, x, y, s[i], color);
x += f->w;
}
} | false | false | false | false | false | 0 |
_gk_verify_buffers(OM_uint32 *minor_status,
const gsskrb5_ctx ctx,
const gss_iov_buffer_desc *header,
const gss_iov_buffer_desc *padding,
const gss_iov_buffer_desc *trailer)
{
if (header == NULL) {
*minor_status = EINVAL;
return GSS_S_FAILURE;
}
if (IS_DCE_STYLE(ctx)) {
/*
* In DCE... | false | false | false | false | false | 0 |
LI13(V87)
object V87;
{ VMB13 VMS13 VMV13
goto TTL;
TTL:;
{object V88;
V88= Cnil;
{register object x= (V87),V89= (((object)VV[16])->s.s_dbind);
while(V89!=Cnil)
if(eql(x,V89->c.c_car->c.c_car) &&V89->c.c_car != Cnil){
V88= (V89->c.c_car);
goto T276;
}else V89=V89->c.c_cdr;
V88= Cnil;}
goto T276;
T276:;
if... | false | false | false | false | false | 0 |
ebt_free_u_entry(struct ebt_u_entry *e)
{
struct ebt_u_match_list *m_l, *m_l2;
struct ebt_u_watcher_list *w_l, *w_l2;
m_l = e->m_list;
while (m_l) {
m_l2 = m_l->next;
free(m_l->m);
free(m_l);
m_l = m_l2;
}
w_l = e->w_list;
while (w_l) {
w_l2 = w_l->next;
free(w_l->w);
free(w_l);
w_l = w_l2;
}
... | false | true | false | false | true | 1 |
obj2ast_alias(PyObject* obj, alias_ty* out, PyArena* arena)
{
PyObject* tmp = NULL;
identifier name;
identifier asname;
if (PyObject_HasAttrString(obj, "name")) {
int res;
tmp = PyObject_GetAttrString(obj, "name");
if (tmp == NULL) goto fa... | false | false | false | false | false | 0 |
get_shown_at(int pos) const
// used by ED4_cursor::updateAwars to get search-comment
{
ED4_SearchPosition *p = get_last_starting_before(ED4_ANY_PATTERN, pos, 0); // @@@ tofix: should find last_ending before
ED4_SearchPosition *best = 0;
if (!p) {
p = get_first();
}
if (p && !p->containsPos... | false | false | false | false | false | 0 |
register_target(struct arptables_target *me)
{
if (strcmp(me->version, program_version) != 0) {
fprintf(stderr, "%s: target `%s' v%s (I'm v%s).\n",
program_name, me->name, me->version, program_version);
exit(1);
}
if (find_target(me->name, DONT_LOAD)) {
fprintf(stderr, "%s: target `%s' already registered.\... | false | false | false | false | false | 0 |
markAnythingOverdefined(Value *V) {
if (const StructType *STy = dyn_cast<StructType>(V->getType()))
for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i)
markOverdefined(getStructValueState(V, i), V);
else
markOverdefined(V);
} | false | false | false | false | false | 0 |
DropRef( int rindex ){
std::vector<int>& refs = m_pparams.Refs();
if (rindex==1 || rindex==2 )
refs.erase( refs.begin()+rindex-1 );
// Now reconfigure the motion data
if ( m_me_data!=NULL )
m_me_data->DropRef( rindex );
} | false | false | false | false | false | 0 |
updateData(void)
{
if (MSView::model()==0) internalCouple(new MSTerm());
MSEntryFieldPlus::updateData();
} | false | false | false | false | false | 0 |
ungrab_all (Widget w, Time ungrabtime)
{
XtUngrabPointer (w, ungrabtime);
if (GRAB_KEYBOARD) XtUngrabKeyboard (w, ungrabtime);
} | false | false | false | false | false | 0 |
heap_swap(TimerHeap *heap, long index1, long index2)
{
Timer *t;
gw_assert(index1 >= 0);
gw_assert(index1 < heap->len);
gw_assert(index2 >= 0);
gw_assert(index2 < heap->len);
if (index1 == index2)
return;
t = heap->tab[index1];
heap->tab[index1] = heap->tab[index2];
heap->... | false | false | false | false | false | 0 |
GResourceFindString(char *name) {
int pos;
pos = _GResource_FindResName(name);
if ( pos==-1 )
return( NULL );
else
return( copy(_GResource_Res[pos].val));
} | false | false | false | false | false | 0 |
prism54_set_essid(struct net_device *ndev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
{
islpci_private *priv = netdev_priv(ndev);
struct obj_ssid essid;
memset(essid.octets, 0, 33);
/* Check if we were asked for `any' */
if (dwrq->flags && dwrq->length) {
if (dwrq->length > 32)
re... | false | false | false | false | false | 0 |
d_mark_used (tree exp)
{
switch (TREE_CODE (exp))
{
case VAR_DECL:
case PARM_DECL:
TREE_USED (exp) = 1;
break;
case ARRAY_REF:
case COMPONENT_REF:
case MODIFY_EXPR:
case REALPART_EXPR:
case IMAGPART_EXPR:
case NOP_EXPR:
case CONVERT_EXPR:
case ADDR_EXPR:
... | false | false | false | false | true | 1 |
set_str_val(const char *str, size_t len)
{
size_t prec;
int exp;
utf8_ptr p;
size_t rem;
int neg;
size_t idx;
int pt;
int significant;
/* get the precision */
prec = get_prec(ext_);
/* set the type to number */
set_type(ext_, VMBN_T_NUM);
/* initia... | false | false | false | false | false | 0 |
doinit() {
_theModel = generator()->standardModel();
tcHwTTbAPtr hwTTbA=dynamic_ptr_cast<tcHwTTbAPtr>(_theModel);
if(hwTTbA) {
_cZPTU_R =hwTTbA->_cZPTU_right();
_cZPTU_L =hwTTbA->_cZPTU_left();
_cZPUU_R =hwTTbA->_cZPUU_right();
_cZPUU_L =hwTTbA->_cZPUU_left();
_cZPCC_R =hwTTbA->_cZPCC_right(... | false | false | false | false | false | 0 |
document_get_modified (Document* self) {
gboolean result = FALSE;
gboolean _tmp0_ = FALSE;
gboolean _tmp1_ = FALSE;
g_return_val_if_fail (self != NULL, FALSE);
_tmp0_ = self->priv->new_file;
if (_tmp0_) {
result = FALSE;
return result;
}
_tmp1_ = gtk_text_buffer_get_modified ((GtkTextBuffer*) G_TYPE_CHECK_I... | false | false | false | false | false | 0 |
fast12_score(const byte* i, int stride, xy* corners, int num_corners, int b)
{
int* scores = (int*)malloc(sizeof(int)* num_corners);
int n;
int pixel[16];
make_offsets(pixel, stride);
for(n=0; n < num_corners; n++)
scores[n] = fast12_corner_score(i + corners[n].y*stride + corners[n].x, pixel, b);
r... | false | true | false | false | false | 1 |
coeff(int narg, char **arg)
{
if (narg != 3) error->all(FLERR,"Incorrect args for improper coefficients");
if (!allocated) allocate();
int ilo,ihi;
force->bounds(arg[0],atom->nimpropertypes,ilo,ihi);
double k_one = force->numeric(FLERR,arg[1]);
double w_one = force->numeric(FLERR,arg[2]);
// convert w0... | false | false | false | false | false | 0 |
daap_open_connection (gchar *host, gint port)
{
gint ai_status;
gint sockfd;
struct sockaddr_in server;
struct addrinfo *ai_hint, *ai_result;
GIOChannel *sock_chan;
GError *err = NULL;
sockfd = socket (AF_INET, SOCK_STREAM, 0);
if (sockfd == -1) {
return NULL;
}
sock_chan = g_io_channel_unix_new (sockfd);... | false | false | false | false | false | 0 |
usnic_uiom_unmap_sorted_intervals(struct list_head *intervals,
struct usnic_uiom_pd *pd)
{
struct usnic_uiom_interval_node *interval, *tmp;
long unsigned va, size;
list_for_each_entry_safe(interval, tmp, intervals, link) {
va = interval->start << PAGE_SHIFT;
size = ((interval->last - interval->start) + 1)... | false | false | false | false | false | 0 |
render_string(Widget *w, int left, int top, int right, int bottom, int fy)
{
debug(RPT_DEBUG, "%s(w=%p, left=%d, top=%d, right=%d, bottom=%d, fy=%d)",
__FUNCTION__, w, left, top, right, bottom, fy);
if ((w != NULL) && (w->text != NULL) &&
(w->x > 0) && (w->y > 0) && (w->y > fy) && (w->y <= bottom - top)) {... | true | true | false | false | false | 1 |
mcp23017_read_regs(struct mcp23s08 *mcp, unsigned reg, u16 *vals, unsigned n)
{
while (n--) {
int ret = mcp23017_read(mcp, reg++);
if (ret < 0)
return ret;
*vals++ = ret;
}
return 0;
} | false | false | false | false | false | 0 |
asctime_internal (const struct tm *tp, char *buf, size_t buflen)
{
if (tp == NULL)
{
__set_errno (EINVAL);
return NULL;
}
/* We limit the size of the year which can be printed. Using the %d
format specifier used the addition of 1900 would overflow the
number and a negative vaue is pr... | false | false | false | false | false | 0 |
g2_X11_query_pointer(int pid, void *pdp,
int *x, int *y, unsigned int *button)
{
Bool rv;
g2_X11_device *xout=&g2_X11_dev[pid];
Window root, child;
int rx, ry;
rv = XQueryPointer(xout->display, xout->window,
&root, &child, &rx, &ry,
x, y, button);
if(rv)
return 0;
el... | false | false | false | false | false | 0 |
H5S_hyper_intersect_block (H5S_t *space, hsize_t *start, hsize_t *end)
{
htri_t ret_value=FAIL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
/* Sanity check */
HDassert(space);
HDassert(start);
HDassert(end);
/* Check for 'all' selection, instead of a hyperslab selection */
/* (Tec... | false | false | false | false | false | 0 |
new_field(int rows, int cols, int frow, int fcol, int nrow, int nbuf)
{
FIELD *New_Field = (FIELD *)0;
int err = E_BAD_ARGUMENT;
if (rows>0 &&
cols>0 &&
frow>=0 &&
fcol>=0 &&
nrow>=0 &&
nbuf>=0 &&
((err = E_SYSTEM_ERROR) != 0) && /* trick: this resets the default error ... | false | false | false | false | false | 0 |
ast_smoother_read(struct ast_smoother *s)
{
struct ast_frame *opt;
int len;
/* IF we have an optimization frame, send it */
if (s->opt) {
if (s->opt->offset < AST_FRIENDLY_OFFSET)
ast_log(LOG_WARNING, "Returning a frame of inappropriate offset (%d).\n",
s->opt->offset);
opt = s->opt;
s->opt = NULL;... | false | false | false | false | false | 0 |
print(AW_device *device)
{
int i;
AW_rectangle ws; // window size
device->get_area_size(&ws);
device->clear(-1);
struct AW_xfig_text *xtext;
for (xtext = text; xtext; xtext=xtext->next){
char *str = xtext->text;
if (str[0]) {
int x = xtext->x;
int ... | false | false | false | false | false | 0 |
append_line(struct buffer *buffer, const char *line)
{
int len = strlen(line);
if (buffer->nr + len > buffer->alloc) {
buffer->alloc = alloc_nr(buffer->nr + len);
buffer->ptr = xrealloc(buffer->ptr, buffer->alloc);
}
memcpy(buffer->ptr + buffer->nr, line, len);
buffer->nr += len;
} | false | false | false | false | false | 0 |
il4965_hdl_c_stats(struct il_priv *il, struct il_rx_buf *rxb)
{
struct il_rx_pkt *pkt = rxb_addr(rxb);
if (le32_to_cpu(pkt->u.stats.flag) & UCODE_STATS_CLEAR_MSK) {
#ifdef CONFIG_IWLEGACY_DEBUGFS
memset(&il->_4965.accum_stats, 0,
sizeof(struct il_notif_stats));
memset(&il->_4965.delta_stats, 0,
... | false | false | false | false | false | 0 |
gee_concurrent_list_node_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gconstpointer data) {
GeeConcurrentListNode* self = NULL;
gpointer data_copy = NULL;
gconstpointer _tmp0_ = NULL;
gpointer _tmp1_ = NULL;
gconstpointer* data_ptr = NULL;
gpointer _tmp2_ =... | 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.