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 |
|---|---|---|---|---|---|---|
node_FreeValue(unsigned char type,unsigned long long value)
{
switch(type)
{
case NODE_TYPE_NULL:
break;
case NODE_TYPE_INT:
case NODE_TYPE_FLOAT:
case NODE_TYPE_DOUBLE:
case NODE_TYPE_UINT8:
case NODE_TYPE_SINT8:
case NODE_TYPE_BOOL:
case NODE_TYPE_UINT16:
case NODE_TYP... | false | false | false | false | false | 0 |
PySys_AddWarnOption(const wchar_t *s)
{
PyObject *unicode;
unicode = PyUnicode_FromWideChar(s, -1);
if (unicode == NULL)
return;
PySys_AddWarnOptionUnicode(unicode);
Py_DECREF(unicode);
} | false | false | false | false | false | 0 |
gl_color_history_model_add_color (glColorHistoryModel *this,
guint color)
{
guint *old;
guint *new;
guint i, n;
old = get_color_array (this, &n);
new = g_new0 (guint, this->priv->max_n);
... | false | false | false | false | false | 0 |
est_expand_word_ew(ESTDB *db, const char *word, CBLIST *list){
const char *kbuf;
int num, wsiz, ksiz;
assert(db && word && list);
num = 0;
wsiz = strlen(word);
vlcurfirst(db->fwmdb);
while((kbuf = vlcurkeycache(db->fwmdb, &ksiz)) != NULL){
if(ksiz >= wsiz && !memcmp(kbuf + ksiz - wsiz, word, wsiz)){
... | false | false | false | false | false | 0 |
check_pr (PR *pr, ErrorDesc *err, int initial_entry)
{
const DatabaseInfo database = pr->database;
BadFields enums;
int x;
int num_fields = get_num_fields (database);
for (x = 0; x < num_fields; x++)
{
FieldIndex field = getNthField (database, x);
if (initial_entry && field == NUMBER (databas... | false | false | false | false | false | 0 |
handle_read( GIOChannel *sock, GIOCondition cond, http_request *h ) {
g_debug( "entering handle_read" );
http_request_read( h );
if (! http_request_ok(h))
return TRUE;
handle_request(h);
g_io_channel_close( h->sock );
g_io_channel_unref( h->sock );
http_request_free( h );
g_debug( "e... | false | false | false | false | false | 0 |
CheckDuplicateSlots(
void *theEnv,
struct lhsParseNode *nodeList,
SYMBOL_HN *slotName)
{
while (nodeList != NULL)
{
if (nodeList->slot == slotName)
{
PrintErrorID(theEnv,"OBJRTBLD",4,TRUE);
EnvPrintRouter(theEnv,WERROR,"Multiple restrictions on attribute ");
EnvP... | false | false | false | false | false | 0 |
addOutput(QString text, QString key)
{
addOutput(text, format(key));
} | false | false | false | false | false | 0 |
valueObjectWithPathData(ParserControl *parm, parseUnion *stateUnion)
{
parseUnion lvalp={0};
CMPIObjectPath *op = NULL;
CMPIInstance *inst;
ct = localLex((parseUnion*)&stateUnion->xtokObjectWithPathData, parm);
if(ct == XTOK_CLASSPATH) {
dontLex = 1;
classWithPath(parm, (parseUnion*)&stateUnion->xtokObjectWith... | false | false | false | false | false | 0 |
init_xml_response(const char *resp, int ns,
xmlNodePtr req, xmlNsPtr *respNs)
{
/* Start construction of our XML response tree */
xmlDocPtr doc = xmlNewDoc(BAD_CAST "1.0");
xmlNodePtr root = NULL;
if (!doc) return NULL;
if (!(root = xmlNewNode(NULL, BAD_CAST resp))) return NULL;
xmlDoc... | false | false | false | false | false | 0 |
eraser_draw (eraser_state *st, Bool first_p)
{
double now = (first_p ? st->start_time : double_time());
double duration = st->stop_time - st->start_time;
st->prev_ratio = st->ratio;
st->ratio = (now - st->start_time) / duration;
if (st->ratio > 1.0)
st->ratio = 1.0;
st->fn (st);
XSync (st->dpy, Fal... | false | false | false | false | false | 0 |
grow_outbuf (obuf, needed)
register FILE_BUF *obuf;
register int needed;
{
register U_CHAR *p;
int minsize;
if (obuf->length - (obuf->bufp - obuf->buf) > needed)
return 0;
/* Make it at least twice as big as it is now. */
obuf->length *= 2;
/* Make it have at least 150% of the free space we... | false | false | false | false | false | 0 |
update_bb_for_insn_chain (rtx begin, rtx end, basic_block bb)
{
rtx insn;
end = NEXT_INSN (end);
for (insn = begin; insn != end; insn = NEXT_INSN (insn))
if (!BARRIER_P (insn))
df_insn_change_bb (insn, bb);
} | false | false | false | false | false | 0 |
_dbus_change_to_daemon_user (const char *user,
DBusError *error)
{
dbus_uid_t uid;
dbus_gid_t gid;
DBusString u;
_dbus_string_init_const (&u, user);
if (!_dbus_get_user_id_and_primary_group (&u, &uid, &gid))
{
dbus_set_error (error, DBUS_ERROR_FAILED,
... | false | false | false | false | false | 0 |
EmitTTypeReference(const GlobalValue *GV,
unsigned Encoding) const {
if (GV) {
const TargetLoweringObjectFile &TLOF = getObjFileLowering();
const MCExpr *Exp =
TLOF.getTTypeGlobalReference(GV, Encoding, *Mang, TM, MMI,
*OutStrea... | false | false | false | false | false | 0 |
hv_ringbuffer_read(struct vmbus_channel *channel,
void *buffer, u32 buflen, u32 *buffer_actual_len,
u64 *requestid, bool raw)
{
u32 bytes_avail_toread;
u32 next_read_location = 0;
u64 prev_indices = 0;
struct vmpacket_descriptor desc;
u32 offset;
u32 packetlen;
int ret = 0;
struct hv_ring_buff... | false | false | false | false | false | 0 |
make_low_pass_filter(double omega_pass, double omega_stop, double error, int *length_p)
{
struct filter_param p = filter(omega_pass, omega_stop, error);
int length;
int n;
double *lpf;
length = p.M + 1;
lpf = calloc (length, sizeof(double));
for (n = 0; n < length; n++)
lpf[n] = lowpass(n, p.M, omega_pass)... | false | false | false | false | false | 0 |
normalizestring(const char *string)
{
size_t i;
size_t len = strlen(string);
char *p;
PyObject *v;
if (len > PY_SSIZE_T_MAX) {
PyErr_SetString(PyExc_OverflowError, "string is too large");
return NULL;
}
p = PyMem_Malloc(len + 1);
if (p == NULL)
return PyErr_NoMe... | false | false | false | false | false | 0 |
bstrtoul(const struct bstr *b)
{
char *inv = NULL;
unsigned long l;
char buf[b->len+1];
memcpy(buf, b->data, b->len);
buf[b->len] = '\0';
l = strtoul(buf, &inv, 0);
if (l == ULONG_MAX || inv == buf)
return ULONG_MAX;
return l;
} | false | false | false | false | false | 0 |
option_overload(const void *data, int opt_len)
{
if (opt_len != 1)
return;
over_load = *(uint8_t *)data;
} | false | false | false | false | false | 0 |
qed_spq_add_entry(struct qed_hwfn *p_hwfn,
struct qed_spq_entry *p_ent,
enum spq_priority priority)
{
struct qed_spq *p_spq = p_hwfn->p_spq;
if (p_ent->queue == &p_spq->unlimited_pending) {
if (list_empty(&p_spq->free_pool)) {
list_add_tail(&p_ent->list, &p_spq->unlimited_pending);
p_spq->unlimited_... | false | false | false | false | false | 0 |
spawnNextItem( PG_Widget* parent, const PG_Point& pos )
{
if ( it != items.end() ) {
const VehicleType* v = *(it++);
return new VehicleTypeCountWidget( parent, pos, parent->Width() - 15, v, gamemap->getCurrentPlayer(), counter[v] );
} else
return NULL;
} | false | false | false | false | false | 0 |
__module_get(struct module *module)
{
if (module) {
preempt_disable();
atomic_inc(&module->refcnt);
trace_module_get(module, _RET_IP_);
preempt_enable();
}
} | false | false | false | false | false | 0 |
dst_read_status(struct dvb_frontend *fe, enum fe_status *status)
{
struct dst_state *state = fe->demodulator_priv;
*status = 0;
if (state->diseq_flags & HAS_LOCK) {
// dst_get_signal(state); // don't require(?) to ask MCU
if (state->decode_lock)
*status |= FE_HAS_LOCK | FE_HAS_SIGNAL | FE_HAS_CARRIER | FE_HAS... | false | false | false | false | false | 0 |
play_lib_n(int color, int num_moves, ...)
{
va_list ap;
int mcolor = color;
int libs = 0;
int i;
int played_moves = 0;
int apos;
int ypos;
va_start(ap, num_moves);
/* Do all the moves with alternating colors. */
for (i = 0; i < num_moves; i++) {
apos = va_arg(ap, int);
if (apos != NO_MOVE... | false | false | false | false | false | 0 |
p_disconnect_resize_handler(GapPlayerMainGlobalParams *gpp)
{
if(gpp->resize_handler_id >= 0)
{
g_signal_handler_disconnect(gpp->resize_box, gpp->resize_handler_id);
gpp->resize_handler_id = -1;
}
} | false | false | false | false | false | 0 |
validate_headref(const char *path)
{
struct stat st;
char *buf, buffer[256];
unsigned char sha1[20];
int len, fd;
if (lstat(path, &st) < 0)
return -1;
/* Make sure it is a "refs/.." symlink */
if (S_ISLNK(st.st_mode)) {
len = readlink(path, buffer, sizeof(buffer)-1);
if (len >= 5 && !memcmp("refs/", buff... | false | false | false | false | false | 0 |
match_subchans (NMDeviceEthernet *self, NMSettingWired *s_wired, gboolean *try_mac)
{
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self);
const GPtrArray *subchans;
int i;
*try_mac = TRUE;
subchans = nm_setting_wired_get_s390_subchannels (s_wired);
if (!subchans)
return TRUE;
/* connectio... | false | false | false | false | false | 0 |
us_ny_hdy (init_data, detected, easter, year, hd_elems, fday, count)
Bool *init_data;
const Bool detected;
int easter;
const int year;
int *hd_elems;
const int fday;
const int count;
/*
Manages all specific holidays celebrated in United States/New York.
*/
{
ptr_cc_id = "US_NY";
... | false | false | false | false | false | 0 |
ParseOldTypeSymbolTable() {
if (Stream.EnterSubBlock(bitc::TYPE_SYMTAB_BLOCK_ID_OLD))
return Error("Malformed block record");
SmallVector<uint64_t, 64> Record;
// Read all the records for this type table.
std::string TypeName;
while (1) {
unsigned Code = Stream.ReadCode();
if (Code == bitc::END_... | false | false | false | false | false | 0 |
convert ( int col, bool recursive )
{
if ( col > 8)
fatalError("convertvehicle: \n invalid target player ");
registerForNewOwner( col );
if ( recursive )
for ( Cargo::iterator i = cargo.begin(); i != cargo.end(); ++i )
if ( *i )
(*i)->convert( col );
} | false | false | false | false | false | 0 |
orte_wait_init(void)
{
OBJ_CONSTRUCT(&mutex, opal_mutex_t);
OBJ_CONSTRUCT(&pending_pids, opal_list_t);
OBJ_CONSTRUCT(®istered_cb, opal_list_t);
opal_event_set(orte_event_base,
&handler, SIGCHLD, OPAL_EV_SIGNAL|OPAL_EV_PERSIST,
orte_wait_signal_callback,
... | false | false | false | false | false | 0 |
Handle (Event& e) {
Perspective oldp = *shown;
if (e.eventType == DownEvent) {
if (Inside(e)) {
Slide(e);
} else {
Jump(e);
}
interactor->Adjust(*shown);
if (((OverlayViewer*)interactor)->Chained()) {
IntCoord dx = shown->curx - oldp.curx;
IntCoord dy = shown->cury - oldp.cury;
Ite... | false | false | false | false | false | 0 |
runOnFunction(Function &F) {
LVI = &getAnalysis<LazyValueInfo>();
bool FnChanged = false;
for (Function::iterator FI = F.begin(), FE = F.end(); FI != FE; ++FI) {
bool BBChanged = false;
for (BasicBlock::iterator BI = FI->begin(), BE = FI->end(); BI != BE; ) {
Instruction *II = BI++;
switch (... | false | false | false | false | false | 0 |
utest_Config(P7_HMM *hmm, P7_BG *bg)
{
char *msg = "modelconfig.c::p7_ProfileConfig() unit test failed";
P7_PROFILE *gm = NULL;
if ((gm = p7_profile_Create(hmm->M, hmm->abc)) == NULL) esl_fatal(msg);
if (p7_ProfileConfig(hmm, bg, gm, 350, p7_LOCAL) != eslOK) esl_fatal(msg);
if (p7_profile_Valid... | false | false | false | false | false | 0 |
xmui_unmanage(Widget w)
{
Widget shell;
DENTER(GUI_LAYER, "xmui_unmanage");
if (XtIsTopLevelShell(w))
shell = w;
else
shell = XtParent(w);
if (XtIsTopLevelShell(shell))
XtPopdown(shell);
else
XtUnmanageChild(w);
DEXIT;
} | false | false | false | false | false | 0 |
gnc_quote_source_lookup_by_ti (QuoteSourceType type, gint index)
{
gnc_quote_source *source;
GList *node;
ENTER("type/index is %d/%d", type, index);
switch (type)
{
case SOURCE_CURRENCY:
LEAVE("found %s", currency_quote_source.user_name);
return ¤cy_quote_source;
b... | false | false | false | false | false | 0 |
isLoadOfStoredAddress(uint64_t LoadSize, int64_t LoadOffset,
const Value *LoadValue) const {
for (unsigned i = 0, e = NumStores; i != e; ++i) {
// Handle exact and commuted addresses.
if (LoadValue == StoreValue[i] && LoadOffset == StoreOffset[i])
return true;
// Okay, we don't have an exact matc... | false | false | false | false | false | 0 |
open_sqlite_odb(void)
{
git_odb *odb;
git_odb_backend *sqlite;
if (git_odb_new(&odb) < GIT_SUCCESS)
return NULL;
if (git_odb_backend_sqlite(&sqlite, ":memory") < GIT_SUCCESS)
return NULL;
if (git_odb_add_backend(odb, sqlite, 0) < GIT_SUCCESS)
return NULL;
return odb;
} | false | false | false | false | false | 0 |
Translate_create(gboolean use_pima){
register Translate *t = g_new0(Translate, 1);
register Translate_ArgumentSet *tas = Translate_ArgumentSet_create(NULL);
t->ref_count = 1;
t->nt = (guchar*)"-GARTKWDCSMVYBHN";
t->aa = (guchar*)"-ARNDCQEGHILKMFPSTWYV*ablkonihdmcepjfrxX";
t->code = (guchar*)Tran... | false | false | false | false | false | 0 |
test_query_strict (void)
{
GDataQuery *query;
gchar *query_uri;
query = gdata_query_new ("bar");
gdata_query_set_is_strict (query, TRUE);
query_uri = gdata_query_get_query_uri (query, "http://example.com");
g_assert_cmpstr (query_uri, ==, "http://example.com?q=bar&strict=true");
g_free (query_uri);
gdata_que... | false | false | false | false | false | 0 |
psdump (cell* gcells, int n_gcells, boxf BB, boxf* rects, int nrect)
{
int i;
boxf bb;
box absbb;
absbb.LL.y = absbb.LL.x = 10;
absbb.UR.x = absbb.LL.x + BB.UR.x - BB.LL.x;
absbb.UR.y = absbb.LL.y + BB.UR.y - BB.LL.y;
fputs (pre, stderr);
fprintf (stderr, "%%%%Page: 1 1\n%%%%PageBoundin... | false | false | false | false | false | 0 |
glusterd_handle_fsm_log (rpcsvc_request_t *req)
{
int32_t ret = -1;
gf1_cli_fsm_log_req cli_req = {0,};
dict_t *dict = NULL;
glusterd_sm_tr_log_t *log = NULL;
xlator_t *this = NULL;
... | true | true | true | true | false | 1 |
follow(c, tp, sp)
char c;
char *tp;
struct state *sp;
{
struct trans *arcp, *arcup;
if(c >= 'a' && c <= 'z') {
c -= 'a' - 'A';
}
arcp = sp->trans + c;
if(c >= 'A' && c <= 'Z') {
arcup = sp->trans + c + 'a' - 'A';
} else {
arcup = arcp;
}
if(c == '\0') {
if(arcp->action == TERMINAL) {
return -1;
... | false | false | false | false | false | 0 |
goku_match_ep(struct usb_gadget *g,
struct usb_endpoint_descriptor *desc,
struct usb_ss_ep_comp_descriptor *ep_comp)
{
struct goku_udc *dev = to_goku_udc(g);
struct usb_ep *ep;
switch (usb_endpoint_type(desc)) {
case USB_ENDPOINT_XFER_INT:
/* single buffering is enough */
ep = &dev->ep[3].ep;
if (usb_gad... | false | false | false | false | false | 0 |
select_p_job_suspend(struct job_record *job_ptr, bool indf_susp)
{
xassert(job_ptr);
if (!indf_susp)
return SLURM_SUCCESS;
return _rm_job_from_res(select_part_record, select_node_usage,
job_ptr, 2);
} | false | false | false | false | false | 0 |
initStaticData(void)
{
/* Dictionary */
dictionary = (DictionaryEntry *) pointerTo(header->dictionary);
/* Find out number of entries in dictionary */
for (dictionarySize = 0; !isEndOfArray(&dictionary[dictionarySize]); dictionarySize++);
/* Scores */
/* All addresses to tables indexed by ... | false | false | false | false | false | 0 |
add_timeout(struct dlm_lkb *lkb)
{
struct dlm_ls *ls = lkb->lkb_resource->res_ls;
if (is_master_copy(lkb))
return;
if (test_bit(LSFL_TIMEWARN, &ls->ls_flags) &&
!(lkb->lkb_exflags & DLM_LKF_NODLCKWT)) {
lkb->lkb_flags |= DLM_IFL_WATCH_TIMEWARN;
goto add_it;
}
if (lkb->lkb_exflags & DLM_LKF_TIMEOUT)
... | false | false | false | false | false | 0 |
codec_getitem(const char *encoding, int index)
{
PyObject *codecs;
PyObject *v;
codecs = _PyCodec_Lookup(encoding);
if (codecs == NULL)
return NULL;
v = PyTuple_GET_ITEM(codecs, index);
Py_DECREF(codecs);
Py_INCREF(v);
return v;
} | false | false | false | false | true | 1 |
gregorio_insert_style_before (unsigned char type, unsigned char style,
gregorio_character * current_character)
{
gregorio_character *element =
(gregorio_character *) malloc (sizeof (gregorio_character));
element->is_character = 0;
element->cos.s.type = type;
element->cos.s.style = style;
element-... | false | false | false | false | true | 1 |
put () const {
std::cerr << "v=HepRandomEngine::put() called -- no data!\n";
std::vector<unsigned long> v;
return v;
} | false | false | false | false | false | 0 |
evthread_posix_lock(unsigned mode, void *_lock)
{
pthread_mutex_t *lock = _lock;
if (mode & EVTHREAD_TRY)
return pthread_mutex_trylock(lock);
else
return pthread_mutex_lock(lock);
} | false | false | false | false | false | 0 |
pop()
{
LASSERT(depth() >= 1, /**/);
pop_back();
} | false | false | false | false | false | 0 |
del_wh_children(struct dentry *h_dentry, struct au_nhash *whlist,
aufs_bindex_t bindex, struct au_branch *br)
{
int err;
unsigned long ul, n;
struct qstr wh_name;
char *p;
struct hlist_head *head;
struct au_vdir_wh *pos;
struct au_vdir_destr *str;
err = -ENOMEM;
p = (void *)__get_free_page(GFP_NOFS);
w... | false | false | false | false | false | 0 |
variable_notebook_varchange_cb (ggobid * gg, vartabled * vt, gint which,
GGobiData * data, void *notebook)
{
GtkWidget *swin, *tree_view;
GGobiData *d;
gint kd = -1;
/*-- add one or more variables to this datad --*/
d = (GGobiData *) datad_get_from_notebook (GTK_WIDGET (notebo... | false | false | false | false | false | 0 |
check_locale(sys_var *self, THD *thd, set_var *var)
{
if (!var->value)
return false;
MY_LOCALE *locale;
char buff[STRING_BUFFER_USUAL_SIZE];
if (var->value->result_type() == INT_RESULT)
{
int lcno= (int)var->value->val_int();
if (!(locale= my_locale_by_number(lcno)))
{
my_error(ER_UNKNO... | false | false | false | false | false | 0 |
spwd_getspnam(PyObject *self, PyObject *args)
{
char *name;
struct spwd *p;
PyObject *arg, *bytes, *retval = NULL;
if (!PyArg_ParseTuple(args, "U:getspnam", &arg))
return NULL;
if ((bytes = PyUnicode_EncodeFSDefault(arg)) == NULL)
return NULL;
if (PyBytes_AsStringAndSize(bytes, ... | false | false | false | false | false | 0 |
nc_get_rec(
int ncid,
size_t recnum,
void **datap)
{
int status;
int varid;
int rvarids[MAX_NC_VARS];
int nrvars;
size_t start[MAX_NC_DIMS];
size_t edges[MAX_NC_DIMS];
status = numrecvars(ncid, &nrvars, rvarids);
if(status != NC_NOERR)
return status;
if (nrvars == 0)
retu... | false | false | false | false | false | 0 |
get_terminal_output(void)
{
static FILE *print;
static gboolean print_ok = FALSE;
if (!print_ok) {
if (isatty(fileno(stdout)))
print = stdout;
else if (isatty(fileno(stderr)))
print = stderr;
else
print = NULL;
print_ok = TRUE;
}
... | false | false | false | false | false | 0 |
CloseThreadSearchFrame()
// ----------------------------------------------------------------------------
{
// called from CodeSnippetsApp::OnClose()
// called from ThreadSearchFrame::OnClose()
// just before Destroy()
//Why?? It's returning to a destroyed frame
wxWindow* pThreadSearchFrame = GetCon... | false | false | false | false | false | 0 |
HandlePolymorphicStoreNamedField(Assignment* expr,
HValue* object,
HValue* value,
ZoneMapList* types,
Handle... | false | false | false | false | false | 0 |
xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *psta)
{
u8 wmmps_ac = 0;
struct list_head *xmitframe_plist, *xmitframe_phead;
struct xmit_frame *pxmitframe = NULL;
struct sta_priv *pstapriv = &padapter->stapriv;
spin_lock_bh(&psta->sleep_q.lock);
xmitframe_phead = get_list_head(&psta->sl... | false | false | false | false | false | 0 |
stats_report_output_week_links(const char * zTimeframe){
Stmt stWeek = empty_Stmt;
char yearPart[5] = {0,0,0,0,0};
memcpy(yearPart, zTimeframe, 4);
db_prepare(&stWeek,
"SELECT DISTINCT strftime('%%W',mtime) AS wk, "
"count(*) AS n, "
"substr(date(mtime),1,%d) AS ym "
... | false | false | false | false | false | 0 |
ctanh(double complex z)
{
double x, y;
double t, beta, s, rho, denom;
u_int32_t hx, ix, lx;
x = creal(z);
y = cimag(z);
EXTRACT_WORDS(hx, lx, x);
ix = hx & 0x7fffffff;
/*
* ctanh(NaN + i 0) = NaN + i 0
*
* ctanh(NaN + i y) = NaN + i NaN for y != 0
*
* The imaginary part has the sign of x*sin(2*y),... | false | false | false | false | false | 0 |
gck_attribute_hash (gconstpointer attr)
{
const GckAttribute *a = attr;
const signed char *p, *e;
guint32 h = 5381;
h ^= _gck_ulong_hash (&a->type);
if (a->value) {
for (p = (signed char *)a->value, e = p + a->length; p != e; p++)
h = (h << 5) + h + *p;
}
return h;
} | false | false | false | false | false | 0 |
stripoff_last_component(char *path)
{
char *p = path ? strrchr(path, '/') : NULL;
if (!p)
return NULL;
*p = '\0';
return p + 1;
} | false | false | false | false | false | 0 |
get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id,
bool is_c45, struct phy_c45_device_ids *c45_ids)
{
int phy_reg;
if (is_c45)
return get_phy_c45_ids(bus, addr, phy_id, c45_ids);
/* Grab the bits from PHYIR1, and put them in the upper half */
phy_reg = mdiobus_read(bus, addr, MII_PHYSID1);
if (phy_... | false | false | false | false | false | 0 |
loadBlock(const int numcols, const int numrows,
const CoinBigIndex * start, const int* index,
const double* value,
const double* collb, const double* colub,
const double* obj,
const double* rowlb, const double* rowub)
{
int numberElements = start[numcols];
int * length = new int [... | false | false | false | false | false | 0 |
dict_keys(register PyDictObject *mp)
{
register PyObject *v;
register Py_ssize_t i, j;
PyDictKeyEntry *ep;
Py_ssize_t size, n, offset;
PyObject **value_ptr;
again:
n = mp->ma_used;
v = PyList_New(n);
if (v == NULL)
return NULL;
if (n != mp->ma_used) {
/* Durnit. T... | false | false | false | false | true | 1 |
execute(const AHCommand& c, const Jid& j)
{
int messageCount = manager()->account()->forwardPendingEvents(j);
XData form;
form.setTitle(QObject::tr("Forward Messages"));
form.setInstructions(QObject::tr("Forwarded %1 messages").arg(messageCount));
form.setType(XData::Data_Form);
return AHCommand::completedReply(c... | false | false | false | false | false | 0 |
gc_db_log(gchar *date, int duration,
int user_id, int board_id,
int level, int sublevel,
int status, gchar *comment)
{
SUPPORT_OR_RETURN(FALSE);
#ifdef USE_SQLITE
static gboolean got_error = FALSE;
char *zErrMsg;
int rc;
gchar *request;
gchar *comment_quoted = escape_quote(comment);
reque... | false | false | false | false | false | 0 |
aobjnam(otmp,verb)
register struct obj *otmp;
register const char *verb;
{
register char *bp = cxname(otmp);
char prefix[PREFIX];
if(otmp->quan != 1L) {
Sprintf(prefix, "%ld ", otmp->quan);
bp = strprepend(bp, prefix);
}
if(verb) {
Strcat(bp, " ");
Strcat(bp, otense(otmp, verb));
}
return(bp);
} | false | false | false | false | true | 1 |
st_table_child_set_allocate_hidden (StTable *table,
ClutterActor *child,
gboolean value)
{
StTableChild *meta;
g_return_if_fail (ST_IS_TABLE (table));
g_return_if_fail (CLUTTER_IS_ACTOR (child));
meta = get_child_meta (table, ch... | false | false | false | false | false | 0 |
ipw2100_close(struct net_device *dev)
{
struct ipw2100_priv *priv = libipw_priv(dev);
unsigned long flags;
struct list_head *element;
struct ipw2100_tx_packet *packet;
IPW_DEBUG_INFO("enter\n");
spin_lock_irqsave(&priv->low_lock, flags);
if (priv->status & STATUS_ASSOCIATED)
netif_carrier_off(dev);
netif_s... | false | false | false | false | false | 0 |
dvb_media_server2_device_groups_media_container2_on_device_added (DVBMediaServer2DeviceGroupsMediaContainer2* self, guint group_id) {
DVBManager* manager = NULL;
DVBManager* _tmp0_ = NULL;
DVBManager* _tmp1_ = NULL;
DVBDeviceGroup* devgroup = NULL;
guint _tmp2_ = 0U;
DVBDeviceGroup* _tmp3_ = NULL;
g_return_if_fa... | false | false | false | false | false | 0 |
moov_recov_file_create (FILE * file, GError ** err)
{
gint i;
MoovRecovFile *moovrf = g_new0 (MoovRecovFile, 1);
g_return_val_if_fail (file != NULL, NULL);
moovrf->file = file;
/* look for ftyp and prefix at the start */
if (!moov_recov_file_parse_prefix (moovrf)) {
g_set_error (err, ATOMS_RECOV_QUAR... | false | false | false | false | false | 0 |
getQueryParadigmList()const{
for(list<CXMLElement*>::const_iterator i(mCollectionElement->child_list_begin());
i!=mCollectionElement->child_list_end();
i++){
if((*i)->getName()=="query-paradigm-list"){
return *i;
}
}
return 0;
} | false | false | false | false | false | 0 |
dir_group_node_set_file (AnjutaDirGroupNode *group, GFile *new_file, GObject *emitter)
{
if (group->base.file != NULL)
{
g_object_unref (group->base.file);
group->base.file = NULL;
}
if (group->monitor != NULL)
{
g_file_monitor_cancel (group->monitor);
group->monitor = NULL;
}
if (new_file)
{
group->... | false | false | false | false | false | 0 |
is_oid_number (const gchar *p)
{
gboolean must = TRUE;
gint i;
for (i = 0; p[i] != '\0'; i++) {
if (g_ascii_isdigit (p[i])) {
must = FALSE;
} else if (must) {
return FALSE;
} else {
if (p[i] != '.')
return FALSE;
must = TRUE;
}
}
return !must;
} | false | false | false | false | false | 0 |
Cns_acl_compare (const void *acl1, const void *acl2)
{
if (((struct Cns_acl *)acl1)->a_type < ((struct Cns_acl *)acl2)->a_type)
return (-1);
if (((struct Cns_acl *)acl1)->a_type > ((struct Cns_acl *)acl2)->a_type)
return (1);
if (((struct Cns_acl *)acl1)->a_id < ((struct Cns_acl *)acl2)->a_id)
return (-1);
if... | false | false | false | false | false | 0 |
replace( string& str, const char* s, const char* r )
{
assert( strlen(s) == strlen(r) );
string::size_type pos;
while( (pos = str.find_first_of(s)) != string::npos )
str.replace( pos, strlen(r), r );
} | false | false | false | false | false | 0 |
SelectAuraRankForLevel(SpellEntry const* spellInfo, uint32 level) const
{
// fast case
if (level + 10 >= spellInfo->spellLevel)
{ return spellInfo; }
// ignore selection for passive spells
if (IsPassiveSpell(spellInfo))
{ return spellInfo; }
bool needRankSelection = false;
for ... | false | false | false | false | false | 0 |
applyOverrideKeys(DcmDataset *outputDset)
{
/* replace specific keys by those in overrideKeys, copied from findscu */
OFListConstIterator(OFString) path = m_overrideKeys.begin();
OFListConstIterator(OFString) endOfList = m_overrideKeys.end();
OFCondition cond;
DcmPathProcessor proc;
while (path != endOfLis... | false | false | false | false | false | 0 |
kgdb_unregister_io_module(struct kgdb_io *old_dbg_io_ops)
{
BUG_ON(kgdb_connected);
/*
* KGDB is no longer able to communicate out, so
* unregister our callbacks and reset state.
*/
kgdb_unregister_callbacks();
spin_lock(&kgdb_registration_lock);
WARN_ON_ONCE(dbg_io_ops != old_dbg_io_ops);
dbg_io_ops = N... | false | false | false | false | false | 0 |
do_filter_cmd (char *args, GtkWidget *dialog)
{
struct fwheel_t *fwheel;
GtkWidget *window;
GtkWidget *combo;
int i;
char **filters;
window = gtk_object_get_data(GTK_OBJECT(dialog), "image_window");
fwheel = fwheel_find(window);
if (! fwheel) {
err_printf("No filter wheel detected\n");
return OBS_CMD_ERROR... | false | false | false | false | false | 0 |
qos_event_setenvresbody_cmd(cmd_parms *cmd, void *dcfg, const char *pattern,
const char *var) {
qos_dir_config *dconf = (qos_dir_config*)dcfg;
if(dconf->response_pattern) {
return apr_psprintf(cmd->pool, "%s: only one pattern must be configured for a location",
... | false | false | false | false | false | 0 |
process_pure_responses(struct adapter *adap, struct sge_qset *qs,
struct rsp_desc *r)
{
struct sge_rspq *q = &qs->rspq;
unsigned int sleeping = 0;
do {
u32 flags = ntohl(r->flags);
r++;
if (unlikely(++q->cidx == q->size)) {
q->cidx = 0;
q->gen ^= 1;
r = q->desc;
}
prefetch(r);
if (flags... | false | false | false | false | false | 0 |
say_first_char(struct vc_data *vc)
{
int i, len = get_line(vc);
u_char ch;
spk_parked |= 0x01;
if (len == 0) {
synth_printf("%s\n", spk_msg_get(MSG_BLANK));
return;
}
for (i = 0; i < len; i++)
if (buf[i] != SPACE)
break;
ch = buf[i];
spk_pos -= (spk_x - i) * 2;
spk_x = i;
synth_printf("%d, ", ++i);
... | false | false | false | false | false | 0 |
operator== (TextTag const& tag) const
{
if (tag.GetTag () != GetTag ())
return false;
return static_cast <PositionTextTag const&> (tag).m_Position == m_Position;
} | false | false | false | false | false | 0 |
cleanup_handler (void)
{
unsigned int i;
int t;
if (debug)
return LDPS_OK;
if (arguments_file_name)
{
t = unlink (arguments_file_name);
check (t == 0, LDPL_FATAL, "could not unlink arguments file");
}
for (i = 0; i < num_output_files; i++)
{
t = unlink (output_files[i]);
... | false | false | false | false | false | 0 |
HandleSetActiveMoverOpcode(WorldPacket& recv_data)
{
DEBUG_LOG("WORLD: Received opcode CMSG_SET_ACTIVE_MOVER");
ObjectGuid guid;
recv_data >> guid;
if (_player->GetMover()->GetObjectGuid() != guid)
{
sLog.outError("HandleSetActiveMoverOpcode: incorrect mover guid: mover is %s and should be... | false | false | false | false | false | 0 |
pt_screen_to_raw (icoords * screen, gint id, gboolean horiz, gboolean vert,
greal * raw, gcoords * eps, GGobiData * d, splotd * sp,
ggobid * gg)
{
gint j;
gcoords planar;
greal *world = (greal *) g_malloc0 (d->ncols * sizeof (greal));
pt_screen_to_plane (screen, id, horiz, v... | false | false | false | false | false | 0 |
clutter_vertex_equal (const ClutterVertex *vertex_a,
const ClutterVertex *vertex_b)
{
g_return_val_if_fail (vertex_a != NULL && vertex_b != NULL, FALSE);
if (vertex_a == vertex_b)
return TRUE;
return fabsf (vertex_a->x - vertex_b->x) < FLOAT_EPSILON &&
fabsf (vertex_a->y - ver... | false | false | false | false | false | 0 |
cfg_doc_map(cfg_printer_t *pctx, const cfg_type_t *type) {
const cfg_clausedef_t * const *clauseset;
const cfg_clausedef_t *clause;
if (type->parse == cfg_parse_named_map) {
cfg_doc_obj(pctx, &cfg_type_astring);
cfg_print_chars(pctx, " ", 1);
} else if (type->parse == cfg_parse_addressed_map) {
cfg_doc_obj(p... | false | false | false | false | false | 0 |
glusterfs_handle_nfs_profile (rpcsvc_request_t *req)
{
int ret = -1;
gd1_mgmt_brick_op_req nfs_req = {0,};
gd1_mgmt_brick_op_rsp rsp = {0,};
dict_t *dict = NULL;
glusterfs_ctx_t *ctx = NULL;
glusterfs_graph_t *active ... | false | false | false | true | false | 1 |
_wm8993_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
unsigned int Fref, unsigned int Fout)
{
struct wm8993_priv *wm8993 = snd_soc_codec_get_drvdata(codec);
struct i2c_client *i2c = to_i2c_client(codec->dev);
u16 reg1, reg4, reg5;
struct _fll_div fll_div;
unsigned int timeout;
int ret;
/* An... | false | false | false | false | false | 0 |
delautgraphnode( Graph, Node )
autgraph *Graph;
autnode_list *Node;
{
autarc_list *Arc;
autnode_list *ScanNode;
chain_list *ScanArc;
chain_list **PrevChain;
chain_list *ScanChain;
if ( Node->NEXT != (autnode_list *)0 )
{
Node->NEXT->PREV = Node->PREV;
}
*Node->PREV = Node->NEXT;
... | false | false | false | true | false | 1 |
array_make_groups(const char *string) {
const char *p, *q;
char **result = NULL;
int items = 0;
for (p = string; ; ) {
char *token;
int len;
while (*p == ',')
p++;
if (!*p)
break;
for (q = p, len = 0; *q && *q != ','; q++, len++);
token = xstrndup(p, len);
p = q;
result = xrealloc(resul... | false | false | false | false | false | 0 |
lwpolygon_desegmentize(LWPOLY *poly)
{
LWGEOM **geoms;
int i, hascurve = 0;
LWDEBUG(2, "lwpolygon_desegmentize called.");
geoms = lwalloc(sizeof(LWGEOM *)*poly->nrings);
for(i=0; i<poly->nrings; i++)
{
geoms[i] = pta_desegmentize(poly->rings[i], ... | false | false | false | true | false | 1 |
RecordPosition(int position) {
if (!FLAG_debug_info || position == RelocInfo::kNoPosition) return;
masm()->positions_recorder()->RecordPosition(position);
} | 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.