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 |
|---|---|---|---|---|---|---|
seeCursor()
{
// see if it is already visible
if ( _cursor.byteOffset() >= _topLeft &&
_cursor.byteOffset() <= _topLeft+bytesPerPage()-1 ) {
updateWord( localWordOffset() );
return;
} else {
// setTopLeft so cursor is in middle line of screen
setTopLeft( max(_cursor.byteOffset() - bytesPer... | false | false | false | false | false | 0 |
regcompW(regex_tW* expression, const wchar_t* ptr, int f)
{
if(expression->re_magic != wmagic_value)
{
expression->guts = 0;
#ifndef BOOST_NO_EXCEPTIONS
try{
#endif
expression->guts = new wc_regex_type();
#ifndef BOOST_NO_EXCEPTIONS
} catch(...)
{
return REG_ESPACE;
}
... | false | false | false | false | false | 0 |
erase_dirty_grid(struct atarimo_data *mo, const struct rectangle *cliprect)
{
int sx = cliprect->min_x >> mo->tilexshift;
int ex = cliprect->max_x >> mo->tilexshift;
int sy = cliprect->min_y >> mo->tileyshift;
int ey = cliprect->max_y >> mo->tileyshift;
int y;
/* loop over all grid rows that intersect ou... | false | false | false | false | false | 0 |
lua_image_draw(lua_State *L) {
struct Image *pImage = checkImage(L, 1);
int argc = lua_gettop(state);
int x, y;
int result;
if (argc == 3) {
if ((lua_type(state, 2) == LUA_TNUMBER) &&
(lua_type(state, 3) == LUA_TNUMBER)) {
x = lua_tonumber(state, 2);
y = ... | false | false | false | false | false | 0 |
print_array_type(h5tools_str_t *buffer, hid_t type, int ind)
{
hid_t super;
int ndims, i;
hsize_t *dims=NULL;
if (H5T_ARRAY!=H5Tget_class(type))
return FALSE;
ndims = H5Tget_array_ndims(type);
if (ndims) {
dims = (hsize_t *)HDmalloc((unsigned)ndims * sizeof(dim... | false | false | false | false | false | 0 |
infereWriteTableType(Type tbl, Type wi, Type wd)
{
TableType* tt = isTableType(tbl);
if (tt == 0) {
cerr << "ERROR infering write table type, wrong table type : " << tbl << endl;
exit(1);
}
SimpleType* st = isSimpleType(wi);
if (st == 0 || st->nature() > kInt) {
cerr << "ERROR infering write table type, wron... | false | false | false | false | false | 0 |
print_progress (CutConsoleUI *console, CutTestResultStatus status,
gchar const *mark)
{
print_with_color(console, status_to_color(status), "%s", mark);
console->progress_row += strlen(mark);
if (console->progress_row >= console->progress_row_max) {
if (console->progress_row_max != -... | false | false | false | false | false | 0 |
promoteSanePivot (dualcand_struct *incands)
/*
This routine attempts to promote a sane pivot high enough in the list to be
used. The rationale is this: Mad pivots are tiny. If the delta of a sane
pivot is small enough, we won't cause dual infeasibility. Suppose we have
two variables x<s> (sane) and x<m> (mad). ... | false | false | false | false | false | 0 |
addFreeRect(const QRect& r)
{
// do not add invalid rects
if ((r.width() < 1) || (r.height() < 1)) return;
if (0) qDebug() << "addFree(" << path(0).join("/") << ", "
<< r.x() << "/" << r.y() << "-"
<< r.width() << "x" << r.height() << ")";
if (_freeRects.isEmpty()) {
_freeRects.append(r... | false | false | false | false | false | 0 |
Image() const
{
bool dummy = true;
if (dummy) // get rid of warning message
Throw(InternalException("Cannot apply Image to this matrix type"));
return 0;
} | false | false | false | false | false | 0 |
setup_pcm_stream(struct hda_pcm_stream *str,
const struct hda_pcm_stream *default_str,
const struct hda_pcm_stream *spec_str,
hda_nid_t nid)
{
*str = *default_str;
if (nid)
str->nid = nid;
if (spec_str) {
if (spec_str->substreams)
str->substreams = spec_str->substreams;
if (spec_str-... | false | false | false | false | false | 0 |
tb_project_to_sphere(float r, float x, float y)
{
float d, t, z;
d = sqrt(x*x + y*y);
if (d < r * 0.70710678118654752440) { /* Inside sphere */
z = sqrt(r*r - d*d);
} else { /* On hyperbola */
t = r / 1.41421356237309504880;
z = t*t / d;
}
return z;
} | false | false | false | false | false | 0 |
isParentOf(string cpath) const
{
if (isDestroyed())
return false;
string pfix=path + hiersep;
if (imapAccount.smap)
pfix += "/"; // SMAP implies this
return (cpath.size() > pfix.size() &&
pfix == cpath.substr(0, pfix.size()));
} | false | false | false | false | false | 0 |
gst_matroska_parse_handle_sink_event (GstPad * pad, GstEvent * event)
{
gboolean res = TRUE;
GstMatroskaParse *parse = GST_MATROSKA_PARSE (GST_PAD_PARENT (pad));
GST_DEBUG_OBJECT (parse,
"have event type %s: %p on sink pad", GST_EVENT_TYPE_NAME (event), event);
switch (GST_EVENT_TYPE (event)) {
case... | false | false | false | false | false | 0 |
nmc93cX6_check_cs(struct nmc93cX6_group *g,u_int old,u_int new)
{
int i,res;
for(i=0;i<g->nr_eeprom;i++)
{
if (g->dout_status == EEPROM_DOUT_HIGH)
g->state[i].dataout_val = 1;
if (g->debug)
{
printf("EEPROM %s(%d): check_cs: check_bit(old,new,select_bit) "
... | false | false | false | false | false | 0 |
compute_one(int m)
{
int vidx = value2index[m];
int aidx = argindex[m];
// invoke compute if not previously invoked
if (which[m] == COMPUTE) {
Compute *compute = modify->compute[vidx];
if (!(compute->invoked_flag & INVOKED_PERATOM)) {
compute->compute_peratom();
compute->invoked_flag |= I... | false | false | false | false | false | 0 |
expect_acknowledge(SMSCenter *smsc, int *cmd, int *err)
{
char *end_of_dataset = NULL;
char *ack = NULL, *nck = NULL;
char *cmdspecifier = NULL, *errorspecifier = NULL;
int ret = 0;
#if 0
time_t thetime;
time(&thetime);
#endif
if (smsc == NULL) goto error;
/* Loop until we get an ack... | false | false | false | false | true | 1 |
setMeshSizes(double value)
{
int i;
for ( i = 0; i < numberObjects_; i++) {
OsiBiLinear * obj = dynamic_cast<OsiBiLinear *> (object_[i]);
if (obj) {
if (obj->xMeshSize() < 1.0 && obj->yMeshSize() < 1.0) {
#ifdef JJF_ZERO
numberContinuous++;
int xColumn... | false | false | false | false | false | 0 |
_signal_anchor_move(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
{
Widget_Data *wd = elm_widget_data_get(data);
if (!wd) return;
} | false | false | false | false | false | 0 |
lfn_checksum(BYTE *name) {
int Sum = 0, i;
for (i = 0; i < 11; i++) {
Sum = (((Sum & 1) << 7) | ((Sum & 0xFE) >> 1)) + name[i];
}
return Sum;
} | false | false | false | false | false | 0 |
compare_right(nat_char const *a, nat_char const *b)
{
int bias = 0;
/* The longest run of digits wins. That aside, the greatest
value wins, but we can't know that it will until we've scanned
both numbers to know that they have the same magnitude, so we
remember it in BIAS. */
for (;; a++, b++) {
if (... | false | false | false | false | false | 0 |
contacts_clickable_activate_timeout_cb (ContactsClickable* self) {
gboolean result = FALSE;
g_return_val_if_fail (self != NULL, FALSE);
contacts_clickable_finish_activate (self, TRUE);
result = FALSE;
return result;
} | false | false | false | false | false | 0 |
gtime ( struct tm *tm )
{
register int i,
sec,
mins,
hour,
mday,
mon,
year;
register long result;
if ((sec = tm -> tm_sec) < 0 || sec > 59
|| (mins = tm -> tm_min) < 0 || mins >... | false | false | false | false | false | 0 |
padItemForSourcePosition(int p) const
{
PadFragment *fragment = padFragmentForSourcePosition(p);
PadItem *item = dynamic_cast<PadItem*>(fragment);
PadFragment *parent = fragment;
while (parent && !item) {
parent = parent->parent();
item = dynamic_cast<PadItem*>(parent);
}
return ... | false | false | false | false | false | 0 |
uid_swap_lists(struct query *ctl)
{
/* debugging code */
if (outlevel >= O_DEBUG)
{
if (dofastuidl) {
report_build(stdout, GT_("Merged UID list from %s:"), ctl->server.pollname);
dump_list(ctl->oldsaved);
} else {
report_build(stdout, GT_("New UID list from %s:"), ctl->server.pollname);
... | false | false | false | false | false | 0 |
wshedBasins(L_WSHED *wshed,
PIXA **ppixa,
NUMA **pnalevels)
{
PROCNAME("wshedBasins");
if (!wshed)
return ERROR_INT("wshed not defined", procName, 1);
if (ppixa)
*ppixa = pixaCopy(wshed->pixad, L_CLONE);
if (pnalevels)
*pnalevels = numaClone(wshed... | false | false | false | false | false | 0 |
printBlock (std::ostream &os, Block *blk, Value *base, int ind) {
indent (os, ind) ;
os << "Block " << blk->name << " {\n" ;
if (blk->superblock != NULL) {
printBlock (os, blk->superblock->block, base, ind + 4) ;
}
Scope::VarMap::iterator i ;
for (i = blk->variables.begin() ; i != blk->v... | false | false | false | false | false | 0 |
tm_project_recreate_tags_array(TMProject *project)
{
guint i, j;
TMWorkObject *source_file;
g_return_if_fail(project);
#ifdef TM_DEBUG
g_message("Recreating tags for project: %s", project->work_object.file_name);
#endif
if (NULL != project->work_object.tags_array)
g_ptr_array_set_size(project->work_object.tags... | false | false | false | false | false | 0 |
gst_oss_src_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstOssSrc *src;
src = GST_OSS_SRC (object);
switch (prop_id) {
case PROP_DEVICE:
if (src->device)
g_free (src->device);
src->device = g_value_dup_string (value);
break;
de... | false | false | false | false | false | 0 |
commonarraysyntax(int &lexpos, int &lineno, int &arraynameid,
int &nindex, int indexarray[])
{
int noerrorlocal=1;
if (IsScalar(lexpos))
{
nindex=0;
return scalarsyntax(lexpos, arraynameid);
}
if (id==outArray[lexpos])
{
arraynameid=idnosyn++;
... | false | false | false | false | true | 1 |
isStringRepresentableAsLong(sds s, long *longval) {
char buf[32], *endptr;
long value;
int slen;
value = strtol(s, &endptr, 10);
if (endptr[0] != '\0') return REDIS_ERR;
slen = snprintf(buf,32,"%ld",value);
/* If the number converted back into a string is not identical
* then it's... | false | false | false | false | false | 0 |
parport_ieee1284_epp_write_addr (struct parport *port,
const void *buffer, size_t len,
int flags)
{
unsigned char *bp = (unsigned char *) buffer;
size_t ret = 0;
/* set EPP idle state (just to make sure) with strobe low */
parport_frob_control (port,
PARPORT_CONTROL_STROBE |
PARPORT_CON... | false | false | false | false | false | 0 |
gdata_contacts_contact_set_user_defined_field (GDataContactsContact *self, const gchar *name, const gchar *value)
{
g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self));
g_return_if_fail (name != NULL);
if (value == NULL) {
/* Removing a field */
g_hash_table_remove (self->priv->user_defined_fields, name);
} el... | false | false | false | false | false | 0 |
cmd_getstr (struct session *sess, char *tbuf, char *word[], char *word_eol[])
{
getvalinfo *info;
if (!word[4][0])
return FALSE;
info = malloc (sizeof (*info));
info->cmd = strdup (word[3]);
info->sess = sess;
fe_get_str (word[4], word[2], get_str_cb, info);
return TRUE;
} | false | false | false | false | false | 0 |
DirDelete(const std::string& path,bool recursive,uid_t uid,gid_t gid) {
if((uid && (uid != getuid())) || (gid && (gid != getgid()))) {
FileAccess fa;
if(!fa.fa_setuid(uid,gid)) { errno = fa.geterrno(); return false; }
if (recursive) {
if(!fa.fa_rmdirr(path)) { errno = fa.geterrno(); return false; }
... | false | false | false | false | false | 0 |
gda_sqlite_provider_create_operation (GdaServerProvider *provider, G_GNUC_UNUSED GdaConnection *cnc,
GdaServerOperationType type,
G_GNUC_UNUSED GdaSet *options, GError **error)
{
gchar *file;
GdaServerOperation *op;
gchar *str;
gchar *dir;
file = g_strdup_printf (PN... | false | false | false | false | false | 0 |
audacious_remote_is_running(DBusGProxy *proxy) {
char *string = NULL;
org_atheme_audacious_version(proxy, &string, &error);
g_clear_error(&error);
if(string) {
g_free(string);
return TRUE;
}
else
return FALSE;
} | false | false | false | false | false | 0 |
g2_c_newton(int n, const double *c1, const double *c2,
int o, const double *xv, double *yv)
{
int i, j;
double p, s;
double ddt[MaxPts][MaxPts]; /* Divided Difference Table */
if (n < 4) {
fputs("g2_c_newton: Error! Less than 4 points passed "
"to function g2_c_newton\n", stderr);
retu... | false | false | false | false | false | 0 |
sixpack_compat_ioctl(struct tty_struct * tty, struct file * file,
unsigned int cmd, unsigned long arg)
{
switch (cmd) {
case SIOCGIFNAME:
case SIOCGIFENCAP:
case SIOCSIFENCAP:
case SIOCSIFHWADDR:
return sixpack_ioctl(tty, file, cmd,
(unsigned long)compat_ptr(arg));
}
return -ENOIOCTLCMD;
} | false | false | false | false | false | 0 |
script_handler_save(spif_charptr_t *params)
{
if (params && *params) {
if (!strcasecmp(params[0], "theme")) {
save_config(params[1], SAVE_THEME_CONFIG);
} else {
save_config(params[0], SAVE_USER_CONFIG);
}
} else {
save_config(NULL, SAVE_USER_CONFIG);
... | false | false | false | false | false | 0 |
addNameCharacters(const ISet<Char> &set)
{
ISetIter<Char> iter(set);
Char min, max;
while (iter.next(min, max)) {
set_[nmchar].addRange(min, max);
set_[significant].addRange(min, max);
categoryTable_.setRange(min, max, otherNameCategory);
}
} | false | false | false | false | false | 0 |
scgi_proclist_sort_up(server *srv, scgi_extension_host *host, scgi_proc *proc) {
scgi_proc *p;
UNUSED(srv);
/* we have been the smallest of the current list
* and we want to insert the node sorted as soon
* possible
*
* 1 0 0 0 1 1 1
* | ^
* | |
* +------+
*
*/
/* nothing to sort, onl... | false | false | false | false | false | 0 |
cs35l32_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
{
struct snd_soc_codec *codec = codec_dai->codec;
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
case SND_SOC_DAIFMT_CBM_CFM:
snd_soc_update_bits(codec, CS35L32_ADSP_CTL,
CS35L32_ADSP_MASTER_MASK,
CS35L32_ADSP_MASTER_MASK);
break;
ca... | false | false | false | false | false | 0 |
bin_eval(const rpt_expr::pointer &lhs,
rpt_expr::pointer (*op)(const rpt_expr::pointer &lhs,
const rpt_expr::pointer &rhs),
const rpt_expr::pointer &rhs)
{
//
// evaluate the left hand side
//
trace(("bin_eval()\n{\n"));
rpt_value::pointer ptr = lhs->evaluate(true, false);
if (pt... | false | false | false | false | false | 0 |
knuth_morris_pratt_unibyte (const char *haystack, const char *needle,
const char **resultp)
{
size_t m = strlen (needle);
/* Allocate the table. */
size_t *table = (size_t *) malloca (m * sizeof (size_t));
if (table == NULL)
return false;
/* Fill the table.
For 0 < i < m:
0 < table[i]... | false | false | false | false | false | 0 |
ssh_new(void) {
ssh_session session;
char *id = NULL;
int rc;
session = malloc(sizeof (struct ssh_session_struct));
if (session == NULL) {
return NULL;
}
ZERO_STRUCTP(session);
session->next_crypto = crypto_new();
if (session->next_crypto == NULL) {
goto err;
}
session->socket = ssh_soc... | false | false | false | false | false | 0 |
is_ip6_in_prefix_list(struct in6_addr *target, struct prefix_list *plist){
unsigned int i, j, full16, rest16;
u_int16_t mask16;
for(i=0; i < plist->nprefix; i++){
full16=(plist->prefix[i])->len / 16;
rest16=(plist->prefix[i])->len % 16;
mask16 = 0xffff;
for(j=0; j < full16; j++)
if(target->s6_addr16[j] ... | false | false | false | false | false | 0 |
setTraceItemDelayed(CostItem* i)
{
// no need to select same item a 2nd time...
if (_traceItemDelayed == i) return;
_traceItemDelayed = i;
_lastSender = sender();
qDebug() << "Selected " << (i ? i->fullName() : "(none)");
#if TRACE_UPDATES
qDebug("QCGTopLevel::setTraceItemDelayed(%s), sender %s",
... | false | false | false | false | false | 0 |
signal_bss_added(const char *path, DBusMessageIter *iter)
{
GSupplicantInterface *interface;
SUPPLICANT_DBG("");
interface = g_hash_table_lookup(interface_table, path);
if (interface == NULL)
return;
interface_bss_added_with_keys(iter, interface);
} | false | false | false | false | false | 0 |
get_res(struct mlx4_dev *dev, int slave, u64 res_id,
enum mlx4_resource type,
void *res)
{
struct res_common *r;
int err = 0;
spin_lock_irq(mlx4_tlock(dev));
r = find_res(dev, res_id, type);
if (!r) {
err = -ENONET;
goto exit;
}
if (r->state == RES_ANY_BUSY) {
err = -EBUSY;
goto exit;
}
if... | false | false | false | false | false | 0 |
wm2000_anc_mode_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev);
unsigned int anc_active = ucontrol->value.integer.value[0];
int ret;
if (anc_active > 1)
r... | false | false | false | false | false | 0 |
WXMPMeta_SetProperty_Bool_1 ( XMPMetaRef xmpRef,
XMP_StringPtr schemaNS,
XMP_StringPtr propName,
XMP_Bool propValue,
XMP_OptionBits options,
WXMP_Result * wResult )
{
XMP_ENTER_WRAPPER ( "WXMPMeta_SetProperty_Bool_1" )
if ( (schemaNS == 0) || (*schemaNS == 0) ) X... | false | false | false | true | false | 1 |
ptrace (enum __ptrace_request request, ...)
{
va_list ap;
pid_t pid;
void *addr;
void *data;
va_start(ap, request);
pid = va_arg(ap, pid_t);
addr = va_arg(ap, void *);
data = va_arg(ap, void *);
va_end(ap);
pid = dmtcp::VirtualPidTable::instance().originalToCurrentPid(pid);
long ptrace_ret = _r... | false | false | false | false | false | 0 |
e_dbhash_compare (EDbHash *edbh,
const gchar *key,
const gchar *compare_data)
{
DB *db;
DBT dkey;
DBT ddata;
guint8 compare_hash[16];
gsize length = sizeof (compare_hash);
g_return_val_if_fail (edbh != NULL, FALSE);
g_return_val_if_fail (edbh->priv != NULL, FALSE);
g_return_... | false | false | false | false | false | 0 |
_global_lock(PyObject *self, PyObject *args)
{
PyObject *server;
PyObject *key;
server_rec *s;
py_global_config *glb;
int index = -1;
apr_status_t rv;
if (! PyArg_ParseTuple(args, "OO|i", &server, &key, &index))
return NULL;
if (! MpServer_Check(server)) {
PyErr_SetS... | false | false | false | false | false | 0 |
iffts1(float *ioptr, long M, long Rows, float *Utbl, short *BRLow){
/* Compute in-place inverse complex fft on the rows of the input array */
/* INPUTS */
/* *ioptr = input data array */
/* M = log2 of fft size */
/* Rows = number of rows in ioptr array (use Rows of 1 if ioptr is a 1 dimensional array) */
/* *Utbl = co... | false | false | false | false | false | 0 |
info_check_index(word *w, node *n, indexdata *idx)
{
int ret = 0;
for (; w; w = w->next) {
if (w->type == word_IndexRef) {
indextag *tag;
int i;
tag = index_findtag(idx, w->text);
if (!tag)
break;
for (i = 0; i < tag->nrefs; i++) {
indexentry *entry = tag->refs[i];
info_idx *i... | false | false | false | false | false | 0 |
run_plan_hooks(fftw_plan p)
{
if (rfftw_plan_hook && p) {
fftw_complete_twiddle(p->root, p->n);
rfftw_plan_hook(p);
}
} | false | false | false | false | false | 0 |
pixReadMemJpeg(const l_uint8 *cdata, size_t size, l_int32 cmflag,
l_int32 reduction, l_int32 *pnwarn, l_int32 hint)
{
return (PIX * )ERROR_PTR("function not present", "pixReadMemJpeg", NULL);
} | false | false | false | false | false | 0 |
gst_rtp_base_audio_payload_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec)
{
GstRTPBaseAudioPayload *payload;
payload = GST_RTP_BASE_AUDIO_PAYLOAD (object);
switch (prop_id) {
case PROP_BUFFER_LIST:
#if 0
payload->priv->buffer_list = g_value_get_boolean (va... | false | false | false | false | false | 0 |
value_pair_update(LList *pairs, LList *new_list)
{
LList *node;
for (node = new_list; node; node = node->next) {
value_pair *vp = node->data;
pairs = value_pair_remove(pairs, vp->key);
pairs = value_pair_add(pairs, vp->key, vp->value);
}
return pairs;
} | false | false | false | false | false | 0 |
engine_list_instance_init (EngineList * self) {
IBusEngineDesc** _tmp0_ = NULL;
_tmp0_ = g_new0 (IBusEngineDesc*, 0 + 1);
self->data = _tmp0_;
self->data_length1 = 0;
self->_data_size_ = self->data_length1;
self->ref_count = 1;
} | false | false | false | false | false | 0 |
rocket_touch (edict_t * ent, edict_t * other, cplane_t * plane,
csurface_t * surf)
{
vec3_t origin;
int n;
if (other == ent->owner)
return;
if (surf && (surf->flags & SURF_SKY))
{
G_FreeEdict (ent);
return;
}
if (ent->owner->client)
PlayerNoise (ent->owner, ent->s.origin,... | false | false | false | false | false | 0 |
extend_ref_init_temps_1 (tree decl, tree init, VEC(tree,gc) **cleanups)
{
tree sub = init;
tree *p;
STRIP_NOPS (sub);
if (TREE_CODE (sub) == COMPOUND_EXPR)
{
TREE_OPERAND (sub, 1)
= extend_ref_init_temps_1 (decl, TREE_OPERAND (sub, 1), cleanups);
return init;
}
if (TREE_CODE (sub) ... | false | false | false | false | true | 1 |
snippets_db_get_path (GtkTreeModel *tree_model,
GtkTreeIter *iter)
{
GtkTreePath *path = NULL;
GtkTreeIter *iter_copy = NULL;
gint count = 0;
GList *l_iter = NULL;
/* Assertions */
g_return_val_if_fail (ANJUTA_IS_SNIPPETS_DB (tree_model), NULL);
g_return_val_if_fail (iter != NULL, NULL);
... | false | false | false | false | false | 0 |
FindOperation(int operationType,
const char* name,
int fromFieldLoc,
int toFieldLoc,
Operation*& before)
{
if (!name) {return 0;}
Op... | false | false | false | false | false | 0 |
aes128k128d(u8 *key, u8 *data, u8 *ciphertext)
{
int round;
int i;
u8 intermediatea[16];
u8 intermediateb[16];
u8 round_key[16];
for (i = 0; i < 16; i++)
round_key[i] = key[i];
for (round = 0; round < 11; round++) {
if (round == 0) {
xor_128(round_key, data, ciphertext);
next_key(round_key, round);
}... | false | false | false | false | false | 0 |
removeAvailabilities()
{
if (m_AvailabilityModel) {
QModelIndex idx = ui->availabilityView->currentIndex();
if (idx.parent()==QModelIndex()) {
if (m_AvailabilityModel->rowCount()==1) {
Utils::warningMessageBox(tr("Can not delete all availabilities"),
... | false | false | false | false | false | 0 |
gst_pngenc_class_init (GstPngEncClass * klass)
{
GObjectClass *gobject_class;
gobject_class = (GObjectClass *) klass;
parent_class = g_type_class_peek_parent (klass);
gobject_class->get_property = gst_pngenc_get_property;
gobject_class->set_property = gst_pngenc_set_property;
g_object_class_install_prop... | false | false | false | false | false | 0 |
wrap_scroll_lines(GVDataPresentation *dp, offset_type current_offset, int delta)
{
gboolean forward = TRUE;
if (delta==0)
return current_offset;
if (delta<0)
{
delta = abs(delta);
forward = FALSE;
}
while (delta--)
{
offset_type temp;
if (forward)
... | false | false | false | false | false | 0 |
on_warp_frame_scroll_event (GtkWidget *widget,
GdkEventScroll *sevent,
GapPlayerMainGlobalParams *gpp)
{
/*if(gap_debug) printf("on_warp_frame_scroll_event: START\n"); */
p_stop_playback(gpp);
if((sevent->direction == GDK_SCROLL_UP)
... | false | false | false | false | false | 0 |
VisitRegExpLiteral(RegExpLiteral* expr) {
HRegExpLiteral* instr = new HRegExpLiteral(expr->pattern(),
expr->flags(),
expr->literal_index());
ast_context()->ReturnInstruction(instr, expr->id());
} | false | false | false | false | false | 0 |
extraFields( const KUrl &url )
{
KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(url.protocol());
if ( !prot )
return ExtraFieldList();
return prot->d_func()->extraFields;
} | false | false | false | false | false | 0 |
cups_raster_read_header(
cups_raster_t *r) /* I - Raster stream */
{
int len; /* Length for read/swap */
if (r == NULL || r->mode != CUPS_RASTER_READ)
return (0);
/*
* Get the length of the raster header...
*/
if (r->sync == CUPS_RASTER_SYNCv1 || r->sync == CUPS_RASTER_REVSYNCv1)
len = s... | false | false | false | false | true | 1 |
z_mulmod_precomp(unsigned long a, unsigned long b,
unsigned long n, double ninv)
{
unsigned long quot = (unsigned long) ((double) a * (double) b * ninv);
long rem = a*b - quot*n;
if (rem < 0)
{
rem += n;
if (rem < 0) return rem + n;
} else i... | false | false | false | false | false | 0 |
apol_infoflow_analysis_t_run(apol_infoflow_analysis_t *self,apol_policy_t *p){
apol_infoflow_t *ai = NULL;
BEGIN_EXCEPTION
ai = apol_infoflow_create();
if (!ai) {
{tcl_throw_error("Out of memory"); goto fail;};
}
if (apol_infoflow_analysis_do(p, self, &ai->v, &ai->g)) {
{tcl_throw_error("Could not run... | false | false | false | false | false | 0 |
qib_create_qp0_ah(struct qib_ibport *ibp, u16 dlid)
{
struct ib_ah_attr attr;
struct ib_ah *ah = ERR_PTR(-EINVAL);
struct qib_qp *qp0;
memset(&attr, 0, sizeof(attr));
attr.dlid = dlid;
attr.port_num = ppd_from_ibp(ibp)->port;
rcu_read_lock();
qp0 = rcu_dereference(ibp->qp0);
if (qp0)
ah = ib_create_ah(qp0->... | false | false | false | false | false | 0 |
ValidateCRC32()
{
HashTestTuple testSet[] =
{
HashTestTuple("", "\x00\x00\x00\x00"),
HashTestTuple("a", "\x43\xbe\xb7\xe8"),
HashTestTuple("abc", "\xc2\x41\x24\x35"),
HashTestTuple("message digest", "\x7f\x9d\x15\x20"),
HashTestTuple("abcdefghijklmnopqrstuvwxyz", "\xbd\x50\x27\x4c"),
HashTestTuple("ABCDE... | false | false | false | false | false | 0 |
find_entry_internal_uniqueid(
Slapi_PBlock *pb,
backend *be,
const char *uniqueid,
int lock,
back_txn *txn
)
{
ldbm_instance *inst = (ldbm_instance *) be->be_instance_info;
struct backentry *e;
int err;
size_t tries = 0;
while ( (tries < LDBM_CACHE_RETRY_COUNT) &&
(e = uniqueid2entry(be, u... | false | false | false | false | false | 0 |
beiscsi_set_static_ip(struct Scsi_Host *shost,
struct iscsi_iface_param_info *iface_param,
void *data, uint32_t dt_len)
{
struct beiscsi_hba *phba = iscsi_host_priv(shost);
struct iscsi_iface_param_info *iface_ip = NULL;
struct iscsi_iface_param_info *iface_subnet = NULL;
struct nlattr *nla;
int ret;
switch... | false | false | false | false | false | 0 |
cpl_propertylist_get_const(const cpl_propertylist *self, long position)
{
#ifdef CPL_PROPERTYLIST_ENABLE_LOOP_CHECK
cxsize i = 0;
#endif
cx_deque_iterator first, last;
if (self == NULL) {
cpl_error_set_(CPL_ERROR_NULL_INPUT);
return NULL;
}
if (position < 0) {
return NU... | false | false | false | false | false | 0 |
read_floorplan(struct fpga_model* model, FILE* f)
{
char line[1024];
int beg, end;
RC_CHECK(model);
while (fgets(line, sizeof(line), f)) {
next_word(line, 0, &beg, &end);
if (end == beg) continue;
if (end-beg == 3
&& !str_cmp(&line[beg], 3, "net", 3)) {
read_net_line(model, line, end);
}
if (en... | false | false | false | false | false | 0 |
RunDestroyOrders()
{
forlist(®ions) {
ARegion *r = (ARegion *) elem;
forlist(&r->objects) {
Object *o = (Object *) elem;
Unit *u = o->GetOwner();
if (u) {
if (u->destroy) {
Do1Destroy(r, o, u);
continue;
} else {
forlist(&o->units)
((Unit *) elem)->destroy = 0;
}
}
... | false | false | false | false | false | 0 |
get_const_data(Data_node *node_head)
{
Data_node *dnode;
Const_table *ct;
dnode = node_head;
switch( dnode->type ){
case TYPE_INT:
ct = get_const_int(dnode->val.i);
break;
case TYPE_REAL:
ct = get_const_real(dnode->val.r);
break;
case TYPE_DOUBLE:
ct ... | false | false | false | false | false | 0 |
cxd2841er_tune_s(struct dvb_frontend *fe,
bool re_tune,
unsigned int mode_flags,
unsigned int *delay,
enum fe_status *status)
{
int ret, carrier_offset;
struct cxd2841er_priv *priv = fe->demodulator_priv;
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
dev_dbg(&priv->i2c->d... | false | false | false | false | false | 0 |
Front(const List * l)
{
if (l == NULL) {
NullPtrError("Front");
return NULL;
}
if (0 == l->count) {
return NULL;
}
if (l->Flags & CONTAINER_READONLY) {
ErrorReadOnly(l,"Front");
return NULL;
}
return l->First->Data;
} | false | false | false | false | false | 0 |
testMechAttr(gss_const_OID attr,
gss_const_OID_set against)
{
int present = 0;
OM_uint32 minor;
if (GSS_ERROR(generic_gss_test_oid_set_member(&minor, attr,
(gss_OID_set)against,
&present)))
... | false | false | false | false | false | 0 |
switch_p_alloc_node_info(switch_node_info_t **switch_node)
{
sw_gen_node_info_t *gen_node_info;
if (debug_flags & DEBUG_FLAG_SWITCH)
info("switch_p_alloc_node_info() starting");
xassert(switch_node);
gen_node_info = xmalloc(sizeof(sw_gen_node_info_t));
gen_node_info->magic = SW_GEN_NODE_INFO_MAGIC;
*switch_nod... | false | false | false | false | false | 0 |
btusb_close(struct hci_dev *hdev)
{
struct btusb_data *data = hci_get_drvdata(hdev);
int err;
BT_DBG("%s", hdev->name);
cancel_work_sync(&data->work);
cancel_work_sync(&data->waker);
clear_bit(BTUSB_ISOC_RUNNING, &data->flags);
clear_bit(BTUSB_BULK_RUNNING, &data->flags);
clear_bit(BTUSB_INTR_RUNNING, &data-... | false | false | false | false | false | 0 |
Jim_LsetCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
if (argc < 3) {
Jim_WrongNumArgs(interp, 1, argv, "listVar ?index...? newVal");
return JIM_ERR;
}
else if (argc == 3) {
if (Jim_SetVariable(interp, argv[1], argv[2]) != JIM_OK)
return JIM_ERR;
... | false | false | false | false | false | 0 |
RecursiveScan(string const &Dir)
{
char *RealPath = NULL;
/* If noprefix is set then jam the scan root in, so we don't generate
link followed paths out of control */
if (InternalPrefix.empty() == true)
{
if ((RealPath = realpath(Dir.c_str(),NULL)) == 0)
return _error->Errno("realpath",_("Faile... | false | false | false | false | false | 0 |
qlcnic_has_mn(struct qlcnic_adapter *adapter)
{
u32 capability = 0;
int err = 0;
capability = QLCRD32(adapter, QLCNIC_PEG_TUNE_CAPABILITY, &err);
if (err == -EIO)
return err;
if (capability & QLCNIC_PEG_TUNE_MN_PRESENT)
return 1;
return 0;
} | false | false | false | false | false | 0 |
psnet_rel_send_ack(SOCKADDR *raddr, unsigned int sig, ubyte link_type, float time_sent)
{
int ret, sig_tmp;
reliable_header ack_header;
ack_header.type = RNT_ACK;
ack_header.data_len = sizeof(unsigned int);
ack_header.send_time = time_sent;
ack_header.send_time = INTEL_FLOAT(&ack_header.send_time);
sig_tmp = IN... | false | false | false | false | false | 0 |
snmp_enable_calllog(void) /* XXX - or take a callback routine ??? */
{
netsnmp_log_handler *logh;
int found = 0;
for (logh = logh_head; logh; logh = logh->next)
if (logh->type == NETSNMP_LOGHANDLER_CALLBACK) {
netsnmp_enable_this_loghandler(logh);
found ... | false | false | false | false | false | 0 |
oppcolor (byte *pos, int oldx, int oldy, int x, int y)
/* True if one square is W and the other is B */
{
int oldv = pos [oldy * board_wid + oldx], v = pos [y * board_wid + x];
if (ANTICHESS_ISWHITE (oldv) && ANTICHESS_ISBLACK (v)) return 1;
if (ANTICHESS_ISBLACK (oldv) && ANTICHESS_ISWHITE (v)) return 1;
return 0... | false | false | false | false | false | 0 |
DepConfigure(DepIterator D)
{
// Never consider reverse configuration dependencies.
if (D.Reverse() == true)
return true;
for (; D.end() == false; ++D)
if (D->Type == pkgCache::Dep::Depends)
if (VisitProvides(D,false) == false)
return false;
return true;
} | false | false | false | false | false | 0 |
vorbis_comment_query_count(vorbis_comment *vc, char *tag){
int i,count=0;
int taglen = strlen(tag)+1; /* +1 for the = we append */
char *fulltag = alloca(taglen+1);
strcpy(fulltag,tag);
strcat(fulltag, "=");
for(i=0;i<vc->comments;i++){
if(!tagcompare(vc->user_comments[i], fulltag, taglen))
count... | false | true | false | false | false | 1 |
EUC_H_Init (HPDF_Encoder encoder)
{
HPDF_CMapEncoderAttr attr;
HPDF_STATUS ret;
if ((ret = HPDF_CMapEncoder_InitAttr (encoder)) != HPDF_OK)
return ret;
attr = (HPDF_CMapEncoderAttr)encoder->attr;
if (HPDF_CMapEncoder_AddCMap (encoder, CMAP_ARRAY_EUC_H) != HPDF_OK)
return encoder... | false | false | false | false | false | 0 |
identify_predicable_attribute (void)
{
struct queue_elem *elem;
char *p_true, *p_false;
const char *value;
/* Look for the DEFINE_ATTR for `predicable', which must exist. */
for (elem = define_attr_queue; elem ; elem = elem->next)
if (strcmp (XSTR (elem->data, 0), "predicable") == 0)
goto found;
... | false | false | false | false | false | 0 |
relay_switch_subbuf(struct rchan_buf *buf, size_t length)
{
void *old, *new;
size_t old_subbuf, new_subbuf;
if (unlikely(length > buf->chan->subbuf_size))
goto toobig;
if (buf->offset != buf->chan->subbuf_size + 1) {
buf->prev_padding = buf->chan->subbuf_size - buf->offset;
old_subbuf = buf->subbufs_produce... | 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.