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 |
|---|---|---|---|---|---|---|
seckey_UpdateCertPQGChain(CERTCertificate * subjectCert, int count)
{
SECStatus rv;
SECOidData *oid=NULL;
int tag;
CERTSubjectPublicKeyInfo * subjectSpki=NULL;
CERTSubjectPublicKeyInfo * issuerSpki=NULL;
CERTCertificate *issuerCert = NULL;
rv = SECSuccess;
/* increment cert chain lengt... | false | false | false | false | false | 0 |
write(hsStream* S, plResManager* mgr) {
plSynchedObject::write(S, mgr);
mgr->writeKey(S, fMatPreShade);
mgr->writeKey(S, fMatRTShade);
S->writeInt(fTargets.getSize());
for (size_t i=0; i<fTargets.getSize(); i++)
mgr->writeKey(S, fTargets[i]);
S->writeInt(fPartyObjects.getSize());
f... | false | false | false | false | false | 0 |
monster_check_enemy(object *npc, rv_vector *rv) {
object *owner;
/* if this is pet, let him attack the same enemy as his owner
* TODO: when there is no ower enemy, try to find a target,
* which CAN attack the owner. */
owner = object_get_owner(npc);
if ((npc->attack_movement&HI4) == PETMOVE) ... | false | false | false | false | false | 0 |
_define_object_macro (glcpp_parser_t *parser,
YYLTYPE *loc,
const char *identifier,
token_list_t *replacements)
{
macro_t *macro, *previous;
if (loc != NULL)
_check_for_reserved_macro_name(parser, loc, identifier);
macro = ralloc (parser, macro_t);
macro->is_function = 0;
macro->parame... | false | false | false | false | false | 0 |
cmd_log_init_finish(int argc, const char **argv, const char *prefix,
struct rev_info *rev, struct setup_revision_opt *opt)
{
int i;
int decoration_given = 0;
struct userformat_want w;
/*
* Check for -h before setup_revisions(), or "git log -h" will
* fail when run without a git directory.
*/
if (argc == ... | false | false | false | false | false | 0 |
handle_drag(double v) {
if (v != value_) {
value_ = v;
value_damage();
set_changed();
if (when() & FL_WHEN_CHANGED) do_callback();
}
} | false | false | false | false | false | 0 |
find_local_socket(unsigned id)
{
asocket *s;
asocket *result = NULL;
adb_mutex_lock(&socket_list_lock);
for (s = local_socket_list.next; s != &local_socket_list; s = s->next) {
if (s->id == id) {
result = s;
break;
}
}
adb_mutex_unlock(&socket_list_lock);... | false | false | false | false | false | 0 |
pm2fb_blank(int blank_mode, struct fb_info *info)
{
struct pm2fb_par *par = info->par;
u32 video = par->video;
DPRINTK("blank_mode %d\n", blank_mode);
switch (blank_mode) {
case FB_BLANK_UNBLANK:
/* Screen: On */
video |= PM2F_VIDEO_ENABLE;
break;
case FB_BLANK_NORMAL:
/* Screen: Off */
video &= ~PM2F... | false | false | false | false | false | 0 |
AddStyle (
TextDisplay* display, int line, int first, int last, int style
) {
if (first < 0) {
prefix = prefix | style;
}
if (last > lastchar) {
postfix = postfix | style;
}
int f = Math::max(first, 0);
int l = Math::min(last, lastchar);
for (int i = f; i <= l; ++i) {
... | false | false | false | false | false | 0 |
_item_content_unset_hook(Elm_Object_Item *it,
const char *part)
{
Elm_Naviframe_Item *nit = (Elm_Naviframe_Item *)it;
Evas_Object *o = NULL;
_part_aliasing_eval(&part);
//specified parts
if (!part || !strcmp(CONTENT_PART, part))
o = _item_content_unset(nit);
else if (!s... | false | false | false | false | false | 0 |
found_file_music(void *instance, const ucs2_char_t* found_path, const ucs2_char_t* found_file)
{
static const ucs2_char_t ucs2cs_mp3[] = {'.','m','p','3',0};
static const ucs2_char_t ucs2cs_wma[] = {'.','w','m','a',0};
static const ucs2_char_t ucs2cs_wav[] = {'.','w','a','v',0};
findfile_music_t* ffd = (findfile_mu... | false | false | false | false | false | 0 |
propertynotify(XEvent *e) {
Client *c;
Window trans;
XPropertyEvent *ev = &e->xproperty;
if((ev->window == root) && (ev->atom == XA_WM_NAME))
updatestatus();
else if(ev->state == PropertyDelete)
return; /* ignore */
else if((c = wintoclient(ev->window))) {
switch (ev->atom) {
default: break;
case XA_WM... | false | false | false | false | false | 0 |
ide_set_dma_mode(ide_drive_t *drive, const u8 mode)
{
ide_hwif_t *hwif = drive->hwif;
const struct ide_port_ops *port_ops = hwif->port_ops;
if (hwif->host_flags & IDE_HFLAG_NO_SET_MODE)
return 0;
if (port_ops == NULL || port_ops->set_dma_mode == NULL)
return -1;
if (hwif->host_flags & IDE_HFLAG_POST_SET_MOD... | false | false | false | false | false | 0 |
stringReplaceEachSubstr(const char *src,
const char *sub1,
const char *sub2,
l_int32 *pcount)
{
char *currstr, *newstr;
l_int32 loc;
PROCNAME("stringReplaceEachSubstr");
if (!src)
return (char *)ERROR_PTR("src not defin... | false | false | false | false | false | 0 |
GetBSDF(const DifferentialGeometry &dgGeom, const DifferentialGeometry &dgShading, MemoryArena &arena) const {
// Allocate _BSDF_, possibly doing bump mapping with _bumpMap_
DifferentialGeometry dgs;
if (bumpMap)
Bump(bumpMap, dgGeom, dgShading, &dgs);
else
dgs = dgShading;
BSDF *bsd... | false | false | false | false | false | 0 |
__ecereMethod_Breakpoint_Save(struct Breakpoint * this, struct __ecereNameSpace__ecere__com__Instance * f)
{
if(this->relativeFilePath && this->relativeFilePath[0])
{
char * location = __ecereMethod_Breakpoint_CopyUserLocationString(this);
__ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, " * %d,%d,%d,%d,%... | false | false | false | false | false | 0 |
week_number_mon4 (const struct tm *tm)
{
int wday = (tm->tm_wday + 6) % 7;
int w1day = (wday - tm->tm_yday % 7 + 7) % 7;
int ret;
ret = (tm->tm_yday + w1day) / 7;
if (w1day >= 4)
--ret;
if (ret == -1)
ret = 53;
else
++ret;
return ret;
} | false | false | false | false | false | 0 |
_temperature_face_id_max(const Eina_Hash *hash __UNUSED__, const void *key, void *hdata __UNUSED__, void *fdata)
{
const char *p;
int *max;
int num = -1;
max = fdata;
p = strrchr(key, '.');
if (p) num = atoi(p + 1);
if (num > *max) *max = num;
return EINA_TRUE;
} | false | false | false | false | true | 1 |
m_trace(aClient *cptr, aClient *sptr, int parc, char *parv[])
{
aClient *acptr;
int maskedserv = 0;
int showsid = 0;
int i = 0;
if (parc > 1)
{
/* wildcards now allowed only in server/service names */
acptr = find_matching_client(parv[1]);
if (!acptr)
{
acptr = find_sid(parv[1], NULL);
if (acptr)
... | false | false | false | false | false | 0 |
LI14__CS_PUSH__cmptop(object first,...)
{
va_list ap;
int narg = VFUN_NARGS; VMB14 VMS14 VMV14
{object V203;
va_start(ap,first);
narg = narg - 0;
if (narg <= 0) goto T717;
else {
V203= first;}
--narg; goto T718;
goto T717;
T717:;
V203= Cnil;
goto T718;
T718:;
{object V204;
(((object)VV[114])->s.s_dbind)=... | false | false | false | false | false | 0 |
get_opclass_name(Oid opclass, Oid actual_datatype,
StringInfo buf)
{
HeapTuple ht_opc;
Form_pg_opclass opcrec;
char *opcname;
char *nspname;
ht_opc = SearchSysCache(CLAOID,
ObjectIdGetDatum(opclass),
0, 0, 0);
if (!HeapTupleIsValid(ht_opc))
elog(ERROR, "cache lookup failed for opclass ... | false | false | false | false | false | 0 |
on_date_popup_today_button_clicked (GtkWidget *button,
EDateEdit *dedit)
{
EDateEditPrivate *priv;
struct tm tmp_tm;
time_t t;
priv = dedit->priv;
hide_date_popup (dedit);
if (priv->time_callback) {
tmp_tm = (*priv->time_callback) (dedit, priv->time_callback_data);
} else... | false | false | false | false | false | 0 |
__rep_sync(dbenv, flags)
DB_ENV *dbenv;
u_int32_t flags;
{
DB_LOG *dblp;
DB_LSN lsn;
DB_REP *db_rep;
DB_THREAD_INFO *ip;
ENV *env;
LOG *lp;
REP *rep;
int master, ret;
u_int32_t repflags, type;
env = dbenv->env;
db_rep = env->rep_handle;
COMPQUIET(flags, 0);
ENV_REQUIRES_CONFIG_XX(
env, rep_handle... | false | false | false | false | false | 0 |
gst_soup_http_src_session_close (GstSoupHTTPSrc * src)
{
if (src->session) {
soup_session_abort (src->session); /* This unrefs the message. */
g_object_unref (src->session);
src->session = NULL;
src->msg = NULL;
}
} | false | false | false | false | false | 0 |
typhoon_alloc_rx_skb(struct typhoon *tp, u32 idx)
{
struct typhoon_indexes *indexes = tp->indexes;
struct rxbuff_ent *rxb = &tp->rxbuffers[idx];
struct basic_ring *ring = &tp->rxBuffRing;
struct rx_free *r;
struct sk_buff *skb;
dma_addr_t dma_addr;
rxb->skb = NULL;
if((ring->lastWrite + sizeof(*r)) % (RXFREE_... | false | false | false | false | false | 0 |
acctprocnt(void)
{
struct stat statacc;
/*
** if accounting not supported, skip call
*/
if (acctfd == -1)
return 0;
/*
** determine how many processes exited last interval
*/
(void) fstat(acctfd, &statacc);
if (acctsize > statacc.st_size) /* somebody did reset accounting? */
{
/*
** reposition to ... | false | false | false | false | false | 0 |
xlyap_event (Display *dpy, Window window, void *closure, XEvent *event)
{
struct state *st = (struct state *) closure;
switch(event->type)
{
case KeyPress:
return Getkey(st, &event->xkey);
return True;
#if 0
case ButtonPress:
StartRubberBand(st, &st->rubber_data, event);
return T... | false | false | false | false | false | 0 |
qla24xx_async_abort_cmd(srb_t *cmd_sp)
{
scsi_qla_host_t *vha = cmd_sp->fcport->vha;
fc_port_t *fcport = cmd_sp->fcport;
struct srb_iocb *abt_iocb;
srb_t *sp;
int rval = QLA_FUNCTION_FAILED;
sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL);
if (!sp)
goto done;
abt_iocb = &sp->u.iocb_cmd;
sp->type = SRB_ABT_CMD... | false | false | false | false | false | 0 |
ISNS_Process_SCN ( ISNS_Msg_Descp *p_md, ISNS_Msg *p_rsp_msg )
{
ISNS_LIST_NODE *cnode;
ISNS_Attr *p_attr;
ISNS_ATTR_VALS_CB *attr_vals_cb;
SOIP_Scn_Callback_Entry *p_scn;
p_attr = (ISNS_Attr *)&p_md->msg.payload;
/* Go through SCN */
/* If Dest Ma... | false | false | false | true | false | 1 |
status(message, type, alignment)
char *message;
int type, alignment;
{
if (status_message)
xfree(status_message);
status_message = xstrdup(message);
toprintable(status_message, strlen(status_message));
status_type = type;
status_alignment = alignment;
status_update();
} | false | false | false | false | false | 0 |
start_oper_irc(int s, char *ip, int port, unsigned char options, char *miscptr, FILE * fp) {
char *empty = "";
char *login, *pass;
int ret;
if (strlen(login = hydra_get_next_login()) == 0)
login = empty;
if (strlen(pass = hydra_get_next_password()) == 0)
pass = empty;
sprintf(buffer, "OPER %s %s\r... | false | true | false | false | true | 1 |
run_function_list(Function *func)
{
init_function_context(func);
while (function_context.fp)
{
function_context.fp->func(
function_context.fp->numargs,
function_context.fp->args);
if (function_context.fp)
{
function_context.fp = function_context.fp->next;
}
}
} | false | false | false | false | false | 0 |
FWAIT(bxInstruction_c *i)
{
#if BX_SUPPORT_FPU
if (BX_CPU_THIS_PTR cr0.get_TS() && BX_CPU_THIS_PTR cr0.get_MP())
exception(BX_NM_EXCEPTION, 0, 0);
BX_CPU_THIS_PTR FPU_check_pending_exceptions();
#else
BX_INFO(("FWAIT: requred FPU, use --enable-fpu"));
#endif
} | false | false | false | false | false | 0 |
gt_Enumcodeatposition_new(const GtEncseq *encseq,
GtReadmode readmode,
unsigned int prefixlength,
unsigned int numofchars)
{
Enumcodeatposition *ecp;
ecp = gt_malloc(sizeof *ecp... | false | false | false | false | false | 0 |
RangeContainsProtected(int start, int end) const {
if (vs.ProtectionActive()) {
if (start > end) {
int t = start;
start = end;
end = t;
}
int mask = pdoc->stylingBitsMask;
for (int pos = start; pos < end; pos++) {
if (vs.styles[pdoc->StyleAt(pos) & mask].IsProtected())
return true;
}
}
retu... | false | false | false | false | false | 0 |
show_bars()
{
SHOW_ALL_NL;
/* I really like this: "terrorbars" ;-) */
if (bar_size > 0.0)
fprintf(stderr, "\terrorbars are plotted in %s with bars of size %f\n",
(bar_layer == LAYER_BACK) ? "back" : "front", bar_size);
else
fputs("\terrors are plotted without bars\n", stderr);
} | false | false | false | false | false | 0 |
getNextAction()
{
vector< AlphaReal > cumsum( getArmNumber()+1 );
int i;
cumsum[0] = 0.0;
for( int i=0; i < getArmNumber(); i++ )
{
cumsum[i+1] = cumsum[i] + _p[i];
}
for( i=0; i < getArmNumber(); i++ )
{
cumsum[i+1] /= cumsum[ getArmNumber() ];
}
AlphaReal r = rand() / (AlphaReal) RAND_MAX;
for( i=... | false | false | false | false | false | 0 |
copy_block(char *buf, unsigned len, int header)
{
bi_windup(); /* align on byte boundary */
if (header) {
put_16bit(len);
put_16bit(~len);
#ifdef DEBUG
G1.bits_sent += 2 * 16;
#endif
}
#ifdef DEBUG
G1.bits_sent += (ulg) len << 3;
#endif
while (len--) {
put_8bit(*buf++);
}
} | false | false | false | false | false | 0 |
xml_escape(const char *from, int len)
{
char *to = malloc(len+1);
char *outp = to;
for (const char *inp = from; *inp; inp++) {
switch (*inp) {
case '<':
strcpy(outp, "<");
outp += 4;
break;
case '>':
strcpy(outp, ">");
outp += 4;
break;
case '&':
strcpy(outp, "&");
... | false | false | false | false | false | 0 |
autorepeat(int restore, int bequiet) {
#if NO_X11
RAWFB_RET_VOID
if (!restore || !bequiet) {}
return;
#else
int global_auto_repeat;
XKeyboardControl kctrl;
RAWFB_RET_VOID
if (restore) {
if (save_auto_repeat < 0) {
return; /* nothing to restore */
}
global_auto_repeat = get_autorepeat_state();
/* re... | false | false | false | false | false | 0 |
check_atoms(void)
{
if(!got_atoms)
{
guint i;
for(i = 0; i < N_CLIPBOARD_TARGETS; i++)
target_atom[i] = GDK_NONE;
for(i = 0; i < G_N_ELEMENTS(targets); i++)
target_atom[targets[i].info] = gdk_atom_intern_static_string(targets[i].target);
got_atoms = TRUE;... | false | false | false | false | false | 0 |
check_locale_messages(char **newval, void **extra, GucSource source)
{
if (**newval == '\0')
{
if (source == PGC_S_DEFAULT)
return true;
else
return false;
}
/*
* LC_MESSAGES category does not exist everywhere, but accept it anyway
*
* On Windows, we can't even check the value, so accept blindly
... | false | false | false | false | false | 0 |
match_domain (const char *domain, const char *reference)
{
const char *dom, *edom, *ref, *eref;
eref = strchr (reference, '\0');
edom = strchr (domain, '\0');
while (eref > reference && edom > domain)
{
/* Find the rightmost component of the reference. */
ref = memrchr (reference, '.', eref - r... | false | false | false | false | false | 0 |
uas_pre_reset(struct usb_interface *intf)
{
struct Scsi_Host *shost = usb_get_intfdata(intf);
struct uas_dev_info *devinfo = (struct uas_dev_info *)shost->hostdata;
unsigned long flags;
if (devinfo->shutdown)
return 0;
/* Block new requests */
spin_lock_irqsave(shost->host_lock, flags);
scsi_block_requests(s... | false | false | false | false | false | 0 |
_rtl92s_dm_ctrl_initgain_byrssi(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_phy *rtlphy = &(rtlpriv->phy);
struct dig_t *digtable = &rtlpriv->dm_digtable;
/* 2T2R TP issue */
if (rtlphy->rf_type == RF_2T2R)
return;
if (!rtlpriv->dm.dm_initialgain_enable)
return;
if (digt... | false | false | false | false | false | 0 |
core_clear_region(struct dm_dirty_log *log, region_t region)
{
struct log_c *lc = (struct log_c *) log->context;
if (likely(!lc->flush_failed))
log_set_bit(lc, lc->clean_bits, region);
} | false | false | false | false | false | 0 |
cgroup_config_group_task_perm(char *perm_type, char *value)
{
struct passwd *pw, *pw_buffer;
struct group *group, *group_buffer;
long val = atoi(value);
char buffer[CGROUP_BUFFER_LEN];
struct cgroup *config_cgroup =
&config_cgroup_table[cgroup_table_index];
if (!strcmp(perm_type, "uid")) {
if (!val) {
pw... | false | false | false | false | false | 0 |
apply_rec(ScmVM *vm, ScmObj proc, int nargs)
{
ScmObj program;
ScmWord code[2];
code[0] = SCM_WORD(SCM_VM_INSN1(SCM_VM_VALUES_APPLY, nargs));
code[1] = SCM_WORD(SCM_VM_INSN(SCM_VM_RET));
vm->val0 = proc;
program = vm->base? SCM_OBJ(vm->base) : SCM_OBJ(&internal_apply_compiled_code);
return ... | false | false | false | false | false | 0 |
UpdateConditionsClientSize()
{
wxSize newSize = m_pListCtrl->GetClientSize();
if (m_lastListSize.GetWidth() == newSize.GetWidth())
return;
int deltaX = newSize.GetWidth() - m_lastListSize.GetWidth();
m_lastListSize = newSize;
// Resize text fields
for (unsigned int i = 0; i < m_filterControls.size(); i++)
{... | false | false | false | false | false | 0 |
R2InitCircle()
{
// Initialize circle angles and points
for (int i = 0; i < R2circle_npoints; i++) {
R2circle_angles[i] = ((RNScalar) i * RN_TWO_PI) / (RNScalar) R2circle_npoints;
R2circle_points[i] = R2Point(cos(R2circle_angles[i]), sin(R2circle_angles[i]));
}
/* Return success */
... | false | false | false | false | false | 0 |
sdhci_finish_data(struct sdhci_host *host)
{
struct mmc_data *data;
BUG_ON(!host->data);
data = host->data;
host->data = NULL;
if (host->flags & SDHCI_REQ_USE_DMA) {
if (host->flags & SDHCI_USE_ADMA)
sdhci_adma_table_post(host, data);
else {
if (data->host_cookie == COOKIE_MAPPED) {
dma_unmap_sg(m... | false | false | false | false | false | 0 |
ves_icall_get_parameter_info (MonoMethod *method, MonoReflectionMethod *member)
{
MonoDomain *domain = mono_domain_get ();
return mono_param_get_objects_internal (domain, method, member->reftype ? mono_class_from_mono_type (member->reftype->type) : NULL);
} | false | false | false | false | false | 0 |
WritePointDataInline(vtkPointData* pd, vtkIndent indent)
{
ostream& os = *(this->Stream);
char** names = this->CreateStringArray(pd->GetNumberOfArrays());
os << indent << "<PointData";
this->WriteAttributeIndices(pd, names);
if (this->ErrorCode != vtkErrorCode::NoError)
{
this->DestroyStringArray(pd... | false | false | false | false | false | 0 |
InitMaster(session_params_t& params)
{
jack_log("JackNetMasterManager::InitMaster slave : %s", params.fName);
//check MASTER <<==> SLAVE network protocol coherency
if (params.fProtocolVersion != NETWORK_PROTOCOL) {
jack_error("Error : slave '%s' is running with a different proto... | false | false | false | false | false | 0 |
source_free(struct audio_device *dev)
{
struct source *source = dev->source;
if (source->cb_id)
avdtp_stream_remove_cb(source->session, source->stream,
source->cb_id);
if (source->session)
avdtp_unref(source->session);
if (source->connect)
pending_request_free(dev, source->connect);
if (source->disc... | false | false | false | false | false | 0 |
map_newlink (int index, struct ifaddrs_storage *ifas, int *map, int max)
{
int i;
for (i = 0; i < max; i++)
{
if (map[i] == -1)
{
map[i] = index;
if (i > 0)
ifas[i - 1].ifa.ifa_next = &ifas[i].ifa;
return i;
}
else if (map[i] == index)
return i;
}
/* This means interfaces ch... | false | false | false | false | false | 0 |
append_key(struct gpg_callbacklistinfo *gci, const char *l)
{
int ll=strlen(l);
if (ll + gci->keybuflen >= gci->keybufsize)
{
int n=ll + gci->keybuflen + 256;
char *p= gci->keybuffer ? realloc(gci->keybuffer, n)
: malloc(n);
if (!p)
return (-1);
gci->keybuffer=p;
gci->keybufsize=n;
}
strcpy(gci->... | false | true | false | false | false | 1 |
read_original_directory (cpp_reader *pfile)
{
const cpp_token *hash, *token;
/* Lex ahead; if the first tokens are of the form # NUM, then
process the directive, otherwise back up. */
hash = _cpp_lex_direct (pfile);
if (hash->type != CPP_HASH)
{
_cpp_backup_tokens (pfile, 1);
return;
... | false | true | false | false | false | 1 |
Allocate() {
if (head_ == NULL) {
return Failure::RetryAfterGC(owner_);
}
ASSERT(!FLAG_always_compact); // We only use the freelists with mark-sweep.
FreeListNode* node = FreeListNode::FromAddress(head_);
head_ = node->next(heap_);
available_ -= object_size_;
return node;
} | false | false | false | false | false | 0 |
rol(uint16_t Sh) {
// Rotate left (i.e. towards increasing bit indices).
// Swap the two parts: [0..W-Sh-1] [W-Sh..W-1]
uint16_t W = width();
Sh = Sh % W;
if (Sh == 0)
return *this;
RegisterCell Tmp(W-Sh);
// Tmp = [0..W-Sh-1].
for (uint16_t i = 0; i < W-Sh; ++i)
Tmp[i] = Bits[i];
// Shift [... | false | false | false | false | false | 0 |
hpaioScannerIsUninterruptible( hpaioScanner_t hpaio,
int * pUploadState )
{
int uploadState;
if( !pUploadState )
{
pUploadState = &uploadState;
}
return ( hpaio->scannerType == SCANNER_TYPE_PML &&
hpaio->pml.scanDone &&
Pml... | false | false | false | false | false | 0 |
GMT_geo_to_xy_line (double *lon, double *lat, GMT_LONG n)
{
/* Traces the lon/lat array and returns x,y plus appropriate pen moves */
GMT_LONG j, np, inside;
GMT_LONG sides[4], nx;
double xlon[4], xlat[4], xx[4], yy[4];
double this_x, this_y, last_x, last_y, dummy[4];
while (n > GMT_n_alloc) GMT_get_plot_array (... | false | false | false | false | false | 0 |
protocol_client_reopendir (xlator_t *this, clnt_fd_ctx_t *fdctx)
{
int ret = -1;
gfs3_opendir_req req = {{0,},};
clnt_local_t *local = NULL;
inode_t *inode = NULL;
char *path = NULL;
call_frame_t *frame = NULL;
clnt... | false | true | false | false | false | 1 |
vga_arbiter_check_bridge_sharing(struct vga_device *vgadev)
{
struct vga_device *same_bridge_vgadev;
struct pci_bus *new_bus, *bus;
struct pci_dev *new_bridge, *bridge;
vgadev->bridge_has_one_vga = true;
if (list_empty(&vga_list))
return;
/* okay iterate the new devices bridge hierarachy */
new_bus = vgadev... | false | false | false | false | false | 0 |
mdio_read(struct net_device *dev, int phy_id, int loc)
{
unsigned int addr = dev->base_addr + MGMT;
u_int cmd = (0x06<<10)|(phy_id<<5)|loc;
int i, retval = 0;
mdio_sync(addr);
for (i = 13; i >= 0; i--) {
int dat = (cmd&(1<<i)) ? MDIO_DATA_WRITE1 : MDIO_DATA_WRITE0;
outb(dat, addr);
outb(dat | MD... | false | false | false | false | false | 0 |
i2c_read_bytes(const int fd, uint8_t *buffer, int size) throw(const char *) {
if (read(fd, buffer, size) != size) {
throw "i2c: Failed to read to slave!";
}
} | false | false | false | false | false | 0 |
__ecereInstMeth___ecereNameSpace__ecere__gui__controls__ListBox_NotifyDoubleClick__00000003(struct __ecereNameSpace__ecere__com__Instance * this, struct __ecereNameSpace__ecere__com__Instance * listBox, int x, int y, unsigned int mods)
{
struct BreakpointsView * __ecerePointer_BreakpointsView = (struct BreakpointsView ... | false | false | false | false | false | 0 |
pv_get_timef(struct sip_msg *msg, pv_param_t *param,
pv_value_t *res)
{
time_t t;
str s;
if(msg==NULL)
return -1;
t = time(NULL);
s.s = ctime(&t);
s.len = strlen(s.s)-1;
return pv_get_strintval(msg, param, res, &s, (int)t);
} | false | false | false | false | false | 0 |
rename( pfs_name *name, pfs_name *newname ) {
int result;
hdfsFS fs = (hdfsFS)pfs_service_connect_cache(name);
HDFS_CHECK_INIT(-1)
HDFS_CHECK_FS(-1)
hdfs_dircache.invalidate();
debug(D_HDFS, "rename %s to %s", name->rest, newname->rest);
result = hdfs->rename(fs, name->rest, newname->rest);
pfs_... | false | false | false | false | false | 0 |
hasverb(int act,int *verbs)
{
int link,word,*verb;
/* get the list of verbs */
link = getafield(act,A_VERBS);
/* look for this verb */
while (link != NIL) {
verb = verbs;
word = getword(link+L_DATA);
while (*verb != NIL && word != NIL) {
if (*verb != getword(word+L_DATA))
break;
ver... | false | false | false | false | false | 0 |
calc_hash(VMG_ int depth) const
{
/* see what we have */
switch(typ)
{
case VM_NIL:
/* this is rather arbitrary */
return 0;
case VM_TRUE:
/* this is arbitrary, but at least make it different from nil */
return 1;
case VM_EMPTY:
... | false | false | false | false | false | 0 |
print_population(){
std::vector<Individual>::iterator iter;
std::cout << "----- generation number " << generation_number << " -------"<< std::endl;
float average_fitness = 0;
int cumulative_sum_fitness = 0;
int best_of_generation_fitness = 99999; //initialize this to be a bad fitness (this is a minimization prob... | false | false | false | false | false | 0 |
KGoldrunner_2()
{
kDebug() << "Entered constructor extension ...";
// Queue a call to the "initGame" method. This renders and paints the
// initial graphics, but only AFTER the initial main-window resize events
// have been seen and the final SVG scale is known.
QMetaObject::invokeMethod (game, "in... | false | false | false | false | false | 0 |
SendTimeUpdate(Player* owner)
{
uint32 duration = GetUInt32Value(ITEM_FIELD_DURATION);
if (!duration)
return;
WorldPacket data(SMSG_ITEM_TIME_UPDATE, (8 + 4));
data << ObjectGuid(GetObjectGuid());
data << uint32(duration);
owner->GetSession()->SendPacket(&data);
} | false | false | false | false | false | 0 |
ResolveIt(Pointer p, Synonym syn, G_Synset ss, int fanss)
{
Pointer ref /*, lastp*/;
if ( syn->ss == ss && p->fromwdnum == ALLWORDS) {
fprintf(logfile, "Self-referential pointer: %s in file %s, line %d\n",
PrintPointer(p),
filelist[ss->filenum].fname,
ss->lineno... | false | false | false | false | false | 0 |
renderNavBrackets(vec3d* nav_pos, vertex* nav_point, color* clr, char* string)
{
float dist;
int box_scale = 15;
int x, y;
x = int(nav_point->screen.xyw.x);
y = int(nav_point->screen.xyw.y);
// draw this nav bracket based on this gauge's base resolution
gr_set_screen_scale(base_w, base_h);
gr_unsize_screen_p... | false | false | false | false | false | 0 |
cm_stop_one(struct cm_context *context, const char *nickname)
{
int i;
i = cm_find_entry_by_nickname(context, nickname);
if (i != -1) {
talloc_free(context->events[i].next_event);
context->events[i].next_event = NULL;
cm_iterate_done(context->entries[i],
context->events[i].iterate_state);
context->events... | false | false | false | false | false | 0 |
rss_fetch_process(rss_feed_t *f, const char *str) {
int new_items = 0;
struct rss_channel_list *l;
rss_fetch_process_t *priv = xmalloc(sizeof(rss_fetch_process_t));
xmlnode_t *node;
XML_Parser parser = XML_ParserCreate(NULL);
XML_SetUserData(parser, (void*) priv);
XML_SetElementHandler(parser, (XML_StartElemen... | false | false | false | false | false | 0 |
choose_host() {
int retval;
char buf[256];
// terminology:
// "enum" is the result of one DB query (typically 100 hosts)
// "scan" is a set of enums covering the entire host table
//
while (1) {
if (!enum_active) {
sprintf(enum_query,
"where cpu_efficienc... | false | false | false | false | false | 0 |
ck_add_ugen_ctrl( Chuck_DL_Query * query, f_ctrl ugen_ctrl, f_cget ugen_cget,
const char * type, const char * name )
{
// make sure there is class
if( !query->curr_class )
{
// error
EM_error2( 0, "class import: add_ugen_func invoked without begin_class..."... | false | false | false | false | false | 0 |
onCmdPost(FXObject*,FXSelector,void*){
if(pane && !pane->shown()){
FXint x,y;
if(!current) current=dynamic_cast<FXOption*>(pane->getFirst());
if(!current) return 1;
translateCoordinatesTo(x,y,getRoot(),0,0);
pane->position(x,y,width,pane->getDefaultHeight());
y+=2-current->getY();
pane->po... | false | false | false | false | false | 0 |
gdict_source_loader_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
switch (prop_id)
{
case PROP_PATHS:
break;
case PROP_SOURCES:
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
... | false | false | false | false | false | 0 |
ff_region_offset2size(GranuleDef *g){
int i, k, j=0;
g->region_size[2] = (576 / 2);
for(i=0;i<3;i++) {
k = FFMIN(g->region_size[i], g->big_values);
g->region_size[i] = k - j;
j = k;
}
} | false | false | false | false | false | 0 |
GetPath(const BasicBlock *Src, const BasicBlock *Dest,
Path &P, unsigned Mode) {
const BasicBlock *BB = 0;
bool hasFoundPath = false;
std::queue<const BasicBlock *> BFS;
BFS.push(Src);
while(BFS.size() && !hasFoundPath) {
BB = BFS.front();
BFS.pop();
succ_const_iterator Succ = s... | false | false | false | false | false | 0 |
vt_disallocate(unsigned int vc_num)
{
struct vc_data *vc = NULL;
int ret = 0;
console_lock();
if (VT_BUSY(vc_num))
ret = -EBUSY;
else if (vc_num)
vc = vc_deallocate(vc_num);
console_unlock();
if (vc && vc_num >= MIN_NR_CONSOLES) {
tty_port_destroy(&vc->port);
kfree(vc);
}
return ret;
} | false | false | false | false | false | 0 |
all_group_types_in_list (char **group_types, GList *mime_types)
{
GList *l;
char **group_type;
char *mime_type;
gboolean found;
group_type = group_types;
while (*group_type != NULL) {
found = FALSE;
for (l = mime_types; l != NULL; l = l->next) {
mime_type = l->data;
if (strcmp (mime_type, *group_type... | false | false | false | false | false | 0 |
event_join(IRC_SERVER_REC *server, const char *data,
const char *nick, const char *address)
{
NETSPLIT_REC *rec;
if (nick == NULL)
return;
/* check if split is over */
rec = g_hash_table_lookup(server->splits, nick);
if (rec != NULL && g_strcasecmp(rec->address, address) == 0) {
/* yep, looks like ... | false | false | false | false | false | 0 |
GetLivingDroidBelowMouseCursor()
{
gps mouse_vpos, mouse_pos;
int RotationModel, RotationIndex;
struct image *our_image;
enemy *this_bot;
// no interaction with the game when the world is frozen
if (world_frozen())
return NULL;
mouse_vpos.x = translate_pixel_to_map_location((float)input_axis.x, (float)input_... | false | false | false | false | false | 0 |
ok_for_early_queue_removal (rtx insn)
{
if (targetm.sched.is_costly_dependence)
{
rtx prev_insn;
int n_cycles;
int i = scheduled_insns.length ();
for (n_cycles = flag_sched_stalled_insns_dep; n_cycles; n_cycles--)
{
while (i-- > 0)
{
int cost;
prev_insn = scheduled_... | false | false | false | false | false | 0 |
__dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req)
{
struct dwc3 *dwc = dep->dwc;
int ret;
req->request.actual = 0;
req->request.status = -EINPROGRESS;
req->direction = dep->direction;
req->epnum = dep->number;
trace_dwc3_ep_queue(req);
/*
* We only add to our list of requests now a... | false | false | false | false | false | 0 |
pulse_mode_cancel (void)
{
int err = errno; /* Function must preserve errno. */
struct itimerval it;
struct sigaction act;
/* Setting it_value to zero cancels the itimer. */
it.it_value.tv_sec = 0;
it.it_value.tv_usec = 0;
it.it_interval.tv_sec = 0;
it.it_interval.tv_usec = 0;
if (setit... | false | false | false | false | false | 0 |
plugin_get_shell_version (PluginObject *obj,
NPVariant *result)
{
GVariant *res;
const gchar *version;
gsize length;
gchar *buffer;
gboolean ret;
ret = TRUE;
res = g_dbus_proxy_get_cached_property (obj->proxy,
"ShellVersion");
i... | false | false | false | false | false | 0 |
set_trust(DBusConnection *conn, DBusMessage *msg,
gboolean value, void *data)
{
struct btd_device *device = data;
struct btd_adapter *adapter = device->adapter;
char srcaddr[18], dstaddr[18];
bdaddr_t src;
int err;
if (device->trusted == value)
return dbus_message_new_method_return(msg);
adapter_get_add... | false | false | false | false | false | 0 |
AcpiDbGetHistoryByIndex (
UINT32 CmdNum)
{
UINT32 i;
UINT16 HistoryIndex;
/* Search history buffer */
HistoryIndex = AcpiGbl_LoHistory;
for (i = 0; i < AcpiGbl_NumHistory; i++)
{
if (AcpiGbl_HistoryBuffer[HistoryIndex].CmdNum == C... | false | false | false | false | false | 0 |
probe_event_disable(struct trace_uprobe *tu, struct trace_event_file *file)
{
if (!trace_probe_is_enabled(&tu->tp))
return;
if (file) {
struct event_file_link *link;
link = find_event_file_link(&tu->tp, file);
if (!link)
return;
list_del_rcu(&link->list);
/* synchronize with u{,ret}probe_trace_func ... | false | false | false | false | false | 0 |
Curl_hash_alloc(int slots,
hash_function hfunc,
comp_function comparator,
curl_hash_dtor dtor)
{
struct curl_hash *h;
if(!slots || !hfunc || !comparator ||!dtor) {
return NULL; /* failure */
}
h = malloc(sizeof(struct curl_hash));
if(h) {
if(Curl_hash_... | false | false | false | false | false | 0 |
_width_equiv(unsigned long n, int *wn, unsigned long m, int *wm)
{
int npad, nmpad, mpad, mnpad;
if (*wn == *wm)
return 1;
npad = _zero_padded(n, *wn);
nmpad = _zero_padded(n, *wm);
mpad = _zero_padded(m, *wm);
mnpad = _zero_padded(m, *wn);
if ((npad != nmpad) && (mpad != mnpad))
return 0;
else if (npa... | false | false | false | false | false | 0 |
sample_move_d24_sS (char *dst, jack_default_audio_sample_t *src, unsigned long nsamples, unsigned long dst_skip, dither_state_t *state)
{
int32_t z;
while (nsamples--) {
float_24 (*src, z);
#if __BYTE_ORDER == __LITTLE_ENDIAN
memcpy (dst, &z, 3);
#elif __BYTE_ORDER == __BIG_ENDIAN
memcpy (dst, (char *)... | false | true | false | false | false | 1 |
text_color(GtkTreeView *treeview,
GwyGrainValue *gvalue,
GdkColor *color)
{
GtkStateType state;
gboolean good_units;
good_units = !gvalue || units_are_good(treeview, gvalue);
state = good_units ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE;
*color = GTK_WIDGET(treeview)->style->t... | false | false | false | false | false | 0 |
number_is_immediate(ivl_expr_t expr, unsigned lim_wid, int negative_ok_flag)
{
const char *bits;
unsigned nbits = ivl_expr_width(expr);
char pad_bit = '0';
unsigned idx;
/* We can only convert numbers to an immediate value. */
if (ivl_expr_type(expr) != IVL_EX_NUMBER
&& ivl_expr_type(... | 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.