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 |
|---|---|---|---|---|---|---|
require_user(int pass)
{
char *id = queue_remove(id_queue);
user_datum_t *user = NULL;
int retval;
if (pass == 1) {
free(id);
return 0;
}
if (id == NULL) {
yyerror("no user name");
return -1;
}
if ((user = malloc(sizeof(*user))) == NULL) {
free(id);
yyerror("Out of memory!");
return -1;
}
user_d... | false | false | false | false | false | 0 |
get_rx_page_info(struct be_rx_obj *rxo)
{
struct be_adapter *adapter = rxo->adapter;
struct be_rx_page_info *rx_page_info;
struct be_queue_info *rxq = &rxo->q;
u16 frag_idx = rxq->tail;
rx_page_info = &rxo->page_info_tbl[frag_idx];
BUG_ON(!rx_page_info->page);
if (rx_page_info->last_frag) {
dma_unmap_page(&a... | false | false | false | false | false | 0 |
vm_class_resolve_class(const struct vm_class *vmc, uint16_t i)
{
const struct cafebabe_constant_info_class *constant_class;
if (cafebabe_class_constant_get_class(vmc->class, i, &constant_class))
return NULL;
const struct cafebabe_constant_info_utf8 *class_name;
if (cafebabe_class_constant_get_utf8(vmc->class,
... | false | false | false | false | false | 0 |
trio_fpclassify_and_signbit
TRIO_ARGS2((number, is_negative),
double number,
int *is_negative)
{
/* The TRIO_FUNC_xxx_FPCLASSIFY_AND_SIGNBIT macros are mutually exclusive */
#if defined(TRIO_FUNC_C99_FPCLASSIFY_AND_SIGNBIT)
return c99_fpclassify_and_signbit(number, is_negative);
#endif
#if defined(TRI... | false | false | false | false | false | 0 |
write(const Sphere* sphere, size_t count)
{
for (size_t i = 0; i < count; ++i, ++sphere)
{
write(&sphere->getCenter());
Real radius = sphere->getRadius();
write(&radius);
}
} | false | false | false | false | false | 0 |
treeFormatOptionsMenu()
{
while (true)
{
lin1 = "";
cout<< "\n\n\n";
cout<<" ****** Format of Phylogenetic Tree Output ******\n\n\n";
cout<<" 1. Toggle CLUSTAL format tree output = "
<< ((!userParameters->getOutputTreeClustal()) ? "OFF" : "ON")<<"\n";
... | false | false | false | false | false | 0 |
meye_init(void)
{
gbuffers = max(2, min((int)gbuffers, MEYE_MAX_BUFNBRS));
if (gbufsize > MEYE_MAX_BUFSIZE)
gbufsize = MEYE_MAX_BUFSIZE;
gbufsize = PAGE_ALIGN(gbufsize);
printk(KERN_INFO "meye: using %d buffers with %dk (%dk total) "
"for capture\n",
gbuffers,
gbufsize / 1024, gbuffers * gbufsize / 10... | false | false | false | false | false | 0 |
header(unsigned char *sha1, char *path1, int mode1,
unsigned char *sha2, char *path2, int mode2)
{
char *abbrev1, *abbrev2;
int subproject;
subproject = (S_ISGITLINK(mode1) || S_ISGITLINK(mode2));
html("<div class='head'>");
html("diff --git a/");
html_txt(path1);
html(" b/");
html_txt(path2);
if (is_nu... | false | false | false | false | false | 0 |
SockConnect(char *host, int port, char *lhost, int lport, int async)
{
SOCKET sock;
struct sockaddr_in lsa;
struct sockaddr_in sa;
int err;
if (Ns_GetSockAddr(&sa, host, port) != NS_OK ||
Ns_GetSockAddr(&lsa, lhost, lport) != NS_OK) {
return INVALID_SOCKET;
}... | false | false | false | false | false | 0 |
handle_net_input(int len)
{
int i;
int cstart = 0;
for (i = 0; i < len; i++) {
byte c = G.buf[i];
if (G.telstate == TS_NORMAL) { /* most typical state */
if (c == IAC) {
cstart = i;
G.telstate = TS_IAC;
}
else if (c == '\r') {
cstart = i + 1;
G.telstate = TS_CR;
}
/* No IACs were... | false | false | false | false | false | 0 |
M_Destroy(void)
{
if(m_AutoFreeElementData && m_ElementData != NULL)
{
delete [] (char *)m_ElementData;
}
m_ElementData = NULL;
if(m_CompressionTable && m_CompressionTable->compressedStream)
{
inflateEnd(m_CompressionTable->compressedStream);
delete m_CompressionTable->compressedStream... | false | false | false | false | false | 0 |
loadLineSegment(double x1, double y1,
double x2, double y2)
{
if (x1 > myLineMax.getX())
myLineMax.setX(x1);
if (y1 > myLineMax.getY())
myLineMax.setY(y1);
if (x1 < myLineMin.getX())
myLineMin.setX(x1);
if (y1 < myLineMin.getY())
myLineMin.setY(y1);
... | false | false | false | false | false | 0 |
traverse(QvState *state)
{
ANNOUNCE(QvLOD);
indent++;
// ??? In a real implementation, this would choose a child based
// ??? on the distance to the eye point.
if (getNumChildren() > 0)
getChild(0)->traverse(state);
indent--;
} | false | false | false | false | false | 0 |
iax2_read(struct ast_channel *c)
{
ast_debug(1, "I should never be called!\n");
return &ast_null_frame;
} | false | false | false | false | false | 0 |
udc_free_request(struct usb_ep *usbep, struct usb_request *usbreq)
{
struct udc_ep *ep;
struct udc_request *req;
if (!usbep || !usbreq)
return;
ep = container_of(usbep, struct udc_ep, ep);
req = container_of(usbreq, struct udc_request, req);
VDBG(ep->dev, "free_req req=%p\n", req);
BUG_ON(!list_empty(&req->q... | false | false | false | false | false | 0 |
davicom_reset(struct nic *nic)
{
unsigned long to;
whereami("davicom_reset\n");
/* Stop Tx and RX */
outl(inl(ioaddr + CSR6) & ~0x00002002, ioaddr + CSR6);
/* Reset the chip, holding bit 0 set at least 50 PCI cycles. */
outl(0x00000001, ioaddr + CSR0);
davicom_wait(TICKS_PER_SEC);
/* TX/RX descript... | false | false | false | false | false | 0 |
add_message(game *g, tut_lesson lesson)
{
// Cycle through intro lessons
if (lesson == LESSON_INTRO) {
while (lesson != NUM_LESSONS && tutorials_seen[lesson]) {
switch (lesson) {
case LESSON_INTRO: lesson = LESSON_MOVE; break;
case LESSON_MOVE: lesson = LESSON_LOOK; break;
case LESSON_LOOK: lesson = N... | false | false | false | false | false | 0 |
node_set_vendor(gnutella_node_t *n, const char *vendor)
{
char *wbuf = NULL;
size_t size = 0;
if (n->flags & NODE_F_FAKE_NAME) {
size = w_concat_strings(&wbuf, "!", vendor, (void *) 0);
} else {
static const char full[] = "Morpheus";
bool fix;
/*
* Morpheus names its servents as "morph350" or "morph461... | false | false | false | false | false | 0 |
ensure_nonzero_step_increments (ETableFieldChooser *etfc)
{
GtkAdjustment *va, *ha;
va = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (etfc->canvas));
ha = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (etfc->canvas));
/*
it looks pretty complicated to get height of column header
so use 16 pixels which s... | false | false | false | false | false | 0 |
FcStringIsConst (const FcChar8 *string,
const FcStringConst *c,
int nc)
{
int i;
for (i = 0; i < nc; i++)
if (FcStrCmpIgnoreBlanksAndCase (string, c[i].name) == 0)
return c[i].value;
return -1;
} | false | false | false | false | false | 0 |
make_expr3(enum expr_type type, expr_t *expr1, expr_t *expr2, expr_t *expr3)
{
expr_t *e;
e = xmalloc(sizeof(expr_t));
e->type = type;
e->ref = expr1;
e->u.ext = expr2;
e->ext2 = expr3;
e->is_const = FALSE;
/* check for compile-time optimization */
if (expr1->is_const && expr2->is_co... | false | false | false | false | false | 0 |
dialog_child_set(gpointer data, const gchar *key, gpointer value)
{
struct dialog_pak *dialog = data;
if (!dialog->children)
dialog->children = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL);
/* use replace, so old g_strdup() key gets freed */
g_hash_table_replace(dialog->children, g_strdup(key), valu... | false | false | false | false | false | 0 |
mulawdec_sink_setcaps (GstPad * pad, GstCaps * caps)
{
GstMuLawDec *mulawdec;
GstStructure *structure;
int rate, channels;
gboolean ret;
GstCaps *outcaps;
mulawdec = GST_MULAWDEC (GST_PAD_PARENT (pad));
structure = gst_caps_get_structure (caps, 0);
ret = gst_structure_get_int (structure, "rate", &rate... | false | false | false | false | false | 0 |
config_param_val_bool (char *val, int *res) {
if (val == NULL) return 0;
if (
strcasecmp(val, CFG_BOOL_ON) == 0 ||
strcasecmp(val, "yes") == 0 ||
strcasecmp(val, "y") == 0 ||
strcasecmp(val, "true") == 0 ||
strcasecmp(val, "t") == 0 ||
strcasecmp(val, "1") == 0) {
*res = 1;
}
retu... | false | false | false | false | false | 0 |
main (int argc, char **argv)
{
rtx desc;
max_opno = -1;
progname = "genpeep";
if (!init_rtx_reader_args (argc, argv))
return (FATAL_EXIT_CODE);
printf ("/* Generated automatically by the program `genpeep'\n\
from the machine description file `md'. */\n\n");
printf ("#include \"config.h\"\n");
pr... | false | false | false | false | false | 0 |
count_ops (const char *p)
{
int n = 0 ;
while (*p) {
if (*p == '+' || *p == '-') n++;
if (*p == '=') break;
p++;
}
return n;
} | false | false | false | false | false | 0 |
size() const
{
// SFB: Why is d->key.size() used when size() returns the length in UniChars and not UTF-8?
int result = 8 + d->key.size() /* d->key.data(String::UTF8).size() */ + 1;
switch (d->type) {
case Text:
if(d->text.size()) {
StringList::ConstIterator it = d->text.begin();
result... | false | false | false | false | false | 0 |
pack_loc (char **buf, LocMsg *lmsg)
{
char *ptr;
int len;
len = 4 + 4 + (lmsg->file ? strlen (lmsg->file) : 0) + 4;
*buf = ptr = emalloc (len);
pack_type (&ptr, CK_MSG_LOC);
pack_str (&ptr, lmsg->file);
pack_int (&ptr, lmsg->line);
return len;
} | false | false | false | false | false | 0 |
soap_recv_fault(struct soap *soap)
{ register int status = soap->error;
DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Receiving SOAP Fault\n"));
soap->error = SOAP_OK;
if (soap_getfault(soap))
{ DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Error: soap_get_soapfault() failed. Is this a SOAP message at all?\n"));
*soap_faultcode(so... | false | false | false | false | false | 0 |
push_base_cleanups (void)
{
tree binfo, base_binfo;
int i;
tree member;
tree expr;
VEC(tree,gc) *vbases;
/* Run destructors for all virtual baseclasses. */
if (CLASSTYPE_VBASECLASSES (current_class_type))
{
tree cond = (condition_conversion
(build2 (BIT_AND_EXPR, integer_type_node,
... | false | false | false | false | false | 0 |
compute_ID( str *name )
{
char *p;
unsigned short id;
id=0;
for( p=name->s+name->len-1 ; p>=name->s ; p-- )
id ^= *p;
return id;
} | false | false | false | false | true | 1 |
draw_select( FL_OBJECT * obj )
{
FL_COLOR color;
FLI_SELECT_SPEC *sp = obj->spec;
int bw = FL_abs( obj->bw ) + ( obj->bw > 0 );
int box_w = 0;
color = ( obj->belowmouse && sp->popup ) ? obj->col2 : obj->col1;
/* Draw the box of the object, possibly lowered if the object is pushed */
if ( ... | false | false | false | false | false | 0 |
mlx4_en_change_mcast_lb(struct mlx4_en_priv *priv, struct mlx4_qp *qp,
int loopback)
{
int ret;
struct mlx4_update_qp_params qp_params;
memset(&qp_params, 0, sizeof(qp_params));
if (!loopback)
qp_params.flags = MLX4_UPDATE_QP_PARAMS_FLAGS_ETH_CHECK_MC_LB;
ret = mlx4_update_qp(priv->mdev->dev, qp->qpn,
... | false | false | false | false | false | 0 |
Verify(uint64_t iSizeofData, string* pstrProblem) const
{
uint64_t iCorrectSize = ComputeDataSize();
bool bResult = iCorrectSize == iSizeofData;
if (!bResult && pstrProblem != NULL) {
stringstream s;
s << "GeometryDataBlock::Verify: size mismatch. Should be " << iCorrectSize << " but parameter was " << ... | false | false | false | false | false | 0 |
garmin_write(struct tty_struct *tty, struct usb_serial_port *port,
const unsigned char *buf, int count)
{
struct device *dev = &port->dev;
int pktid, pktsiz, len;
struct garmin_data *garmin_data_p = usb_get_serial_port_data(port);
__le32 *privpkt = (__le32 *)garmin_data_p->privpkt;
usb_serial_debug_data(dev... | false | true | false | false | false | 1 |
fillContains(const FloatPoint& point, bool requiresFill) const
{
if (m_path.isEmpty())
return false;
if (requiresFill && !SVGPaintServer::fillPaintServer(style(), this))
return false;
return m_path.contains(point, style()->svgStyle()->fillRule());
} | false | false | false | false | false | 0 |
updateRange(FXint sr,FXint er,FXint sc,FXint ec) const {
FXint xl,xr,yt,yb;
if(sr<0 || sc<0 || nrows<=er || ncols<=ec){ fxerror("%s::updateRange: index out of range.\n",getClassName()); }
if(sr<=er && sc<=ec){
xl=colHeader->getX()+colHeader->getItemOffset(sc);
xr=colHeader->getX()+colHeader->getItemOffset... | false | false | false | false | false | 0 |
xfersetup_generic(
const char *zTitle, /* Page title */
const char *zDbField, /* Configuration field being edited */
const char *zDfltValue, /* Default text value */
const char *zDesc, /* Description of this field */
char *(*xText)(const char*), /* Validity test or NULL */
... | false | false | false | false | false | 0 |
yytbl_dmap_lookup (struct yytbl_dmap * dmap, int id )
{
while (dmap->dm_id)
if (dmap->dm_id == id)
return dmap;
else
dmap++;
return NULL;
} | false | false | false | false | false | 0 |
M_FlyCheck (edict_t * self)
{
if (self->waterlevel)
return;
if (random () > 0.5)
return;
self->think = M_FliesOn;
self->nextthink = level.time + 5 + 10 * random ();
} | false | false | false | false | false | 0 |
popupdead_close()
{
if ( !Popupdead_active ) {
return;
}
gamesnd_play_iface(SND_POPUP_DISAPPEAR);
Popupdead_window.destroy();
game_flush();
Popupdead_active = 0;
Popupdead_skip_active = 0;
Popupdead_skip_already_shown = 0;
} | false | false | false | false | false | 0 |
dent(int n)
{
if(sindent == NULL) {
sindent = (char*)ocmalloc(102);
MEMCHECK(sindent,NULL);
memset((void*)sindent,(int)' ',(size_t)101);
sindent[101] = '\0';
}
if(n > 100) n = 100;
return sindent+(100-n);
} | false | false | false | false | false | 0 |
trans_select_break(bool do_not_add_pos)
{
BEGIN_NO_BREAK
{
if (current_ctrl->value)
{
if (!do_not_add_pos)
{
control_add_current_pos();
CODE_jump();
}
CODE_jump_length(current_ctrl->value, CODE_get_current_pos());
}
}
END_NO_BREAK
} | false | false | false | false | false | 0 |
access(uint param){
uint mult=0;
register uint j;
uint partialSum=0;
uint ini = param-1;
byte readByte;
uint cont,pos, rankini;
partialSum=0;
j=0;
pos=levelsIndex[j]+ini;
mult=0;
cont = iniLevel[j]+ini*base_bits[j];
readByte = bitread(levels,cont,base_bits[j]);
while((!bitget(((BitSequenceRG *... | false | false | false | false | false | 0 |
LexSingleQuote() {
int CurChar = getNextChar();
if (CurChar == '\\')
CurChar = getNextChar();
if (CurChar == EOF)
return ReturnError(TokStart, "unterminated single quote");
CurChar = getNextChar();
if (CurChar != '\'')
return ReturnError(TokStart, "single quote way too long");
// The idea h... | false | false | false | false | false | 0 |
H5O_get_rc(const H5O_loc_t *loc, hid_t dxpl_id, unsigned *rc)
{
H5O_t *oh = NULL; /* Object header */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(loc);
HDassert(rc);
/* Get the object header */
if(NULL == (oh = H5O_protec... | false | false | false | false | false | 0 |
do_spec (spec)
const char *spec;
{
int value;
value = do_spec_2 (spec);
/* Force out any unfinished command.
If -pipe, this forces out the last command if it ended in `|'. */
if (value == 0)
{
if (argbuf_index > 0 && !strcmp (argbuf[argbuf_index - 1], "|"))
argbuf_index--;
set_col... | false | false | false | false | false | 0 |
c2_find_qpn(struct c2_dev *c2dev, int qpn)
{
unsigned long flags;
struct c2_qp *qp;
spin_lock_irqsave(&c2dev->qp_table.lock, flags);
qp = idr_find(&c2dev->qp_table.idr, qpn);
spin_unlock_irqrestore(&c2dev->qp_table.lock, flags);
return qp;
} | false | false | false | false | false | 0 |
auth_gssapi_mic(ssh_session session, const char *user, const char *principal, void *userdata){
(void)userdata;
client_creds = ssh_gssapi_get_creds(session);
printf("Authenticating user %s with gssapi principal %s\n",user, principal);
if (client_creds != NULL)
printf("Received some gssapi credent... | false | false | false | false | false | 0 |
loadMeta(const QDomElement &i, const QString &dir)
{
Q_UNUSED(dir);
for (QDomNode node = i.firstChild(); !node.isNull(); node = node.nextSibling()) {
QDomElement e = node.toElement();
if( e.isNull() )
continue;
QString tag = e.tagName();
if ( tag == "name" ) {
name = e.text();
}
else if... | false | false | false | false | false | 0 |
rsc_next_conj(struct rsc *rsc)
{
unsigned int i;
for (i = 0; (i < 8) && (!(rsc->msr & (0x1 << i))); )
i++;
rsc->conj += (AUDIO_SLOT_BLOCK_NUM >> i);
return rsc->conj;
} | false | false | false | false | false | 0 |
Stmt_tadd(CTX ctx, kStmtExpr *stmt, tkitr_t *itr, knh_FisTerm f, const char *whatis)
{
if(STT_(stmt) == STT_ERR) return;
if(ITR_hasNext(itr) && f(ITR_tk(itr))) {
knh_Stmt_add(ctx, stmt, ITR_nextTK(itr));
}
else {
_ERROR(ctx, stmt, itr, whatis);
}
} | false | false | false | false | false | 0 |
findstr(const char *hay, size_t slen, const char *needle)
{
const char *ret = NULL;
if(hay && slen && needle) {
size_t nlen=strlen(needle);
if(nlen<=slen) {
size_t smax = slen-nlen+1;
size_t i;
const char *sp = hay;
for(i=0;i<smax;++i) {
if(sheadof(needle,sp+i)) {
ret = sp+i;
break;
... | false | false | false | false | false | 0 |
usbScanDevicesInBus(unsigned bus, const char *bus_name,
uint16_t vid, uint16_t pid,
USBFindDevicesCallback callback, void *data)
{
DIR *dir;
char path[NAME_MAX+1];
struct dirent *de;
USBDevice *dev;
char *endptr;
const USBDeviceDescriptor *ddesc;
int stop = 0;
unsigned idVendor, id... | false | false | false | false | false | 0 |
u_wipe_engr(cnt)
register int cnt;
{
if (can_reach_floor())
wipe_engr_at(u.ux, u.uy, cnt);
} | false | false | false | false | false | 0 |
cc_wacom_nav_button_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
CcWacomNavButton *nav = CC_WACOM_NAV_BUTTON (object);
CcWacomNavButtonPrivate *priv = nav->priv;
switch (property_id) {
case PROP_NOTEBOOK:
if (priv->notebook) {
g_s... | false | false | false | false | false | 0 |
GC_malloc(size_t bytes)
{
size_t granules = ROUNDED_UP_GRANULES(bytes);
void *tsd;
void *result;
void **tiny_fl;
# if !defined(USE_PTHREAD_SPECIFIC) && !defined(USE_WIN32_SPECIFIC)
GC_key_t k = GC_thread_key;
if (EXPECT(0 == k, FALSE)) {
/* We haven't yet run GC_init_parallel. Th... | false | false | false | false | false | 0 |
H5LT_read_dataset_numerical(hid_t loc_id, const char *dset_name, hid_t tid, void *data)
{
hid_t did;
/* Open the dataset. */
if((did = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0)
return -1;
/* Read */
if(H5Dread(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0)
goto out;
... | false | false | false | false | false | 0 |
j_on_state_handler(jconn conn, int state)
{
int previous_state;
JABBER_Conn *JConn = NULL;
char buff[4096];
JConn = JCfindConn(conn);
previous_state = JConn->state;
eb_debug(DBG_JBR, "Entering: new state: %i previous_state: %i\n", state,
previous_state);
switch (state) {
case JCONN_STATE_OFF:
if (previou... | false | false | false | false | false | 0 |
knh_DictMap_getNULL(CTX ctx, kDictMap *m, kbytes_t key)
{
knh_dmap_t *dmap = (knh_dmap_t*)m->mapptr;
kindex_t loc = dmap_index(dmap, 0, dmap->sorted, key);
if(loc == -1) {
loc = dmap_index(dmap, dmap->sorted, dmap->size, key);
}
return (loc == -1) ? NULL : dmap->dentry[loc].value;
} | false | false | false | false | false | 0 |
m68hc11_eq_compare_operator (op, mode)
register rtx op;
enum machine_mode mode ATTRIBUTE_UNUSED;
{
return GET_CODE (op) == EQ || GET_CODE (op) == NE;
} | false | false | false | false | false | 0 |
fmgr_internal_validator(PG_FUNCTION_ARGS)
{
Oid funcoid = PG_GETARG_OID(0);
HeapTuple tuple;
bool isnull;
Datum tmp;
char *prosrc;
/*
* We do not honor check_function_bodies since it's unlikely the function
* name will be found later if it isn't there now.
*/
tuple = SearchSysCache1(PROCOID, Objec... | false | false | false | false | false | 0 |
plain_account_init(FILE *fp)
{
char buf[BUFSIZE], *p, *q;
u32 tid;
int idx;
tid = 0;
while (fgets(buf, sizeof(buf), fp)) {
q = buf;
p = target_sep_string(&q);
if (!p || *p == '#')
continue;
if (!strcasecmp(p, "Target")) {
struct target *target;
tid = 0;
if (!(p = target_sep_string(&q)))
c... | false | false | false | false | false | 0 |
H5P_get_driver_info(H5P_genplist_t *plist)
{
void *ret_value=NULL;
FUNC_ENTER_NOAPI(H5P_get_driver_info, NULL);
/* Get the current driver info */
if( TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS) ) {
if(H5P_get(plist, H5F_ACS_FILE_DRV_INFO_NAME, &ret_value) < 0)
HGOTO_ERR... | false | false | false | false | false | 0 |
nv_restore_phy ( struct forcedeth_private *priv )
{
u16 phy_reserved, mii_control;
if ( priv->phy_oui == PHY_OUI_REALTEK &&
priv->phy_model == PHY_MODEL_REALTEK_8201 ) {
mii_rw ( priv, priv->phyaddr, PHY_REALTEK_INIT_REG1,
PHY_REALTEK_INIT3 );
phy_reserved = mii_rw ( priv, priv->phyaddr,
PH... | false | false | false | false | false | 0 |
GNUNET_CRYPTO_hash_sum (const GNUNET_HashCode * a,
const GNUNET_HashCode * delta, GNUNET_HashCode * result)
{
int i;
for (i = (sizeof (GNUNET_HashCode) / sizeof (unsigned int)) - 1; i >= 0; i--)
result->bits[i] = delta->bits[i] + a->bits[i];
} | false | false | false | false | false | 0 |
gnominv(
double x, /* (O) X projection coordinate */
double y, /* (O) Y projection coordinate */
double *lon, /* (I) Longitude */
double *lat) /* (I) Latitude */
{
double rh;
double z,sinz,cosz;
double con;
/* Inverse equations
-----------------*/
x -= false_easting;
y -= false_northing;
rh = sqrt(x * x + ... | false | false | false | false | false | 0 |
unixCurrentTime(unqlite_vfs *pVfs,Sytm *pOut)
{
struct tm *pTm;
time_t tt;
SXUNUSED(pVfs);
time(&tt);
pTm = gmtime(&tt);
if( pTm ){ /* Yes, it can fail */
STRUCT_TM_TO_SYTM(pTm,pOut);
}
return UNQLITE_OK;
} | false | false | false | false | false | 0 |
GetCoreClientStatus(CC_STATUS& ccs, bool bForce) {
wxString strMachine = wxEmptyString;
int iRetVal = 0;
if (IsConnected()) {
if (!m_bWaitingForRPC) { // Prevent recursive entry of RequestRPC()
#if USE_CACHE_TIMEOUTS
wxTimeSpan ts(wxDateTime::Now() - m_dtCachedC... | false | false | false | false | false | 0 |
selinux_xfrm_skb_sid_ingress(struct sk_buff *skb,
u32 *sid, int ckall)
{
u32 sid_session = SECSID_NULL;
struct sec_path *sp = skb->sp;
if (sp) {
int i;
for (i = sp->len - 1; i >= 0; i--) {
struct xfrm_state *x = sp->xvec[i];
if (selinux_authorizable_xfrm(x)) {
struct xfrm_sec_ctx *ctx = x->secur... | false | false | false | false | false | 0 |
ekiga_main_window_init (EkigaMainWindow *mw)
{
mw->priv = new EkigaMainWindowPrivate ();
/* Accelerators */
mw->priv->accel = gtk_accel_group_new ();
gtk_window_add_accel_group (GTK_WINDOW (mw), mw->priv->accel);
g_object_unref (mw->priv->accel);
mw->priv->current_call = boost::shared_ptr<Ekiga::Call>();
... | false | false | false | false | false | 0 |
gia(A i,I r){R!r&&i&&i->t<Et?enc((I)i):(I)i;} | false | false | false | false | false | 0 |
event_alloc(void)
{
struct event *event = malloc(sizeof(struct event));
if (event) {
/* The new event is initialized with values that represents
* unset values: -1 for uid and pid and 0 (or NULL) for numbers
* and pointers. For example, event->end = 0 represents an
* unfinished event.
*/
memset(event,... | false | false | false | false | false | 0 |
panel_separator_parent_set (GtkWidget *widget,
GtkWidget *previous_parent)
{
PanelSeparator *separator;
GtkWidget *parent;
separator = PANEL_SEPARATOR (widget);
parent = gtk_widget_get_parent (widget);
g_assert (!parent || PANEL_IS_WIDGET (parent));
separator->priv->panel = (PanelWidget *) parent;
} | false | false | false | false | false | 0 |
clean_resv_nick(const char *nick)
{
char tmpch;
int as = 0;
int q = 0;
int ch = 0;
if(*nick == '-' || IsDigit(*nick))
return 0;
while((tmpch = *nick++))
{
if(tmpch == '?' || tmpch == '@' || tmpch == '#')
q++;
else if(tmpch == '*')
as++;
else if(IsNickChar(tmpch))
ch++;
else
return 0;
}
... | false | false | false | false | false | 0 |
jswrap_string_replace(JsVar *parent, JsVar *subStr, JsVar *newSubStr) {
JsVar *str = jsvAsString(parent, false);
subStr = jsvAsString(subStr, false);
newSubStr = jsvAsString(newSubStr, false);
int idx = jswrap_string_indexOf(parent, subStr, 0, false);
if (idx>=0) {
JsVar *newStr = jsvNewFromStringVar(str... | false | false | false | false | false | 0 |
drop_nlink(struct inode *inode)
{
WARN_ON(inode->i_nlink == 0);
inode->__i_nlink--;
if (!inode->i_nlink)
atomic_long_inc(&inode->i_sb->s_remove_count);
} | false | false | false | false | false | 0 |
DeleteThisItem(struct Item **liststart,struct Item *entry)
{ struct Item *ip, *sp;
if (entry != NULL)
{
if (entry->name != NULL)
{
free(entry->name);
}
sp = entry->next;
if (entry == *liststart)
{
*liststart = sp;
}
else
{
for (ip = *liststart; ip->nex... | false | false | false | false | false | 0 |
photo_populate (EContact *contact,
struct berval **ber_values)
{
if (ber_values && ber_values[0]) {
EContactPhoto photo;
photo.type = E_CONTACT_PHOTO_TYPE_INLINED;
photo.data.inlined.mime_type = NULL;
photo.data.inlined.data = (guchar *) ber_values[0]->bv_val;
photo.data.inlined.length = ber_... | false | true | false | false | false | 1 |
iwl_mvm_bt_coex_notif_handle(struct iwl_mvm *mvm)
{
struct iwl_bt_iterator_data data = {
.mvm = mvm,
.notif = &mvm->last_bt_notif_old,
};
struct iwl_bt_coex_ci_cmd_old cmd = {};
u8 ci_bw_idx;
/* Ignore updates if we are in force mode */
if (unlikely(mvm->bt_force_ant_mode != BT_FORCE_ANT_DIS))
return;
rc... | false | false | false | false | false | 0 |
hex_decode(char ch, unsigned char* val) {
if ((ch >= '0') && (ch <= '9')) {
*val = ch - '0';
} else if ((ch >= 'A') && (ch <= 'Z')) {
*val = (ch - 'A') + 10;
} else if ((ch >= 'a') && (ch <= 'z')) {
*val = (ch - 'a') + 10;
} else {
return false;
}
return true;
} | false | false | false | false | false | 0 |
deviceAdapter() const
{
QString string = device();
int pos = string.lastIndexOf('/');
if (pos < 0)
return -1;
string = string.left(pos);
pos = string.lastIndexOf('/');
if (pos < 0)
return -1;
string = string.mid(pos + 1);
if (!string.startsWith(QLatin1String("adapter"))... | false | false | false | false | false | 0 |
men_z135_startup(struct uart_port *port)
{
struct men_z135_port *uart = to_men_z135(port);
int err;
u32 conf_reg = 0;
err = men_z135_request_irq(uart);
if (err)
return -ENODEV;
conf_reg = ioread32(port->membase + MEN_Z135_CONF_REG);
/* Activate all but TX space available IRQ */
conf_reg |= MEN_Z135_ALL_IRQ... | false | false | false | false | false | 0 |
read_instructions(exec_list *instructions, s_expression *expr,
ir_loop *loop_ctx)
{
// Read in a list of instructions
s_list *list = SX_AS_LIST(expr);
if (list == NULL) {
ir_read_error(expr, "Expected (<instruction> ...); found an atom.");
return;
}
foreach_iter(exec_list_iterator, i... | false | false | false | false | false | 0 |
jas_image_rawsize(jas_image_t *image)
{
uint_fast32_t rawsize;
int cmptno;
jas_image_cmpt_t *cmpt;
rawsize = 0;
for (cmptno = 0; cmptno < image->numcmpts_; ++cmptno) {
cmpt = image->cmpts_[cmptno];
rawsize += (cmpt->width_ * cmpt->height_ * cmpt->prec_ +
7) / 8;
}
return rawsize;
} | false | false | false | false | false | 0 |
getAttributeEnumerationLiteralsOfEnumeration(const c8* attributeName, core::array<core::stringc>& outLiterals)
{
IAttribute* att = getAttributeP(attributeName);
if (att && att->getType() == EAT_ENUM)
outLiterals = ((CEnumAttribute*)att)->EnumLiterals;
} | false | false | false | false | false | 0 |
_fingerprint(struct printer *p)
{
int c;
uint32_t result = 0;
struct dfa_state *node;
while ((node = _pop_node(p))) {
result = _combine(result, (node->final < 0) ? 0 : node->final);
for (c = 0; c < 256; c++)
result = _combine(resul... | false | false | false | false | false | 0 |
send_ring(struct unistimsession *pte, char volume, char style)
{
BUFFSEND;
if (unistimdebug) {
ast_verb(0, "Sending ring packet\n");
}
memcpy(buffsend + SIZE_HEADER, packet_send_ring, sizeof(packet_send_ring));
buffsend[24] = style + 0x10;
buffsend[29] = volume * 0x10;
send_client(SIZE_HEADER + sizeof(packet_s... | false | true | false | false | false | 1 |
command_select(GtkComboBox *combobox, gpointer d)
{
GtkTreeIter iter;
gchar* data = NULL;
if (gtk_combo_box_get_active_iter (combobox, &iter))
{
GtkTreeModel* model = gtk_combo_box_get_model(combobox);
gtk_tree_model_get (model, &iter, 0, &data, -1);
}
if(FrameShow !=NULL) gtk_widget_destroy(FrameShow);
if (... | false | false | false | false | false | 0 |
set_cgats_type(cgats *p, const char *osym) {
cgatsAlloc *al = p->al;
p->errc = 0;
p->err[0] = '\000';
if (p->cgats_type != NULL)
al->free(al, p->cgats_type);
if ((p->cgats_type = (char *)al->malloc(al, (strlen(osym)+1) * sizeof(char))) == NULL)
return err(p,-2,"cgats.add_cgats_type(), malloc failed!");
strcp... | false | false | false | false | false | 0 |
js_PurgeCachedNativeEnumerators(JSContext *cx, JSThreadData *data)
{
jsuword *cachep = &data->nativeEnumCache[0];
jsuword *end = cachep + JS_ARRAY_LENGTH(data->nativeEnumCache);
for (; cachep != end; ++cachep)
SetEnumeratorCache(cx, cachep, jsuword(0));
#ifdef JS_DUMP_ENUM_CACHE_STATS
printf("n... | false | false | false | false | false | 0 |
check_normal(Ipnt PC,
HMatrix norm,
Ipnt *refpt, Ipnt *newpt){
Hint dot,dmin,dmax;
int i,first=TRUE;
Ipnt pmin = NULL;
Ipnt pmax = NULL;
Hinit(dot,0);
Hinit(dmin,0);
Hinit(dmax,0);
while(PC!=0){
Hnorm_dot(dot,norm,PC);
if (first==TRUE) {
HHs... | false | false | false | false | false | 0 |
isoent_new(struct isofile *file)
{
struct isoent *isoent;
static const struct archive_rb_tree_ops rb_ops = {
isoent_cmp_node, isoent_cmp_key,
};
isoent = calloc(1, sizeof(*isoent));
if (isoent == NULL)
return (NULL);
isoent->file = file;
isoent->children.first = NULL;
isoent->children.last = &(isoent->chil... | false | false | false | false | false | 0 |
static_style (GtkWidget *widget, void *data)
{
gamgi_window *window = GAMGI_CAST_WINDOW data;
GtkWidget *dialog = window->dialog0;
GtkWidget *entry;
GtkWidget *label_size, *label_variancy;
GtkWidget *combo_style, *combo_size, *combo_variancy;
char token[GAMGI_ENGINE_TOKEN];
int row;
/****************
* update style *... | true | true | false | false | false | 1 |
GetReferenceSystemPointId(vtkPolyData* referenceSystems, const char* groupIdsArrayName, vtkIdType groupId)
{
vtkDataArray* groupIdsArray = referenceSystems->GetPointData()->GetArray(groupIdsArrayName);
int numberOfPoints = referenceSystems->GetNumberOfPoints();
vtkIdType pointId = -1;
for (int i=0; i<numberOfP... | false | false | false | false | false | 0 |
lalr1AddFollow2( TransAp *trans, FollowToAdd &followKeys )
{
for ( ExpandToSet::Iter ets = trans->expandTo; ets.lte(); ets++ ) {
int prodId = ets->prodId;
StateAp *expandTo = ets->state;
for ( FollowToAdd::Iter fkey = followKeys; fkey.lte(); fkey++ ) {
TransMapEl *transEl = expandTo->transMap.find( fkey->key... | false | false | false | false | false | 0 |
get_basic_block(struct compilation_unit *cu, unsigned long start, unsigned long end)
{
struct basic_block *bb;
bb = alloc_basic_block(cu, start, end);
if (bb)
list_add_tail(&bb->bb_list_node, &cu->bb_list);
return bb;
} | false | false | false | false | false | 0 |
Set_file_error(int value)
{
if (File_error>=0)
File_error=value;
} | false | false | false | false | false | 0 |
CmiAllocateHashTableCell (
IN PCMHIVE RegistryHive,
OUT PCM_KEY_FAST_INDEX *HashBlock,
OUT HCELL_INDEX *HBOffset,
IN USHORT SubKeyCount,
IN HSTORAGE_TYPE Storage)
{
PCM_KEY_FAST_INDEX NewHashBlock;
ULONG NewHashSize;
NTSTATUS Status;
Status = STATUS_SUCCESS;
*HashBlock = NULL;
NewHashSize = FIELD_OFFSET(CM_... | false | false | false | false | false | 0 |
ubifs_sync_wbufs_by_inode(struct ubifs_info *c, struct inode *inode)
{
int i, err = 0;
for (i = 0; i < c->jhead_cnt; i++) {
struct ubifs_wbuf *wbuf = &c->jheads[i].wbuf;
if (i == GCHD)
/*
* GC head is special, do not look at it. Even if the
* head contains something related to this inode, it is
*... | 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.