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 |
|---|---|---|---|---|---|---|
vrrp_leave_fault(vrrp_t * vrrp, char *buffer, int len)
{
if (!VRRP_ISUP(vrrp))
return;
if (vrrp_state_fault_rx(vrrp, buffer, len)) {
if (vrrp->sync) {
if (vrrp_sync_leave_fault(vrrp)) {
log_message(LOG_INFO,
"VRRP_Instance(%s) prio is higher than received advert",
vrrp->iname);
v... | false | false | false | false | false | 0 |
is_file_hidden (NemoFile *file)
{
return file->details->directory->details->hidden_file_hash != NULL &&
g_hash_table_lookup (file->details->directory->details->hidden_file_hash,
eel_ref_str_peek (file->details->name)) != NULL;
} | false | false | false | false | false | 0 |
_mixer_fill_channels_info(E_Config_Dialog_Data *cfdata)
{
E_Mixer_System *sys;
const char *channel;
Eina_List *l;
int i = 0;
sys = e_mod_mixer_new(cfdata->card);
if (!sys)
return;
cfdata->channel = 0;
cfdata->channel_name = eina_stringshare_add(cfdata->conf->channel_name);
cfdata->chan... | false | false | false | false | false | 0 |
key(int k, int x, int y)
{
if (k == 3 || k == 27 || k == 'q' || k == 'Q')
exit(0);
if (k == KEY_F(1) || k == 'h' || k == 'H')
{
set_centered_pic(0);
help("solitaire.html", solitaire_help);
}
if (k == ' ')
{
double_click(x, y, 1);
check_for_end_of_game();
}
if (k == 'w')
... | false | false | false | false | false | 0 |
n_distinct_prime_factors(int i) {
int count = 0;
int n;
if (is_prime(i)) {
return 0;
}
// check each prime number starting with 2
for (n = 2; i > 1; n = next_prime(n)) {
if (i % n == 0) {
count++;
while (i % n == 0) {
i = i/n;
}
}
}
return count;
} | false | false | false | false | false | 0 |
do_lrm_event(long long action,
enum crmd_fsa_cause cause,
enum crmd_fsa_state cur_state, enum crmd_fsa_input cur_input, fsa_data_t * msg_data)
{
CRM_CHECK(FALSE, return);
} | false | false | false | false | false | 0 |
sheet_style_set_list (Sheet *sheet, GnmCellPos const *corner,
GnmStyleList const *list,
sheet_style_set_list_cb_t range_modify,
gpointer data)
{
GnmSpanCalcFlags spanflags = GNM_SPANCALC_SIMPLE;
GnmStyleList const *l;
g_return_val_if_fail (IS_SHEET (sheet), spanflags);
/* Sluggish but simp... | false | false | false | false | false | 0 |
IsInlined(JSFunction* function, SharedFunctionInfo* candidate) {
AssertNoAllocation no_gc;
if (function->code()->kind() != Code::OPTIMIZED_FUNCTION) return false;
DeoptimizationInputData* data =
DeoptimizationInputData::cast(function->code()->deoptimization_data());
if (data == Heap::empty_fixed_array(... | false | false | false | false | false | 0 |
get_orbitals_from_strorbs(gchar **strorbs,gint nrows,gint *norbitals,gint type)
{
OneOrbital* orbs=g_malloc(sizeof(OneOrbital));
gint begin = 0;
gint end = -2;
gint i;
gint k;
gint norbs = 0;
OneOrbital orb;
for(k=0;k<nrows;k+=end-begin+2)
{
/* Debug("k=%d\n",k); */
begin=end+2;
i=1;
if(begin>=nrows-... | false | false | false | false | false | 0 |
e_cal_backend_file_add_timezone (ECalBackendSync *backend,
EDataCal *cal,
GCancellable *cancellable,
const gchar *tzobj,
GError **error)
{
ETimezoneCache *timezone_cache;
icalcomponent *... | false | false | false | false | false | 0 |
buffer_prepare(struct vb2_buffer *vb2)
{
struct saa7134_dmaqueue *dmaq = vb2->vb2_queue->drv_priv;
struct saa7134_dev *dev = dmaq->dev;
struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb2);
struct saa7134_buf *buf = container_of(vbuf, struct saa7134_buf, vb2);
struct sg_table *dma = vb2_dma_sg_plane_desc(vb2, 0)... | false | false | false | false | false | 0 |
_scryptROMix (u32 r, unsigned char *B, u64 N,
unsigned char *tmp1, unsigned char *tmp2)
{
unsigned char *X = B, *T = B;
u64 i;
#if 0
if (r == 1)
{
printf ("B = ");
for (i = 0; i < 128 * r; i++)
{
if (i && !(i % 16))
printf ("\n ");
printf (" %02x"... | false | false | false | false | false | 0 |
execute(VM &vm) const
{
if (n_ == 0) {
vm.needStack(1);
*vm.sp++ = new (*vm.interp) VectorObj;
}
else {
Vector<ELObj *> v(n_);
ELObj **p = vm.sp;
for (size_t n = n_; n > 0; n--)
v[n - 1] = *--p;
*p = new (*vm.interp) VectorObj(v);
vm.sp = p + 1;
}
return next_.pointer();
} | false | false | false | false | false | 0 |
arm_set_fixed_conv_libfunc (convert_optab optable, enum machine_mode to,
enum machine_mode from, const char *funcname,
const char *toname, const char *fromname)
{
char buffer[50];
const char *maybe_suffix_2 = "";
/* Follow the logic for selecting a "2" suffix in fixed-bit.h. */
if (ALL_FIXED_POI... | true | true | false | false | false | 1 |
vl_dsift_delete (VlDsiftFilter * self)
{
_vl_dsift_free_buffers (self) ;
if (self->convTmp2) vl_free (self->convTmp2) ;
if (self->convTmp1) vl_free (self->convTmp1) ;
vl_free (self) ;
} | false | false | false | false | false | 0 |
setLDAPRebindProc(LDAP *server, const char *user, const char *pw)
{
RebindData *data = (RebindData*)apr_palloc(module_pool, sizeof(RebindData));
if (user) data->user = apr_pstrdup(module_pool, user);
if (pw) data->pw = apr_pstrdup(module_pool, pw);
ldap_set_rebind_proc(server, admserv_ldap_rebind_proc, (voi... | false | false | false | false | false | 0 |
getUnclippedInnerRect() const
{
const WidgetLookFeel& lf(getLookNFeel());
if (lf.isNamedAreaDefined("inner_rect"))
return lf.getNamedArea("inner_rect").getArea().
getPixelRect(*d_window, d_window->getUnclippedOuterRect());
else
return d_window->getUnclippedOuterRect();
} | false | false | false | false | false | 0 |
tpl_text_channel_finalize (GObject *obj)
{
PATH_DEBUG (obj, "finalizing channel %p", obj);
G_OBJECT_CLASS (_tpl_text_channel_parent_class)->finalize (obj);
} | false | false | false | false | false | 0 |
DeleteRfmLabel(RfmLabel label)
{
if (label == NULL) {
return;
}
if (label->prev) {
label->prev->next = label->next;
} else {
if (label->module) {
label->module->label_list = label->next;
} else {
MSG_LOGICALERROR;
}
}
if (label->nex... | false | false | false | false | false | 0 |
previewgui_goto_xy (GuPreviewGui* pc, gdouble x, gdouble y) {
if (isnan(x) || isnan(y)) {
return;
}
//L_F_DEBUG;
x = CLAMP(x, 0, gtk_adjustment_get_upper(pc->hadj) -
gtk_adjustment_get_page_size(pc->hadj));
y = CLAMP(y, 0, gtk_adjustment_get_upper(pc->vadj) -
... | false | false | false | false | false | 0 |
register_kprobes(struct kprobe **kps, int num)
{
int i, ret = 0;
if (num <= 0)
return -EINVAL;
for (i = 0; i < num; i++) {
ret = register_kprobe(kps[i]);
if (ret < 0) {
if (i > 0)
unregister_kprobes(kps, i);
break;
}
}
return ret;
} | false | false | false | false | false | 0 |
internal_putbytes(const char *s, size_t len)
{
size_t amount;
while (len > 0)
{
/* If buffer is full, then flush it out */
if (PqSendPointer >= PQ_BUFFER_SIZE)
if (internal_flush())
return EOF;
amount = PQ_BUFFER_SIZE - PqSendPointer;
if (amount > len)
amount = len;
memcpy(PqSendBuffer + PqSend... | false | false | false | false | false | 0 |
merfun(field_t field1, field_t *field2, int function)
{
if ( function == func_min ) mermin(field1, field2);
else if ( function == func_max ) mermax(field1, field2);
else if ( function == func_sum ) mersum(field1, field2);
else if ( function == func_mean ) mermean(field1, field2);
else if ( funct... | false | false | false | false | false | 0 |
processSubpath(const Shape& s, bool tr, int expectedType)
{
const ASTrule* rule = 0;
if (m_cfdg->getShapeType(s.mShapeType) != CFDGImpl::pathType &&
primShape::isPrimShape(s.mShapeType) && expectedType == ASTreplacement::op)
{
rule = ASTrule::PrimitivePaths[s.mShapeType];
} else {
... | false | false | false | false | false | 0 |
parseTypeIndex(Solid::DvbInterface::DeviceType *type, int *index) const
{
QString string = device();
int pos = string.lastIndexOf('/');
if (pos < 0)
return false;
string = string.mid(pos + 1);
if (string.startsWith(QLatin1String("audio"))) {
*type = Solid::DvbInterface::DvbAudio;
... | false | false | false | false | false | 0 |
cpl_column_set_array(cpl_column *column,
cpl_size indx, const cpl_array *array)
{
const char *fid = "cpl_column_set_array";
cpl_size length = cpl_column_get_size(column);
cpl_type type = cpl_column_get_type(column);
cpl_type atype;
if (column == 0... | false | false | false | false | false | 0 |
build_dd(
DdManager * table,
int num /* the index of the individual to be built */,
int lower,
int upper)
{
int i,j; /* loop vars */
int position;
int index;
int limit; /* how large the DD for this order can grow */
int size;
/* Check the computed table. If the order already e... | false | false | false | false | false | 0 |
switchover_timeout(unsigned long data)
{
unsigned long flags = *(unsigned long *) data;
if ((flags & 1)) {
if ((inb(TLCLK_REG1) & 0x08) != (flags & 0x08))
alarm_events->switchover_primary++;
} else {
if ((inb(TLCLK_REG1) & 0x08) != (flags & 0x08))
alarm_events->switchover_secondary++;
}
/* Alarm proces... | false | false | false | false | false | 0 |
free_host (SoupSessionHost *host)
{
g_warn_if_fail (host->connections == NULL);
if (host->keep_alive_src) {
g_source_destroy (host->keep_alive_src);
g_source_unref (host->keep_alive_src);
}
soup_uri_free (host->uri);
g_object_unref (host->addr);
g_slice_free (SoupSessionHost, host);
} | false | false | false | false | false | 0 |
exif_tag_from_string (const char *string)
{
ExifTag tag;
unsigned int i, number;
int t;
const char *name;
if (!string)
return EXIF_INVALID_TAG;
/* Is the string a decimal number? */
if (strspn (string, "0123456789") == strlen (string))
return (atoi (string));
/* Is the string a hexadecimal number? */
if... | false | false | false | false | false | 0 |
gra_ps_polymarker(index, n, p) int index, n; Point *p;
{
double vx,vy,wx,wy,wz;
int *x, *y,
i,nm;
if (gra_state.cur_marker != index)
{
gra_state.cur_marker = index;
}
if (n > 0)
{
x = (int *)ALLOCMEM(n*sizeof(int));
y = (int *)ALLOCMEM(n*sizeof(int));
for(i=nm=0; i < n; i++)
{... | false | false | false | false | false | 0 |
ShowDebugStack()
{
if (mpisize)
cerr << " current line = " << TheCurrentLine
<< " mpirank " << mpirank << " / " << mpisize <<endl;
else
cerr << " current line = " << TheCurrentLine << endl;
while ( debugstack.size() )
{
cerr << " call " << debugstack.front().first->n... | false | false | false | false | false | 0 |
forward_substitution(const DenseMatrix &A, const DenseMatrix &b,
DenseMatrix &x)
{
CSYMPY_ASSERT(A.row_ == A.col_);
CSYMPY_ASSERT(b.row_ == A.row_ && b.col_ == 1);
CSYMPY_ASSERT(x.row_ == A.col_ && x.col_ == 1);
unsigned col = A.col_;
x.m_ = b.m_;
for (unsigned i = 0; i < col - 1; i++)
... | false | false | false | false | false | 0 |
copy(const cs * const sm)
{
ASSERTMSG_(sm->nz==-1, "I expected a column-compressed sparse matrix, not a triplet form.")
sparse_matrix.m = sm->m;
sparse_matrix.n = sm->n;
sparse_matrix.nz = sm->nz;
sparse_matrix.nzmax = sm->nzmax;
// Do it in a different way depending on it being triplet or compressed format:
... | false | false | false | false | false | 0 |
i2d_AC_ATTR(AC_ATTR *a, unsigned char **pp)
{
char text[1000];
M_ASN1_I2D_vars(a);
if (!i2t_ASN1_OBJECT(text,999,a->type))
return 0;
else if (!((strcmp(text, "idacagroup") == 0) || (strcmp(text,"idatcap") == 0)))
return 0;
M_ASN1_I2D_len(a->type, i2d_ASN1_OBJECT);
#if (OPENSSL_VERSION_NUMBER >= 0... | false | false | false | false | false | 0 |
Resize () {
if (canvas != nil) {
display->Draw(output, canvas);
display->Resize(0, 0, xmax, ymax);
int topmargin = (
perspective->height - perspective->curheight - perspective->cury
);
IntCoord height = ymax + 1;
IntCoord width = xmax + 1;
perspect... | false | false | false | false | false | 0 |
get_cursystfcall(struct h_t *hp)
{
vpiHandle ihref;
struct task_t *tskp;
if (hp != NULL)
{
__vpi_err(1833, vpiError,
"vpi_handle with 1-to-1 vpiSysTfCall NULL handle required - %s illegal",
__to_vpionam(__wrks1, hp->hrec->htyp));
return(NULL);
}
/* DBG remove --- */
if (__cur_sysf_expr == NULL... | false | false | false | false | false | 0 |
SetScales(const ScalesType & scales)
{
//Only the inverse is used computes the inverse at each iteration.
//provides 1 commone place where the inverse can be computes
//and validated.
m_InverseScales.SetSize(scales.GetSize());
for( unsigned int i = 0; i < scales.size(); ++i )
{
if ( scales[i] <= Nume... | false | false | false | false | false | 0 |
internalBondsPresent(TEditedMolecule * mQuery, TSimpleMolecule * mStructure) {
std::vector<int> aList(mStructure->nAtoms());
std::vector<int> bList(mStructure->nBonds());
unsigned int i, n1, n2;
bool result=false;
for (i=0; i<aList.size(); i++) aList[i]=0;
for (i=0; i<bList.size(); i++) bList[i... | false | false | false | false | false | 0 |
note_lookup(git_note **out, git_repository *repo,
const git_oid *tree_sha, const char *target)
{
int error, fanout = 0;
git_oid oid;
git_blob *blob;
git_tree *tree;
git_note *note;
error = find_subtree(&tree, tree_sha, repo, target, &fanout);
if (error < 0)
return error;
error = find_blob(&oid, tre... | false | false | false | false | false | 0 |
finish_automerge(struct commit_list *common,
unsigned char *result_tree,
const char *wt_strategy)
{
struct commit_list *parents = NULL, *j;
struct strbuf buf = STRBUF_INIT;
unsigned char result_commit[20];
free_commit_list(common);
if (allow_fast_forward) {
parents = remoteheads;
commit_list_ins... | true | true | false | false | false | 1 |
cha_s_read(FILE * fp)
{
if (Cha_lineno == 0)
Cha_lineno = 1;
Cha_lineno_error = Cha_lineno;
return s_read_main(fp);
} | false | false | false | false | false | 0 |
dialog( const QString & word, QStringList & sugg, const char *_slot )
{
dlgorigword = word;
dialog3slot = _slot;
dialogwillprocess = true;
connect( ksdlg, SIGNAL(command(int)), this, SLOT(dialog2(int)) );
QString tmpBuf = newbuffer;
kDebug(750)<<" position = "<<lastpos;
// extract a context string, repl... | false | false | false | false | false | 0 |
PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
if ( this->HandleProperty )
{
os << indent << "Handle Property: " << this->HandleProperty << "\n";
}
else
{
os << indent << "Handle Property: (none)\n";
}
if ( this->SelectedHandleProperty )
{
os ... | false | false | false | false | false | 0 |
remove_leading_promoters_starting_after( int32_t pos )
{
assert( pos >= 0 && pos < _dna->get_length() );
ae_list_node<ae_rna*>* rna_node = _rna_list[LEADING]->get_last();
// Delete RNAs until we pass pos ( or we reach the beginning of the list)
while ( rna_node != NULL && rna_node->get_obj()->get_promoter... | false | false | false | false | false | 0 |
gammal_positive (long double x, int *exp2_adj)
{
int local_signgam;
if (x < 0.5L)
{
*exp2_adj = 0;
return __ieee754_expl (__ieee754_lgammal_r (x + 1, &local_signgam)) / x;
}
else if (x <= 1.5L)
{
*exp2_adj = 0;
return __ieee754_expl (__ieee754_lgammal_r (x, &local_signgam));
... | false | false | false | false | false | 0 |
Substring_assign_shortexon_prob (T shortexon) {
if (shortexon->chimera_knownp == false) {
/* Prob1 already assigned */
} else if (shortexon->plusp == shortexon->chimera_sensep) {
shortexon->chimera_prob = Maxent_hr_acceptor_prob(shortexon->chimera_modelpos,shortexon->chroffset);
} else {
shortexon->c... | false | false | false | false | false | 0 |
Reset(void)
{
mState = eDetecting;
for (uint32_t i = 0; i < NUM_OF_ESC_CHARSETS; i++)
if (mCodingSM[i])
mCodingSM[i]->Reset();
mActiveSM = NUM_OF_ESC_CHARSETS;
mDetectedCharset = nullptr;
} | false | false | false | false | false | 0 |
operator<<(ostream & strum,TAddrClient &x)
{
if (x.DUID->getLen()==1)
strum << " <!-- 1-byte length DUID. DECLINED-ADDRESSES -->" << endl;
strum << " <AddrClient>" << endl;
if (x.DUID->getLen())
strum << " " << *x.DUID;
strum << " <!-- " << x.IAsLst.count() << " IA(s) -->" << endl;
SPtr<... | false | false | false | false | false | 0 |
veth_change_mtu(struct net_device *dev, int new_mtu)
{
if (!is_valid_veth_mtu(new_mtu))
return -EINVAL;
dev->mtu = new_mtu;
return 0;
} | false | false | false | false | false | 0 |
alloc_change(void)
{
static int border_changes_size = 0;
if( border_changes_size == border_changes_last ) {
border_changes_size += 10;
border_changes = libspectrum_realloc( border_changes,
border_changes_size *
sizeof( st... | false | false | false | false | false | 0 |
connect_fd (struct fujitsu *s)
{
SANE_Status ret;
int buffer_size = s->buffer_size;
DBG (10, "connect_fd: start\n");
if(s->fd > -1){
DBG (5, "connect_fd: already open\n");
ret = SANE_STATUS_GOOD;
}
else if (s->connection == CONNECTION_USB) {
DBG (15, "connect_fd: opening USB device\n");
re... | false | false | false | false | false | 0 |
runOnMachineFunction(MachineFunction &MF) override {
const X86TargetMachine *TM =
static_cast<const X86TargetMachine *>(&MF.getTarget());
const X86Subtarget &STI = MF.getSubtarget<X86Subtarget>();
// Don't do anything if this is 64-bit as 64-bit PIC
// uses RIP relative addressing.
... | false | false | false | false | false | 0 |
opt_rename(struct bouquet_ctx *ctx, int argc, char **argv)
{
struct bouquet *bp;
HTABLE_FOREACH(&ctx->bouquets, bp, struct bouquet, hash,
if (strcmp(argv[1], bp->bouquet_name) == 0) {
free(bp->bouquet_name);
bp->bouquet_name = strdup(argv[2]);
break;
}
);
} | false | false | false | false | false | 0 |
read(hsStream* S, plResManager* mgr) {
plSynchedObject::read(S, mgr);
fName = S->readSafeStr();
fStart = S->readFloat();
fEnd = S->readFloat();
clearApplicators();
fApps.setSizeNull(S->readInt());
for (size_t i=0; i<fApps.getSize(); i++) {
plAGApplicator* agApp = plAGApplicator::Co... | false | false | false | false | false | 0 |
installMeshInputBulkElements(bool clear_nodes)
{
Rc rc;
for (int i = 0; i < nofMeshInputElements; i++) {
MeshInputElement& te = meshInputElements[i];
// Add if bulk element
if ( te.type != 'U' ) continue;
rc = addMeshBulkElement(te.extElementId, te.extParentTag,
te.el... | false | false | false | false | false | 0 |
clunit_set_unit_name(cst_item *s,cst_clunit_db *clunit_db)
{
if (clunit_db->unit_name_func)
{
char *cname;
cname = (clunit_db->unit_name_func)(s);
item_set_string(s,"clunit_name",cname);
cst_free(cname);
}
else
{
/* is just the name by default */
item_set(s,"clunit_name",item_feat(s,"name"));
... | false | false | false | false | false | 0 |
op_operands(enum prog_opcode opcode)
{
int i;
/* Can we trust mesas opcodes to be in order ? */
for(i=0; i < sizeof(op_names) / sizeof(*op_names); i++)
if(op_names[i].opcode == opcode)
return op_names[i].ip;
fprintf(stderr, "op %d not found in op_names\n", opcode);
exit(-1);
return 0;
} | false | false | false | false | false | 0 |
ath10k_mac_set_txbf_conf(struct ath10k_vif *arvif)
{
u32 value = 0;
struct ath10k *ar = arvif->ar;
int nsts;
int sound_dim;
if (ath10k_wmi_get_txbf_conf_scheme(ar) != WMI_TXBF_CONF_BEFORE_ASSOC)
return 0;
nsts = ath10k_mac_get_vht_cap_bf_sts(ar);
if (ar->vht_cap_info & (IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABL... | false | false | false | false | false | 0 |
rk3x_i2c_prepare_read(struct rk3x_i2c *i2c)
{
unsigned int len = i2c->msg->len - i2c->processed;
u32 con;
con = i2c_readl(i2c, REG_CON);
/*
* The hw can read up to 32 bytes at a time. If we need more than one
* chunk, send an ACK after the last byte of the current chunk.
*/
if (len > 32) {
len = 32;
co... | false | false | false | false | false | 0 |
protected_get_length (gchar *str, guint offset)
{
gchar *ptr;
guint i;
ensure_static_blob_filled ();
for (i = 0, ptr = str; i < RANDOM_BLOB_SIZE - offset - 1; i++, ptr++) {
gchar c0, c1;
c0 = *ptr;
c1 = c0 ^ random_blob [offset + i];
if (!c1)
break;
}
return i;
} | false | false | false | false | false | 0 |
__ecereProp_Sheet_Get_sheetSelected(struct __ecereNameSpace__ecere__com__Instance * this)
{
struct Sheet * __ecerePointer_Sheet = (struct Sheet *)(this ? (((char *)this) + __ecereClass_Sheet->offset) : 0);
return __ecereProp___ecereNameSpace__ecere__gui__controls__Button_Get_checked(__ecerePointer_Sheet->methBtn) ? 0 ... | false | false | false | true | false | 1 |
tda9840_status(struct v4l2_subdev *sd)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
u8 byte;
if (1 != i2c_master_recv(client, &byte, 1)) {
v4l2_dbg(1, debug, sd,
"i2c_master_recv() failed\n");
return -EIO;
}
if (byte & 0x80) {
v4l2_dbg(1, debug, sd,
"TDA9840_DETECT: register contents invali... | false | false | false | false | false | 0 |
knh_getcid(CTX ctx, kbytes_t lname)
{
const knh_ClassTBL_t *ct = (const knh_ClassTBL_t *)knh_DictSet_get(ctx, ctx->share->classNameDictSet, lname);
if(ct != NULL) return ct->cid;
#if defined(K_USING_SEMANTICS)
if(lname.buf[lname.len-1] == '}') {
return knh_findcidx(ctx, lname);
}
#endif/*K_USING_SEMANTICS*/
retu... | false | false | false | false | false | 0 |
fqfstat(fq)
struct freq *fq;
{
int4 ret; /* result of stat() */
struct fdesc *f; /* target descriptor */
f = fdfind(fq->fq_tfd);
if (f == FDNULL) {
fsendr(fq->fq_src_node, fq->fq_src_event,
EBADF, (int4) LAMERROR, INT4_NIL, INT4_NIL);
} else {
fdactivate(f);
ret = fmyfstat(f->f_fd, fbuf);
fsend... | false | false | false | false | false | 0 |
set_my_tty(void)
{
char buf[BUFSIZE];
char *arglist[MAXARGS];
int argc;
FILE *pipe;
strcpy(pc->my_tty, "?");
if (file_exists("/usr/bin/tty", NULL)) {
sprintf(buf, "/usr/bin/tty");
if ((pipe = popen(buf, "r")) == NULL)
return;
whil... | true | true | false | false | true | 1 |
GenerateFaces()
{
if ( this->FacesGenerated )
{
return;
}
if (this->GlobalFaces->GetNumberOfTuples() == 0)
{
return;
}
// Basically we just ron through the faces and change the global ids to the
// canonical ids using the PointIdMap.
this->Faces->SetNumberOfTuples(this->GlobalFaces... | false | false | false | false | false | 0 |
read_command(char *filename, struct session *ses)
{
FILE *myfile;
char buffer[BUFFER_SIZE], lfname[BUFFER_SIZE];
get_arg_in_braces(filename, buffer, 1);
substitute_vars(buffer, filename);
substitute_myvars(filename, buffer, ses);
expand_filename(buffer, filename, lfname);
if (!*filename)
... | false | false | false | false | true | 1 |
ExecFindJunkAttributeInTlist(List *targetlist, const char *attrName)
{
ListCell *t;
foreach(t, targetlist)
{
TargetEntry *tle = lfirst(t);
if (tle->resjunk && tle->resname &&
(strcmp(tle->resname, attrName) == 0))
{
/* We found it ! */
return tle->resno;
}
}
return InvalidAttrNumber;
} | false | false | false | false | false | 0 |
cypress_force_mc_use_s0(struct radeon_device *rdev,
struct radeon_ps *radeon_boot_state)
{
struct rv7xx_ps *boot_state = rv770_get_ps(radeon_boot_state);
u32 strobe_mode;
u32 mc_seq_cg;
int i;
cypress_copy_ac_timing_from_s1_to_s0(rdev);
radeon_mc_wait_for_idle(rdev);
if ((rdev->family == CHIP_CYPRESS) ... | false | false | false | false | false | 0 |
GetHostI4( CString stringHost, struct sockaddr_in * sin, CString * errmsg )
{
CAsyncDnsEntry * AsyncDnsEntry;
eAsyncDns err;
// return if lock failed
if ( TryLock() == false )
{
return eadAGAIN;
}
err = eadERROR;
// sanity check
if ( m_pHostCache && m_pHostList && (stringHost.NotEmpty()) && sin )
{
i... | false | false | false | false | false | 0 |
gst_rfb_negotiate_pool (GstRfbSrc * src, GstCaps * caps)
{
GstQuery *query;
GstBufferPool *pool = NULL;
guint size, min, max;
GstStructure *config;
/* find a pool for the negotiated caps now */
query = gst_query_new_allocation (caps, TRUE);
if (!gst_pad_peer_query (GST_BASE_SRC_PAD (src), query)) {
... | false | false | false | false | false | 0 |
ATS_2d0_2e2_2e11_2src_2ats_dynexp2_2esats__staload () {
static int ATS_2d0_2e2_2e11_2src_2ats_dynexp2_2esats__staload_flag = 0 ;
if (ATS_2d0_2e2_2e11_2src_2ats_dynexp2_2esats__staload_flag) return ;
ATS_2d0_2e2_2e11_2src_2ats_dynexp2_2esats__staload_flag = 1 ;
ATS_2d0_2e2_2e11_2src_2ats_filename_2esats__staload () ;
A... | false | false | false | false | false | 0 |
alloc_tmp_rbuf(struct slgt_info *info)
{
info->tmp_rbuf = kmalloc(info->max_frame_size + 5, GFP_KERNEL);
if (info->tmp_rbuf == NULL)
return -ENOMEM;
/* unused flag buffer to satisfy receive_buf calling interface */
info->flag_buf = kzalloc(info->max_frame_size + 5, GFP_KERNEL);
if (!info->flag_buf) {
kfree(inf... | false | false | false | false | false | 0 |
hashtab_map(struct hashtab *h,
int (*apply)(void *k, void *d, void *args),
void *args)
{
u32 i;
int ret;
struct hashtab_node *cur;
if (!h)
return 0;
for (i = 0; i < h->size; i++) {
cur = h->htable[i];
while (cur) {
ret = apply(cur->key, cur->datum, args);
if (ret)
return ret;
cur = cur->ne... | false | false | false | false | false | 0 |
cache_flush_addr(struct cache_t *cp, /* cache instance to flush */
md_addr_t addr, /* address of block to flush */
tick_t now) /* time of cache flush */
{
md_addr_t tag = CACHE_TAG(cp, addr);
md_addr_t set = CACHE_SET(cp, addr);
struct cache_blk_t *blk;
int lat = cp->hit_latency; /* min latency to probe ... | false | false | false | false | false | 0 |
ajDomNodeListRemove(AjPDomNodeList list, AjPDomNode child)
{
AjPDomNodeEntry e;
AjPDomNode trukey;
if(!list)
{
ajDebug("ajDomNodeListRemove: Empty list");
return NULL;
}
if(list->filter)
{
ajDebug("ajDomNodeListRemove: Filtered list error");
return NULL;
... | false | false | false | false | false | 0 |
gv_get_vect(int id)
{
geovect *gv;
G_debug(5, "gv_get_vect() id=%d", id);
for (gv = Vect_top; gv; gv = gv->next) {
if (gv->gvect_id == id) {
return (gv);
}
}
return (NULL);
} | false | false | false | false | false | 0 |
Process(Address* start) {
map<string, string> global_scope_copy = global_scope_;
StatelessChangelist* change = new StatelessChangelist;
ParsedInstruction* parsed = new ParsedInstruction(start);
for(vector<InstructionComprehension*>::iterator it = instructioncomprehensions_.begin(); it != instructioncomprehens... | false | false | false | false | false | 0 |
davicom_transmit(struct nic *nic, const char *d, unsigned int t,
unsigned int s, const char *p)
{
unsigned long to;
whereami("davicom_transmit\n");
/* Stop Tx */
/* outl(inl(ioaddr + CSR6) & ~0x00002000, ioaddr + CSR6); */
/* setup ethernet header */
memcpy(&txb[0], d, ETH_ALEN... | false | true | false | false | false | 1 |
_ct_diag_clearmsg(CS_CONTEXT * context, CS_INT type)
{
struct cs_diag_msg_client *curptr, *freeptr;
struct cs_diag_msg_svr *scurptr, *sfreeptr;
tdsdump_log(TDS_DBG_FUNC, "_ct_diag_clearmsg(%p, %d)\n", context, type);
if (type == CS_CLIENTMSG_TYPE || type == CS_ALLMSG_TYPE) {
curptr = context->clientstore;
con... | false | false | false | false | false | 0 |
OnCtrlAltTab(cb_unused wxCommandEvent& event)
{
wxCommandEvent dummy;
switch (m_LastCtrlAltTabWindow)
{
case 1: // Focus is on the Mgmt. panel -> Cycle to Editor
m_LastCtrlAltTabWindow = 2;
OnFocusEditor(dummy);
break;
case 2: // Focus is on the Editor -> Cycle to Logs ... | false | false | false | false | false | 0 |
getEdgeWeight(const MachineBasicBlock *Src,
MachineBasicBlock::const_succ_iterator Dst) const {
uint32_t Weight = Src->getSuccWeight(Dst);
if (!Weight)
return DEFAULT_WEIGHT;
return Weight;
} | false | false | false | false | false | 0 |
gnc_tree_model_split_reg_destroy (GncTreeModelSplitReg *model)
{
GncTreeModelSplitRegPrivate *priv;
ENTER("Model is %p", model);
priv = model->priv;
g_object_unref (priv->description_list);
g_object_unref (priv->notes_list);
g_object_unref (priv->memo_list);
g_object_unref (priv->action_l... | false | false | false | false | false | 0 |
oldest_expired_lease(void)
{
struct dyn_lease *oldest_lease = NULL;
leasetime_t oldest_time = time(NULL);
unsigned i;
/* Unexpired leases have g_leases[i].expires >= current time
* and therefore can't ever match */
for (i = 0; i < server_config.max_leases; i++) {
if (g_leases[i].expires < oldest_time) {
ol... | false | false | false | false | false | 0 |
selectDirectoryClicked()
{
QFileDialog fileDialog( this );
fileDialog.setAcceptMode( QFileDialog::AcceptOpen );
fileDialog.setFileMode( QFileDialog::Directory );
fileDialog.setOptions( QFileDialog::ShowDirsOnly );
fileDialog.setDirectory( m_downloadDir );
if( fileDialog.exec() )
{
m... | false | false | false | false | false | 0 |
isLoopDead(Loop *L,
SmallVectorImpl<BasicBlock *> &exitingBlocks,
SmallVectorImpl<BasicBlock *> &exitBlocks,
bool &Changed, BasicBlock *Preheader) {
BasicBlock *exitBlock = exitBlocks[0];
// Make sure that all PHI entries com... | false | false | false | false | false | 0 |
addAutoContent(const QStringList & filePaths)
{
// simple auto-detection of the content type
foreach (const QString & localFile, filePaths) {
if (QFile::exists(localFile)) {
// Note: should use App.h for this, but dup'ed for isolation
if (localFile.endsWith(".fotowall", Qt::CaseI... | false | false | false | false | false | 0 |
save(FXStream& store) const {
FXuchar hadvertices,hadcolors,hadnormals,hadtextures;
FXGLShape::save(store);
store << vertexNumber;
hadvertices=(vertexBuffer!=NULL);
hadcolors=(colorBuffer!=NULL);
hadnormals=(normalBuffer!=NULL);
hadtextures=(textureBuffer!=NULL);
store << hadvertices << hadcolors << had... | false | false | false | false | false | 0 |
csio_wr_fixup_host_params(struct csio_hw *hw)
{
struct csio_wrm *wrm = csio_hw_to_wrm(hw);
struct csio_sge *sge = &wrm->sge;
uint32_t clsz = L1_CACHE_BYTES;
uint32_t s_hps = PAGE_SHIFT - 10;
uint32_t ingpad = 0;
uint32_t stat_len = clsz > 64 ? 128 : 64;
csio_wr_reg32(hw, HOSTPAGESIZEPF0_V(s_hps) | HOSTPAGESIZEP... | false | false | false | false | false | 0 |
countLhsDigits(double v)
{
if (v<0) v = -v; // Take abs value
else if (v==0) return 1; // Special case if v==0
int n=0;
for (; v<0.1; v*=10) // Count digits on right hand side (l.t. 0.1)
{ n--; }
for (; v>=1; v/=10) // Count digits on... | false | false | false | false | false | 0 |
ipa_record_reference (symtab_node referring_node,
symtab_node referred_node,
enum ipa_ref_use use_type, gimple stmt)
{
struct ipa_ref *ref;
struct ipa_ref_list *list, *list2;
ipa_ref_t *old_references;
gcc_checking_assert (!stmt || is_a <cgraph_node> (referring_node));
gcc_checking_assert (us... | false | false | false | false | false | 0 |
dm_thin_find_mapped_range(struct dm_thin_device *td,
dm_block_t begin, dm_block_t end,
dm_block_t *thin_begin, dm_block_t *thin_end,
dm_block_t *pool_begin, bool *maybe_shared)
{
int r;
dm_block_t pool_end;
struct dm_thin_lookup_result lookup;
if (end < begin)
return -ENODATA;
/*
*... | false | false | false | false | true | 1 |
parse_mailonchange(char *line)
{
char *address;
check_number_of_args(line, 2);
address = line;
line = CPS_SplitWord(line);
if (sscanf(line, "%lf", &mail_change_threshold) == 1) {
mail_user_on_change = strdup(address);
} else {
mail_user_on_change = NULL;
command_parse_error();
}
} | false | false | false | false | false | 0 |
MuTSetToOptimalCTRL(int file, unsigned long baud)
{
unsigned char packet[3];
struct termios options;
tcgetattr(file, &options);
options.c_cflag = baud | CS8 | CLOCAL | CREAD;
switch (baud) {
case B19200:
MuTSendPacket (file, "PN811", 5);
break;
... | false | false | false | false | false | 0 |
find_char_info_specifier_index (const format_char_info *fci, int c)
{
unsigned i;
for (i = 0; fci->format_chars; i++, fci++)
if (strchr (fci->format_chars, c))
return i;
/* We shouldn't be looking for a non-existent specifier. */
gcc_unreachable ();
} | false | false | false | false | false | 0 |
grow_tree_refs(struct audit_context *ctx)
{
struct audit_tree_refs *p = ctx->trees;
ctx->trees = kzalloc(sizeof(struct audit_tree_refs), GFP_KERNEL);
if (!ctx->trees) {
ctx->trees = p;
return 0;
}
if (p)
p->next = ctx->trees;
else
ctx->first_trees = ctx->trees;
ctx->tree_count = 31;
return 1;
} | false | false | false | false | false | 0 |
get_byte_array_output_stream_data(ByteArrayOutputStream * buf, char ** data, size_t * size) {
if (buf->mem == NULL) {
buf->max = buf->pos;
buf->mem = (char *)loc_alloc(buf->max);
memcpy(buf->mem, buf->buf, buf->pos);
}
if (data != NULL) *data = buf->mem;
if (size != NULL) *size =... | false | false | false | false | false | 0 |
ParsePublicPartyNumber(struct Aoc *chanp, u_char *p, u_char *end, char *str)
{
int publicTypeOfNumber;
char numberDigits[20];
INIT;
XSEQUENCE_1(ParsePublicTypeOfNumber, ASN1_TAG_ENUM, ASN1_NOT_TAGGED, &publicTypeOfNumber);
XSEQUENCE_1(ParseNumberDigits, ASN1_TAG_NUMERIC_STRING, ASN1_NOT_TAGGED, numberDigits);
... | false | false | false | false | true | 1 |
readmt(s) /* read through the "MThd" or "MTrk" header string */
char *s;
{
int n = 0;
char *p = s;
int c;
while ( n++<4 && (c=(*Mf_getc)()) != EOF ) {
if ( c != *p++ ) {
char buff[32];
(void) strcpy(buff,"expecting ");
(void) strcat(buff,s);
mferror(buff);
}
}
return(c);
} | 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.