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 |
|---|---|---|---|---|---|---|
tun_not_capable(struct tun_struct *tun)
{
const struct cred *cred = current_cred();
struct net *net = dev_net(tun->dev);
return ((uid_valid(tun->owner) && !uid_eq(cred->euid, tun->owner)) ||
(gid_valid(tun->group) && !in_egroup_p(tun->group))) &&
!ns_capable(net->user_ns, CAP_NET_ADMIN);
} | false | false | false | false | false | 0 |
internal_text_pattern_compare(text *arg1, text *arg2)
{
int result;
int len1,
len2;
len1 = VARSIZE_ANY_EXHDR(arg1);
len2 = VARSIZE_ANY_EXHDR(arg2);
result = memcmp(VARDATA_ANY(arg1), VARDATA_ANY(arg2), Min(len1, len2));
if (result != 0)
return result;
else if (len1 < len2)
return -1;
else if (len1... | false | false | false | false | false | 0 |
invent_extents(fr_map<ft_uoff> & extent_map, ft_uoff file_len, ft_uoff & ret_block_size_bitmask) const
{
fr_vector<ft_uoff> extent_vec;
file_len >>= this_block_size_log2;
ft_uoff pos = 0, hole, len, max_extent_len = ff_max2(file_len >> 16, (ft_uoff)0x100);
fr_extent<ft_uoff> extent;
while (pos < fi... | false | false | false | false | false | 0 |
make_complex (header *hd)
/**** make_complex
make a function argument complex.
****/
{ header *old=hd,*nextarg;
unsigned long size;
int r,c,i,j;
double *m,*m1;
hd=getvariablesub(hd);
if (iscomplex(hd)) return;
if (isinterval(hd))
{ output("Cannot convert from interval to complex.\n");
error=1; return;
}
hd=... | false | false | false | false | false | 0 |
soap_out_params(struct soap *soap, const char *tag, int id, const struct params *a, const char *type)
{
(void)soap; (void)tag; (void)id; (void)type;
if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_params), type))
return soap->error;
/* transient iterator skipped */
/* transient param... | false | false | false | false | false | 0 |
amdmsCalcConversionFactorGlobalLineR(amdmsALGO_PROPERTIES_ENV *env, int rX, int rY, int rW, int rH)
{
int iInput, nInputs;
int iPixel, nPixels;
int iX, iY;
int n = 0;
double x, y;
double sx = 0.0;
double sxx = 0.0;
double sy = 0.0;
do... | false | false | false | false | false | 0 |
bnx2x_exe_queue_add(struct bnx2x *bp,
struct bnx2x_exe_queue_obj *o,
struct bnx2x_exeq_elem *elem,
bool restore)
{
int rc;
spin_lock_bh(&o->lock);
if (!restore) {
/* Try to cancel this element queue */
rc = o->optimize(bp, o->owner, elem);
if (rc)
goto free_and_exit;
/* Ch... | false | false | false | false | false | 0 |
QaCallback( const void *inputBuffer, void *outputBuffer,
unsigned long framesPerBuffer,
const PaStreamCallbackTimeInfo* timeInfo,
PaStreamCallbackFlags statusFlags,
void *userData )
{
unsigned long i;
short pha... | false | false | false | false | false | 0 |
variant() const
{
if (m_tags.contains("Variant"))
return m_tags.value("Variant");
return "standard";
} | false | false | false | false | false | 0 |
neg_const_double_rtx_ok_for_fpa (rtx x)
{
REAL_VALUE_TYPE r;
int i;
if (!fp_consts_inited)
init_fp_table ();
REAL_VALUE_FROM_CONST_DOUBLE (r, x);
r = real_value_negate (&r);
if (REAL_VALUE_MINUS_ZERO (r))
return 0;
for (i = 0; i < 8; i++)
if (REAL_VALUES_EQUAL (r, values_fp[i]))
retur... | false | false | false | false | false | 0 |
get_absolute_dc_deltas(float *dc, int dc_len, float *dc_deltas) {
float last_dc=0;
for(int i=0; i < dc_len; i++) {
dc_deltas[i] = (last_dc - dc[i])*(last_dc - dc[i]);
last_dc = dc[i];
}
} | false | false | false | false | false | 0 |
fsmodem_open (qconn, ibaud, fwait, fuser)
struct sconnection *qconn;
long ibaud;
boolean fwait;
boolean fuser;
{
struct uuconf_modem_port *qm;
qm = &qconn->qport->uuconf_u.uuconf_smodem;
if (ibaud == (long) 0)
ibaud = qm->uuconf_ibaud;
if (! fsserial_open (qconn, ibaud, fwait, fuser,
... | false | false | false | false | false | 0 |
clearvisibility( GameMap* gamemap )
{
if (!gamemap || (gamemap->xsize <= 0) || (gamemap->ysize <= 0))
return;
for ( int p = 0; p < gamemap->getPlayerCount() ; p++ ) {
for ( Player::VehicleList::iterator i = gamemap->player[p].vehicleList.begin(); i != gamemap->player[p].vehicleList.end(); i++ )
... | false | false | false | false | false | 0 |
check_result_string(const char * value, const char *target, const char *function)
{
if (sge_strnullcmp(value, target) != 0) {
fprintf(stderr, "function "SFQ" failed\n", function);
exit_code = EXIT_FAILURE;
} else {
fprintf(stdout, "function "SFQ" ok\n", function);
}
} | false | false | false | false | false | 0 |
ring_buffer_get(struct perf_event *event)
{
struct ring_buffer *rb;
rcu_read_lock();
rb = rcu_dereference(event->rb);
if (rb) {
if (!atomic_inc_not_zero(&rb->refcount))
rb = NULL;
}
rcu_read_unlock();
return rb;
} | false | false | false | false | false | 0 |
read( utils::CStream &in )
{
uint32_t i,n;
in >> n;
BASE::clear();
for (i=0;i<n;i++)
{
CHMHMapArcPtr theObj = CHMHMapArc::Create();
in >> *theObj;
this->push_back( theObj );
}
} | false | false | false | false | false | 0 |
bfa_fcdiag_queuetest_timeout(void *cbarg)
{
struct bfa_fcdiag_s *fcdiag = cbarg;
struct bfa_diag_qtest_result_s *res = fcdiag->qtest.result;
bfa_trc(fcdiag, fcdiag->qtest.all);
bfa_trc(fcdiag, fcdiag->qtest.count);
fcdiag->qtest.timer_active = 0;
res->status = BFA_STATUS_ETIMER;
res->count = QTEST_CNT_... | false | false | false | false | false | 0 |
delete_builtin (b)
struct builtin *b;
{
int ind, size;
struct builtin *new_shell_builtins;
/* XXX - funky pointer arithmetic - XXX */
#ifdef __STDC__
ind = b - shell_builtins;
#else
ind = ((int)b - (int)shell_builtins) / sizeof (struct builtin);
#endif
size = num_shell_builtins * sizeof (struct builti... | false | false | false | false | false | 0 |
semantic(Scope *sc)
{ Expression *e;
#if LOGSEMANTIC
printf("AddExp::semantic('%s')\n", toChars());
#endif
if (!type)
{
BinExp::semanticp(sc);
e = op_overload(sc);
if (e)
return e;
Type *tb1 = e1->type->toBasetype();
Type *tb2 = e2->type->toBasetype()... | false | false | false | false | false | 0 |
initialize_allowed_input(void) {
char *str;
if (allowed_input_normal) {
free(allowed_input_normal);
allowed_input_normal = NULL;
}
if (allowed_input_view_only) {
free(allowed_input_view_only);
allowed_input_view_only = NULL;
}
if (! allowed_input_str) {
allowed_input_normal = strdup("KMBCF");
allowe... | false | false | false | false | false | 0 |
gst_udpsrc_getcaps (GstBaseSrc * src)
{
GstUDPSrc *udpsrc;
udpsrc = GST_UDPSRC (src);
if (udpsrc->caps)
return gst_caps_ref (udpsrc->caps);
else
return gst_caps_new_any ();
} | false | false | false | false | false | 0 |
mcr12_update_sprites(void)
{
int offs;
/* render the sprites into the bitmap, ORing together */
for (offs = 0; offs < spriteram_size; offs += 4)
{
int code, x, y, sx, sy, xcount, ycount, xtile, ytile, hflip, vflip;
/* skip if zero */
if (spriteram[offs] == 0)
continue;
/* extract the bits... | false | false | false | false | false | 0 |
uselink(const LinkSet *linkSet,
Boolean restore,
const Lpd *lpd)
{
if (lpd_.isNull())
return;
if (lpd != lpd_.pointer())
return;
if (restore)
open_.head()->current = open_.head()->restore;
else if (linkSet)
open_.head()->current = linkSet;
} | false | false | false | false | false | 0 |
truth_type_for (tree type)
{
if (TREE_CODE (type) == VECTOR_TYPE)
{
tree elem = lang_hooks.types.type_for_size
(GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (type))), 0);
return build_opaque_vector_type (elem, TYPE_VECTOR_SUBPARTS (type));
}
else
return boolean_type_node;
} | false | false | false | false | false | 0 |
Append (const Token &iOther)
{
if (!iOther.String)
return;
if (!String)
{
String = iOther.String;
Length = iOther.Length;
Allocated = iOther.Allocated;
iOther.Allocated = 0; // !!! not quite correct but effective
return;
}
if (Allocated)
{
... | false | false | false | false | false | 0 |
get_test_string (guint start_num, guint end_num)
{
GString *test_string;
guint i;
test_string = g_string_new (NULL);
for (i = start_num; i <= end_num; i++)
g_string_append_printf (test_string, "%u\n", i);
return g_string_free (test_string, FALSE);
} | false | false | false | false | false | 0 |
glade_widget_dup (GladeWidget * template_widget, gboolean exact)
{
GladeWidget *widget;
g_return_val_if_fail (GLADE_IS_WIDGET (template_widget), NULL);
glade_widget_push_superuser ();
widget =
glade_widget_dup_internal (template_widget, NULL, template_widget, exact);
glade_widget_pop_superuser ();
... | false | false | false | false | false | 0 |
parser_getval(struct parser *p, const char *name) {
struct parser_value *v;
for (v = p->fhead; v; v = (struct parser_value *)v->spec.next)
{
if (!strcmp(v->spec.name, name))
{
return v;
}
}
assert(0);
} | false | false | false | false | false | 0 |
mlx5_ib_modify_cq(struct ib_cq *cq, u16 cq_count, u16 cq_period)
{
struct mlx5_modify_cq_mbox_in *in;
struct mlx5_ib_dev *dev = to_mdev(cq->device);
struct mlx5_ib_cq *mcq = to_mcq(cq);
int err;
u32 fsel;
if (!MLX5_CAP_GEN(dev->mdev, cq_moderation))
return -ENOSYS;
in = kzalloc(sizeof(*in), GFP_KERNEL);
if ... | false | false | false | false | false | 0 |
makeenv(void)
{
FILE *ifp, *ofp;
char line[BUFSIZ];
char *s;
if (env) {
ifp = fopen(env, "r");
if (ifp == NULL)
err(1, "%s", env);
} else {
ifp = NULL;
}
ofp = fopen(path("env.c.new"), "w");
if (ofp == NULL)
err(1, "%s", path("env.c.new"));
fprintf(ofp, "#include <sys/types.h>\n");
fprintf(ofp, "#... | false | false | false | false | true | 1 |
pruneInvalid(Clauses &layer, size_t layer_idx) {
size_t j = 0;
for (size_t i = 0; i < layer.size(); i++)
if (layer[i]->validAt(layer_idx))
layer[j++] = layer[i];
else {
// printf("Clause no longer valid in layer %zu: ",layer_idx); printClauseNice(layer[i]->data);
layer[i]->... | false | false | false | false | false | 0 |
unload_package(std::string name, bool limbo)
{
CYG_REPORT_FUNCNAME("CdlConfiguration::unload_package");
CYG_REPORT_FUNCARG1XV(this);
CYG_PRECONDITION_THISC();
CdlLocalTransaction transaction(this);
this->unload_package(transaction.get(), name, limbo);
transaction.body();
CYG_REPORT_RETURN(... | false | false | false | false | false | 0 |
gf_isom_datamap_del(GF_DataMap *ptr)
{
if (!ptr) return;
//then delete the structure itself....
switch (ptr->type) {
//file-based
case GF_ISOM_DATA_FILE:
gf_isom_fdm_del((GF_FileDataMap *)ptr);
break;
case GF_ISOM_DATA_FILE_MAPPING:
gf_isom_fmo_del((GF_FileMappingDataMap *)ptr);
break;
//not implemented... | false | false | false | false | false | 0 |
bus_policy_append_console_rule (BusPolicy *policy,
dbus_bool_t at_console,
BusPolicyRule *rule)
{
if (at_console)
{
if (!_dbus_list_append (&policy->at_console_true_rules, rule))
return FALSE;
}
else
{
if (!_... | false | false | false | false | false | 0 |
LoadValueFromMemory(GenericValue &Result,
GenericValue *Ptr,
Type *Ty) {
const unsigned LoadBytes = getDataLayout().getTypeStoreSize(Ty);
switch (Ty->getTypeID()) {
case Type::IntegerTyID:
// An APInt with all words initially... | false | false | false | false | false | 0 |
read_all (lua_State *L, FILE *f) {
size_t nr;
luaL_Buffer b;
luaL_buffinit(L, &b);
do { /* read file in chunks of LUAL_BUFFERSIZE bytes */
char *p = luaL_prepbuffsize(&b, LUAL_BUFFERSIZE);
nr = fread(p, sizeof(char), LUAL_BUFFERSIZE, f);
luaL_addsize(&b, nr);
} while (nr == LUAL_BUFFERSIZE);
lu... | false | false | false | false | false | 0 |
rmi_scan_pdt(struct hid_device *hdev)
{
struct rmi_data *data = hid_get_drvdata(hdev);
struct pdt_entry entry;
int page;
bool page_has_function;
int i;
int retval;
int interrupt = 0;
u16 page_start, pdt_start , pdt_end;
hid_info(hdev, "Scanning PDT...\n");
for (page = 0; (page <= RMI4_MAX_PAGE); page++) {
... | false | false | false | false | false | 0 |
findIndexFilter(const char *columnname)
{
for (_subfilters_t::iterator it = _subfilters.begin();
it != _subfilters.end();
++it)
{
Filter *filter = *it;
void *refvalue = filter->indexFilter(columnname);
if (refvalue)
return refvalue;
}
return 0;... | false | false | false | false | false | 0 |
unity_tester_series_preview_renderer_on_change_selected_item_clicked (UnityTesterSeriesPreviewRenderer* self, GtkComboBox* combo) {
gint index = 0;
GtkComboBox* _tmp0_ = NULL;
const gchar* _tmp1_ = NULL;
const gchar* _tmp2_ = NULL;
gint _tmp3_ = 0;
UnityProtocolSeriesPreview* series_preview = NULL;
UnityProtocol... | false | false | false | false | true | 1 |
emit_support_tinfos (void)
{
static tree *const fundamentals[] =
{
&void_type_node,
&boolean_type_node,
&wchar_type_node,
&char_type_node, &signed_char_type_node, &unsigned_char_type_node,
&short_integer_type_node, &short_unsigned_type_node,
&integer_type_node, &unsigned_type_node,
&long... | false | false | false | false | false | 0 |
getHead(e) /* get head cell of application */
Cell e; { /* set number of args in argCount */
for (argCount=0; isAp(e); e=fun(e))
argCount++;
return e;
} | false | false | false | false | false | 0 |
ebews_store_distribution_list_items (EBookBackendEws *ebews,
const EwsId *id,
const gchar *d_name,
GSList *members,
GError **error)
{
EContact *contact;
EVCardAttribute *... | false | false | false | false | false | 0 |
free_fspan(Dt_t* d, fspan* p, Dtdisc_t* ds)
{
textspan_t* ti;
if (p->lp.nitems) {
int i;
ti = p->lp.items;
for (i = 0; i < p->lp.nitems; i++) {
if (ti->str) free (ti->str);
ti++;
}
free (p->lp.items);
}
free (p);
} | false | false | false | false | false | 0 |
___mkd_emblock(MMIOT *f)
{
int i;
block *p;
emblock(f, 0, S(f->Q)-1);
for (i=0; i < S(f->Q); i++) {
p = &T(f->Q)[i];
emfill(p);
if ( S(p->b_post) ) { SUFFIX(f->out, T(p->b_post), S(p->b_post));
DELETE(p->b_post); }
if ( S(p->b_text) ) { SUFFIX(f->out, T(p->b_text), S(p->b_text));
... | false | false | false | false | false | 0 |
is_cached_header(const char *hdr)
{
int i;
/* xxx if we can sort the header list we can do better here */
for (i=0; i<MAILBOX_NUM_CACHE_HEADERS; i++) {
if (!strcmp(mailbox_cache_headers[i].name, hdr))
return mailbox_cache_headers[i].min_cache_version;
}
/* Don't Cache X- headers unless expl... | false | false | false | false | false | 0 |
ComputeTotalLatencies()
{
std::vector<jack_int_t> sorted;
std::vector<jack_int_t>::iterator it;
std::vector<jack_int_t>::reverse_iterator rit;
fGraphManager->TopologicalSort(sorted);
/* iterate over all clients in graph order, and emit
* capture latency callback.
*/
for (it = sorted.begin... | false | false | false | false | false | 0 |
ufraw_set_error(ufraw_data *uf, const char *format, ...)
{
uf->status = UFRAW_ERROR;
if (format != NULL) {
va_list ap;
va_start(ap, format);
char *message = g_strdup_vprintf(format, ap);
va_end(ap);
message_append(uf, message);
g_free(message);
}
} | false | false | false | false | false | 0 |
link_alt_odb_entry(const char * entry, int len, const char * relative_base, int depth)
{
struct stat st;
const char *objdir = get_object_directory();
struct alternate_object_database *ent;
struct alternate_object_database *alt;
/* 43 = 40-byte + 2 '/' + terminating NUL */
int pfxlen = len;
int entlen = pfxlen + ... | false | true | false | false | false | 1 |
if_exists_spec_function (argc, argv)
int argc;
const char **argv;
{
/* Must have only one argument. */
if (argc == 1 && IS_ABSOLUTE_PATHNAME (argv[0]) && ! access (argv[0], R_OK))
return argv[0];
return NULL;
} | false | false | false | false | false | 0 |
Add(int *p,int n,int o)
{
for(int i=0;i<n;++i)
p[i] += o;
} | false | false | false | false | false | 0 |
_e2_keybinding_tree_selection_check_cb
(GtkTreeSelection *selection, GtkTreeModel *model, GtkTreePath *path,
gboolean path_currently_selected, E2_OptionSet *set)
{
GtkTreeIter iter;
if (gtk_tree_model_get_iter (set->ex.tree.model, &iter, path))
{
gchar *cat;
gtk_tree_model_get (set->ex.tree.model, &iter, 0, &c... | false | false | false | false | false | 0 |
unmap_manager (WinManager *man)
{
if (man->window_mapped == 1) {
XUnmapWindow (theDisplay, man->theWindow);
set_manager_window_mapping (man, 0);
XFlush (theDisplay);
}
} | false | false | false | false | false | 0 |
deleteMessages()
{
if (mHerculesActive)
{
QMessageBox msgBox;
msgBox.setText("Messages belong to to a running Hercules.");
msgBox.setInformativeText("Are you sure you want to delete history messages?");
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
msgBox.setDefaultButton(QMessageBox::Yes);... | false | false | false | false | false | 0 |
gm_audio_profile_init (GMAudioProfile *self)
{
g_return_if_fail (profiles != NULL);
self->priv = g_new0 (GMAudioProfilePrivate, 1);
self->priv->name = g_strdup (_("<no name>"));
self->priv->description = g_strdup (_("<no description>"));
self->priv->pipeline = g_strdup ("identity");
self->priv->extension =... | false | false | false | false | false | 0 |
AIO_OfxGroup_Generic_AccountTypeFromString(const char *s) {
AB_ACCOUNT_TYPE t;
if (strcasecmp(s, "CHECKING")==0)
t=AB_AccountType_Checking;
else if (strcasecmp(s, "SAVINGS")==0)
t=AB_AccountType_Savings;
else if (strcasecmp(s, "MONEYMRKT")==0)
t=AB_AccountType_MoneyMarket;
else if (strcasecmp(s... | false | false | false | false | false | 0 |
load_xmt_done(GF_SceneLoader *load)
{
GF_XMTParser *parser = (GF_XMTParser *)load->loader_priv;
if (!parser) return;
while (1) {
XMTNodeStack *st = (XMTNodeStack *)gf_list_last(parser->nodes);
if (!st) break;
gf_list_rem_last(parser->nodes);
gf_node_register(st->node, NULL);
gf_node_unregister(st->node, N... | false | false | false | false | false | 0 |
pit_spikes(game *g, monster *z, int x, int y)
{
int junk;
bool sees = g->u_see(z, junk);
if (sees)
g->add_msg("The %s falls in a spiked pit!", z->name().c_str());
if (z->hurt(rng(20, 50)))
g->kill_mon(g->mon_at(x, y));
else
z->moves = -1000;
if (one_in(4)) {
if (sees)
g->add_msg("The spears break!");
... | 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));
ReceiveDialog *_t = static_cast<ReceiveDialog *>(_o);
switch (_id) {
case 0: _t->cancelClicked(); break;
case 1: _t->ski... | false | false | false | false | false | 0 |
kmo_edgepars_to_table(cpl_vector **slitlet_ids,
cpl_matrix **edgepars)
{
cpl_table **tbl = NULL;
int nr_rows = 0,
nr_cols = 0,
i = 0, nc = 0, nr = 0;
double *pedgepars = NULL,
... | false | false | false | false | false | 0 |
Slice_Wrapper3(Pointer a)
{
struct argblk *ap = (struct argblk *)a;
struct argblk a2;
Object o;
memcpy((char *)&a2, (char *)a, sizeof(struct argblk));
o = Object_Slice(a2.toslice, &a2);
if (!o && (DXGetError() != ERROR_NONE))
return ERROR;
if (!o || (IsEmpty(o)))
o = (Object)DXEndField... | false | false | false | false | false | 0 |
test_object_equals_hash (Test *test, gconstpointer unused)
{
GckSlot *other_slot;
GckSession *other_session;
GckObject *other_object;
GObject *obj;
GError *err = NULL;
guint hash;
hash = gck_object_hash (test->object);
g_assert (hash != 0);
g_assert (gck_object_equal (test->object, test->object));
other_sl... | false | false | false | false | false | 0 |
ptr_new( EnvT* e)
{
int nParam=e->NParam();
if( nParam > 0)
{
// new ptr from undefined variable is allowed as well
BaseGDL* p= e->GetPar( 0);
if( p == NULL)
{
DPtr heapID= e->NewHeap();
return new DPtrGDL( heapID);
}
if( e->KeywordSet(0)) // NO_COPY
{
BaseGDL** ... | false | false | false | false | false | 0 |
da9150_gpadc_read_offset(int channel, int *val)
{
switch (channel) {
case DA9150_GPADC_CHAN_VBAT:
*val = 1500000 / 2932;
return IIO_VAL_INT;
case DA9150_GPADC_CHAN_TJUNC_CORE:
case DA9150_GPADC_CHAN_TJUNC_OVP:
*val = -144;
return IIO_VAL_INT;
default:
return -EINVAL;
}
} | false | false | false | false | false | 0 |
libnet_hex_dump(u_char *buf, int len, int swap, FILE *stream)
{
int i, s_cnt;
u_short *p;
p = (u_short *)buf;
s_cnt = len / sizeof(u_short);
i = 0;
fprintf(stream, "\t");
while (--s_cnt >= 0)
{
if ((!(i % 8)))
{
fprintf(stream, "\n%02x\t", (... | false | false | false | false | false | 0 |
PR_EnumerateHostEnt(
PRIntn enumIndex, const PRHostEnt *hostEnt, PRUint16 port, PRNetAddr *address)
{
void *addr = hostEnt->h_addr_list[enumIndex++];
memset(address, 0, sizeof(PRNetAddr));
if (NULL == addr) enumIndex = 0;
else
{
address->raw.family = hostEnt->h_addrtype;
if (PR_A... | false | false | false | false | false | 0 |
removeNamedItemNS(const XMLString& namespaceURI, const XMLString& localName)
{
Attr* pAttr = _pElement->getAttributeNodeNS(namespaceURI, localName);
if (pAttr)
return _pElement->removeAttributeNode(pAttr);
else
return 0;
} | false | false | false | false | false | 0 |
_rl_vi_callback_getchar (mb, mblen)
char *mb;
int mblen;
{
int c;
RL_SETSTATE(RL_STATE_MOREINPUT);
c = rl_read_key ();
RL_UNSETSTATE(RL_STATE_MOREINPUT);
#if defined (HANDLE_MULTIBYTE)
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
c = _rl_read_mbstring (c, mb, mblen);
#endif
return c;
} | false | false | false | false | false | 0 |
open_view(struct view *prev, enum request request, enum open_flags flags)
{
bool split = !!(flags & OPEN_SPLIT);
bool reload = !!(flags & (OPEN_RELOAD | OPEN_REFRESH | OPEN_PREPARED));
bool nomaximize = !!(flags & OPEN_REFRESH);
struct view *view = VIEW(request);
int nviews = displayed_views();
struct view *base_... | false | false | false | true | false | 1 |
test_object_commit_commitstagedfile__generate_predictable_object_ids(void)
{
git_index *index;
const 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 f... | false | false | false | false | false | 0 |
main()
{
int n,l,k;
cin>>n>>l>>k; //taking input
/* 1. n is the total number of stations.
2. l is the number of stations which have station masters.
3. k is the maximum number of stations by which a station master can move. */
int m[l],t[l];
/* m[i] is the position of the ith station maste... | false | false | false | false | false | 0 |
cb_child_exit (G_GNUC_UNUSED GPid pid, gint status, GnmSubSolver *subsol)
{
gboolean normal = WIFEXITED (status);
int code;
subsol->child_watch = 0;
if (normal) {
code = WEXITSTATUS (status);
if (gnm_solver_debug ())
g_printerr ("Solver process exited with code %d\n",
code);
#ifndef G_OS_WIN32
} e... | false | false | false | false | false | 0 |
ConcatData(Acquisition::Pointer output, Acquisition::Pointer input) const
{
// Point
for (Acquisition::PointIterator it = input->BeginPoint() ; it != input->EndPoint() ; ++it)
{
std::string suffix = "";
int inc = 2;
while (1)
{
(*it)->SetLabel((*it)->GetLabel() + suffix);
... | false | false | false | false | false | 0 |
inc_integer(int index, int num)
{
uint16_t value = num & 0xffff;
if(num > 0 && num < 64)
{
fprintf(out, "; inc_integer (optimized, add)\n");
fprintf(out, " ldi XL, stack_lo - %d\n", LOCALS(index));
fprintf(out, " add XL, locals\n");
fprintf(out, " ld ZL, X\n");
fprintf(out, " ldi YL, stac... | false | false | false | false | false | 0 |
dumpCommitRequests(FIS_HANDLE ** fisHandle)
{
LST_HEAD *requestList;
FIS_STORAGECOMMITREQRECORD *commitReq;
CONDITION cond;
requestList = LST_Create();
if (requestList == NULL) {
fprintf(stderr, "Could not create an initial request list. Exiting now.\n");
return;
}
cond = FIS_Get(fisHandl... | false | false | false | false | false | 0 |
Disconnect_Fields( FORM * form )
{
if (form->field)
{
FIELD **fields;
for(fields=form->field;*fields;fields++)
{
if (form == (*fields)->form)
(*fields)->form = (FORM *)0;
}
form->rows = form->cols = 0;
form->maxfield = form->maxpage = -1;
form->field = (FIELD **)0;... | false | false | false | false | false | 0 |
eb_initialize_search_contexts(EB_Book *book)
{
EB_Search_Context *context;
int i;
LOG(("in: eb_initialize_search_context(book=%d)", (int)book->code));
for (i = 0, context = book->search_contexts;
i < EB_NUMBER_OF_SEARCH_CONTEXTS; i++, context++) {
context->code = EB_SEARCH_NONE;
context->compare_p... | false | false | false | false | false | 0 |
initctx1(isc_task_t *task, isc_event_t *event) {
char gssid[512];
char contextname[512];
isc_result_t result;
isc_buffer_t buf;
dns_message_t *query;
dns_request_t *request;
int c;
isc_event_free(&event);
printf("Initctx - GSS name => ");
c = scanf("%511s", gssid);
if (c == EOF)
return;
snprintf(contex... | false | false | false | false | false | 0 |
xsh_ref_ind_read(int arm, DOUBLE** ref_ind_T,DOUBLE temper)
{
int ii,jj,flag;
//printf("temper %lf \n",temper);
ii=2; /*start filling from row [2][*] */
flag=0;
for (ii=2; ii<8; ii+=1) {
for (jj=0;jj<7;jj+=1){
if (arm==0) {
ref_ind_T[ii][jj]=silica_zemax[ii-2][jj];
}
else if (arm==1) ... | false | false | false | false | false | 0 |
wt_dens(FILE *fp, HTK_HMM_INFO *hmm)
{
HTK_HMM_Dens *d;
unsigned int idx;
unsigned int vid;
dens_num = hmm->totalmixnum;
dens_index = (HTK_HMM_Dens **)mymalloc(sizeof(HTK_HMM_Dens *) * dens_num);
idx = 0;
for(d = hmm->dnstart; d; d = d->next) dens_index[idx++] = d;
qsort(dens_index, dens_num, sizeof(HT... | false | false | false | false | false | 0 |
UTI_FdSetCloexec(int fd)
{
int flags;
flags = fcntl(fd, F_GETFD);
if (flags != -1) {
flags |= FD_CLOEXEC;
fcntl(fd, F_SETFD, flags);
}
} | false | false | false | false | false | 0 |
__clk_lookup_subtree(const char *name,
struct clk_core *core)
{
struct clk_core *child;
struct clk_core *ret;
if (!strcmp(core->name, name))
return core;
hlist_for_each_entry(child, &core->children, child_node) {
ret = __clk_lookup_subtree(name, child);
if (ret)
return ret;
}
return NULL;
} | false | false | false | false | false | 0 |
HandleClass (char *id)
{ int members;
char *sp;
Debug("HandleClass(%s)\n",id);
for (sp = id; *sp != '\0'; sp++)
{
switch (*sp)
{
case '-':
case '*':
snprintf(OUTPUT,CF_BUFSIZE,"Illegal character (%c) in class %s",*sp,id);
yyerror(OUTPUT);
}
}
InstallPending(A... | false | true | false | false | false | 1 |
draw_wave_hatch (cairo_surface_t *hatch, GpHatch *hbr)
{
double hatch_wd = gdip_hatch_get_width (hbr);
double hatch_ht = gdip_hatch_get_height (hbr);
double line_width = gdip_hatch_get_line_width (hbr);
/* hatch is not supposed to be affected by user matrix (so we create a new context) */
cairo_t *ct2 = create_hat... | false | false | false | false | false | 0 |
test_incremental_no_line_breaks_for_length (gsize length)
{
gsize encoded_length, decoded_length, max;
max = length * 4 / 3 + 6;
test_incremental (FALSE, length,
&encoded_length, &decoded_length);
cut_assert (encoded_length <= max,
cut_message ("Too long encoded length: got "
... | false | false | false | false | false | 0 |
check_external_converter(void)
{
/* FIXME: This creates a race condition. However we don't want to do all
* the checking before every execlp() when conveting 500 files in a row,
* and even if doing that, something can still sneak between stat() and
* execlp(), so what. This is just a simple sanity check, n... | false | false | false | false | false | 0 |
sta529_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{
struct snd_soc_codec *codec = dai->codec;
int pdata, play_freq_val, record_freq_val;
int bclk_to_fs_ratio;
switch (params_width(params)) {
case 16:
pdata = 1;
bclk_to_fs_ratio = 0;
break;
... | false | false | false | false | false | 0 |
load_attr_from_cache(
git_attr_file **file,
git_attr_cache *cache,
git_attr_file_source source,
const char *relative_path)
{
git_buf cache_key = GIT_BUF_INIT;
khiter_t cache_pos;
*file = NULL;
if (!cache || !cache->files)
return 0;
if (git_buf_printf(&cache_key, "%d#%s", (int)source, relative_path) < 0)
... | false | false | false | false | false | 0 |
fmgr_security_definer(PG_FUNCTION_ARGS)
{
Datum result;
FmgrInfo *save_flinfo;
struct fmgr_security_definer_cache *volatile fcache;
Oid save_userid;
int save_sec_context;
HeapTuple tuple;
if (!fcinfo->flinfo->fn_extra)
{
fcache = MemoryContextAllocZero(fcinfo->flinfo->fn_mcxt,
sizeof(*fcache... | false | false | false | true | false | 1 |
PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
os << indent << "Sample Distance: " << this->SampleDistance << "\n";
os << indent << "Image Sample Distance: "
<< this->ImageSampleDistance << "\n";
os << indent << "Minimum Image Sample Distance: "
<< this->MinimumI... | false | false | false | false | false | 0 |
toHiragana( int number ) {
static const QChar hiragana[48] = {0x3042, 0x3044, 0x3046, 0x3048, 0x304A, 0x304B, 0x304D,
0x304F, 0x3051, 0x3053, 0x3055, 0x3057, 0x3059, 0x305B, 0x305D,
0x305F, 0x3061, 0x3064, 0x3066, 0x3068, 0x306A, 0x306B,
... | false | false | false | false | false | 0 |
gt_splicedseq_map(const Splicedseq *ss, unsigned long pos)
{
gt_assert(ss &&
gt_str_length(ss->splicedseq) == gt_array_size(ss->positionmapping));
gt_assert(pos < gt_str_length(ss->splicedseq)); /* legal position */
return *(unsigned long*) gt_array_get(ss->positionmapping, pos);
} | false | false | false | false | false | 0 |
MvgAutoWrapPrintf(DrawContext context, const char *format, ...)
{
va_list
argp;
int
formatted_length;
char
buffer[MaxTextExtent];
va_start(argp, format);
#if defined(HAVE_VSNPRINTF)
formatted_length = vsnprintf(buffer, sizeof(buffer) - 1, format, argp);
#else
# if defined(HAVE_VSPRINTF)
form... | false | false | false | false | false | 0 |
StringToSquare(std::string square) {
int column = square[0] - 'a';
int line = square[1] - '1';
if( -1 < column && column < 8 && -1 < line && line < 8) return (7 - line) * 8 + column;
else return -1;
} | false | false | false | false | false | 0 |
gaa_get_option_num(char *str, int status)
{
switch(status)
{
case GAA_LETTER_OPTION:
GAA_CHECK1STR("d", GAAOPTID_debug);
GAA_CHECK1STR("", GAAOPTID_outfile);
GAA_CHECK1STR("", GAAOPTID_provider);
GAA_CHECK1STR("", GAAOPTID_load_certificate);
GAA_CHECK1STR("", GAAOPTID_load_pubkey);
... | false | false | false | false | false | 0 |
udc_irq(struct ci_hdrc *ci)
{
irqreturn_t retval;
u32 intr;
if (ci == NULL)
return IRQ_HANDLED;
spin_lock(&ci->lock);
if (ci->platdata->flags & CI_HDRC_REGS_SHARED) {
if (hw_read(ci, OP_USBMODE, USBMODE_CM) !=
USBMODE_CM_DC) {
spin_unlock(&ci->lock);
return IRQ_NONE;
}
}
intr = hw_test_and_cle... | false | false | false | false | false | 0 |
Find(const BaseGDL* data_)
{
int vSize=var.size();
for( int i=0; i<vSize; i++)
{
if( var[i]->Data() == data_) return i;
}
return -1;
} | false | false | false | false | false | 0 |
camel_cipher_context_export_keys_sync (CamelCipherContext *context,
GPtrArray *keys,
CamelStream *ostream,
GCancellable *cancellable,
GError **error)
{
CamelCipher... | false | false | false | true | false | 1 |
doTransform(std::list<ArPoseWithTime *> *poseList)
{
std::list<ArPoseWithTime *>::iterator it;
ArPoseWithTime *pose;
for (it = poseList->begin(); it != poseList->end(); it++)
{
pose = (*it);
*pose = doTransform(*pose);
}
} | false | false | false | false | false | 0 |
Tree1Scan(void *p) {
Tree *n = p;
switch (n->kind) {
default:
panic("Tree1Scan: bad node kind %d", n->kind);
case nPrim: case nWord: case nQword:
n->u[0].s = forward(n->u[0].s);
break;
case nCall: case nThunk: case nVar:
n->u[0].p = forward(n->u[0].p);
break;
}
return offsetof(Tree, u[1]);... | false | false | false | false | false | 0 |
initStyleOption(QStyleOptionToolButton* opt) const
{
opt->initFrom(this);
// Setup icon..
if (!icon().isNull()) {
opt->iconSize = iconPixmap().size();
opt->icon = icon();
}
// Should we draw text?
if (shouldDrawText())
opt->text = text();
if (underMouse())
opt->state |= QStyle::State_AutoRaise | Q... | 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.