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 |
|---|---|---|---|---|---|---|
get_file_text(const char *suggested_name, char *path, size_t len)
{
char buf[160];
/* Get filename */
my_strcpy(buf, suggested_name, sizeof buf);
if (!get_string("File name: ", buf, sizeof buf)) return FALSE;
/* Make sure it's actually a filename */
if (buf[0] == '\0' || buf[0] == ' ') return FALSE;
/* Build ... | true | true | false | false | false | 1 |
updateStatusNames()
{
QString msg;
if (!(mDoc->gameStatus()==KGame::Run))
msg=i18n("No game ");
else if (mDoc->getCurrentPlayer()==Yellow)
msg=i18n(" %1 - %2 ", mDoc->getName(Yellow), mTheme->colorNamePlayer(0));
else if (mDoc->getCurrentPlayer())
msg=i18n(" %1 - %2 ", mDoc->getName(Red), mTheme->c... | false | false | false | false | false | 0 |
SelectPh(int index)
{//=====================================
// A phoneme has been selected
PHONEME_LIST *p;
const char *emphasized;
int y1, y2;
int ix;
const char *name = "?";
char buf[120];
if(index < 0) return;
p = &phlist[index];
if((p == NULL) || (p->ph == NULL)) return;
emphasized = "";
if(p->stres... | false | false | false | false | false | 0 |
xmlSecIORegisterDefaultCallbacks(void) {
int ret;
#ifdef LIBXML_HTTP_ENABLED
ret = xmlSecIORegisterCallbacks(xmlIOHTTPMatch, xmlIOHTTPOpen,
xmlIOHTTPRead, xmlIOHTTPClose);
if(ret < 0) {
xmlSecError(XMLSEC_ERRORS_HERE,
NULL,
"xmlSecIORegisterCallbacks",
XMLSEC_E... | false | false | false | false | false | 0 |
getLoop(const plString& key) const {
loop_t::const_iterator f = fLoops.find(key);
if (f == fLoops.end())
throw hsOutOfBoundsException(__FILE__, __LINE__);
return f->second;
} | false | false | false | false | false | 0 |
il4965_store_debug_level(struct device *d, struct device_attribute *attr,
const char *buf, size_t count)
{
struct il_priv *il = dev_get_drvdata(d);
unsigned long val;
int ret;
ret = kstrtoul(buf, 0, &val);
if (ret)
IL_ERR("%s is not in hex or decimal form.\n", buf);
else
il->debug_level = val;
return s... | false | false | false | false | false | 0 |
resign_worker(int workerId)
{
err_when( !worker_array ); // this function shouldn't be called if this firm does not need worker
err_when( workerId<1 || workerId>worker_count );
//------- decrease worker no. and create an unit -----//
Worker* workerPtr = worker_array+workerId-1;
int unitRecno = 0;
if( wor... | false | false | false | false | true | 1 |
add_stat(struct stat_sdb_t *sdb, /* stat database */
struct stat_stat_t *stat) /* stat variable */
{
struct stat_stat_t *elt, *prev;
/* append at end of stat database list */
for (prev=NULL, elt=sdb->stats; elt != NULL; prev=elt, elt=elt->next)
/* nada */;
/* append stat to stats chain */
if (prev != ... | false | false | false | false | false | 0 |
operator=(const Predicate &other)
{
d->isValid = other.d->isValid;
d->type = other.d->type;
if (d->type!=PropertyCheck && d->type!=InterfaceCheck)
{
Predicate* operand1 = new Predicate(*(other.d->operand1));
delete d->operand1;
d->operand1 = operand1;
Predicate* operand2... | false | false | false | false | false | 0 |
dosave(BW *bw, struct savereq *req, int *notify)
{
if (backup(bw)) {
return saver(bw, 0, req, notify);
} else {
return saver(bw, 'y', req, notify);
}
} | false | false | false | false | false | 0 |
draw()
{
if (!IsVisible)
return;
IGUISkin* skin = Environment->getSkin();
video::IVideoDriver* driver = Environment->getVideoDriver();
core::rect<s32> rect = AbsoluteRect;
if (Texture)
{
if (ScaleImage)
{
const video::SColor Colors[] = {Color,Color,Color,Color};
driver->draw2DImage... | false | false | false | false | false | 0 |
verifyerror (lua_State *L, int *passed, int npassed) {
int i, j;
for (i = npassed - 1; i >= 0; i--) { /* search for a repetition */
for (j = i - 1; j >= 0; j--) {
if (passed[i] == passed[j]) {
lua_rawgeti(L, -1, passed[i]); /* get rule's key */
return luaL_error(L, "rule '%s' may be left... | false | false | false | false | false | 0 |
HTS_Engine_save_generated_parameter(HTS_Engine * engine, size_t stream_index, FILE * fp)
{
size_t i, j;
float temp;
HTS_GStreamSet *gss = &engine->gss;
for (i = 0; i < HTS_GStreamSet_get_total_frame(gss); i++)
for (j = 0; j < HTS_GStreamSet_get_vector_length(gss, stream_index); j++) {
temp =... | false | false | false | false | false | 0 |
remove_hook(const char *name, hookfn fn)
{
int i;
if((i = find_hook(name)) < 0)
return;
rb_dlinkFindDestroy(fn, &hooks[i].hooks);
} | false | false | false | false | false | 0 |
JimForeachMapHelper(Jim_Interp *interp, int argc, Jim_Obj *const *argv, int doMap)
{
int result = JIM_ERR;
int i, numargs;
Jim_ListIter twoiters[2]; /* Avoid allocation for a single list */
Jim_ListIter *iters;
Jim_Obj *script;
Jim_Obj *resultObj;
if (argc < 4 || argc % 2 != 0) {
... | false | false | false | false | false | 0 |
copy(const char *s, int len, int allocation_hint)
{
if (len == 0 || allocation_hint == 0)
return; // We're not actually copying anything!
allocate_fix_space(allocation_hint);
Length = len;
copy_data_from(s, len);
} | false | false | false | false | false | 0 |
deleteLinkedList(struct Node** node)
{
struct Node* tmpNode;
while(*node)
{
tmpNode = *node;
*node = tmpNode->next;
delete tmpNode;
}
} | false | false | false | false | false | 0 |
xlator_set_type_virtual (xlator_t *xl, const char *type)
{
GF_VALIDATE_OR_GOTO ("xlator", xl, out);
GF_VALIDATE_OR_GOTO ("xlator", type, out);
xl->type = gf_strdup (type);
if (xl->type)
return 0;
out:
return -1;
} | false | false | false | false | false | 0 |
gst_child_proxy_get_child_by_name (GstChildProxy * parent, const gchar * name)
{
guint count, i;
GstObject *object, *result;
gchar *object_name;
g_return_val_if_fail (GST_IS_CHILD_PROXY (parent), NULL);
g_return_val_if_fail (name != NULL, NULL);
result = NULL;
count = gst_child_proxy_get_children_count... | false | false | false | false | false | 0 |
zisset(ZVALUE z, long n)
{
if ((n < 0) || ((n / BASEB) >= z.len))
return FALSE;
return ((z.v[n / BASEB] & (((HALF) 1) << (n % BASEB))) != 0);
} | false | false | false | false | false | 0 |
pg_column_size(PG_FUNCTION_ARGS)
{
Datum value = PG_GETARG_DATUM(0);
int32 result;
int typlen;
/* On first call, get the input type's typlen, and save at *fn_extra */
if (fcinfo->flinfo->fn_extra == NULL)
{
/* Lookup the datatype of the supplied argument */
Oid argtypeid = get_fn_expr_argtype(fcinfo->f... | false | false | false | false | false | 0 |
channel_rejoin(IRC_SERVER_REC *server, const char *channel)
{
IRC_CHANNEL_REC *chanrec;
REJOIN_REC *rec;
g_return_val_if_fail(IS_IRC_SERVER(server), 0);
g_return_val_if_fail(channel != NULL, 0);
chanrec = irc_channel_find(server, channel);
if (chanrec == NULL || chanrec->joined) return 0;
if (!settings_get_bo... | false | false | false | false | false | 0 |
create_diamond(ObjSynthObject *feature,
gdouble size,
gdouble aspect,
gdouble angle)
{
gdouble a, b, c, s, r, x, y, xc, yc;
gint xres, yres, i, j;
gdouble *z;
a = size*sqrt(aspect);
b = size/sqrt(aspect);
c = cos(angle);
s = sin(angle);
xres ... | false | false | false | false | false | 0 |
AddCompilerPredefinedMacrosGCC(const wxString& compilerId, cbProject* project, wxString& defs)
{
Compiler* compiler = CompilerFactory::GetCompiler(compilerId);
if (!compiler)
return false;
wxString masterPath = compiler->GetMasterPath();
Manager::Get()->GetMacrosManager()->ReplaceMacros(masterP... | false | false | false | false | false | 0 |
iio_device_add_event(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan, unsigned int spec_index,
enum iio_event_type type, enum iio_event_direction dir,
enum iio_shared_by shared_by, const unsigned long *mask)
{
ssize_t (*show)(struct device *, struct device_attribute *, char *);
ssize_t (*store)(struct ... | false | false | false | false | false | 0 |
assign_parms_setup_varargs (struct assign_parm_data_all *all,
struct assign_parm_data_one *data, bool no_rtl)
{
int varargs_pretend_bytes = 0;
targetm.calls.setup_incoming_varargs (&all->args_so_far,
data->promoted_mode,
data->passed_type,
&varargs_pretend_bytes, no_rtl);
/* If the back-en... | false | false | false | false | false | 0 |
IsM44Identity(const float* m44)
{
int index=0;
for(unsigned int j=0; j<4; ++j)
{
for(unsigned int i=0; i<4; ++i)
{
index = 4*j+i;
if(i==j)
{
if(!IsScalarEqualToOne(m44[index])) return false;
... | false | false | false | false | false | 0 |
new_Db(DB_ENV *dbenv,u_int32_t flags){
DB *self = NULL;
errno = db_create(&self, dbenv, flags);
if (errno == 0 && dbenv == NULL)
self->env->dbt_usercopy = __dbj_dbt_memcopy;
return self;
} | false | false | false | false | false | 0 |
vmw_overlay_move_buffer(struct vmw_private *dev_priv,
struct vmw_dma_buffer *buf,
bool pin, bool inter)
{
if (!pin)
return vmw_dmabuf_unpin(dev_priv, buf, inter);
if (dev_priv->active_display_unit == vmw_du_legacy)
return vmw_dmabuf_pin_in_vram(dev_priv, buf, inter);
return vmw_dmabuf_pin_in_vram... | false | false | false | false | false | 0 |
edge_vector_integral(e_info)
struct qinfo *e_info;
{ int m,j;
REAL value=0.0;
if ( web.modeltype == QUADRATIC ) return edge_vector_integral_q(e_info);
if ( web.modeltype == LAGRANGE ) return edge_vector_integral_lagrange(e_info);
for ( m = 0 ; m < gauss1D_num ; m++ )
{ e_info->gauss_pt[m][2*SDIM] = m; /* klu... | false | false | false | false | false | 0 |
connect_dialog_request_additional_details (NemoConnectServerDialog *self,
GAskPasswordFlags flags,
const gchar *default_user,
const gchar *default_domain)
{
GtkWidget *content_area, *label, *hbox, *icon;
self->details->fill_details_flags = flags;
connect_dialog_restore_info_bar (self, GTK_M... | false | false | false | false | false | 0 |
reportInfo(const ErrorLogger::ErrorMessage &msg)
{
// Suppressing info message?
std::string file;
unsigned int line(0);
if (!msg._callStack.empty()) {
file = msg._callStack.back().getfile(false);
line = msg._callStack.back().line;
}
if (_useGlobalSuppressions) {
if (_sett... | false | false | false | false | false | 0 |
CreateFailSafe(char *name)
{ FILE *fout;
if ((fout = fopen(name,"w")) == NULL)
{
CfOut(cf_error,"fopen","Unable to write failsafe file! (%s)",name);
return;
}
CfOut(cf_cmdout,""," -> No policy failsafe discovered, assume temporary bootstrap vector\n");
fprintf(fout,
"body common control\n"
"{\n"
"bundle... | false | false | false | false | true | 1 |
string_netstringlen(size_t namlen, size_t vallen, const void* value)
{
HA_MSG_ASSERT(value);
HA_MSG_ASSERT( vallen == strlen(value));
return binary_netstringlen(namlen, vallen, value);
} | false | false | false | false | false | 0 |
Channel_NeedsBuffering(GF_Channel *ch, u32 ForRebuffering)
{
if (!ch->MaxBuffer || ch->IsEndOfStream) return 0;
/*for rebuffering, check we're not below min buffer*/
if (ForRebuffering) {
if (ch->MinBuffer && (ch->BufferTime <= (s32) ch->MinBuffer)) {
return 1;
}
return 0;
}
/*nothing received, buffer n... | true | true | false | false | false | 1 |
lcd2usb_HD44780_flush(PrivateData *p)
{
/* only if some data available */
if (p->tx_buf.use_count == 0)
return;
/* construct and send message */
usb_control_msg(p->usbHandle, USB_TYPE_VENDOR,
p->tx_buf.type | (p->tx_buf.use_count - 1),
p->tx_buf.buffer[0] | (p->tx_buf.buffer[1] << 8),
p->tx_buf.buffer[2... | false | false | false | false | false | 0 |
change_state(tState new_state)
{
if (next_state && next_state != new_state)
DEBUGMSGTL(("process", "Ignore transition to %s\n", next_state->name));
next_state = new_state;
} | false | false | false | false | false | 0 |
_prolog_error(batch_job_launch_msg_t *req, int rc)
{
char *err_name_ptr, err_name[256], path_name[MAXPATHLEN];
char *fmt_char;
int fd;
if (req->std_err || req->std_out) {
if (req->std_err)
strncpy(err_name, req->std_err, sizeof(err_name));
else
strncpy(err_name, req->std_out, sizeof(err_name));
if ((fm... | true | true | false | false | true | 1 |
sendFile(Socket * peerconn, String & filename, String & filemime, String & filedis, String &url)
{
int fd = open(filename.toCharArray(), O_RDONLY);
if (fd < 0) { // file access error
syslog(LOG_ERR, "Error reading file to send");
#ifdef DGDEBUG
std::cout << "Error reading file to send:" << filename << std::endl;... | false | false | false | false | false | 0 |
RemovePoint(vtkIdType ptId)
{
int found = 0;
vtkIdType pos = this->HashFunction(ptId);
//Need to check size first
assert("check: valid range pos" &&
static_cast<unsigned>(pos) < this->HashPoints->PointVector.size() );
//Be carefull with reference the equal is not overloaded
vtkEdgeTablePoints::V... | false | false | false | false | false | 0 |
CGUITab(s32 number, IGUIEnvironment* environment,
IGUIElement* parent, const core::rect<s32>& rectangle,
s32 id)
: IGUITab(environment, parent, id, rectangle), Number(number),
BackColor(0,0,0,0), OverrideTextColorEnabled(false), TextColor(255,0,0,0),
DrawBackground(false)
{
#ifdef _DEBUG
setDebugName("... | false | false | false | false | false | 0 |
G_str_replace(char *buffer, const char *old_str, const char *new_str)
{
char *B, *R;
const char *N;
char *replace;
int count, len;
/* Make sure old_str and new_str are not NULL */
if (old_str == NULL || new_str == NULL)
return G_strdup(buffer);
/* Make sure buffer is not NULL */
if (b... | false | false | false | false | false | 0 |
stmCommitNestedTransaction(Capability *cap, StgTRecHeader *trec) {
StgTRecHeader *et;
int result;
ASSERT (trec != NO_TREC && trec -> enclosing_trec != NO_TREC);
TRACE("%p : stmCommitNestedTransaction() into %p", trec, trec -> enclosing_trec);
ASSERT ((trec -> state == TREC_ACTIVE) || (trec -> state == TREC_CO... | false | false | false | false | false | 0 |
T_FireFlicker (fireflicker_t* flick)
{
int amount;
if (--flick->count)
return;
amount = (P_Random() & 3) * 8; // [STRIFE] 16 -> 8
if (flick->sector->lightlevel - amount < flick->minlight)
flick->sector->lightlevel = flick->minlight;
else
flick->sector->lightlevel = flick->... | false | false | false | false | false | 0 |
handleProperties()
{
if( _currentCell->getLord() ) {
handlePropertiesLord();
} else if( _currentCell->getBase() ) {
handlePropertiesBase();
} else if( _currentCell->getBuilding() ) {
handlePropertiesBuilding();
} else if (_currentCell->getCreature() ) {
handlePropertiesCreature();
} else if( _currentCell->... | false | false | false | false | false | 0 |
rbio_can_merge(struct btrfs_raid_bio *last,
struct btrfs_raid_bio *cur)
{
if (test_bit(RBIO_RMW_LOCKED_BIT, &last->flags) ||
test_bit(RBIO_RMW_LOCKED_BIT, &cur->flags))
return 0;
/*
* we can't merge with cached rbios, since the
* idea is that when we merge the destination
* rbio is going to run our... | false | false | false | false | false | 0 |
raid_rmw_end_io(struct bio *bio)
{
struct btrfs_raid_bio *rbio = bio->bi_private;
if (bio->bi_error)
fail_bio_stripe(rbio, bio);
else
set_bio_pages_uptodate(bio);
bio_put(bio);
if (!atomic_dec_and_test(&rbio->stripes_pending))
return;
if (atomic_read(&rbio->error) > rbio->bbio->max_errors)
goto cleanu... | false | false | false | false | false | 0 |
__ecereNameSpace__ecere__gui__Enum_OnEdit(struct __ecereNameSpace__ecere__com__Class * _class, int * data, struct __ecereNameSpace__ecere__com__Instance * window, struct __ecereNameSpace__ecere__com__Instance * master, int x, int y, int w, int h, void * userData)
{
struct __ecereNameSpace__ecere__gui__AnchorValue __sim... | false | false | false | false | false | 0 |
ipmi_mc_getsysinfo(struct ipmi_intf * intf, int param, int block, int set,
int len, void *buffer)
{
uint8_t data[4];
struct ipmi_rs *rsp = NULL;
struct ipmi_rq req = {0};
memset(buffer, 0, len);
memset(data, 0, 4);
req.msg.netfn = IPMI_NETFN_APP;
req.msg.lun = 0;
req.msg.cmd = IPMI_GET_SYS_INFO;
req.msg.dat... | false | true | false | false | false | 1 |
asn1c_lang_C_type_REFERENCE(arg_t *arg) {
asn1p_ref_t *ref;
ref = arg->expr->reference;
if(ref->components[ref->comp_count-1].name[0] == '&') {
asn1p_expr_t *extract;
arg_t tmp;
int ret;
extract = asn1f_class_access_ex(arg->asn, arg->expr->module,
arg->expr, arg->expr->rhs_pspecs, ref);
if(extract == ... | false | false | false | false | false | 0 |
__blk_queue_bounce(struct request_queue *q, struct bio **bio_orig,
mempool_t *pool)
{
struct bio *bio;
int rw = bio_data_dir(*bio_orig);
struct bio_vec *to, from;
struct bvec_iter iter;
unsigned i;
bio_for_each_segment(from, *bio_orig, iter)
if (page_to_pfn(from.bv_page) > queue_bounce_pfn(q))
got... | false | false | false | false | false | 0 |
array_find(const gs_memory_t *mem, ref *Encoding, ref *char_name)
{
ulong n = r_size(Encoding), i;
ref v;
for (i = 0; i < n; i++)
if (array_get(mem, Encoding, i, &v) < 0)
break;
else if (r_type(char_name) == r_type(&v)
&& char_name->value.const_pname == v.value.... | false | false | false | false | false | 0 |
igb_force_mac_fc_generic(struct e1000_hw *hw)
{
u32 ctrl;
s32 ret_val = E1000_SUCCESS;
DEBUGFUNC("igb_force_mac_fc_generic");
ctrl = E1000_READ_REG(hw, E1000_CTRL);
/*
* Because we didn't get link via the internal auto-negotiation
* mechanism (we either forced link or we got link via PHY
* auto-neg), we h... | false | false | false | false | false | 0 |
_wrap_render(int nargs, VALUE *args, VALUE self) {
int argc;
VALUE argv[3];
int ii;
argc = nargs;
if (argc > 3) SWIG_fail;
for (ii = 0; (ii < argc); ++ii) {
argv[ii] = args[ii];
}
if (argc == 1) {
int _v;
void *vptr = 0;
int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Agraph_t, 0... | false | false | false | false | false | 0 |
lineIndentPosition(const QString &text)
{
int i = 0;
while(i < text.size())
{
if(!text.at(i).isSpace())
break;
++i;
}
int column = columnAt(text, i);
return i - (column % 30);
} | false | false | false | false | false | 0 |
length() const
{
if (managerDocument)
managerDocument->ensureStyleSheetListUpToDate();
// hack so implicit BODY stylesheets don't get counted here
unsigned long l = 0;
foreach (StyleSheetImpl* sh, styleSheets) {
if (!sh->isCSSStyleSheet() || !static_cast<CSSStyleSheetImpl*>(sh)->implici... | false | false | false | false | false | 0 |
read_next_byte(struct si_sm_data *kcs)
{
if (kcs->read_pos >= MAX_KCS_READ_SIZE) {
/* Throw the data away and mark it truncated. */
read_data(kcs);
kcs->truncated = 1;
} else {
kcs->read_data[kcs->read_pos] = read_data(kcs);
(kcs->read_pos)++;
}
write_data(kcs, KCS_READ_BYTE);
} | false | false | false | false | false | 0 |
setMinimumPDFVersion(std::string const& version,
int extension_level)
{
bool set_version = false;
bool set_extension_level = false;
if (this->min_pdf_version.empty())
{
set_version = true;
set_extension_level = true;
}
else
{
int old_major = 0;
int... | false | false | false | false | false | 0 |
XGIfb_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info)
{
int err;
if (var->xoffset > (info->var.xres_virtual - info->var.xres))
return -EINVAL;
if (var->yoffset > (info->var.yres_virtual - info->var.yres))
return -EINVAL;
if (var->vmode & FB_VMODE_YWRAP) {
if (var->yoffset >= info->var.yre... | false | false | false | false | false | 0 |
computeOverlaps(size_t start0, size_t end0,
MonotoneChain& mc,
size_t start1, size_t end1,
MonotoneChainOverlapAction& mco)
{
//Debug.println("computeIntersectsForChain:"+p00+p01+p10+p11);
// terminating condition for t... | false | false | false | false | false | 0 |
setCurrentFont()
{
CursorSlice const & cs = innerTextSlice();
Paragraph const & par = cs.paragraph();
pos_type cpit = cs.pit();
pos_type cpos = cs.pos();
Text const & ctext = *cs.text();
TextMetrics const & tm = bv().textMetrics(&ctext);
// are we behind previous char in fact? -> go to that char
if (cpos > 0 &... | false | false | false | false | false | 0 |
pg_db_pg_notifies (SV * dbh, imp_dbh_t * imp_dbh)
{
dTHX;
int status;
PGnotify * notify;
AV * ret;
SV * retsv;
if (TSTART_slow) TRC(DBILOGFP, "%sBegin pg_db_pg_notifies\n", THEADER_slow);
TRACE_PQCONSUMEINPUT;
status = PQconsumeInput(imp_dbh->conn);
if (0 == status) {
TRACE_PQERRORMESSA... | false | false | false | false | false | 0 |
nfs4_layoutreturn_release(void *calldata)
{
struct nfs4_layoutreturn *lrp = calldata;
struct pnfs_layout_hdr *lo = lrp->args.layout;
LIST_HEAD(freeme);
dprintk("--> %s\n", __func__);
spin_lock(&lo->plh_inode->i_lock);
if (lrp->res.lrs_present)
pnfs_set_layout_stateid(lo, &lrp->res.stateid, true);
pnfs_mark_ma... | false | false | false | false | false | 0 |
store_gene_feature(GtFeatureNode *fn, void *data,
GT_UNUSED GtError *err)
{
StoreGeneFeatureInfo *info = (StoreGeneFeatureInfo*) data;
GtRange range;
gt_error_check(err);
gt_assert(fn && info);
if (gt_feature_node_has_type(fn, gt_ft_mRNA))
gt_array_add(info->mRNAs, fn);
els... | false | false | false | false | false | 0 |
set (const ACE_TCHAR *addr,
gid_t gid,
uid_t uid)
{
int len = sizeof (this->SPIPE_addr_.uid_);
len += sizeof (this->SPIPE_addr_.gid_);
#if defined (ACE_WIN32)
const ACE_TCHAR *colonp = ACE_OS::strchr (addr, ':');
ACE_TCHAR temp[BUFSIZ];
if (colonp == 0) // Assume it... | false | false | false | false | false | 0 |
sina_mask(AW_root *root) {
const char *sinaName = root->awar(GA_AWAR_CMD)->read_char_pntr();
char *sina = GB_executable(sinaName);
const char *fail_reason = 0;
if (sina) {
int exitstatus = system(GBS_global_string("%s --has-cli-vers 1", sina));
exitstatus = WEXITSTAT... | false | false | false | false | false | 0 |
eina_module_environment_path_get(const char *env,
const char *sub_dir)
{
const char *env_dir;
EINA_SAFETY_ON_NULL_RETURN_VAL(env, NULL);
env_dir = getenv(env);
if (env_dir)
{
char *path;
size_t l1;
size_t l2 = 0;
l1 = strlen... | false | false | false | false | false | 0 |
Log2(uint64_t n) {
int iLog=0;
while( n>>=1 ) iLog++;
return iLog;
} | false | false | false | false | false | 0 |
align_len(size_t *len)
{
if (*len % 4)
*len += 4 - (*len % 4);
} | false | false | false | false | false | 0 |
GetChild(unsigned int index)
{
if (index < this->Internals->Children.size())
{
return this->Internals->Children[index].DataObject;
}
return 0;
} | false | false | false | false | false | 0 |
rawCharToBuf(unsigned char c)
{
if (!hasWriteCapacity(1)) {
return;
}
myBuf[myLength] = c;
//memcpy(myBuf+myLength, &c, 1);
myLength += 1;
} | false | false | false | false | false | 0 |
ElementIndexedName(unsigned int iIndex) {
ostringstream sIndex;
if(m_iAddressRadix == 16) {
sIndex << hex;
}
sIndex << Value::name() << "[" << m_szPrefix << iIndex;
sIndex << "]" << ends;
return sIndex.str();
} | false | false | false | false | false | 0 |
ConsumeMessage(Message* message, const string delimeter) {
while (!LookingAt(">") && !LookingAt("}")) {
DO(ConsumeField(message));
}
// Confirm that we have a valid ending delimeter.
DO(Consume(delimeter));
return true;
} | false | false | false | false | false | 0 |
pcoalesce(P *p)
{
if (p->hdr != p->b->eof->hdr && GSIZE(p->hdr) + GSIZE(p->hdr->link.next) <= SEGSIZ - SEGSIZ / 4) {
H *hdr = p->hdr->link.next;
unsigned char *ptr = vlock(vmem, hdr->seg);
int osize = GSIZE(p->hdr);
int size = GSIZE(hdr);
P *q;
gstgap(hdr, ptr, size);
ginsm(p->hdr, p->ptr, GSIZE(p->hdr)... | false | false | false | false | false | 0 |
collectWireConnectees(QSet<Wire *> & wires) {
PaletteItemBase::collectWireConnectees(wires);
foreach (ItemBase * lkpi, m_layerKin) {
qobject_cast<LayerKinPaletteItem *>(lkpi)->collectWireConnectees(wires);
}
} | false | false | false | false | false | 0 |
_hb_ot_layout_create (hb_face_t *face)
{
hb_ot_layout_t *layout = (hb_ot_layout_t *) calloc (1, sizeof (hb_ot_layout_t));
if (unlikely (!layout))
return NULL;
layout->gdef_blob = OT::Sanitizer<OT::GDEF>::sanitize (face->reference_table (HB_OT_TAG_GDEF));
layout->gdef = OT::Sanitizer<OT::GDEF>::lock_instanc... | false | false | false | false | false | 0 |
get_stlforce_mlow_tile_info(int tile_index)
{
int tileno,colour;
tileno = stlforce_mlow_videoram[tile_index] & 0x0fff;
colour = stlforce_mlow_videoram[tile_index] & 0xe000;
colour = colour >> 13;
colour += 8;
tileno += 0x1000;
SET_TILE_INFO(0,tileno,colour,0)
} | false | false | false | false | false | 0 |
DES_raw_get_binary(char *ciphertext)
{
ARCH_WORD block[3];
ARCH_WORD mask;
int ofs, chr, src, dst, value;
if (ciphertext[13]) ofs = 9; else ofs = 2;
block[0] = block[1] = 0;
dst = 0;
for (chr = 0; chr < 11; chr++) {
value = DES_atoi64[ARCH_INDEX(ciphertext[chr + ofs])];
mask = 0x20;
for (src = 0; src < ... | false | false | false | false | false | 0 |
radeon_audio_decode_dfs_div(unsigned int div)
{
if (div >= 8 && div < 64)
return (div - 8) * 25 + 200;
else if (div >= 64 && div < 96)
return (div - 64) * 50 + 1600;
else if (div >= 96 && div < 128)
return (div - 96) * 100 + 3200;
else
return 0;
} | false | false | false | false | false | 0 |
UTypeName(void) const {
AType* theItem = allTypes;
int found = 0;
UnicodeString typeName;
while ((theItem != NULL) && (!found)) {
if (theItem->GUIDType == *this) { // found it!
typeName = theItem->name.c_str();
found = 1;
} else {
theItem = theItem->next;
} // i... | false | false | false | false | false | 0 |
get_stream_info(
struct intel_sst_drv *sst_drv_ctx, int str_id)
{
if (sst_validate_strid(sst_drv_ctx, str_id))
return NULL;
return &sst_drv_ctx->streams[str_id];
} | false | false | false | false | false | 0 |
ublkmove(BW *bw)
{
if (markv(1)) {
if (markb->b->rdonly) {
msgnw(bw->parent, US "Read only");
return -1;
}
if (square) {
long height = markk->line - markb->line + 1;
long width = markk->xcol - markb->xcol;
int usetabs = ptabrect(markb, height, markk->xcol);
long ocol = piscol(bw->cursor);
B ... | false | false | false | false | false | 0 |
ast_dsp_call_progress(struct ast_dsp *dsp, struct ast_frame *inf)
{
if (inf->frametype != AST_FRAME_VOICE) {
ast_log(LOG_WARNING, "Can't check call progress of non-voice frames\n");
return 0;
}
if (!ast_format_is_slinear(&inf->subclass.format)) {
ast_log(LOG_WARNING, "Can only check call progress in signed-lin... | false | false | false | false | false | 0 |
reload_mounts (UDisksMountMonitor *monitor)
{
GList *old_mounts;
GList *cur_mounts;
GList *added;
GList *removed;
GList *l;
udisks_mount_monitor_ensure (monitor);
old_mounts = g_list_copy (monitor->mounts);
g_list_foreach (old_mounts, (GFunc) g_object_ref, NULL);
udisks_mount_monitor_invalidate (mo... | false | false | false | false | false | 0 |
kernel_map_sync_memtype(u64 base, unsigned long size,
enum page_cache_mode pcm)
{
unsigned long id_sz;
if (base > __pa(high_memory-1))
return 0;
/*
* some areas in the middle of the kernel identity range
* are not mapped, like the PCI space.
*/
if (!page_is_ram(base >> PAGE_SHIFT))
return 0;
id... | false | false | false | false | false | 0 |
ssl_log_cxerror(const char *file, int line, int level, apr_status_t rv,
conn_rec *c, X509 *cert, const char *fmt, ...)
{
if (APLOG_IS_LEVEL(mySrvFromConn(c),level)) {
va_list ap;
va_start(ap, fmt);
ssl_log_cert_error(file, line, level, rv, NULL, c, NULL, c->pool,
... | false | false | false | false | false | 0 |
_eina_hash_del_by_key_hash(Eina_Hash *hash,
const void *key,
int key_length,
int key_hash,
const void *data)
{
Eina_Hash_Element *hash_element;
Eina_Hash_Head *hash_head;
Eina_Hash_Tuple tuple;
EINA_... | false | false | false | false | false | 0 |
bot_replace (tree* t, int* /*walk_subtrees*/, void* data)
{
splay_tree target_remap = ((splay_tree) data);
if (TREE_CODE (*t) == VAR_DECL)
{
splay_tree_node n = splay_tree_lookup (target_remap,
(splay_tree_key) *t);
if (n)
*t = (tree) n->value;
}
else if (TREE_CODE (*t) == PARM_DEC... | false | false | false | false | false | 0 |
Free_ChainSubRule( HB_ChainSubRule* csr )
{
FREE( csr->SubstLookupRecord );
FREE( csr->Lookahead );
FREE( csr->Input );
FREE( csr->Backtrack );
} | false | false | false | false | false | 0 |
main(int argc, char *argv[])
{
DBusConnectionPtr conn;
DBusErrorCXX err;
struct sigaction sa;
memset(&sa, 0, sizeof(sa));
sa.sa_handler = sig_term;
sigaction(SIGINT, &sa, NULL);
sigaction(SIGTERM, &sa, NULL);
sa.sa_handler = SIG_IGN;
sigaction(SIGCHLD, &sa, NULL);
sigaction(SIG... | false | false | false | false | false | 0 |
G_add_modular_color_rule(CELL cat1, int r1, int g1, int b1, CELL cat2, int r2,
int g2, int b2, struct Colors *colors)
{
CELL min, max;
if (colors->version < 0)
return -1; /* can;t use this on 3.0 colors */
min = colors->cmin;
max = colors->cmax;
add_color_rule((void *)&cat1, r1, g1, b1, (void... | false | false | false | false | false | 0 |
gnac_profiles_wavpack_save_profile(gpointer data)
{
if (!data) return;
gchar *bitrate = NULL;
gchar *bits_per_sample = NULL;
AudioProfileWavpack *profile = (AudioProfileWavpack *) data;
if (profile->bitrate != -1) {
bitrate = gnac_profiles_utils_gdouble_to_gchararray(profile->bitrate);
} else if (prof... | false | false | false | false | false | 0 |
setipxname (int slot,char **argv)
{
char *dest = ipxcp_wantoptions[slot].name;
char *src = *argv;
int count;
char ch;
ipxcp_wantoptions[slot].neg_name = 1;
ipxcp_allowoptions[slot].neg_name = 1;
memset (dest, '\0', sizeof (ipxcp_wantoptions[slot].name));
count = 0;
while (*src) ... | false | false | false | false | false | 0 |
gui_get_x11_windis(Window *win, Display **dis)
{
if (gui.mainwin != NULL && gui.mainwin->window != NULL)
{
*dis = GDK_WINDOW_XDISPLAY(gui.mainwin->window);
*win = GDK_WINDOW_XWINDOW(gui.mainwin->window);
return OK;
}
*dis = NULL;
*win = 0;
return FAIL;
} | false | false | false | false | false | 0 |
roll(int n, int j) {
PSObject obj;
int i, k;
if (unlikely(n == 0)) {
return;
}
if (j >= 0) {
j %= n;
} else {
j = -j % n;
if (j != 0) {
j = n - j;
}
}
if (n <= 0 || j == 0) {
return;
}
if (j <= n / 2) {
for (i = 0; i < j; ++i) {
obj = stack[sp];
for (k ... | false | false | false | false | false | 0 |
new_node(glp_tree *tree, IOSNPD *parent)
{ IOSNPD *node;
int p;
/* pull a free slot for the new node */
p = get_slot(tree);
/* create descriptor of the new subproblem */
node = dmp_get_atom(tree->pool, sizeof(IOSNPD));
tree->slot[p].node = node;
node->p = p;
node->up ... | false | false | false | false | false | 0 |
hci_uart_exit(void)
{
int err;
#ifdef CONFIG_BT_HCIUART_H4
h4_deinit();
#endif
#ifdef CONFIG_BT_HCIUART_BCSP
bcsp_deinit();
#endif
#ifdef CONFIG_BT_HCIUART_LL
ll_deinit();
#endif
#ifdef CONFIG_BT_HCIUART_ATH3K
ath_deinit();
#endif
#ifdef CONFIG_BT_HCIUART_3WIRE
h5_deinit();
#endif
#ifdef CONFIG_BT_HCIUART_INTEL
... | false | false | false | false | false | 0 |
legacyresample_event (GstBaseTransform * base, GstEvent * event)
{
GstLegacyresample *legacyresample;
legacyresample = GST_LEGACYRESAMPLE (base);
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_FLUSH_START:
break;
case GST_EVENT_FLUSH_STOP:
if (legacyresample->resample)
resample_inp... | false | false | false | false | false | 0 |
mpd_connection_changed_callback(MpdObj *mi, int connect, void *userdata) {
struct glurp_t* glurp = userdata;
if (connect) {
debug("We're connected!");
/* we're just connected */
debug("Connected to %s:%d", glurp->config->server_host, glurp->config->server_port);
statusbar_print("Connected to server... | false | false | false | false | false | 0 |
Slab_ (MolComplexS *mol_complexSP, int mol_complexesN)
{
int mol_complexI;
MolComplexS *curr_mol_complexSP;
/* Check every macromolecular complex: */
for (mol_complexI = 0; mol_complexI < mol_complexesN; mol_complexI++)
{
/** Pointer to the current macromolecular complex: **/
curr_mol_complexSP = mol_complexSP + m... | 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.