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 |
|---|---|---|---|---|---|---|
merge_array_def_use_table_semnode(Array_def_use_table_semnode *aduts, Module_table *mpt)
{
Array_def_use_table_semnode *ret;
Array_region_list_semnode *arls;
arls = merge_array_region_list_semnode(aduts->region_head, aduts->entry, aduts->kind, aduts->pa_object_list, mpt);
if (arls == NULL) {
... | false | false | false | false | false | 0 |
SetInputStuffFC(void)
{
switch(JPTypeFC)
{
case SIFC_NONE:FCExp=0;break;
case SIFC_ARKANOID:FCExp=FCEU_InitArkanoidFC();break;
case SIFC_SHADOW:FCExp=FCEU_InitSpaceShadow();break;
case SIFC_OEKAKIDS:FCExp=FCEU_InitOekaKids();break;
case SIFC_4PLAYER:FCExp=&FAMI4C;memset(&F... | false | false | false | false | false | 0 |
glade_eprop_attrs_populate_view (GladeEditorProperty *eprop,
GtkTreeView *view)
{
GList *attributes, *list;
GtkListStore *model = (GtkListStore *)gtk_tree_view_get_model (view);
GtkTreeIter *iter;
GladeAttribute *gattr;
gchar *text;
attributes = g_value_ge... | false | false | false | false | false | 0 |
browse(void)
{
MSNotebook *notebook=(MSNotebook *)owner();
NotebookEntry *entry;
if (arrow()->arrowType()==MSArrow::Up||arrow()->arrowType()==MSArrow::Left) entry=notebook->previousBrowseEntry();
else entry=notebook->nextBrowseEntry();
if (entry!=notebook->currentEntry())
{
if (arrow()->selected()==MS... | false | false | false | false | false | 0 |
handle_ruleset_nation(const struct packet_ruleset_nation *packet)
{
struct nation_type *pnation = nation_by_number(packet->id);
int i;
fc_assert_ret_msg(NULL != pnation, "Bad nation %d.", packet->id);
names_set(&pnation->adjective, packet->adjective, packet->rule_name);
name_set(&pnation->noun_plural, packe... | false | false | false | false | false | 0 |
HTS_fopen_from_fn(const char *name, const char *opt)
{
HTS_File *fp = (HTS_File *) HTS_calloc(1, sizeof(HTS_File));
fp->type = HTS_FILE;
fp->pointer = (void *) fopen(name, opt);
if (fp->pointer == NULL) {
HTS_error(0, "HTS_fopen: Cannot open %s.\n", name);
HTS_free(fp);
return NULL;
}... | false | false | false | false | false | 0 |
dump_status(FILE *file,const char *banner)
{
SIG_ENTITY *sig;
SOCKET *walk;
if (entities) fprintf(file,"%s\n\n",banner);
for (sig = entities; sig; sig = sig->next) {
fprintf(file,"--- Entity %d.%d.%d ---\n",S_PVC(sig));
for (walk = sockets; walk; walk = walk->next) {
fprintf(file,"%s: %s, CR 0x%... | false | false | false | false | false | 0 |
as_command(void)
{
switch (as_getline()) {
case T_EOF:
return 0;
case T_SEMI:
if (as_parse() == 0)
return 0;
as_loop();
break;
case T_ERROR:
as_display(ERR, "syntax error");
case T_NL:
if (as_parse() == 0)
return 0;
if (as_state == AS_command)
as_set_state(as_work);
as_prompt();
}
retu... | false | false | false | false | false | 0 |
ch7006_encoder_save(struct drm_encoder *encoder)
{
struct i2c_client *client = drm_i2c_encoder_get_client(encoder);
struct ch7006_priv *priv = to_ch7006_priv(encoder);
ch7006_dbg(client, "\n");
ch7006_state_save(client, &priv->saved_state);
} | false | false | false | false | false | 0 |
updateDebugDisplay(Page* p, SceneNode* sn)
{
uint8 dbglvl = mManager->getDebugDisplayLevel();
if (dbglvl)
{
// we could try to avoid updating the geometry every time here, but this
// wouldn't easily deal with paging parameter changes. There shouldn't
//... | false | false | false | false | false | 0 |
phy_connect(struct net_device *dev, const char *bus_id,
void (*handler)(struct net_device *),
phy_interface_t interface)
{
struct phy_device *phydev;
struct device *d;
int rc;
/* Search the list of PHY devices on the mdio bus for the
* PHY with the requested name
*/
d = bus_find_device_by_... | false | false | false | false | false | 0 |
folks_abstract_field_details_real_set_id (FolksAbstractFieldDetails* base, const gchar* value) {
FolksAbstractFieldDetails* self;
const gchar* _tmp0_ = NULL;
const gchar* _tmp1_ = NULL;
const gchar* _tmp3_ = NULL;
gchar* _tmp4_ = NULL;
self = base;
_tmp1_ = value;
if (_tmp1_ != NULL) {
const gchar* _tmp2_ = N... | false | false | false | false | false | 0 |
insertarg(buf, ptr, arg, olen, nlen)
char *buf;
int ptr;
CONST char *arg;
int olen, nlen;
{
if (nlen <= olen) return(buf);
buf = Xrealloc(buf, ptr + nlen + (int)strlen(arg) - olen + 1);
return(buf);
} | false | false | false | false | false | 0 |
bridge_drop_control_frame(int subclass)
{
switch (subclass) {
case AST_CONTROL_ANSWER:
case -1:
return 1;
default:
return 0;
}
} | false | false | false | false | false | 0 |
dup_trans_table_list(Trans_table *tr_head)
{
Trans_table *rtn,*rtn_pt;
Trans_table *t_pt;
if(tr_head == NULL){
return NULL;
}
rtn = dup1_trans_table(tr_head);
for(t_pt = tr_head,
rtn_pt = rtn;
t_pt->next != NULL;
t_pt = t_pt->next,
rtn_pt = rtn_pt->next){
rtn_pt->next = dup1_trans_table(... | false | false | false | false | false | 0 |
bcm8704_init_user_dev3(struct niu *np)
{
int err;
err = mdio_write(np, np->phy_addr,
BCM8704_USER_DEV3_ADDR, BCM8704_USER_CONTROL,
(USER_CONTROL_OPTXRST_LVL |
USER_CONTROL_OPBIASFLT_LVL |
USER_CONTROL_OBTMPFLT_LVL |
USER_CONTROL_OPPRFLT_LVL |
USER_CONTROL_OPTXFLT_LVL |
USER_CONTROL_O... | false | false | false | false | false | 0 |
PyCursesWindow_EchoChar(PyCursesWindowObject *self, PyObject *args)
{
PyObject *temp;
chtype ch;
attr_t attr = A_NORMAL;
long lattr;
switch (PyTuple_Size(args)) {
case 1:
if (!PyArg_ParseTuple(args,"O;ch or int", &temp))
return NULL;
break;
case 2:
if (!P... | false | false | false | false | false | 0 |
session_machine_create(WAPAddrTuple *tuple,
WAPEvent *e)
{
PPGSessionMachine *m;
gw_assert(e->type = Push_Message);
m = gw_malloc(sizeof(PPGSessionMachine));
#define INTEGER(name) m->name = 0;
#define OCTSTR(name) m->name = NULL;
#define A... | false | false | false | false | false | 0 |
chkforgn(outer)
int outer;
{
fprintf(codefile, " if (pfp != (struct p_frame *)");
if (outer) {
fprintf(codefile, "&r_frame) {\n");
fprintf(codefile, " tend = r_frame.tend.previous;\n");
}
else
fprintf(codefile, "r_pfp) {\n");
fprintf(codefile, " return r_signal;\n");
... | false | false | false | false | false | 0 |
ReadVarNames()
{
bool success = true; // optimistic start value
while (IS_ALIVE)
{
wxString token = m_Tokenizer.GetToken();
if (token.IsEmpty()) // end of file / tokens
break;
if (token==ParserConsts::comma) // another variable name
... | false | false | false | false | false | 0 |
gupnp_service_state_variable_info_free
(GUPnPServiceStateVariableInfo *variable)
{
g_free (variable->name);
g_value_unset (&variable->default_value);
if (variable->is_numeric) {
g_value_unset (&variable->minimum);
g_value_unset (&va... | false | false | false | false | false | 0 |
array_call(
pTHX_
SV *obj,
SV *hook,
int cloning)
{
dSP;
int count;
AV *av;
int i;
TRACEME(("array_call (cloning=%d)", cloning));
ENTER;
SAVETMPS;
PUSHMARK(sp);
XPUSHs(obj); /* Target object */
XPUSHs(sv_2mortal(newSViv(cloning))); /* Cloning flag */
PUTBACK;
count = perl_call_sv(hook... | false | false | false | false | false | 0 |
retreat(unsigned int nb)
{
bool res;
if (m_nbMovedArmies >= int(nb))
{
res = initArmiesMovement(nb, m_secondCountry, m_firstCountry);
}
else
{
res = false;
}
kDebug() << "retreat("<<nb<<") returns " << res;
return res;
} | false | false | false | false | false | 0 |
bonobo_dock_item_get_floating_position (BonoboDockItem *item,
gint *x, gint *y)
{
if (GTK_WIDGET_REALIZED (item) && item->is_floating)
gtk_window_get_position (GTK_WINDOW (item->_priv->float_window), x, y);
else
{
*x = item->float_x;
*y = item->float_y;
}
} | false | false | false | false | false | 0 |
make_pointer_declarator (cp_cv_quals cv_qualifiers, cp_declarator *target,
tree attributes)
{
cp_declarator *declarator;
declarator = make_declarator (cdk_pointer);
declarator->declarator = target;
declarator->u.pointer.qualifiers = cv_qualifiers;
declarator->u.pointer.class_type = NULL_TREE;
if (targe... | false | false | false | false | false | 0 |
func_read_params (xmlNodePtr node, xmlDocPtr doc,
ufunc *fun)
{
xmlNodePtr cur;
char *field;
int n, err = 0;
if (!gretl_xml_get_prop_as_int(node, "count", &n) || n < 0) {
fprintf(stderr, "Couldn't read param count\n");
return E_DATA;
}
if (n == 0) {
return 0;
}
fun->param... | false | false | false | false | false | 0 |
hts_equalsAlphanum(const char *a, const char *b) {
size_t i, j;
for(i = 0, j = 0;; i++, j++) {
/* Skip non-alnum */
for(; a[i] != '\0' && !IS_ALNUM(a[i]); i++) ;
for(; b[j] != '\0' && !IS_ALNUM(b[j]); j++) ;
/* Compare */
if (CHAR_LOWER(a[i]) != CHAR_LOWER(b[j])) {
break;
}
/* End ... | false | true | false | false | false | 1 |
InitializeShaders()
{
// Create vertex shader
glEnable( vtkgl::VERTEX_PROGRAM_ARB );
vtkgl::GenProgramsARB(1, reinterpret_cast<GLuint *>(&this->VertexProgram));
vtkgl::BindProgramARB(vtkgl::VERTEX_PROGRAM_ARB, this->VertexProgram);
vtkgl::ProgramStringARB(vtkgl::VERTEX_PROGRAM_ARB,
v... | false | false | false | false | false | 0 |
removeCommonAccess( CharCptr aName )
{
REQUIRE( aName != NULLPTR );
struct stat statRet;
Int stret( stat(aName,&statRet) );
if( stret != -1 )
{
stret = unlink(aName);
}
else
{
; // do nothing, bad check
}
return str... | false | false | false | false | false | 0 |
bnxt_sriov_enable(struct bnxt *bp, int *num_vfs)
{
int rc = 0, vfs_supported;
int min_rx_rings, min_tx_rings, min_rss_ctxs;
int tx_ok = 0, rx_ok = 0, rss_ok = 0;
/* Check if we can enable requested num of vf's. At a mininum
* we require 1 RX 1 TX rings for each VF. In this minimum conf
* features like TPA will... | false | false | false | false | false | 0 |
gftp_get_pixmap (GtkWidget * widget, char *filename, GdkPixmap ** pix,
GdkBitmap ** bitmap)
{
gftp_graphic * graphic;
if (filename == NULL || *filename == '\0')
{
*pix = NULL;
*bitmap = NULL;
return;
}
if ((graphic = g_hash_table_lookup (graphic_hash_table, filename)) ... | false | false | false | false | false | 0 |
copy_from_brd(void *dst, struct brd_device *brd,
sector_t sector, size_t n)
{
struct page *page;
void *src;
unsigned int offset = (sector & (PAGE_SECTORS-1)) << SECTOR_SHIFT;
size_t copy;
copy = min_t(size_t, n, PAGE_SIZE - offset);
page = brd_lookup_page(brd, sector);
if (page) {
src = kmap_atomic(page);
... | false | true | false | false | false | 1 |
LI16__WT_SIMPLE_CALL__cmpcall(object V237,object V236,object V235,object first,...)
{
va_list ap;
int narg = VFUN_NARGS; VMB16 VMS16 VMV16
{object V238;
object V239;
object V240;
object V241;
va_start(ap,first);
V238= V237;
V239= V236;
V240= V235;
narg = narg - 3;
if (narg <= 0) goto T697;
else {
V241= f... | false | false | false | false | false | 0 |
database_restore(char * backup_filename)
{
char directory[STRING_BLOCK];
char command[STRING_BLOCK];
int len = strlen(backup_filename);
int unlocked = 0;
char temp_filename[STRING_BLOCK];
if (file_exists(backup_filename)==0) {
/* file was not found */
return -1;
}
if (len > 4) {
if ((backu... | false | false | false | false | true | 1 |
remove_value(ITEM * item, const char *value)
{
LIST **p = &item->list;
LIST *l = *p;
for (l = *p; l; l = *p) {
if (value && l->value && !strcmp(value, l->value)) {
*p = l->next;
if (l->value)
G_free(l->value);
G_free(l);
}
else
p = &l->next;
}
return 0;
} | false | false | false | false | false | 0 |
needsRelocateWithSymbol(const MCSymbol &Sym,
unsigned Type) const {
switch (Type) {
default:
return false;
// All relocations that use a GOT need a symbol, not an offset, as
// the offset of the symbol within the section is irrelevant to
// where... | false | false | false | false | false | 0 |
apol_infoflow_graph_create_nodes(const apol_policy_t * p,
apol_infoflow_graph_t * g, const qpol_type_t * type, apol_bst_t * types,
int node_type)
{
unsigned char isattr;
apol_vector_t *v = NULL;
apol_infoflow_node_t *node = NULL;
if (qpol_type_get_isattr(p->p, type, &isattr) < 0) {
retur... | false | false | false | false | false | 0 |
skip_words(const char *p, int n)
{
int in_blank = 0;
for (;n && *p; p++) {
if (isblank(*p) /* XXX order is important */ && !in_blank) {
n--; /* one word is gone */
in_blank = 1;
} else if (/* !is_blank(*p), we know already, && */ in_blank) {
in_blank = 0;
}
}
return p;
} | false | false | false | false | false | 0 |
net2272_kick_dma(struct net2272_ep *ep, struct net2272_request *req)
{
unsigned size;
u8 tmp;
if (!use_dma || (ep->num < 1) || (ep->num > 2) || !ep->dma)
return -EINVAL;
/* don't use dma for odd-length transfers
* otherwise, we'd need to deal with the last byte with pio
*/
if (req->req.length & 1)
return... | false | false | false | false | false | 0 |
cm_tophits_ComputeEvalues(CM_TOPHITS *th, double eZ, int istart)
{
int i;
for (i = istart; i < th->N ; i++) {
th->unsrt[i].evalue = th->unsrt[i].pvalue * eZ;
}
return eslOK;
} | false | false | false | false | false | 0 |
same_price(obj1, obj2)
struct obj *obj1, *obj2;
{
register struct monst *shkp1, *shkp2;
register struct bill_x *bp1 = 0, *bp2 = 0;
register boolean are_mergable = FALSE;
/* look up the first object by finding shk whose bill it's on */
for (shkp1 = next_shkp(fmon, TRUE); shkp1;
shkp1 = next_shkp(shkp1->nmon, TRU... | false | false | false | false | false | 0 |
handleAnswerCreatureMercenary()
{
bool accept = (bool) readChar();
GenericMapCreature * creature = _question->getCreature();
GenericLord * lord = _question->getLord();
uchar race = creature->getRace();
uchar level = creature->getLevel();
if( accept ) {
_state = IN_GAME;
GenericFightUnit * unit = 0;
int ... | false | false | false | false | false | 0 |
CopySendEndOfRow(CopyState cstate)
{
StringInfo fe_msgbuf = cstate->fe_msgbuf;
switch (cstate->copy_dest)
{
case COPY_FILE:
if (!cstate->binary)
{
/* Default line termination depends on platform */
#ifndef WIN32
CopySendChar(cstate, '\n');
#else
CopySendString(cstate, "\r\n");
#endif
}
(v... | false | false | false | false | false | 0 |
go_spectre_new_from_data (char const *data, size_t length, GError **error)
{
GOImage *image;
char *tmpname;
g_return_val_if_fail (data != NULL && length != 0, NULL);
/* libspectre can only load files,
see https://bugs.freedesktop.org/show_bug.cgi?id=42424 */
tmpname = create_file (data, length);
image = go_sp... | false | false | false | false | false | 0 |
_ustrlen(Py_UNICODE *u)
{
int i = 0;
Py_UNICODE *v = u;
while (*v != 0) { i++; v++; }
return i;
} | true | true | false | false | false | 1 |
xx_resolve2(Topform c, int n, BOOL renumber_vars)
{
Topform res;
Literals l = ith_literal(c->literals, n);
Context s = get_context();
Trail tr = NULL;
if (neg_eq(l) &&
unify(ARG(l->atom,0), s,
ARG(l->atom,1), s, &tr)) {
Literals lit;
res = get_topform();
for (lit = c->literals; lit; li... | false | false | false | false | false | 0 |
net80211_rx_frag ( struct net80211_device *dev,
struct io_buffer *iob, int signal )
{
struct ieee80211_frame *hdr = iob->data;
int fragnr = IEEE80211_FRAG ( hdr->seq );
if ( fragnr == 0 && ( hdr->fc & IEEE80211_FC_MORE_FRAG ) ) {
/* start a frag cache entry */
int i, newest = -1;
u32 curr_ticks = cu... | false | false | false | false | false | 0 |
Scm_InetAddressToString(ScmObj addr, /* integer or uvector */
int proto)
{
if (proto == AF_INET) {
char buf[INET_ADDRSTRLEN];
struct in_addr in4;
if (SCM_INTEGERP(addr)) {
u_long a = Scm_GetIntegerU(addr);
in4.s_addr = htonl(a);
... | false | false | false | false | false | 0 |
remove_reqtimeout(ap_filter_t *next)
{
ap_filter_t *reqto = NULL;
ap_filter_rec_t *filter;
filter = ap_get_input_filter_handle("reqtimeout");
if (!filter) {
return;
}
while (next) {
if (next->frec == filter) {
reqto = next;
break;
}
next ... | false | false | false | false | false | 0 |
miniscope_set_phase(Miniscope *m, gfloat phase, gboolean highlight)
{
g_return_if_fail(m != NULL);
g_return_if_fail(IS_MINISCOPE(m));
m->phase = phase;
m->highlight = highlight;
set_idle_callback(m);
} | false | false | false | false | false | 0 |
etree_add_left_sibling(etree_t *tree, void *node, void *item)
{
node_t *n, *i;
etree_check(tree);
g_assert(node != NULL);
g_assert(item != NULL);
g_assert(etree_is_orphan(tree, item));
g_assert(!etree_is_root(tree, node));
n = ptr_add_offset(node, tree->offset);
i = ptr_add_offset(item, tree->offset);
i->pa... | false | false | false | false | false | 0 |
inetCidrRouteMetric5_set(inetCidrRouteTable_rowreq_ctx * rowreq_ctx,
long inetCidrRouteMetric5_val)
{
DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteMetric5_set",
"called\n"));
/** should never get a NULL pointer */
netsnmp_assert(NULL != rowreq_ctx);
/*... | false | false | false | true | false | 1 |
makeRangeKernel(l_float32 range_stdev)
{
l_int32 x;
l_float32 val, denom;
L_KERNEL *kel;
PROCNAME("makeRangeKernel");
if (range_stdev <= 0.0)
return (L_KERNEL *)ERROR_PTR("invalid stdev <= 0", procName, NULL);
denom = 2. * range_stdev * range_stdev;
if ((kel = kernelCreate(1, 256)) == N... | false | false | false | false | false | 0 |
sdecodeint32(const byte * p, int format)
{
int a = p[0], b = p[1], c = p[2], d = p[3];
int v = (num_is_lsb(format) ?
((int)d << 24) + ((int)c << 16) + (b << 8) + a :
((int)a << 24) + ((int)b << 16) + (c << 8) + d);
return v;
} | false | false | false | false | false | 0 |
build_equal_items(THD *thd, COND *cond,
COND_EQUAL *inherited,
List<TABLE_LIST> *join_list,
COND_EQUAL **cond_equal_ref)
{
COND_EQUAL *cond_equal= 0;
if (cond)
{
cond= build_equal_items_for_cond(thd, cond, inherited... | false | false | false | false | false | 0 |
real_output_window_append(const char *astring,
const struct text_tag_list *tags,
int conn_id)
{
/* Currently this is a wrapper to the message subsystem. */
if (pConnDlg) {
Uint16 *pUniStr;
size_t n = strlen(astring);
n += 1;
n *= 2;
... | false | false | false | false | false | 0 |
setConfigItem(const char* tag, const char* value)
{
if (streq(tag, "maxmsglength")) {
maxMsgLength = getNumber(value);
} else if (streq(tag, "pageridmapfile")) {
pagerIDMapFile = value;
} else if (streq(tag, "prioritymap")) {
setShortMap(priMap, value);
} else if (streq(tag, "killtimemap")) {
setTim... | false | false | false | false | false | 0 |
simplify()
{
if (children.size() == 1) {
ASTexpression* ret = children[0]->simplify();
children[0] = NULL;
delete this;
return ret;
}
for (size_t i = 0; i < children.size(); ++i)
children[i] = children[i]->simplify();
return... | false | false | false | false | false | 0 |
dispose()
{
// Deletes the data value if necessary.
switch (fType) {
case kString:
delete fValue.fString;
break;
case kArray:
delete[] fValue.fArrayAndCount.fArray;
break;
case kObject:
delete fValue.fObject;
break;
default:
break;
}
... | false | false | false | false | false | 0 |
OutputFileStream(const std::string &filePath)
: m_outFile(NULL)
{
Open(filePath);
} | false | false | false | false | false | 0 |
main (int argc, char* argv[]) {
/* var declarations */
char* templateSeqFilename;
char* querySeqFilename;
int print_both_alignments = 0; // by default, just print the query in NAST format.
ntCounts templateSeq [MAX_SEQ_LENGTH];
int i;
for (i = 0; i < MAX_SEQ_LENGTH; i++) {
ntCounts* n = &templateSeq... | false | false | false | false | false | 0 |
keyNameGetOneLevel(const char *name, size_t *size) {
char *real=(char *)name;
size_t cursor=0;
int escapeNext=0;
int end=0;
/* skip all repeating '/' in the begining */
while (*real && *real == PATH_SEPARATOR) real++;
/* now see where this basename ends handling escaped chars with '\' */
while (real[cursor]... | false | false | false | false | false | 0 |
add_nat_oa_payloads(private_quick_mode_t *this, message_t *message)
{
identification_t *id;
id_payload_t *nat_oa;
host_t *src, *dst;
payload_type_t nat_oa_payload_type;
src = message->get_source(message);
dst = message->get_destination(message);
src = this->initiator ? src : dst;
dst = this->initiator ? dst :... | false | false | false | false | false | 0 |
test_crypto_s2k(void)
{
char buf[29];
char buf2[29];
char *buf3 = NULL;
int i;
memset(buf, 0, sizeof(buf));
memset(buf2, 0, sizeof(buf2));
buf3 = tor_malloc(65536);
memset(buf3, 0, 65536);
secret_to_key(buf+9, 20, "", 0, buf);
crypto_digest(buf2+9, buf3, 1024);
test_memeq(buf, buf2, 29);
memc... | true | true | false | false | false | 1 |
ndarray_subscript(NDArrayObject *self, PyObject *key)
{
NDArrayObject *nd;
ndbuf_t *ndbuf;
Py_buffer *base = &self->head->base;
if (base->ndim == 0) {
if (PyTuple_Check(key) && PyTuple_GET_SIZE(key) == 0) {
return unpack_single(base->buf, base->format, base->itemsize);
}
... | false | false | false | false | true | 1 |
_eglQueryContextRenderBuffer(_EGLContext *ctx)
{
_EGLSurface *surf = ctx->DrawSurface;
EGLint rb;
if (!surf)
return EGL_NONE;
if (surf->Type == EGL_WINDOW_BIT && ctx->WindowRenderBuffer != EGL_NONE)
rb = ctx->WindowRenderBuffer;
else
rb = surf->RenderBuffer;
return rb;
} | false | false | false | false | false | 0 |
sp_set_fldr(MAILSTREAM *stream, char *folder)
{
PER_STREAM_S **pss;
pss = sp_data(stream);
if(pss && *pss){
if((*pss)->fldr)
fs_give((void **) &(*pss)->fldr);
if(folder)
(*pss)->fldr = cpystr(folder);
}
} | false | false | false | false | false | 0 |
free_pgpaths(struct list_head *pgpaths, struct dm_target *ti)
{
struct pgpath *pgpath, *tmp;
list_for_each_entry_safe(pgpath, tmp, pgpaths, list) {
list_del(&pgpath->list);
dm_put_device(ti, pgpath->path.dev);
free_pgpath(pgpath);
}
} | false | false | false | false | false | 0 |
SPI_execute_snapshot(SPIPlanPtr plan,
Datum *Values, const char *Nulls,
Snapshot snapshot, Snapshot crosscheck_snapshot,
bool read_only, bool fire_triggers, long tcount)
{
int res;
if (plan == NULL || plan->magic != _SPI_PLAN_MAGIC || tcount < 0)
return SPI_ERROR_ARGUMENT;
if (plan->nargs > 0... | false | false | false | false | false | 0 |
_mesa_init_current(struct gl_context *ctx)
{
GLuint i;
/* Init all to (0,0,0,1) */
for (i = 0; i < Elements(ctx->Current.Attrib); i++) {
ASSIGN_4V( ctx->Current.Attrib[i], 0.0, 0.0, 0.0, 1.0 );
}
/* redo special cases: */
ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_WEIGHT], 1.0, 0.0, 0.0, 0.0 )... | false | false | false | false | false | 0 |
preferences_response_cb(GtkWidget *dialog, gint response, gpointer data)
{
if (response == GTK_RESPONSE_HELP) {
GError *error = NULL;
gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (dialog)),
"ghelp:stickynotes_applet?stickynotes-advanced-settings",
gtk_get_current_event_time (),
&error);
if (error)... | false | false | false | false | false | 0 |
gf_proc_dump_add_section (char *key, ...)
{
char buf[GF_DUMP_MAX_BUF_LEN];
va_list ap;
GF_ASSERT(key);
memset (buf, 0, sizeof(buf));
snprintf (buf, GF_DUMP_MAX_BUF_LEN, "\n[");
va_start (ap, key);
vsnprintf (buf + strlen(buf),
GF_DUMP_MAX_BUF... | false | false | false | false | false | 0 |
SetRunning()
{
if( m_runapp_button )
m_runapp_button->Enable(false);
m_syncagain_button->Enable(false);
m_killclose_button->SetLabel(_W("Kill Sync"));
m_killclose_button->Enable(true);
UpdateTitle();
m_throbber->SetRange(10);
m_throbber->SetValue(0);
StartTimer();
} | false | false | false | false | false | 0 |
add_nonoui_reg_req(struct ib_mad_reg_req *mad_reg_req,
struct ib_mad_agent_private *agent_priv,
u8 mgmt_class)
{
struct ib_mad_port_private *port_priv;
struct ib_mad_mgmt_class_table **class;
struct ib_mad_mgmt_method_table **method;
int i, ret;
port_priv = agent_priv->qp_info->port_priv;
class... | false | false | false | false | false | 0 |
search_from (pfile, type)
cpp_reader *pfile;
enum include_type type;
{
cpp_buffer *buffer = pfile->buffer;
unsigned int dlen;
/* Command line uses the cwd, and does not cache the result. */
if (type == IT_CMDLINE)
goto use_cwd;
/* Ignore the current file's directory if -I- was given. */
if... | false | false | false | false | false | 0 |
compare_origins (gconstpointer a,
gconstpointer b,
gpointer user_data)
{
const lglTemplateOrigin *a_origin = a, *b_origin = b;
if ( a_origin->y < b_origin->y )
{
return -1;
}
else if ( a_origin->y > b_origin->y )
{
... | false | false | false | false | false | 0 |
_bfd_elf_get_symtab_upper_bound (bfd *abfd)
{
long symcount;
long symtab_size;
Elf_Internal_Shdr *hdr = &elf_tdata (abfd)->symtab_hdr;
symcount = hdr->sh_size / get_elf_backend_data (abfd)->s->sizeof_sym;
symtab_size = (symcount + 1) * (sizeof (asymbol *));
if (symcount > 0)
symtab_size -= sizeof (asym... | false | false | false | false | false | 0 |
char_bbox(int ff, int cc, double *xx1, double *yy1, double *xx2, double *yy2) {
GLECoreFont* cfont = get_core_font_ensure_loaded(ff);
GLEFontCharData* cdata = cfont->getCharData(cc);
if (cdata != 0) {
*xx1 = cdata->x1;
*yy1 = cdata->y1;
*xx2 = cdata->x2;
*yy2 = cdata->y2;
} else {
*xx1 = 0;
*xx2 = 0;
... | false | false | false | false | false | 0 |
find_erts_vsn(char *erl_top)
{
/* List install dir and look for latest erts-vsn */
DIR *dp; /* Pointer to directory structure. */
struct dirent* dirp; /* Pointer to directory entry. */
char latest_vsn[MAXPATHLEN];/* Latest erts-vsn directory name. */
dp = opendir(erl_t... | false | false | false | false | false | 0 |
ParseAdd(std::vector<std::string> args)
{
this->Synchronizer->SetOperation(midasSynchronizer::OPERATION_ADD);
unsigned i;
for(i = 0; i < args.size(); i++)
{
if(args[i] == "-c")
{
this->Synchronizer->SetResourceType(midasResourceType::COLLECTION);
}
else if(args[i] == "-C")
{... | false | false | false | false | false | 0 |
krb5_expand_hostname (krb5_context context,
const char *orig_hostname,
char **new_hostname)
{
struct addrinfo *ai, *a, hints;
int error;
if ((context->flags & KRB5_CTX_F_DNS_CANONICALIZE_HOSTNAME) == 0)
return copy_hostname (context, orig_hostname, new_hostname);
memset (&hints, 0, si... | false | false | false | false | false | 0 |
rv515_debugfs(struct radeon_device *rdev)
{
if (r100_debugfs_rbbm_init(rdev)) {
DRM_ERROR("Failed to register debugfs file for RBBM !\n");
}
if (rv515_debugfs_pipes_info_init(rdev)) {
DRM_ERROR("Failed to register debugfs file for pipes !\n");
}
if (rv515_debugfs_ga_info_init(rdev)) {
DRM_ERROR("Failed to re... | false | false | false | false | false | 0 |
DoExport(struct gfc_data *d,unichar_t *path) {
char *temp;
int format, good;
temp = cu_copy(path);
last_format = format = (intpt) (GGadgetGetListItemSelected(d->format)->userdata);
if ( d->bc )
last_format += BITMAP_FORMAT_START;
if ( d->bc!=NULL )
good = BCExportXBM(temp,d->bc,format);
e... | false | false | false | false | false | 0 |
i915_l3_read(struct file *filp, struct kobject *kobj,
struct bin_attribute *attr, char *buf,
loff_t offset, size_t count)
{
struct device *dev = container_of(kobj, struct device, kobj);
struct drm_minor *dminor = dev_to_drm_minor(dev);
struct drm_device *drm_dev = dminor->dev;
struct drm_i915_private *d... | false | true | false | false | false | 1 |
unextend (c, p, unsignedp, mask)
tree c;
int p;
int unsignedp;
tree mask;
{
tree type = TREE_TYPE (c);
int modesize = GET_MODE_BITSIZE (TYPE_MODE (type));
tree temp;
if (p == modesize || unsignedp)
return c;
/* We work by getting just the sign bit into the low-order bit, then
in... | false | false | false | false | false | 0 |
write_header(bigint nbig)
{
if (nbig > MAXSMALLINT) error->all(FLERR,"Too many atoms for dump xtc");
int n = nbig;
if (update->ntimestep > MAXSMALLINT)
error->all(FLERR,"Too big a timestep for dump xtc");
int ntimestep = update->ntimestep;
// all procs realloc coords if total count grew
if (n != natom... | false | false | false | false | false | 0 |
main (int argc, char **argv)
{
int debug = 0;
int i = 1;
if (argc > 1 && !strcmp (argv[1], "--verbose"))
verbose = 1;
else if (argc > 1 && !strcmp (argv[1], "--debug"))
verbose = debug = 1;
gcry_control (GCRYCTL_DISABLE_SECMEM, 0);
if (!gcry_check_version (GCRYPT_VERSION))
die ("version mismat... | false | false | false | false | false | 0 |
gst_audioringbuffer_stop (GstRingBuffer * buf)
{
GstAudioSrc *src;
GstAudioSrcClass *csrc;
src = GST_AUDIO_SRC (GST_OBJECT_PARENT (buf));
csrc = GST_AUDIO_SRC_GET_CLASS (src);
/* unblock any pending writes to the audio device */
if (csrc->reset) {
GST_DEBUG ("reset...");
csrc->reset (src);
GST... | false | false | false | false | false | 0 |
FilterGeometry( OGRGeometry *poGeometry )
{
/* -------------------------------------------------------------------- */
/* In trivial cases of new filter or target geometry, we accept */
/* an intersection. No geometry is taken to mean "the whole */
/* world". ... | false | false | false | false | false | 0 |
Read (istream& in) {
Connector::Read(in);
Coord x0, y0;
int mobility;
in >> x0 >> y0 >> mobility;
PinGraphic* pin = new PinGraphic(x0, y0);
_mobility = Mobility(mobility);
pin->FillBg(ReadBgFilled(in));
PSColor* fg = ReadColor(in);
PSColor* bg = ReadColor(in);
pin->SetColor... | false | false | false | false | false | 0 |
set_data_type(s)
deflate_state *s;
{
int n;
for (n = 0; n < 9; n++)
if (s->dyn_ltree[n].Freq != 0)
break;
if (n == 9)
for (n = 14; n < 32; n++)
if (s->dyn_ltree[n].Freq != 0)
break;
s->strm->data_type = (n == 32) ? Z_TEXT : Z_BINARY;
} | false | false | false | false | false | 0 |
dma_pte_free_pagetable(struct dmar_domain *domain,
unsigned long start_pfn,
unsigned long last_pfn)
{
BUG_ON(!domain_pfn_supported(domain, start_pfn));
BUG_ON(!domain_pfn_supported(domain, last_pfn));
BUG_ON(start_pfn > last_pfn);
dma_pte_clear_range(domain, start_pfn, last_pfn);
/* We don't need l... | false | false | false | false | false | 0 |
makeInstance(const Locale& desiredLocale,
UErrorCode& status)
{
// A bit of explanation is required here. Although in the current
// implementation
// Collator::createInstance() is just turning around and calling
// RuleBasedCollator(Locale&), this will not n... | false | false | false | false | false | 0 |
initLearning()
{
const int numClasses = _pTrainingData->getNumClasses();
const int numColumns = _pTrainingData->getNumAttributes();
_v.resize(numClasses);
AlphaReal _gammat = _initialGammat;
if (_verbose>4)
cout << "-->Init gamma: " << _gammat << endl;
_featuresWeight.resize(numColum... | false | false | false | false | false | 0 |
hb_ot_layout_table_find_script (hb_face_t *face,
hb_tag_t table_tag,
hb_tag_t script_tag,
unsigned int *script_index)
{
ASSERT_STATIC (OT::Index::NOT_FOUND_INDEX == HB_OT_LAYOUT_NO_SCRIPT_INDEX);
const OT::GSUBGPOS &g = get_gsubgpos_table (face, table_tag);
if (g.find_script_index (scrip... | false | false | false | false | false | 0 |
ioq_recv_set(struct ioq_recv* q, void* buf, size_t bufsize)
{
if (q->buf)
{
hub_free(q->buf);
q->buf = 0;
q->size = 0;
}
if (!bufsize)
{
return 0;
}
q->buf = hub_malloc(bufsize);
if (!q->buf)
return 0;
q->size = bufsize;
memcpy(q->buf, buf, bufsize);
return bufsize;
} | false | true | false | false | false | 1 |
handle_accheck(CMD_Request *rx_message, CMD_Reply *tx_message)
{
IPAddr ip;
UTI_IPNetworkToHost(&rx_message->data.ac_check.ip, &ip);
if (NCR_CheckAccessRestriction(&ip)) {
tx_message->status = htons(STT_ACCESSALLOWED);
} else {
tx_message->status = htons(STT_ACCESSDENIED);
}
} | false | false | false | false | false | 0 |
snmppdu_print(u_short pduid, const u_char *np, u_int length)
{
struct be elem;
int count = 0, error;
/* reqId (Integer) */
if ((count = asn1_parse(np, length, &elem)) < 0)
return;
if (elem.type != BE_INT) {
fputs("[reqId!=INT]", stdout);
asn1_print(&elem);
return;
}
if (vflag)
printf("R=%d ", elem.dat... | false | false | false | false | false | 0 |
new_alias_set (void)
{
if (flag_strict_aliasing)
{
if (alias_sets == 0)
VEC_safe_push (alias_set_entry, gc, alias_sets, 0);
VEC_safe_push (alias_set_entry, gc, alias_sets, 0);
return VEC_length (alias_set_entry, alias_sets) - 1;
}
else
return 0;
} | false | false | false | false | false | 0 |
dstring_append_string (DString *ds, const void *data, int len)
{
if (!dstring_ensure_space (ds, (ds->str_len + len + 1) * ds->char_size))
return FALSE;
memcpy ((char *)ds->val + (ds->char_size * ds->str_len), data,
ds->char_size * len);
ds->str_len += len;
return TRUE;
} | 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.