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 |
|---|---|---|---|---|---|---|
computeDataLayout(const Triple &TT, StringRef CPU,
const TargetOptions &Options,
bool isLittle) {
std::string Ret = "";
MipsABIInfo ABI = MipsABIInfo::computeTargetABI(TT, CPU, Options.MCOptions);
// There are both little and big endian mi... | false | false | false | false | false | 0 |
legacy_dev_present(int mtd_num)
{
int ret;
struct proc_parse_info pi;
ret = proc_parse_start(&pi);
if (ret)
return -1;
while (proc_parse_next(&pi)) {
if (pi.mtd_num == mtd_num)
return 1;
}
return 0;
} | false | false | false | false | false | 0 |
EnvGetInstancePPForm(
void *theEnv,
char *buf,
unsigned buflen,
void *iptr)
{
char *pbuf = "***InstancePPForm***";
if (((INSTANCE_TYPE *) iptr)->garbage == 1)
return;
if (OpenStringDestination(theEnv,pbuf,buf,buflen+1) == 0)
return;
PrintInstance(theEnv,pbuf,(INSTANCE_TYPE *) iptr," ");... | false | false | false | false | false | 0 |
event_topic(IRC_SERVER_REC *server, const char *data,
const char *nick, const char *addr)
{
char *params, *channel, *topic, *mask;
g_return_if_fail(data != NULL);
params = event_get_params(data, 2, &channel, &topic);
mask = addr == NULL ? g_strdup(nick) :
g_strconcat(nick, "!", addr, NULL);
channel_change_t... | false | false | false | false | false | 0 |
XCmpToken(const char *s, const char **t)
{
register const char *w=*t;
if (w==NULL)
{
return 1;
}
if (s==NULL)
{
return -1;
}
while (*w && (*s==*w || toupper(*s)==toupper(*w)) )
{
s++;
w++;
}
if ((*s=='\0' && (ispunct(*w) || isspace(*w)))||
(*w=='\0' && (ispunct(*s) || isspace(*s))) )
{
ret... | false | false | false | false | false | 0 |
file_data_sc_check_ci(FileData *fd, FileDataChangeType type)
{
GList *work;
if (fd->parent) fd = fd->parent;
if (!fd->change || fd->change->type != type) return FALSE;
work = fd->sidecar_files;
while (work)
{
FileData *sfd = work->data;
if (!sfd->change || sfd->change->type != type) return FALSE;
wo... | false | false | false | false | false | 0 |
clip_line(g3s_point **p0,g3s_point **p1,ubyte codes_or)
{
int plane_flag;
g3s_point *old_p1;
//might have these left over
(*p0)->p3_flags &= ~(PF_UVS|PF_LS);
(*p1)->p3_flags &= ~(PF_UVS|PF_LS);
for (plane_flag=1;plane_flag<16;plane_flag<<=1)
if (codes_or & plane_flag) {
if ((*p0)->p3_codes & plane_flag)
... | false | false | false | false | false | 0 |
output(QTextStream& out, Database& database)
{
if(!database.isUtf8() && (m_outputType == Pgn))
{
QTextCodec* textCodec = QTextCodec::codecForName("ISO 8859-1");
if(textCodec)
{
out.setCodec(textCodec);
}
}
QString header = m_header;
postProcessOutput(head... | false | false | false | false | false | 0 |
read_diff(FileFd &f)
{
char buffer[BLOCK_SIZE];
bool cmdwanted = true;
Change ch(0);
while(f.ReadLine(buffer, sizeof(buffer)))
{
if (cmdwanted) {
char *m, *c;
size_t s, e;
s = strtol(buffer, &m, 10);
if (m == buffer) {
s = e = ch.offset + ch.add_cnt;
... | false | false | false | false | false | 0 |
s2255_start_acquire(struct s2255_vc *vc)
{
int res;
unsigned long chn_rev;
int j;
struct s2255_dev *dev = to_s2255_dev(vc->vdev.v4l2_dev);
__le32 *buffer = dev->cmdbuf;
mutex_lock(&dev->cmdlock);
chn_rev = G_chnmap[vc->idx];
vc->last_frame = -1;
vc->bad_payload = 0;
vc->cur_frame = 0;
for (j = 0; j < SYS_FR... | false | false | false | false | false | 0 |
EvaluateExpression(const std::string &expr, const std::map<std::string, std::string> &preprocessorDefinitions) {
// Break into tokens, replacing with definitions
std::string word;
std::vector<std::string> tokens;
const char *cp = expr.c_str();
for (;;) {
if (setWord.Contains(static_cast<unsigned char>(*cp))) {
... | false | false | false | false | false | 0 |
trace_module_notify(struct notifier_block *self,
unsigned long val, void *data)
{
struct module *mod = data;
switch (val) {
case MODULE_STATE_COMING:
trace_module_add_enums(mod);
break;
case MODULE_STATE_GOING:
trace_module_remove_enums(mod);
break;
}
return 0;
} | false | false | false | false | false | 0 |
gfs_client_statfs_request_multiplexed(struct gfarm_eventqueue *q,
struct gfs_connection *gfs_server, char *path,
void (*continuation)(void *), void *closure,
struct gfs_client_statfs_state **statepp)
{
gfarm_error_t e;
int rv;
struct gfs_client_statfs_state *state;
GFARM_MALLOC(state);
if (state == NULL) {
e... | false | false | false | false | false | 0 |
ReadFrom ( int iLen, int iTimeout )
{
if ( iLen<=0 || iLen>g_iMaxPacketSize || m_iSock<0 )
return false;
BYTE * pBuf = m_dMinibufer;
if ( iLen>NET_MINIBUFFER_SIZE )
{
if ( iLen>m_iMaxibuffer )
{
SafeDeleteArray ( m_pMaxibuffer );
m_pMaxibuffer = new BYTE [ iLen ];
m_iMaxibuffer = iLen;
}
pBuf = ... | false | false | false | false | false | 0 |
create(void)
{
DEBUG_MSG("DataPool::DataPool()\n");
DEBUG_MAKE_INDENT(3);
DataPool *pool=new DataPool();
GP<DataPool> retval=pool;
pool->init();
// If we maintain the data ourselves, we want to interpret its
// IFF structure to predict its length
pool->add_trigger(0, 32, static_trigger_cb, poo... | false | false | false | false | false | 0 |
DtsGetDilShMem(uint32_t shmid)
{
bc_dil_glob_ptr=(bc_dil_glob_s *)shmat(shmid,(void *)0,0);
if((long)bc_dil_glob_ptr==-1) {
DebugLog_Trace(LDIL_DBG,"Unable to open shared memory ...\n");
return BC_STS_ERROR;
}
return BC_STS_SUCCESS;
} | false | false | false | false | false | 0 |
buildColorString(const ED4_sequence_terminal *seq_terminal, int start, int end)
// builds a char buffer (access is only valid from result[start] till result[end])
{
int i;
int st_shown = 0;
e4_assert(start<=end); //confirming the condition
for (i=0; i<SEARCH_PATTERNS; i++) {
... | false | false | false | false | false | 0 |
hif_usb_send_mgmt(struct hif_device_usb *hif_dev,
struct sk_buff *skb)
{
struct urb *urb;
struct cmd_buf *cmd;
int ret = 0;
__le16 *hdr;
urb = usb_alloc_urb(0, GFP_ATOMIC);
if (urb == NULL)
return -ENOMEM;
cmd = kzalloc(sizeof(*cmd), GFP_ATOMIC);
if (cmd == NULL) {
usb_free_urb(urb);
return -ENO... | false | false | false | false | false | 0 |
GMT_logy_grid (double w, double e, double s, double n, double dval)
{
GMT_LONG i, ny;
double *y = NULL;
ny = GMT_log_array (s, n, dval, &y);
for (i = 0; i < ny; i++) GMT_geosegment (w, y[i], e, y[i]);
if (ny) GMT_free ((void *)y);
} | false | false | false | false | false | 0 |
s5k4ecgx_s_power(struct v4l2_subdev *sd, int on)
{
struct s5k4ecgx *priv = to_s5k4ecgx(sd);
int ret;
v4l2_dbg(1, debug, sd, "Switching %s\n", on ? "on" : "off");
if (on) {
ret = __s5k4ecgx_power_on(priv);
if (ret < 0)
return ret;
/* Time to stabilize sensor */
msleep(100);
ret = s5k4ecgx_init_sensor(... | false | false | false | false | false | 0 |
deque_traverse(dequeobject *deque, visitproc visit, void *arg)
{
block *b;
PyObject *item;
Py_ssize_t index;
Py_ssize_t indexlo = deque->leftindex;
for (b = deque->leftblock; b != deque->rightblock; b = b->rightlink) {
for (index = indexlo; index < BLOCKLEN ; index++) {
item = b... | false | false | false | false | false | 0 |
array_make(const char *string, const char *sep, int max, int trim, int quotes)
{
const char *p, *q;
char **result = NULL;
int items = 0, last = 0;
if (!string || !sep)
return xcalloc(1, sizeof(char*));
for (p = string; ; ) {
int len = 0;
char *token = NULL;
if (max && items >= max - 1)
last = 1;
... | false | false | false | false | false | 0 |
setAntennas(std::vector<std::string> &antennas)
{
ui->antSelector->clear();
for (std::vector<std::string>::iterator it = antennas.begin(); it != antennas.end(); ++it)
{
ui->antSelector->addItem(QString(it->c_str()));
}
} | false | false | false | false | false | 0 |
set_commodity_value(xmlNodePtr node, gnc_commodity* com)
{
if (g_strcmp0((char*) node->name, cmdty_fraction) == 0)
{
gint64 val;
char *string;
string = (char*) xmlNodeGetContent (node->xmlChildrenNode);
if (string_to_gint64(string, &val))
{
gnc_commodity_set_... | false | false | false | false | false | 0 |
mag_g_print(const mag_t *g)
{
int i;
kstring_t out;
out.l = out.m = 0; out.s = 0;
for (i = 0; i < g->v.n; ++i) {
if (g->v.a[i].len < 0) continue;
mag_v_write(&g->v.a[i], &out);
fwrite(out.s, 1, out.l, stdout);
}
free(out.s);
fflush(stdout);
} | false | true | false | false | false | 1 |
accregdb_fromstr(const char *str, struct accreg *reg)
{
int j, v, n;
char buf[256];
const char *p = str;
nullpo_retr(1, reg);
if( sscanf(p, "%d\t%n", ®->account_id, &n) != 1 || reg->account_id <= 0 )
return 1;
for(j = 0, p += n; j < ACCOUNT_REG_NUM; j++, p += n) {
if( sscanf(p,"%255[^,],%d%n",buf,&v,&n)... | false | false | false | false | false | 0 |
display_encode_color_device8(gx_device * dev, const gx_color_value cv[])
{
/* palette of 96 colors */
/* 0->63 = 00RRGGBB, 64->95 = 010YYYYY */
gx_color_value r = cv[0];
gx_color_value g = cv[1];
gx_color_value b = cv[2];
gx_color_value k = cv[3]; /* 0 = black */
if ((r == 0) && (g == 0) && ... | false | false | false | false | false | 0 |
addItem( QString label )
{
label = label.toLower();
QTreeWidgetItem *entry = new QTreeWidgetItem;
entry->setText( 0, label );
entry->setText( 1, label.toLower() );
// I couldn't make it sort properly otherwise, even the QVariant methods wouldn't work!
entry->setText( 2, QString::number( 10 ... | false | false | false | false | false | 0 |
__syncbarrier_wake (struct syncbarrier *barrier)
{
struct synctask *task = NULL;
if (!barrier) {
errno = EINVAL;
return -1;
}
barrier->count++;
pthread_cond_signal (&barrier->cond);
if (!list_empty (&barrier->waitq)) {
task = list_entry (barrier->waitq.next, struct synctask, waitq);
list_... | false | false | false | false | false | 0 |
OutputDeferredMols(OBConversion* pConv)
{
std::map<std::string, OBMol*>::iterator itr, lastitr;
bool ret=false;
int i=1;
lastitr = IMols.end();
--lastitr;
pConv->SetOneObjectOnly(false);
for(itr=IMols.begin();itr!=IMols.end();++itr,++i)
{
if(!(itr->second)->DoTransformations(... | false | false | false | false | false | 0 |
main(int argc, char * const argv[])
{
int retval = 0;
int convert = 0; /* convert to given type */
int remove = 0; /* remove or not */
int keep_going = 0; /* Break on first error, or keep going? */
char *newpath = NULL; /* insert this path */
int opt;
#ifdef HAVE_GETOPT_LONG
int option_index ... | false | false | false | false | false | 0 |
init(void* args)
{
if (!readStandardLists()) { //always
return DGCS_ERROR; //include
} // these
return DGCS_OK;
} | false | false | false | false | false | 0 |
array_redraw(t_array *a, t_glist *glist)
{
while (a->a_gp.gp_stub->gs_which == GP_ARRAY)
a = a->a_gp.gp_stub->gs_un.gs_array;
scalar_redraw(a->a_gp.gp_un.gp_scalar, glist);
} | false | false | false | false | false | 0 |
listenForIncomingConnectionsNoFork(rfbClient* client, int timeout)
{
fd_set fds;
struct timeval to;
int r;
to.tv_sec= timeout / 1000000;
to.tv_usec= timeout % 1000000;
client->listenSpecified = TRUE;
if (client->listenSock < 0)
{
client->listenSock = ListenAtTcpPort(client->listenPort);
... | false | false | false | false | false | 0 |
e1000_copper_link_rtl_setup(struct e1000_hw *hw)
{
s32 ret_val;
/* SW reset the PHY so all changes take effect */
ret_val = e1000_phy_reset(hw);
if (ret_val) {
e_dbg("Error Resetting the PHY\n");
return ret_val;
}
return E1000_SUCCESS;
} | false | false | false | false | false | 0 |
multiline_strip_tabs(char *text)
{
if (char_to_strip)
for (; *text && char_to_strip(*text); text++)
;
return text;
} | false | false | false | false | false | 0 |
dbg_chk_lpt_sz(struct ubifs_info *c, int action, int len)
{
struct ubifs_debug_info *d = c->dbg;
long long chk_lpt_sz, lpt_sz;
int err = 0;
if (!dbg_is_chk_lprops(c))
return 0;
switch (action) {
case 0:
d->chk_lpt_sz = 0;
d->chk_lpt_sz2 = 0;
d->chk_lpt_lebs = 0;
d->chk_lpt_wastage = 0;
if (c->dirty_... | false | false | false | false | false | 0 |
flags(const QModelIndex & index) const
{
Qt::ItemFlags flags = QStandardItemModel::flags(index);
if (!index.isValid())
return flags;
QString value = index.data(Qt::UserRole).toString();
if(value == "header")
{
flags &= ~Qt::ItemIsSelectable;
flags &= ~Qt::ItemIsEnabled;
}
return flags;
} | false | false | false | false | false | 0 |
__set_channels (GstCaps * caps, gint channels)
{
GstStructure *s;
gint i, size;
size = gst_caps_get_size (caps);
for (i = 0; i < size; i++) {
s = gst_caps_get_structure (caps, i);
if (channels > 0)
gst_structure_set (s, "channels", G_TYPE_INT, channels, NULL);
else
gst_structure_set (s,... | false | false | false | false | false | 0 |
opseg(x86_insn_op *op, const char *xop)
{
for (int i=0; i<8; i++) {
if (x86_segs[i] && strcmp(xop, x86_segs[i])==0) {
op->type = X86_OPTYPE_SEG;
op->size = 2;
op->seg = i;
return true;
}
}
return false;
} | false | false | false | false | false | 0 |
mailimf_mailbox_list_add_mb(struct mailimf_mailbox_list * mailbox_list,
char * display_name, char * address)
{
int r;
struct mailimf_mailbox * mb;
int res;
mb = mailimf_mailbox_new(display_name, address);
if (mb == NULL) {
res = MAILIMF_ERROR_MEMORY;
goto err;
}
r = mailimf_mailbox_list_ad... | false | false | false | false | false | 0 |
SerializePrettyRDFSchema ( const XMP_VarString & treeName,
const XMP_Node * schemaNode,
XMP_VarString & outputStr,
XMP_OptionBits options,
XMP_StringPtr newline,
XMP_StringPtr indentStr,
XMP_Index baseIndent )
{
XMP_Assert ( schemaNode->options & kXMP_... | false | false | false | false | false | 0 |
infeasibility(const OsiBranchingInformation * /*info*/,
int &preferredWay) const
{
int numberUnsatis = 0, numberFree = 0;
int j;
const int * integer = model_->integerVariable();
OsiSolverInterface * solver = model_->solver();
const double * solution = model_->testSolution();... | false | false | false | false | false | 0 |
usb_ep_autoconfig_ss(
struct usb_gadget *gadget,
struct usb_endpoint_descriptor *desc,
struct usb_ss_ep_comp_descriptor *ep_comp
)
{
struct usb_ep *ep;
u8 type;
type = desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK;
if (gadget->ops->match_ep) {
ep = gadget->ops->match_ep(gadget, desc, ep_comp);
if (ep)
... | false | false | false | false | false | 0 |
PyvtkBox_IntersectBox(PyObject *, PyObject *args)
{
vtkPythonArgs ap(args, "IntersectBox");
double temp0[6];
double save0[6];
const int size0 = 6;
double temp1[3];
double save1[3];
const int size1 = 3;
double temp2[3];
double save2[3];
const int size2 = 3;
double temp3[3];
double save3[3];
co... | false | false | false | false | false | 0 |
utf_16_le_encode(PyObject *self,
PyObject *args)
{
PyObject *str, *v;
const char *errors = NULL;
if (!PyArg_ParseTuple(args, "O|z:utf_16_le_encode",
&str, &errors))
return NULL;
str = PyUnicode_FromObject(str);
if (str == NULL)
return NULL... | false | false | false | false | false | 0 |
t1_hinter__drop_hints(t1_hinter * self)
{ if (self->disable_hinting)
return 0;
if (self->primary_hint_count == -1)
self->primary_hint_count = self->hint_range_count;
return t1_hinter__hint_mask(self, NULL);
} | false | false | false | false | false | 0 |
__ecereMethod___ecereNameSpace__ecere__gui__controls__EditBox_OnActivate(struct __ecereNameSpace__ecere__com__Instance * this, unsigned int active, struct __ecereNameSpace__ecere__com__Instance * previous, unsigned int * goOnWithActivation, unsigned int direct)
{
struct __ecereNameSpace__ecere__gui__controls__EditBox *... | false | false | false | true | false | 1 |
cm_tophits_CreateNextHit(CM_TOPHITS *h, CM_HIT **ret_hit)
{
CM_HIT *hit = NULL;
int status;
if ((status = cm_tophits_Grow(h)) != eslOK) goto ERROR;
hit = &(h->unsrt[h->N]);
h->N++;
if (h->N >= 2) {
h->is_sorted_by_evalue = FALSE;
h->is_sorted_for_overlap_removal = FALSE;
h->is... | false | false | false | false | false | 0 |
ConvertLibraries(CompileTargetBase* object)
{
wxArrayString linkerOpts = object->GetLinkerOptions();
wxArrayString linkLibs = object->GetLinkLibs();
wxString compilerId = object->GetCompilerID();
Compiler* compiler = CompilerFactory::GetCompiler(compilerId);
if (!compiler)
return;
wxStr... | false | false | false | false | false | 0 |
load_reduce(Unpicklerobject *self)
{
PyObject *callable = 0, *arg_tup = 0, *ob = 0;
PDATA_POP(self->stack, arg_tup);
if (! arg_tup) return -1;
PDATA_POP(self->stack, callable);
if (callable) {
ob = Instance_New(callable, arg_tup);
Py_DECREF(callable);
}
Py_DECREF(arg_tup);
... | false | false | false | false | false | 0 |
reply_ptrop(const struct spdet *priv, const classcode_t classcode, const slotno_t slotno, const ULONG seq, const ULONG flags, const ULONG op)
{
const struct spptr *pp;
unsigned reqflag;
int mustberun;
switch (op) {
default:
return XT_UNKNOWN_COMMAND;
case SO_DELP:
reqflag = PV_ADDDEL;
mustberun = 0... | false | false | false | false | false | 0 |
lgdt3306a_read_signal_strength(struct dvb_frontend *fe,
u16 *strength)
{
/*
* Calculate some sort of "strength" from SNR
*/
struct lgdt3306a_state *state = fe->demodulator_priv;
u16 snr; /* snr_x10 */
int ret;
u32 ref_snr; /* snr*100 */
u32 str;
*strength = 0;
switch (state->current_modulation) {
c... | false | false | false | false | false | 0 |
ironlake_do_reset(struct drm_device *dev, unsigned engine_mask)
{
struct drm_i915_private *dev_priv = dev->dev_private;
int ret;
I915_WRITE(ILK_GDSR,
ILK_GRDOM_RENDER | ILK_GRDOM_RESET_ENABLE);
ret = wait_for((I915_READ(ILK_GDSR) &
ILK_GRDOM_RESET_ENABLE) == 0, 500);
if (ret)
return ret;
I915_WRITE(IL... | false | false | false | false | false | 0 |
s48_integer_or_floanum_LE(long x_739X, long y_740X)
{
char b_741X;
{ if ((3 == (3 & x_739X))) {
if ((18 == (31 & ((((*((long *) ((((char *) (-3 + x_739X))) + -8))))>>2))))) {
if (((*((double *) (((char *) (-3 + y_740X))))) < (*((double *) (((char *) (-3 + x_739X))))))) {
return 1;}
else {
... | false | false | false | false | false | 0 |
fsbe_write_pe_statement(cx, sp)
fsbe_context *cx;
Pe_statement *sp;
{
Statement *p;
fsbe_begin_pe_statement(cx, sp);
for (p = sp->stm_head; p; p = p->next)
if (!fsbe_write_pe_statement_item_hook(cx, sp, p)) {
FSBE_HOOKDECL(int
fsbe_write_pe_statement_item_hook(cx, sp, p)
fsbe_context *cx;
... | false | false | false | false | false | 0 |
zend_do_delayed_early_binding(const zend_op_array *op_array TSRMLS_DC) /* {{{ */
{
if (op_array->early_binding != -1) {
zend_bool orig_in_compilation = CG(in_compilation);
zend_uint opline_num = op_array->early_binding;
zend_class_entry **pce;
CG(in_compilation) = 1;
while (opline_num != -1) {
if (zend_l... | false | false | false | false | false | 0 |
parser_read_token(ParserState *st) {
char ch = st->ch;
/* consume whitespace and comments */
int comment_nesting = 0;
while (!feof(st->file) && (ch == ' ' || ch == '\t' || ch == '\n'
|| comment_nesting > 0 || ch == PARSER_COMMENT_BEGIN
|| (comment_nesting >= 0 && ch == PARSER_COMM... | false | false | false | false | false | 0 |
SetRemoteContent_w(const MediaContentDescription* content,
ContentAction action) {
ASSERT(worker_thread() == talk_base::Thread::Current());
LOG(LS_INFO) << "Setting remote voice description";
const AudioContentDescription* audio =
static_cast<const AudioContentDescript... | false | false | false | false | false | 0 |
cin_islabel(ind_maxcomment) /* XXX */
int ind_maxcomment;
{
char_u *s;
s = cin_skipcomment(ml_get_curline());
/*
* Exclude "default" from labels, since it should be indented
* like a switch label. Same for C++ scope declarations.
*/
if (cin_isdefault(s))
return FALSE;
if (ci... | false | false | false | false | false | 0 |
gst_multi_socket_sink_timeout (GstMultiSocketSink * sink)
{
GstClockTime now;
GTimeVal nowtv;
GList *clients;
GstMultiHandleSink *mhsink = GST_MULTI_HANDLE_SINK (sink);
g_get_current_time (&nowtv);
now = GST_TIMEVAL_TO_TIME (nowtv);
CLIENTS_LOCK (mhsink);
for (clients = mhsink->clients; clients; clien... | false | false | false | false | false | 0 |
ipCidrRouteTable_index_to_oid(netsnmp_index * oid_idx,
ipCidrRouteTable_mib_index * mib_idx)
{
int err = SNMP_ERR_NOERROR;
/*
* temp storage for parsing indexes
*/
/*
* ipCidrRouteDest(1)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h
*/
... | false | false | false | false | false | 0 |
iot_xattrop (call_frame_t *frame, xlator_t *this, loc_t *loc,
gf_xattrop_flags_t optype, dict_t *xattr)
{
call_stub_t *stub = NULL;
int ret = -1;
stub = fop_xattrop_stub (frame, iot_xattrop_wrapper, loc, optype,
xattr);
... | false | false | false | false | false | 0 |
parse_dirlist(const char*, const char* arg, Dir_list* retval)
{
retval->push_back(Search_directory(arg, false));
} | false | false | false | false | false | 0 |
query_data_info_ready_cb (GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
QueryInfoData *query_data = user_data;
GError *error = NULL;
GFileInfo *info;
info = g_file_query_info_finish ((GFile *) source_object, result, &err... | false | false | false | false | false | 0 |
get_document_element()
{
CL_DomNode cur(impl->first_child);
while (!cur.is_null())
{
if (cur.is_element()) return cur.to_element();
cur = cur.get_next_sibling();
}
return CL_DomElement();
} | false | false | false | false | false | 0 |
finalize_round( ServerGame *game )
{
/* update stats */
game_update_stats( 0, &game->stats[0] );
game_update_stats( 1, &game->stats[1] );
/* finalize */
game_finalize( game->game );
/* tell clients that round is over */
if ( game->cur_round == game->rounds-1 )
msgbuf[0] = MSG_LAST_ROUND_OVER;
else
msgbuf... | false | false | false | false | false | 0 |
check_first_field (const char *line, csvdata *c, PRN *prn)
{
if (c->delim != ' ' && *line == c->delim) {
csv_set_blank_column(c);
} else {
char field1[OBSLEN];
int i = 0;
if (c->delim == ' ' && *line == ' ') line++;
while (*line && i < sizeof field1) {
if (*line == c->delim) break;
field1[i++] ... | true | true | false | false | false | 1 |
RPC_EnumRegisteredKeys2_TP(struct host_table_entry *hte,
TSS_UUID * pKeyUUID, /* in */
UINT32 * pcKeyHierarchySize, /* out */
TSS_KM_KEYINFO2 ** ppKeyHierarchy /* out */
)
{
TSS_RESULT result;
int i, j;
initData(&hte->comm, 2);
hte->comm.hdr.u.ordinal = TCSD_ORD_ENUMREGISTEREDK... | false | false | false | false | false | 0 |
Use()
{
assert("pre: context_is_set" && this->Context!=0);
assert("pre: current_context_matches" && this->Context->IsCurrent());
this->Build();
// We need to know if this call happens in a display list or not because
// glGetIntegerv(vtkgl::CURRENT_PROGRAM,&value) is executed immediately
// while vtkgl::Us... | false | false | false | false | false | 0 |
save_to_file(VMG_ class CVmFile *fp)
{
vm_lookup_ext *ext = get_ext();
uint i;
vm_lookup_val **bp;
vm_lookup_val *val;
/* write our bucket count, value count, and first-free index */
fp->write_int2(ext->bucket_cnt);
fp->write_int2(ext->value_cnt);
fp->write_int2(ext->val_to_im... | false | false | false | false | true | 1 |
Reverse ()
{
map<Atom*, ChainElt>::iterator i, end = m_Bonds.end ();
Bond* pBond;
for (i = m_Bonds.begin (); i != end; i++) {
pBond = (*i).second.fwd;
(*i).second.fwd = (*i).second.rev;
(*i).second.rev = pBond;
}
} | false | false | false | false | false | 0 |
SWIG_FromCharPtr(const char *cptr)
{
return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
} | false | false | false | false | false | 0 |
updateShadowVolumes()
{
const u32 oldIndexCount = IndexCount;
const u32 oldVertexCount = VertexCount;
VertexCount = 0;
IndexCount = 0;
ShadowVolumesUsed = 0;
const IMesh* const mesh = ShadowMesh;
if (!mesh)
return;
// calculate total amount of vertices and indices
u32 i;
u32 totalVertice... | false | false | false | false | false | 0 |
mh_store_get_folder_info_sync (CamelStore *store,
const gchar *top,
CamelStoreGetFolderInfoFlags flags,
GCancellable *cancellable,
GError **error)
{
CamelLocalSettings *local_settings;
CamelServ... | false | false | false | false | false | 0 |
rx_eth(struct adapter *adap, struct sge_rspq *rq,
struct sk_buff *skb, int pad, int lro)
{
struct cpl_rx_pkt *p = (struct cpl_rx_pkt *)(skb->data + pad);
struct sge_qset *qs = rspq_to_qset(rq);
struct port_info *pi;
skb_pull(skb, sizeof(*p) + pad);
skb->protocol = eth_type_trans(skb, adap->port[p->iff]);
pi... | false | false | false | false | false | 0 |
deinit()
{
if( sprite_id && cur_x >= 0 )
{
sprite_info->free_bitmap_res();
sprite_id = 0;
}
} | false | false | false | false | false | 0 |
bq25890_handle_state_change(struct bq25890_device *bq,
struct bq25890_state *new_state)
{
int ret;
struct bq25890_state old_state;
mutex_lock(&bq->lock);
old_state = bq->state;
mutex_unlock(&bq->lock);
if (!new_state->online) { /* power removed */
/* disable ADC */
ret = bq25890_field_write(bq, ... | false | false | false | false | false | 0 |
ClearAttrCache()
{
if ( m_cacheAttrType != -1 )
{
m_cacheAttr.Destroy();
m_cacheAttrCoords = wxNullSheetCoords;
m_cacheAttrType = -1;
}
} | false | false | false | false | false | 0 |
dictkeys_contains(dictviewobject *dv, PyObject *obj)
{
if (dv->dv_dict == NULL)
return 0;
return PyDict_Contains((PyObject *)dv->dv_dict, obj);
} | false | false | false | false | false | 0 |
cond_write_node(struct policydb *p, struct cond_node *node,
struct policy_file *fp)
{
struct cond_expr *cur_expr;
__le32 buf[2];
int rc;
u32 len = 0;
buf[0] = cpu_to_le32(node->cur_state);
rc = put_entry(buf, sizeof(u32), 1, fp);
if (rc)
return rc;
for (cur_expr = node->expr; cur_expr != NULL; cur_exp... | false | false | false | false | false | 0 |
vcard_unescape_qp( gchar *value ) {
gchar *res = NULL;
gint len;
if (value == NULL)
return NULL;
len = strlen(value);
res = g_malloc(len);
qp_decode_const(res, len-1, value);
if (!g_utf8_validate(res, -1, NULL)) {
gchar *mybuf = g_malloc(strlen(res)*2 +1);
conv_localetodisp(mybuf, strlen(res)*2 +1, res)... | false | false | false | false | false | 0 |
setup_cube_rollout(evalsetup * pes, moverecord * pmr,
float aarOutput[][NUM_ROLLOUT_OUTPUTS], float aarStdDev[][NUM_ROLLOUT_OUTPUTS])
{
if (pes->et != EVAL_ROLLOUT) {
pes->rc = rcRollout;
pes->rc.nGamesDone = 0;
} else {
pes->rc.nTrials = rcRollout.nTrials;
pes... | false | false | false | false | false | 0 |
dht_complete_bootstrap(bool complete)
{
struct bootstrap *b;
struct kbucket *ours;
ours = dht_find_bucket(our_kuid);
g_assert(ours->depth);
WALLOC(b);
b->current = ours->prefix; /* Struct copy */
b->bits = ours->depth;
b->complete = complete; /* Did we look up our KUID successfully?*/
gnet_prop_set_guin... | false | false | false | false | false | 0 |
fuse_fs_fgetattr(struct fuse_fs *fs, const char *path, struct stat *buf,
struct fuse_file_info *fi)
{
fuse_get_context()->private_data = fs->user_data;
if (fs->op.fgetattr) {
if (fs->debug)
fprintf(stderr, "fgetattr[%llu] %s\n",
(unsigned long long) fi->fh, path);
return fs->op.fgetattr(path, buf, ... | false | false | false | false | false | 0 |
butterfly_open(PROGRAMMER * pgm, char * port)
{
strcpy(pgm->port, port);
/*
* If baudrate was not specified use 19200 Baud
*/
if(pgm->baudrate == 0) {
pgm->baudrate = 19200;
}
if (serial_open(port, pgm->baudrate, &pgm->fd)==-1) {
return -1;
}
/*
* drain any extraneous input
*/
butt... | false | true | false | false | false | 1 |
lpsolve_file_save (GOFileSaver const *fs, GOIOContext *io_context,
WorkbookView const *wb_view, GsfOutput *output)
{
Sheet *sheet = wb_view_cur_sheet (wb_view);
GError *err = NULL;
GString *prg;
GnmLocale *locale;
GnmSubSolver *ssol = g_object_get_data (G_OBJECT (fs), "solver");
go_io_progress_message (io_c... | false | false | false | false | false | 0 |
e100_rx_alloc_skb(struct nic *nic, struct rx *rx)
{
if (!(rx->skb = netdev_alloc_skb_ip_align(nic->netdev, RFD_BUF_LEN)))
return -ENOMEM;
/* Init, and map the RFD. */
skb_copy_to_linear_data(rx->skb, &nic->blank_rfd, sizeof(struct rfd));
rx->dma_addr = pci_map_single(nic->pdev, rx->skb->data,
RFD_BUF_LEN, PCI_... | false | false | false | false | false | 0 |
CompressTo88(ILimage *Image)
{
ILimage *TempImage;
ILubyte *Data;
ILuint i, j;
if ((Image->Type != IL_UNSIGNED_BYTE && Image->Type != IL_BYTE) || Image->Format == IL_COLOUR_INDEX) {
TempImage = iConvertImage(iCurImage, IL_BGR, IL_UNSIGNED_BYTE); // @TODO: Needs to be BGRA.
if (TempImage == NULL)
return ... | false | false | false | false | false | 0 |
supervisorSOCTableLookup(float vBat) {
float soc;
int i;
i = 0;
while (i < SUPERVISOR_SOC_TABLE_SIZE+1 && supervisorData.socTable[i] < vBat) {
i++;
}
soc = (float)i * (100.0f / SUPERVISOR_SOC_TABLE_SIZE);
if (i > 0 && supervisorData.socTable[i] > vBat) {
float a, b;
a = supervisorData.socTable[i];
b ... | false | false | false | false | false | 0 |
gcr_key_renderer_set_property (GObject *obj, guint prop_id, const GValue *value,
GParamSpec *pspec)
{
GcrKeyRenderer *self = GCR_KEY_RENDERER (obj);
switch (prop_id) {
case PROP_LABEL:
g_free (self->pv->label);
self->pv->label = g_value_dup_string (value);
g_object_notify (obj, ... | false | false | false | false | false | 0 |
show_dmi_oem_strings(int argc __unused, char **argv __unused,
struct s_hardware *hardware)
{
reset_more_printf();
if (strlen(hardware->dmi.oem_strings))
more_printf("OEM Strings\n%s", hardware->dmi.oem_strings);
} | false | false | false | false | false | 0 |
pReplacement(float value){
if(value == pRepl) return pRepl;
if(value <= 0 || value > 1){
GAErr(GA_LOC, className(), "pReplacement", gaErrBadPRepl);
params.set(gaNpReplacement, pRepl); // force it back
return pRepl;
}
params.set(gaNpReplacement, (double)value);
pRepl = value;
float n = ((value*... | false | false | false | false | false | 0 |
email_populate (EContact *contact,
gchar **values)
{
gint i;
for (i = 0; values[i] && i < 4; i++)
e_contact_set (contact, email_ids[i], values[i]);
} | false | false | false | false | false | 0 |
sockget(struct fetchdef *fdef, struct osrel *osrel, struct sockstat *ss)
{
FILE *fp;
char linebuf[1024];
char itsname[32], notused[64];
count_t nowuse, maxuse;
memset(ss, 0, sizeof(struct sockstat));
if ( (fp = fopen("/proc/net/sockstat", "r")) != NULL)
{
while ( fgets(linebuf, sizeof(linebuf), fp) != NULL)... | true | true | true | false | true | 1 |
coerce_enclosed (NODE_T * p, SOID_T * q)
{
if (IS (p, ENCLOSED_CLAUSE)) {
coerce_enclosed (SUB (p), q);
} else if (IS (p, CLOSED_CLAUSE)) {
coerce_closed (SUB (p), q);
} else if (IS (p, COLLATERAL_CLAUSE)) {
coerce_collateral (SUB (p), q);
} else if (IS (p, PARALLEL_CLAUSE)) {
coerce_collateral ... | false | false | false | false | false | 0 |
clipboard_filter(const SDL_Event *event)
{
/* Post all non-window manager specific events */
if ( event->type != SDL_SYSWMEVENT ) {
return 1;
}
/* Handle window-manager specific clipboard events */
switch (event->syswm.msg->event.xevent.type) {
/* Copy the selection from XA_CUT_BUFFER0 to the requested proper... | false | false | false | false | false | 0 |
gcov_seq_start(struct seq_file *seq, loff_t *pos)
{
loff_t i;
gcov_iter_start(seq->private);
for (i = 0; i < *pos; i++) {
if (gcov_iter_next(seq->private))
return NULL;
}
return seq->private;
} | false | false | false | false | false | 0 |
frame_create() {
gint32 i;
/* search the first free frame */
for(i = 1 ; i < MAX_FRAME ; i++) {
if( !engine->active_frame[i] ) {
frame[i] = g_malloc0( sizeof(_frame) );
frame_reset(i);
engine->active_frame[i] = 1;
frame[i]->compute = 1;
set_lastframe();
#if ENG_DEBUG
fprintf(stdout, "New F... | false | false | false | false | false | 0 |
process_receive_queue()
{
if( !process_queue_flag ) // avoid sys.yield()
return;
int processFlag;
int loopCount=0;
disable_poll_msg();
RemoteQueue &rq = receive_queue[0];
RemoteQueueTraverse rqt(rq);
if( !rq.validate_queue() )
err.run( "Queue corrupted, Remote::process_receive_queue()" );
//---- if ... | false | false | false | false | true | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.