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 |
|---|---|---|---|---|---|---|
GetIntConstValueOrDie()
{
Token tok = GetConstTokOrDie();
if (tok.GetType() != INT_CONST) Error("integer const expected");
return tok.GetIntValue();
} | false | false | false | false | false | 0 |
PyAST_CompileObject(mod_ty mod, PyObject *filename, PyCompilerFlags *flags,
int optimize, PyArena *arena)
{
struct compiler c;
PyCodeObject *co = NULL;
PyCompilerFlags local_flags;
int merged;
if (!__doc__) {
__doc__ = PyUnicode_InternFromString("__doc__");
if (!_... | false | false | false | false | false | 0 |
xml_sax_named_expr_prop (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
{
XMLSaxParseState *state = (XMLSaxParseState *)xin->user_state;
char const * content = xin->content->str;
int const len = xin->content->len;
switch (xin->node->user_data.v_int) {
case 0:
g_return_if_fail (state->name.name == NULL);
stat... | false | false | false | false | false | 0 |
get_insert_query_def(Query *query, deparse_context *context)
{
StringInfo buf = context->buf;
RangeTblEntry *select_rte = NULL;
RangeTblEntry *values_rte = NULL;
RangeTblEntry *rte;
char *sep;
ListCell *values_cell;
ListCell *l;
List *strippedexprs;
/* Insert the WITH clause if given */
get_with_cl... | false | false | false | false | false | 0 |
gdev_tiff_begin_page(gx_device_tiff *tfdev,
FILE *file)
{
gx_device_printer *const pdev = (gx_device_printer *)tfdev;
if (gdev_prn_file_is_new(pdev)) {
/* open the TIFF device */
tfdev->tif = tiff_from_filep(pdev, pdev->dname, file, tfdev->BigEndian, tfdev->UseBigTIFF);... | false | false | false | false | false | 0 |
applicable(const solver *ego, const problem *p_,
const planner *plnr)
{
const problem_dft *p = (const problem_dft *) p_;
UNUSED(ego);
return (1
&& p->sz->rnk == 1
&& p->vecsz->rnk == 0
/* FIXME: allow other sizes */
&& X(is_prime)(p->sz->dims[0].n)
/* FIXME: avoid ... | false | false | false | false | false | 0 |
xmp_serialization_data_use_schema (XmpSerializationData * serdata,
const gchar * schemaname)
{
gint i = 0;
if (serdata->schemas == NULL)
return TRUE;
while (serdata->schemas[i] != NULL) {
if (strcmp (serdata->schemas[i], schemaname) == 0)
return TRUE;
i++;
}
return FALSE;
} | false | false | false | false | false | 0 |
gst_video_balance_colorbalance_get_value (GstColorBalance * balance,
GstColorBalanceChannel * channel)
{
GstVideoBalance *vb = GST_VIDEO_BALANCE (balance);
gint value = 0;
g_return_val_if_fail (vb != NULL, 0);
g_return_val_if_fail (GST_IS_VIDEO_BALANCE (vb), 0);
g_return_val_if_fail (channel->label != NU... | false | false | false | false | false | 0 |
gzbuf_getbyte(struct gzbuf *gb)
{
if(gb->avail == 0) {
avssize_t res = av_read(gb->vf, (char*)( gb->buf ), GZBUFSIZE);
if(res < 0)
return res;
gb->next = gb->buf;
gb->avail = res;
}
if(gb->avail == 0) {
av_log(AVLOG_ERROR, "UGZ: Premature end of file... | false | false | false | false | false | 0 |
xloper_type_name (const XLOPER*x)
{
if (NULL != x) {
switch (x->xltype & xltypeType) {
CASE(xltypeNum);
CASE(xltypeStr);
CASE(xltypeBool);
CASE(xltypeRef);
CASE(xltypeErr);
CASE(xltypeFlow);
CASE(xltypeMulti);
CASE(xltypeMissing);
CASE(xltypeNil);
CASE(xltypeSRef);
CASE(xltypeInt);
default: r... | false | false | false | false | false | 0 |
invalidate_fastmap(struct ubi_device *ubi)
{
int ret;
struct ubi_fastmap_layout *fm;
struct ubi_wl_entry *e;
struct ubi_vid_hdr *vh = NULL;
if (!ubi->fm)
return 0;
ubi->fm = NULL;
ret = -ENOMEM;
fm = kzalloc(sizeof(*fm), GFP_KERNEL);
if (!fm)
goto out;
vh = new_fm_vhdr(ubi, UBI_FM_SB_VOLUME_ID);
if (... | false | false | false | false | false | 0 |
Is_extension (P_WBXML_INFO buffer)
{
WBXML_INFO tmpbuffer;
memcpy(&tmpbuffer, buffer, sizeof(WBXML_INFO));
tmpbuffer.m_curpos += SWITCHPAGE_SIZE;
return ((Is_switchPage(buffer) &&
(IsTag(&tmpbuffer, TAG_EXT_0) ||
IsTag(&tmpbuffer, TAG_EXT_1) ||
IsTag(&tmpbuffer, TAG_EXT_2) ||
IsTag(... | false | false | false | false | false | 0 |
NSSUTIL_ArgGetPair(char c) {
switch (c) {
case '\'': return c;
case '\"': return c;
case '<': return '>';
case '{': return '}';
case '[': return ']';
case '(': return ')';
default: break;
}
return ' ';
} | false | false | false | false | false | 0 |
addDeferredMultiBulkLength(redisClient *c) {
/* Note that we install the write event here even if the object is not
* ready to be sent, since we are sure that before returning to the
* event loop setDeferredMultiBulkLength() will be called. */
if (_installWriteEvent(c) != REDIS_OK) return NULL;
li... | false | false | false | false | false | 0 |
domain_of(char *host)
{
char *cp;
int numdots = 0;
cp = host + strlen(host) - 1;
if (*cp == '.')
cp--;
for (; numdots < 2 && cp > host; cp--)
{
if (*cp == '.')
numdots++;
}
if (cp != host)
cp += 2;
return cp;
} | false | false | false | false | false | 0 |
gdl_switcher_get_preferred_height (GtkWidget *widget, gint *minimum, gint *natural)
{
GdlSwitcher *switcher = GDL_SWITCHER (widget);
GSList *p;
gint button_min = 0;
gint button_nat = 0;
GTK_WIDGET_CLASS (gdl_switcher_parent_class)->get_preferred_height (GTK_WIDGET (switcher), minimum, natural);
... | false | false | false | false | false | 0 |
server_fd (xlator_t *this)
{
server_conf_t *conf = NULL;
server_connection_t *trav = NULL;
char key[GF_DUMP_MAX_BUF_LEN];
int i = 1;
int ret = -1;
gf_boolean_t section_added = _gf_false;
GF_VALIDAT... | false | false | false | false | false | 0 |
kodak605_get_status(struct kodak605_ctx *ctx)
{
uint8_t cmdbuf[4];
uint8_t rdbuf[76];
int ret, i, num = 0;
/* Send Status Query */
cmdbuf[0] = 0x01;
cmdbuf[1] = 0x00;
cmdbuf[2] = 0x00;
cmdbuf[3] = 0x00;
if ((ret = send_data(ctx->dev, ctx->endp_down,
cmdbuf, sizeof(cmdbuf))))
return ret;
/* Read i... | false | false | false | false | false | 0 |
hf_next(TokenStream *ts)
{
HyphenFilter *hf = HyphenFilt(ts);
TokenFilter *tf = TkFilt(ts);
Token *tk = hf->tk;
if (hf->pos < hf->len) {
const int pos = hf->pos;
const int text_len = strlen(hf->text + pos);
strcpy(tk->text, hf->text + pos);
tk->pos_inc = ((pos != 0) ? 1 ... | false | false | false | false | false | 0 |
evdns_base_clear_nameservers_and_suspend(struct evdns_base *base)
{
struct nameserver *server, *started_at;
int i;
EVDNS_LOCK(base);
server = base->server_head;
started_at = base->server_head;
if (!server) {
EVDNS_UNLOCK(base);
return 0;
}
while (1) {
struct nameserver *next = server->next;
(void) even... | false | false | false | false | false | 0 |
test_memory_unlock_bad_password (Test *test, gconstpointer unused)
{
GkmCredential *cred;
GkmDataResult res;
CK_RV rv;
/* Load the data in the file */
res = gkm_secret_collection_load (test->collection);
g_assert (res == GKM_DATA_SUCCESS);
/* Unlock the keyring, which should load again */
rv = gkm_credential_... | false | false | false | false | false | 0 |
tgdb_process(struct tgdb * tgdb, char *buf, size_t n, int *is_finished)
{
char local_buf[10 * n];
ssize_t size;
size_t buf_size = 0;
int is_busy;
/* make the queue empty */
tgdb_delete_responses(tgdb);
/* TODO: This is kind of a hack.
* Since I know that I didn't do a read yet, the ne... | true | true | false | false | false | 1 |
pop_integer_local(int index)
{
#if 0
if (stack > 0)
{
fprintf(out, " pop %d(r12) ; pop local_%d\n", LOCALS(index), index);
stack--;
}
else
#endif
if (reg > 0)
{
if (index == 0)
{
fprintf(out, " mov r%d, *r12 ; pop local_%d\n", REG_STACK(reg-1), index);
}
else
{
... | false | false | false | false | false | 0 |
modify_file(const nstring &filename, const nstring &from)
{
trace(("repository_subversion::modify_file(filename = %s, from = %s)\n{\n",
filename.quote_c().c_str(), from.quote_c().c_str()));
//
// Copy the baseline file into the subversion work area.
// No special command lets subversion know it was cha... | false | false | false | false | false | 0 |
ompfbe_get_number_of_schedule(Block *start, Scheduling_kind kind)
{
int num = 0;
Block *bp;
for(bp = start; bp != NULL; bp = bp->next){
if(bp->hmdf != NULL && bp->hmdf->scheduling == kind)
num++;
if(bp->inner != NULL)
num += ompfbe_get_number_of_schedule(bp->inner, k... | false | false | false | false | false | 0 |
LoadSpellThreats()
{
mSpellThreatMap.clear(); // need for reload case
// 0 1 2 3
QueryResult* result = WorldDatabase.Query("SELECT entry, Threat, multiplier, ap_bonus FROM spell_threat");
if (!result)
... | false | false | false | false | false | 0 |
_update_slurmctld_debug(char *val)
{
char *endptr;
int error_code = SLURM_SUCCESS;
uint32_t level = (uint32_t)strtoul(val, &endptr, 10);
if (*endptr != '\0' || level > 9) {
error_code = 1;
if (quiet_flag != 1)
fprintf(stderr, "invalid debug level: %s\n",
val);
} else {
error_code = slurm_set_debug_le... | false | false | false | false | false | 0 |
dico_base64_encode(const unsigned char *input, size_t input_len,
unsigned char **output, size_t *output_len)
{
size_t olen = 4 * (input_len + 2) / 3 + 1;
unsigned char *out = malloc(olen);
if (!out)
return 1;
*output = out;
while (input_len >= 3) {
*out++ = b64tab[input[0] >> 2];
*out++ = b... | false | false | false | false | false | 0 |
audit_free_rule(struct audit_entry *e)
{
int i;
struct audit_krule *erule = &e->rule;
/* some rules don't have associated watches */
if (erule->watch)
audit_put_watch(erule->watch);
if (erule->fields)
for (i = 0; i < erule->field_count; i++)
audit_free_lsm_field(&erule->fields[i]);
kfree(erule->fields);
... | false | false | false | false | false | 0 |
doApply()
{
assert(m_element);
assert(!m_value.isNull());
// int exceptionCode = 0;
m_oldValue = m_element->getAttribute(m_attribute);
m_element->setAttribute(m_attribute, m_value.implementation());
// assert(exceptionCode == 0);
} | false | false | false | false | false | 0 |
ni_calculate_power_boost_limit(struct radeon_device *rdev,
struct radeon_ps *radeon_state,
u32 near_tdp_limit)
{
struct ni_ps *state = ni_get_ps(radeon_state);
struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
struct ni_power_info *ni_pi = ni_get_pi(rdev);
u32 power_boost_limit = 0;
int re... | false | false | false | false | false | 0 |
cp_parser_new_declarator_opt (cp_parser* parser)
{
enum tree_code code;
tree type;
cp_cv_quals cv_quals;
/* We don't know if there's a ptr-operator next, or not. */
cp_parser_parse_tentatively (parser);
/* Look for a ptr-operator. */
code = cp_parser_ptr_operator (parser, &type, &cv_quals);
/* If tha... | false | false | false | false | false | 0 |
ComposeXPath ( const XMP_ExpandedXPath & expandedXPath,
XMP_VarString * stringXPath )
{
*stringXPath = expandedXPath[kRootPropStep].step;
for ( size_t index = kRootPropStep+1; index < expandedXPath.size(); ++index ) {
const XPathStepInfo & currStep = expandedXPath[index];
switch ( currStep.options & kXMP_... | false | false | false | false | false | 0 |
net2272_ep_reset(struct net2272_ep *ep)
{
u8 tmp;
ep->desc = NULL;
INIT_LIST_HEAD(&ep->queue);
usb_ep_set_maxpacket_limit(&ep->ep, ~0);
ep->ep.ops = &net2272_ep_ops;
/* disable irqs, endpoint */
net2272_ep_write(ep, EP_IRQENB, 0);
/* init to our chosen defaults, notably so that we NAK OUT
* packets until ... | false | false | false | false | false | 0 |
scanline_to_vcount(int scanline)
{
if (Machine->visible_area.min_y == 0)
scanline += SMART_IOREG(VEBLNK);
if (scanline > SMART_IOREG(VTOTAL))
scanline -= SMART_IOREG(VTOTAL);
return scanline;
} | false | false | false | false | false | 0 |
ithread_mg_free(pTHX_ SV *sv, MAGIC *mg)
{
ithread *thread = (ithread *)mg->mg_ptr;
PERL_UNUSED_ARG(sv);
MUTEX_LOCK(&thread->mutex);
S_ithread_free(aTHX_ thread); /* Releases MUTEX */
return (0);
} | false | false | false | false | false | 0 |
WriteGeometryToMIFFile(MIDDATAFile *fp)
{
OGRGeometry *poGeom;
poGeom = GetGeometryRef();
if (poGeom && (wkbFlatten(poGeom->getGeometryType()) == wkbPolygon ||
wkbFlatten(poGeom->getGeometryType()) == wkbMultiPolygon ) )
{
/*=========================================... | false | false | false | false | false | 0 |
parse_cmd_options(int argc, char* argv[], cmd_options_t* opts) {
int c;
opts->offset = 0;
opts->continuous = 0;
opts->kappa = -1;
opts->seed = 0;
opts->use_seed = 0;
opts->xmin = 1;
opterr = 0;
while ((c = getopt(argc, argv, "chk:o:s:vx:")) != -1) {
switch (c) {
... | false | true | false | false | true | 1 |
clearGlobalMappingsFromModule(Module *M) {
MutexGuard locked(lock);
for (Function &FI : *M)
EEState.RemoveMapping(getMangledName(&FI));
for (GlobalVariable &GI : M->globals())
EEState.RemoveMapping(getMangledName(&GI));
} | false | false | false | false | false | 0 |
stopping_finished(void)
{
struct interface_info *ip;
struct client_state *client;
for (ip = interfaces; ip; ip = ip -> next) {
for (client = ip -> client; client; client = client -> next) {
if (client->state != S_STOPPED)
return ISC_FALSE;
if (client->active_lease != NULL)
return ISC_FALSE;
}
}
... | false | false | false | false | false | 0 |
edit_plugin_item_to_widgets (PluginEditorDialog *dlg, GnomeUIInfo *gui)
{
GttPlugin *plg;
if (!gui) return;
plg = gui->user_data;
gtk_entry_set_text (dlg->plugin_name, plg->name);
gtk_file_chooser_set_uri (dlg->plugin_path, plg->path);
gtk_entry_set_text (dlg->plugin_tooltip, plg->tooltip);
} | false | false | false | false | false | 0 |
btrfs_init_acl(struct btrfs_trans_handle *trans,
struct inode *inode, struct inode *dir)
{
struct posix_acl *default_acl, *acl;
int ret = 0;
/* this happens with subvols */
if (!dir)
return 0;
ret = posix_acl_create(dir, &inode->i_mode, &default_acl, &acl);
if (ret)
return ret;
if (default_acl) {
r... | false | false | false | false | false | 0 |
afs_vnode_cache_get_aux(const void *cookie_netfs_data,
void *buffer, uint16_t bufmax)
{
const struct afs_vnode *vnode = cookie_netfs_data;
uint16_t dlen;
_enter("{%x,%x,%Lx},%p,%u",
vnode->fid.vnode, vnode->fid.unique, vnode->status.data_version,
buffer, bufmax);
dlen = sizeof(vnode->fid.uniq... | false | true | false | false | false | 1 |
IoRange_each(IoRange *self, IoObject *locals, IoMessage *m)
{
IoState *state = IOSTATE;
IoObject *result = IONIL(self);
IoMessage *doMessage = IoMessage_rawArgAt_(m, 0);
IoObject *savedCursor, *savedIndex;
IoRangeData *rd = DATA(self);
double index;
savedCursor = rd->curr;
savedIndex = rd->index;
IoRange_setC... | false | false | false | false | false | 0 |
jp2_cdef_putdata(jp2_box_t *box, jas_stream_t *out)
{
jp2_cdef_t *cdef = &box->data.cdef;
unsigned int i;
jp2_cdefchan_t *ent;
if (jp2_putuint16(out, cdef->numchans)) {
return -1;
}
for (i = 0; i < cdef->numchans; ++i) {
ent = &cdef->ents[i];
if (jp2_putuint16(out, ent->channo) ||
jp2_putuint16(out, e... | false | false | false | false | false | 0 |
fd_ready (int fd)
{
pthread_mutex_lock (&readylist_lock);
/* Find an empty entry in FDLIST. */
size_t inner;
for (inner = 0; inner < nconns; ++inner)
if (fdlist[inner].next == NULL)
break;
assert (inner < nconns);
fdlist[inner].fd = fd;
if (readylist == NULL)
readylist = fdlist[inner].ne... | false | false | false | false | false | 0 |
scalbnf(float x, int n)
{
int32_t k,ix;
GET_FLOAT_WORD(ix,x);
k = (ix&0x7f800000)>>23; /* extract exponent */
if (k==0) { /* 0 or subnormal x */
if ((ix&0x7fffffff)==0) return x; /* +-0 */
x *= two25;
GET_FLOAT_WORD(ix,x);
k = ((ix&0x7f800000)>>23) - 25;
if ... | false | false | false | false | false | 0 |
sheet_object_init (GObject *object)
{
int i;
SheetObject *so = SHEET_OBJECT (object);
so->sheet = NULL;
so->flags = SHEET_OBJECT_IS_VISIBLE | SHEET_OBJECT_PRINT |
SHEET_OBJECT_CAN_RESIZE | SHEET_OBJECT_CAN_EDIT |
SHEET_OBJECT_MOVE_WITH_CELLS | SHEET_OBJECT_SIZE_WITH_CELLS;
/* Store the logical position as A1... | false | false | false | false | false | 0 |
gnm_filter_attach (GnmFilter *filter, Sheet *sheet)
{
int i;
g_return_if_fail (filter != NULL);
g_return_if_fail (filter->sheet == NULL);
g_return_if_fail (IS_SHEET (sheet));
gnm_filter_ref (filter);
filter->sheet = sheet;
sheet->filters = g_slist_prepend (sheet->filters, filter);
sheet->priv->filters_change... | false | false | false | false | false | 0 |
process_logs(void)
{
struct daemon_conf config;
char *filename;
int len, num = 0;
if (user_file && userfile_is_dir) {
char dirname[MAXPATHLEN];
clear_config (&config);
strcpy(dirname, user_file);
if (dirname[strlen(dirname)-1] != '/')
strcat(dirname, "/");
strcat (dirname, "audit.log");
free((void ... | false | false | false | false | false | 0 |
afr_truncate_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
struct iatt *postbuf)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
int child_index = (long) cookie;
... | false | false | false | false | false | 0 |
gm_triggers_new_from_file(gchar *filename) {
GmTriggers *trg = GM_TRIGGERS(g_object_new(GM_TYPE_TRIGGERS, NULL));
xmlDocPtr doc;
xmlNodePtr cur;
trg->priv->path = g_strdup(filename);
if (!g_file_test(filename, G_FILE_TEST_EXISTS)) {
gm_debug_msg(DEBUG_DEFAULT, "GmTriggers.NewFromFile: Trigger file does not ex... | false | false | false | false | false | 0 |
DisableHandler() {
RAW_CHECK(prof_handler_token_ != NULL, "SIGPROF handler is not registered");
ProfileHandlerUnregisterCallback(prof_handler_token_);
prof_handler_token_ = NULL;
} | false | false | false | false | false | 0 |
dirserv_get_networkstatus_v2(smartlist_t *result,
const char *key)
{
cached_dir_t *cached;
smartlist_t *fingerprints = smartlist_new();
tor_assert(result);
if (!cached_v2_networkstatus)
cached_v2_networkstatus = digestmap_new();
dirserv_get_networkstatus_v2_fingerprints(fing... | true | true | false | false | false | 1 |
compact(uchar *d, uchar *s)
{
uchar *dest = d, *src = s, patt, *t, *end = s + _xsize;
int i, n;
while (src < end) {
for (n = 0, t = src; t + 2 < end && !(*t == t[1] && *t == t[2]); t++)
n++;
while (n) {
i = n > 126 ? 126 : n;
n -= i;
*dest++ =... | false | false | false | false | false | 0 |
snefru_sum(fingerprint_ty *p, char *obuf, size_t obuf_len)
{
size_t j;
char *cp;
unsigned char h[SNEFRU_HASH_LEN];
snefru_hash(p, h);
cp = obuf;
for (j = 0; j < SNEFRU_HASH_LEN; ++j)
{
if (j && !(j & 3))
*cp++ = ' ';
snprintf(cp, obuf + obuf_len - cp, "%2.2X", h[j]... | false | false | false | false | false | 0 |
ClearWeakness() {
LOG(HandleEvent("GlobalHandle::ClearWeakness", handle().location()));
ASSERT(state_ != DESTROYED);
if (state_ == WEAK || IsNearDeath()) {
GlobalHandles::number_of_weak_handles_--;
if (object_->IsJSGlobalObject()) {
GlobalHandles::number_of_global_object_weak_handles_--;... | false | false | false | false | false | 0 |
ad_move_tree_info(AW_window *aww,AW_CL mode){
/*
* mode == 0 -> move info (=overwrite info from source tree)
* mode == 1 -> compare info
* mode == 2 -> add info
*/
bool compare_node_info = mode==1;
bool delete_old_nodes = mode==0;
bool nodes_with_marked_only = (mode==0 |... | false | false | false | false | false | 0 |
addMixInfo(DOMNode* a_element, bool a_bForceFirstNode)
{
// this is a complete mixinfo node to be sent to the InfoService
XERCES_CPP_NAMESPACE::DOMDocument* docMixInfo=NULL;
if(pglobalOptions->getMixXml(docMixInfo)!=E_SUCCESS)
{
return E_UNKNOWN;
}
DOMNode* nodeMixInfo = a_element->getOwnerDocument()->importNod... | false | false | false | false | false | 0 |
ComputeRowAMaxImpl(Vector& rows_norms, bool init) const
{
// A few sanity checks
DBG_ASSERT(initialized_);
DenseVector* dense_vec = static_cast<DenseVector*>(&rows_norms);
DBG_ASSERT(dynamic_cast<DenseVector*>(&rows_norms));
Number* vec_vals=dense_vec->Values();
const double* vals = values_... | false | false | false | false | false | 0 |
AllocateHeapNumber(double value) {
// Use general version, if we're forced to always allocate.
if (always_allocate()) return AllocateHeapNumber(value, TENURED);
// This version of AllocateHeapNumber is optimized for
// allocation in new space.
STATIC_ASSERT(HeapNumber::kSize <= Page::kMaxHeapObjectSize);
A... | false | false | false | false | false | 0 |
droproot(const char *username, const char *chroot_dir)
{
struct passwd *pw = NULL;
if (chroot_dir && !username) {
fprintf(stderr, "tcpdump: Chroot without dropping root is insecure\n");
exit(1);
}
pw = getpwnam(username);
if (pw) {
if (chroot_dir) {
if (chroot(chroot_dir) != 0 || chdir ("/") != 0) {
... | false | false | false | false | true | 1 |
axi_dmac_interrupt_handler(int irq, void *devid)
{
struct axi_dmac *dmac = devid;
unsigned int pending;
pending = axi_dmac_read(dmac, AXI_DMAC_REG_IRQ_PENDING);
axi_dmac_write(dmac, AXI_DMAC_REG_IRQ_PENDING, pending);
spin_lock(&dmac->chan.vchan.lock);
/* One or more transfers have finished */
if (pending & AX... | false | false | false | false | false | 0 |
collectExtraInfo(QWidget * parent, const QString & family, const QString & prop, const QString & value, bool swappingEnabled, QString & returnProp, QString & returnValue, QWidget * & returnWidget, bool & hide)
{
if (m_hasLogo) {
if (prop.compare("color", Qt::CaseInsensitive) == 0) {
returnProp = tr("color");
... | false | false | false | false | false | 0 |
Fjacobi()
{
int n, m, sign1, sign2;
int j;
word2 *x, *y, *hilf;
if(chkints(jacobsym,argStkPtr-1,2) == aERROR)
return(brkerr());
x = AriBuf;
y = AriScratch;
hilf = y + aribufSize;
n = bigretr(argStkPtr-1,x,&sign1);
m = bigretr(argStkPtr,y,&sign2);
if(m == 0 || (*y & 1) ==... | false | false | false | false | false | 0 |
_e2_fileview_make_all_infos (gchar *parentpath, GList **list)
{
gint len1, len2, trailer;
gchar *item;
FileInfo *info;
GList *member;
guint errval = E2DREAD_ENOENT; //assign to prevent compiler error
#ifdef E2_VFS
VPATH data;
data.spacedata = NULL; //FIXME
#endif
#ifdef E2_VFSTMP
get proper spacedata
#endif
l... | false | false | false | false | false | 0 |
bcma_host_soc_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct device_node *np = dev->of_node;
struct bcma_bus *bus;
int err;
/* Alloc */
bus = devm_kzalloc(dev, sizeof(*bus), GFP_KERNEL);
if (!bus)
return -ENOMEM;
/* Map MMIO */
bus->mmio = of_iomap(np, 0);
if (!bus->mmio)
... | false | false | false | false | false | 0 |
df_maybe_reorganize_def_refs (enum df_ref_order order)
{
if (order == df->def_info.ref_order)
return;
switch (order)
{
case DF_REF_ORDER_BY_REG:
df_reorganize_refs_by_reg (&df->def_info, true, false, false);
break;
case DF_REF_ORDER_BY_INSN:
df_reorganize_refs_by_insn (&df->def_i... | false | false | false | false | false | 0 |
purgeItem(qint64 parent)
{
QList<QList<qint64> > childItemRows = m_model->m_childItems.value(parent);
if (childItemRows.size() > 0)
{
for (int col = 0; col < m_numCols; col++)
{
QList<qint64> childItems = childItemRows[col];
foreach(qint64 item, childItems)
{
purgeItem(item);
... | false | false | false | false | false | 0 |
get_runstate_snapshot(struct vcpu_runstate_info *res)
{
u64 state_time;
struct vcpu_runstate_info *state;
BUG_ON(preemptible());
state = this_cpu_ptr(&xen_runstate);
/*
* The runstate info is always updated by the hypervisor on
* the current CPU, so there's no need to use anything
* stronger than a compil... | false | false | false | false | false | 0 |
gtk_shruler_expose (GtkWidget *widget,
GdkEventExpose *event)
#else
static gboolean
gtk_shruler_expose (GtkWidget *widget,
cairo_t *cr)
#endif
{
if (gtk_widget_is_drawable (widget))
{
GtkSHRuler *ruler = GTK_SHRULER (widget);
GtkSHRulerPrivate *priv... | false | false | false | false | false | 0 |
print_clause_s2(FILE *fp,
struct clause *c)
{
if (c->first_lit == NULL)
fprintf(fp, "false");
else {
struct literal *lit;
for (lit = c->first_lit; lit; lit = lit->next_lit) {
if (lit->next_lit)
fprintf(fp, "(or ");
if (!lit->sign)
fprintf(fp, "(not ");
if (is_symbol(lit->ato... | false | false | false | false | false | 0 |
Clear() {
int entries = length();
for (int i = 0; i != entries; i++) {
set_undefined(i);
}
} | false | false | false | false | false | 0 |
printstr (fmt, string, len, fieldwidth, precision)
char *fmt; /* format */
char *string; /* expanded string argument */
int len; /* length of expanded string */
int fieldwidth; /* argument for width of `*' */
int precision; /* argument for precision of `*' */
{
#if 0
char *s;
#endif
... | false | false | false | false | false | 0 |
Allocate(unsigned long ItemSize)
{
if (unlikely(ItemSize == 0))
{
_error->Fatal("Can't allocate an item of size zero");
return 0;
}
// Look for a matching pool entry
Pool *I;
Pool *Empty = 0;
for (I = Pools; I != Pools + PoolCount; ++I)
{
if (I->ItemSize == 0)
Empty = I;
... | false | false | false | false | false | 0 |
_PyImport_FindExtension(char *name, char *filename)
{
PyObject *dict, *mod, *mdict;
if (extensions == NULL)
return NULL;
dict = PyDict_GetItemString(extensions, filename);
if (dict == NULL)
return NULL;
mod = PyImport_AddModule(name);
if (mod == NULL)
return NULL;
mdi... | false | false | false | false | false | 0 |
brcms_b_bsinit(struct brcms_c_info *wlc, u16 chanspec)
{
struct brcms_hardware *wlc_hw = wlc->hw;
brcms_dbg_mac80211(wlc_hw->d11core, "wl%d: bandunit %d\n", wlc_hw->unit,
wlc_hw->band->bandunit);
brcms_c_ucode_bsinit(wlc_hw);
wlc_phy_init(wlc_hw->band->pi, chanspec);
brcms_c_ucode_txant_set(wlc_hw);
/*... | false | false | false | false | false | 0 |
WriteCharSet(CharSet *s) {
for (CharSet::Range *r = s->head; r != NULL; r = r->next) {
if (r->from < r->to) {
wchar_t *from = Ch(r->from);
wchar_t *to = Ch(r->to);
fwprintf(trace, L"%ls .. %ls ", from, to);
delete [] from;
delete [] to;
}
else {
wchar_t *from = Ch(r->from);
fwprintf(trace, L... | false | false | false | false | false | 0 |
xmlSecTransformMemBufFinalize(xmlSecTransformPtr transform) {
xmlSecBufferPtr buffer;
xmlSecAssert(xmlSecTransformCheckId(transform, xmlSecTransformMemBufId));
buffer = xmlSecTransformMemBufGetBuf(transform);
xmlSecAssert(buffer != NULL);
xmlSecBufferFinalize(xmlSecTransformMemBufGetBuf(trans... | false | false | false | false | false | 0 |
mcxBJhash
( register const void* key
, register u32 len
)
{ register u32 a, b, c, l
; const char* k = key
; l = len
; a = b = 0x9e3779b9u
; c = 0xabcdef01u
; while (l >= 12)
{
a += k[0] + (k[1]<<8) + (k[2]<<16) + (k[3]<<24)
... | false | false | false | false | false | 0 |
Main_ParseWarn(const char *arg, int iscmd)
{
int i, neg;
static const struct {
const char *option;
uint32_t flag;
} options[] = {
{ "dirsyntax", WARN_DIRSYNTAX },
{ NULL, 0 }
};
neg = 0;
if (arg[0] == 'n' && arg[1] == 'o') {
neg = 1;
arg += 2;
}
for (i = 0; options[i].option != NULL; i++)
if (... | false | false | false | false | false | 0 |
bq24190_write_mask(struct bq24190_dev_info *bdi, u8 reg,
u8 mask, u8 shift, u8 data)
{
u8 v;
int ret;
ret = bq24190_read(bdi, reg, &v);
if (ret < 0)
return ret;
v &= ~mask;
v |= ((data << shift) & mask);
return bq24190_write(bdi, reg, v);
} | false | false | false | false | false | 0 |
copyFrom(const List& other)
{
// Assumption: we're empty (e.g. called from copy)
ListImpBase* otherImp = other._impBase;
ListImp* ourImp = static_cast<ListImp *>(_impBase);
assert(ourImp->size == 0 && ourImp->capacity == 0);
int size = otherImp->size;
ourImp->size = size;
... | false | false | false | false | false | 0 |
php_ob_handler_from_string(const char *handler_name, int len TSRMLS_DC)
{
zval *output_handler;
ALLOC_INIT_ZVAL(output_handler);
Z_STRLEN_P(output_handler) = len;
Z_STRVAL_P(output_handler) = estrndup(handler_name, len);
Z_TYPE_P(output_handler) = IS_STRING;
return output_handler;
} | false | false | false | false | false | 0 |
rl_old_menu_complete (count, invoking_key)
int count, invoking_key;
{
rl_compentry_func_t *our_func;
int matching_filenames, found_quote;
static char *orig_text;
static char **matches = (char **)0;
static int match_list_index = 0;
static int match_list_size = 0;
static int orig_start, orig_end;
st... | false | false | false | false | false | 0 |
cbf_lex_unget (cbf_file *file, YYSTYPE *val, int c[5]) {
if ( file->temporary || file->characters ) {
if (file->characters > file->characters_base) {
file->characters--;
file->characters_used++;
file->characters_size++;
} else {
... | false | false | false | false | false | 0 |
get_and_dump_any_records(bind_handle_t h, uint16_t attr_id,
uint32_t attr_mod, ib_net64_t comp_mask,
void *attr,
size_t attr_size,
void (*dump_func) (void *))
{
struct sa_query_result result;
int ret = get_any_records(h, attr_id, attr_mod, comp_mask, attr,
attr_size, &result);
i... | false | false | false | false | false | 0 |
read(hsStream* S) {
fEntries.resize(S->readInt());
fUnknown = S->readInt();
for (size_t i=0; i<fEntries.size(); i++) {
fEntries[i].fPath = S->readSafeStr();
fEntries[i].fHash.read(S);
fEntries[i].fTimestamp = S->readInt();
fEntries[i].fUnknown = S-... | false | false | false | false | false | 0 |
send_list(struct nntp *nntp, const char *command, const char *pattern)
{
bool okay;
enum nntp_status status;
enum nntp_code code;
char *line;
if (pattern != NULL)
okay = nntp_send_line(nntp, "LIST %s %s", command, pattern);
else
okay = nntp_send_line(nntp, "LIST %s", command);
... | false | false | false | false | false | 0 |
cut_utils_remove_path (const char *path, GError **error)
{
if (!g_file_test(path, G_FILE_TEST_EXISTS)) {
g_set_error(error, G_FILE_ERROR, G_FILE_ERROR_NOENT,
"path doesn't exist: %s", path);
return FALSE;
}
if (g_file_test(path, G_FILE_TEST_IS_DIR)) {
if (g_rmdir... | false | false | false | false | false | 0 |
_nl_expand_alias (name)
const char *name;
{
static const char *locale_alias_path = LOCALE_ALIAS_PATH;
struct alias_map *retval;
const char *result = NULL;
size_t added;
#ifdef _LIBC
__libc_lock_lock (lock);
#endif
do
{
struct alias_map item;
item.alias = name;
if (nmap > 0)
re... | false | false | false | false | false | 0 |
uint_attribute(unsigned int attr)
{
const Attribute_value* attr_val = this->attribute(attr);
if (attr_val == NULL)
return 0;
switch (attr_val->form)
{
case elfcpp::DW_FORM_flag_present:
case elfcpp::DW_FORM_data1:
case elfcpp::DW_FORM_flag:
case elfcpp::DW_FORM_data4:
case el... | false | false | false | false | false | 0 |
set_print_width (bfd *file)
{
print_width = bfd_get_arch_size (file);
if (print_width == -1)
{
/* PR binutils/4292
Guess the target's bitsize based on its name.
We assume here than any 64-bit format will include
"64" somewhere in its name. The only known exception
is the MMO object file format. ... | false | false | false | false | false | 0 |
copy_string20(unpack_data_t *unpack_data, unsigned int length, unsigned int distance)
{
unsigned int dest_ptr;
unpack_data->last_dist = unpack_data->old_dist[unpack_data->old_dist_ptr++ & 3] = distance;
unpack_data->last_length = length;
unpack_data->dest_unp_size -= length;
dest_ptr = unpack_data->unp_ptr - d... | false | false | false | false | false | 0 |
static_method (GtkWidget *widget, void *data)
{
gamgi_window *window = GAMGI_CAST_WINDOW data;
GtkWidget *dialog = window->dialog0;
GtkWidget *combo;
GtkWidget *vbox_shift;
GtkWidget *vbox_position, *vbox_change, *vbox_occupancy;
GtkWidget *vbox_packing;
int row;
/**********************
* get link combo box *
******... | false | false | false | false | false | 0 |
lower() {
if (this != manager->bottom(getActiveLayer())) {
YWindow::lower();
setAbove(0);
}
} | false | false | false | false | false | 0 |
decide_prefetch_mt_between_mt(Info_for_prefetch *info_p,
int use_mt,
int assigns,
int *assign,
real *TaskEndTime,
real def_time)
{
int i;
for(i = assigns -... | false | false | false | false | false | 0 |
link_mark_add_new(enum text_link_type type, int id)
{
struct link_mark *pmark = link_mark_find(type, id);
struct tile *ptile;
if (pmark) {
/* Already displayed, but maybe increase the turn counter. */
pmark->turn_counter = MAX(pmark->turn_counter, 2);
return;
}
pmark = link_mark_new(type, id, 2)... | false | false | false | false | false | 0 |
__uwb_rc_ctx_get(struct uwb_rc *rc, struct uwb_rc_neh *neh)
{
int result;
result = find_next_zero_bit(rc->ctx_bm, UWB_RC_CTX_MAX,
rc->ctx_roll++);
if (result < UWB_RC_CTX_MAX)
goto found;
result = find_first_zero_bit(rc->ctx_bm, UWB_RC_CTX_MAX);
if (result < UWB_RC_CTX_MAX)
goto found;
return -ENFILE;... | false | false | false | false | false | 0 |
VasySimulateVpnPlace( VpnFigure, VpnProc, BeginPlace )
vpnfig_list *VpnFigure;
vpnproc_list *VpnProc;
vpnplace_list *BeginPlace;
{
chain_list *ScanTrans;
vpnarc *VpnArc;
vpntrans_list *VpnTrans;
vpnplace_list *VpnPlace;
vpnact_list *VpnAct;
VpnPlace = (vpnplace_list *)0;
do
... | false | false | false | true | false | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.