本文整理汇总了C++中NEVER函数的典型用法代码示例。如果您正苦于以下问题:C++ NEVER函数的具体用法?C++ NEVER怎么用?C++ NEVER使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NEVER函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Invalidate
RichTxt& RichTxt::GetTableUpdateText(int table, const RichStyles& style, int& pi)
{
Invalidate();
for(int i = 0;; i++)
if(IsTable(i)) {
table--;
RichTable& tab = part[i].Get<RichTable>();
if(table <= tab.GetTableCount()) {
SetRefresh(i);
if(table == 0) {
pi = i;
return *this;
}
for(int i = 0; i < tab.GetRows(); i++)
for(int j = 0; j < tab.GetColumns(); j++)
if(tab(i, j)) {
RichTxt& txt = tab[i][j].text;
if(table <= txt.GetTableCount()) {
tab.InvalidateRefresh(i, j);
return txt.GetTableUpdateText(table, style, pi);
}
table -= txt.GetTableCount();
}
NEVER();
}
else
table -= tab.GetTableCount();
}
NEVER();
}
示例2: zxbus_login_subj_hash
/* Called by: */
int zxbus_login_subj_hash(struct hi_thr* hit, struct hi_io* io, unsigned long subj_hash)
{
struct hi_ent* ent;
char* p;
char* eid;
char buf[1024];
if (!read_all(sizeof(buf), buf, "ClientTLS login", 1,
"%s" ZXID_UID_DIR "/%lu/.bs/.at", zxbus_path, subj_hash)) {
ERR("Login by ClienTLS failed subj_hash(%lu). No such uid.", subj_hash);
return 0;
}
if (!(eid = strstr(buf, "eid: "))) {
ERR("Login by ClienTLS failed subj_hash(%lu). .bs/.at file does not specify eid", subj_hash);
return 0;
}
eid += sizeof("eid: ")-1;
if (p = strchr(eid, '\n'))
*p = 0;
LOCK(hit->shf->ent_mut, "subj_hash");
D("LOCK ent_mut->thr=%x (%s:%d)", hit->shf->ent_mut.thr, hit->shf->ent_mut.func, hit->shf->ent_mut.line);
if (!(ent = zxbus_load_ent(hit->shf, -1, eid))) {
if (hit->shf->anonlogin) {
ent = zxbus_new_ent(hit->shf, -1, eid);
INFO("Anon login eid(%s)", ent->eid);
/* *** consider persisting the newly created account */
} else {
D("UNLOCK ent_mut->thr=%x (%s:%d)", hit->shf->ent_mut.thr, hit->shf->ent_mut.func, hit->shf->ent_mut.line);
UNLOCK(hit->shf->ent_mut, "subj_hash-fail");
ERR("Login account(%s) does not exist and no anon login", eid);
return 0;
}
}
if (ent->io) {
if (ent->io == io) {
NEVER("Entity has io already set to current io_%p", io);
} else {
NEVER("Entity has io already set to different io_%p", ent->io);
}
}
ent->io = io;
LOCK(io->qel.mut, "subj_hash");
D("LOCK io(%x)->qel.mut->thr=%x (%s:%d)", io->qel.mut.thr, io->qel.mut.func, io->qel.mut.line);
if (io->ent) {
if (io->ent == ent) {
NEVER("io has ent already set to current ent_%p", ent);
} else {
NEVER("io has ent already set to different ent_%p", ent);
}
}
io->ent = ent;
D("UNLOCK io(%x)->qel.mut->thr=%x (%s:%d)", io->qel.mut.thr, io->qel.mut.func, io->qel.mut.line);
UNLOCK(io->qel.mut, "subj_hash");
D("UNLOCK ent_mut->thr=%x (%s:%d)", hit->shf->ent_mut.thr, hit->shf->ent_mut.func, hit->shf->ent_mut.line);
UNLOCK(hit->shf->ent_mut, "subj_hash");
return 1;
}
示例3: void
/*
** The first parameter (pDef) is a function implementation. The
** second parameter (pExpr) is the first argument to this function.
** If pExpr is a column in a virtual table, then let the virtual
** table implementation have an opportunity to overload the function.
**
** This routine is used to allow virtual table implementations to
** overload MATCH, LIKE, GLOB, and REGEXP operators.
**
** Return either the pDef argument (indicating no change) or a
** new FuncDef structure that is marked as ephemeral using the
** SQLITE_FUNC_EPHEM flag.
*/
FuncDef *sqlite3VtabOverloadFunction(
sqlite3 *db, /* Database connection for reporting malloc problems */
FuncDef *pDef, /* Function to possibly overload */
int nArg, /* Number of arguments to the function */
Expr *pExpr /* First argument to the function */
){
Table *pTab;
sqlite3_vtab *pVtab;
sqlite3_module *pMod;
void (*xSFunc)(sqlite3_context*,int,sqlite3_value**) = 0;
void *pArg = 0;
FuncDef *pNew;
int rc = 0;
char *zLowerName;
unsigned char *z;
/* Check to see the left operand is a column in a virtual table */
if( NEVER(pExpr==0) ) return pDef;
if( pExpr->op!=TK_COLUMN ) return pDef;
pTab = pExpr->pTab;
if( NEVER(pTab==0) ) return pDef;
if( (pTab->tabFlags & TF_Virtual)==0 ) return pDef;
pVtab = sqlite3GetVTable(db, pTab)->pVtab;
assert( pVtab!=0 );
assert( pVtab->pModule!=0 );
pMod = (sqlite3_module *)pVtab->pModule;
if( pMod->xFindFunction==0 ) return pDef;
/* Call the xFindFunction method on the virtual table implementation
** to see if the implementation wants to overload this function
*/
zLowerName = sqlite3DbStrDup(db, pDef->zName);
if( zLowerName ){
for(z=(unsigned char*)zLowerName; *z; z++){
*z = sqlite3UpperToLower[*z];
}
rc = pMod->xFindFunction(pVtab, nArg, zLowerName, &xSFunc, &pArg);
sqlite3DbFree(db, zLowerName);
}
if( rc==0 ){
return pDef;
}
/* Create a new ephemeral function definition for the overloaded
** function */
pNew = sqlite3DbMallocZero(db, sizeof(*pNew)
+ sqlite3Strlen30(pDef->zName) + 1);
if( pNew==0 ){
return pDef;
}
*pNew = *pDef;
pNew->zName = (const char*)&pNew[1];
memcpy((char*)&pNew[1], pDef->zName, sqlite3Strlen30(pDef->zName)+1);
pNew->xSFunc = xSFunc;
pNew->pUserData = pArg;
pNew->funcFlags |= SQLITE_FUNC_EPHEM;
return pNew;
}
示例4: sqlite3FixSrcList
/*
** The following set of routines walk through the parse tree and assign
** a specific database to all table references where the database name
** was left unspecified in the original SQL statement. The pFix structure
** must have been initialized by a prior call to sqlite3FixInit().
**
** These routines are used to make sure that an index, trigger, or
** view in one database does not refer to objects in a different database.
** (Exception: indices, triggers, and views in the TEMP database are
** allowed to refer to anything.) If a reference is explicitly made
** to an object in a different database, an error message is added to
** pParse->zErrMsg and these routines return non-zero. If everything
** checks out, these routines return 0.
*/
int sqlite3FixSrcList(
DbFixer *pFix, /* Context of the fixation */
SrcList *pList /* The Source list to check and modify */
){
int i;
const char *zDb;
struct SrcList_item *pItem;
if( NEVER(pList==0) ) return 0;
zDb = pFix->zDb;
for(i=0, pItem=pList->a; i<pList->nSrc; i++, pItem++){
if( pFix->bVarOnly==0 ){
if( pItem->zDatabase && sqlite3StrICmp(pItem->zDatabase, zDb) ){
sqlite3ErrorMsg(pFix->pParse,
"%s %T cannot reference objects in database %s",
pFix->zType, pFix->pName, pItem->zDatabase);
return 1;
}
sqlite3DbFree(pFix->pParse->db, pItem->zDatabase);
pItem->zDatabase = 0;
pItem->pSchema = pFix->pSchema;
}
#if !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_TRIGGER)
if( sqlite3FixSelect(pFix, pItem->pSelect) ) return 1;
if( sqlite3FixExpr(pFix, pItem->pOn) ) return 1;
#endif
if( pItem->fg.isTabFunc && sqlite3FixExprList(pFix, pItem->u1.pFuncArg) ){
return 1;
}
}
return 0;
}
示例5: NEVER
IconDes::Slot& IconDes::Current()
{
if(ilist.IsCursor())
return slot[ilist.GetKey()];
NEVER();
return dummy;
}
示例6: switch
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// gets rectangular bounding box of marker
Rect Marker::GetBoundingBox() const
{
switch(kind)
{
case EmptyMarker:
return Rect(0, 0, 0, 0);
case RectMarker:
return Rect(points[0], points[1]);
case PolyMarker:
{
int minX = INT_MAX;
int maxX = INT_MIN;
int minY = INT_MAX;
int maxY = INT_MIN;
for(int i = 0; i < points.GetCount(); i++)
{
Point p = points[i];
if(p.x < minX) minX = p.x;
if(p.x > maxX) maxX = p.x;
if(p.y < minY) minY = p.y;
if(p.y > maxY) maxY = p.y;
}
return Rect(minX, minY, maxX, maxY);
}
default:
NEVER();
}
}
示例7: Nvl
const char *StrToDate(const char *fmt, Date& d, const char *s, Date def)
{
if(*s == 0) {
d = Null;
return s;
}
d = Nvl(def, GetSysDate());
while(*fmt) {
while(*s && !IsDigit(*s) && !IsAlpha(*s) && (byte)*s < 128)
s++;
int n;
if(IsDigit(*s)) {
char *q;
n = strtoul(s, &q, 10);
s = q;
}
else
if(IsAlpha(*s) || (byte)*s >= 128) {
if(*fmt != 'm')
return NULL;
String m;
while(IsAlpha(*s) || (byte)*s >= 128)
m.Cat(*s++);
m = ToUpper(m);
for(int i = 0; i < 12; i++)
if(m == ToUpper(MonthName(i)) || m == ToUpper(MonName(i))) {
n = i + 1;
goto found;
}
return NULL;
found:
;
}
else
break;
switch(*fmt) {
case 'd':
if(n < 1 || n > 31)
return NULL;
d.day = n;
break;
case 'm':
if(n < 1 || n > 12)
return NULL;
d.month = n;
break;
case 'y':
d.year = n;
if(d.year < 25) d.year += 2000; // Check again in 2020.... // TODO: Make this automatic
else
if(d.year < 100) d.year += 1900;
break;
default:
NEVER();
}
fmt++;
}
return d.IsValid() ? s : NULL;
}
示例8: sqlite3IsLikeFunction
/*
** pExpr points to an expression which implements a function. If
** it is appropriate to apply the LIKE optimization to that function
** then set aWc[0] through aWc[2] to the wildcard characters and
** return TRUE. If the function is not a LIKE-style function then
** return FALSE.
*/
int sqlite3IsLikeFunction(sqlite3 *db, Expr *pExpr, int *pIsNocase, char *aWc){
FuncDef *pDef;
if( pExpr->op!=TK_FUNCTION
|| !pExpr->x.pList
|| pExpr->x.pList->nExpr!=2
){
return 0;
}
assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
pDef = sqlite3FindFunction(db, pExpr->u.zToken,
sqlite3Strlen30(pExpr->u.zToken),
2, SQLITE_UTF8, 0);
if( NEVER(pDef==0) || (pDef->flags & SQLITE_FUNC_LIKE)==0 ){
return 0;
}
/* The memcpy() statement assumes that the wildcard characters are
** the first three statements in the compareInfo structure. The
** asserts() that follow verify that assumption
*/
memcpy(aWc, pDef->pUserData, 3);
assert( (char*)&likeInfoAlt == (char*)&likeInfoAlt.matchAll );
assert( &((char*)&likeInfoAlt)[1] == (char*)&likeInfoAlt.matchOne );
assert( &((char*)&likeInfoAlt)[2] == (char*)&likeInfoAlt.matchSet );
*pIsNocase = (pDef->flags & SQLITE_FUNC_CASE)==0;
return 1;
}
示例9: memset
static PgHdr *pcacheSortDirtyList(PgHdr *pIn){
PgHdr *a[N_SORT_BUCKET], *p;
int i;
memset(a, 0, sizeof(a));
while( pIn ){
p = pIn;
pIn = p->pDirty;
p->pDirty = 0;
for(i=0; ALWAYS(i<N_SORT_BUCKET-1); i++){
if( a[i]==0 ){
a[i] = p;
break;
}else{
p = pcacheMergeDirtyList(a[i], p);
a[i] = 0;
}
}
if( NEVER(i==N_SORT_BUCKET-1) ){
/* To get here, there need to be 2^(N_SORT_BUCKET) elements in
** the input list. But that is impossible.
*/
a[i] = pcacheMergeDirtyList(a[i], p);
}
}
p = a[0];
for(i=1; i<N_SORT_BUCKET; i++){
p = pcacheMergeDirtyList(p, a[i]);
}
return p;
}
示例10: memset
static PgHdr *pcacheSortDirtyList(PgHdr *pIn){
PgHdr *a[N_SORT_BUCKET], *p;
int i;
memset(a, 0, sizeof(a));
while( pIn ){
p = pIn;
pIn = p->pDirty;
p->pDirty = 0;
for(i=0; ALWAYS(i<N_SORT_BUCKET-1); i++){
if( a[i]==0 ){
a[i] = p;
break;
}else{
p = pcacheMergeDirtyList(a[i], p);
a[i] = 0;
}
}
if( NEVER(i==N_SORT_BUCKET-1) ){
a[i] = pcacheMergeDirtyList(a[i], p);
}
}
p = a[0];
for(i=1; i<N_SORT_BUCKET; i++){
p = pcacheMergeDirtyList(p, a[i]);
}
return p;
}
示例11: while
void XmlView::Load(int parent, XmlParser& p)
{
if(p.IsTag()) {
String tag = p.ReadTag();
String txt = tag;
for(int i = 0; i < p.GetAttrCount(); i++)
txt << ' ' << p.GetAttr(i) << "=\"" << p[i] << "\"";
parent = xml.Add(parent, XmlImg::Tag(), tag, txt);
while(!p.End()) {
if(p.IsEof())
throw XmlError("");
Load(parent, p);
}
}
else
if(p.IsText())
xml.Add(parent, XmlImg::Text(), Null, NormalizeSpaces(p.ReadText()));
else
if(p.IsPI())
xml.Add(parent, XmlImg::PI(), Null, NormalizeSpaces(p.ReadPI()));
else
if(p.IsDecl())
xml.Add(parent, XmlImg::Decl(), Null, NormalizeSpaces(p.ReadDecl()));
else
if(p.IsComment())
xml.Add(parent, XmlImg::Comment(), Null, NormalizeSpaces(p.ReadComment()));
else
NEVER();
}
示例12: switch
bool ODBCConnection::Fetch()
{
if(rowi >= rowcount)
return false;
fetchrow.Clear();
for(int i = 0; i < info.GetCount(); i++) {
Value v;
switch(info[i].type) {
case DOUBLE_V:
v = number[number_i++];
break;
case INT64_V:
v = num64[num64_i++];
break;
case TIME_V:
v = time[time_i++];
break;
case DATE_V:
v = date[date_i++];
break;
case STRING_V:
v = text[text_i++];
break;
default:
NEVER();
}
fetchrow.Add(v);
}
++rowi;
return true;
}
示例13: RealizeDirectory
///////////////////////////////////////////////////////////////////////////////////////
// main updater call
// returns TRUE if app should continue, FALSE if should terminate
// BEWARE, app MUST check for return value AND behave as needed
// te SELF_UPDATE() macro does all what is needed
bool Updater::Run()
{
// create user config path only on normal run
if(state == NormalRun)
RealizeDirectory(userConfigPath);
// creates system config path on superuser mode
if(state == InsideUpdater)
RealizeDirectory(systemConfigPath);
switch(state)
{
case NormalRun :
return DO_NormalRun();
case InsideUpdater :
return DO_InsideUpdater();
case UninstallFailed :
return DO_UninstallFailed();
case InstallFailed :
return DO_InstallFailed();
case UpdateFailed :
return DO_UpdateFailed();
case UninstallSucceeded :
return DO_UninstallSucceeded();
case InstallSucceeded :
return DO_InstallSucceeded();
case UpdateSucceeded :
return DO_UpdateSucceeded();
default:
NEVER();
break;
}
// dummy
return false;
}
示例14: ASSERT
void Gdal::Block::GetDouble(double *out, int x, int y, int count) const
{
ASSERT(x >= 0 && x + count <= size.cx);
ASSERT(y >= 0 && y < size.cy);
int offset = (x + y * size.cx) * pixel_bytes;
const byte *raw_src = &bytes[offset];
switch(type) {
case GDT_Byte: CONVERT_LOOP(byte, *src);
case GDT_UInt16: CONVERT_LOOP(uint16, *src);
case GDT_Int16: CONVERT_LOOP(int16, *src);
case GDT_UInt32: CONVERT_LOOP(uint32, (int)*src);
case GDT_Int32: CONVERT_LOOP(int32, (int)*src);
case GDT_Float32: CONVERT_LOOP(float, (double)*src);
case GDT_Float64: CONVERT_LOOP(double, *src);
case GDT_CInt16: CONVERT_LOOP(Point16, src->x);
case GDT_CInt32: CONVERT_LOOP(Point, src->x);
case GDT_CFloat32: CONVERT_LOOP(Point_<float>, (double)src->x);
case GDT_CFloat64: CONVERT_LOOP(Pointf, src->x);
default: {
Fill(out, out + count, (double)Null);
RLOG("unsupported GDAL data type: " << (int)type);
NEVER();
break;
}
}
}
示例15: sqlite3FixSrcList
/*
** The following set of routines walk through the parse tree and assign
** a specific database to all table references where the database name
** was left unspecified in the original SQL statement. The pFix structure
** must have been initialized by a prior call to sqlite3FixInit().
**
** These routines are used to make sure that an index, trigger, or
** view in one database does not refer to objects in a different database.
** (Exception: indices, triggers, and views in the TEMP database are
** allowed to refer to anything.) If a reference is explicitly made
** to an object in a different database, an error message is added to
** pParse->zErrMsg and these routines return non-zero. If everything
** checks out, these routines return 0.
*/
int sqlite3FixSrcList(
DbFixer *pFix, /* Context of the fixation */
SrcList *pList /* The Source list to check and modify */
){
int i;
const char *zDb;
struct SrcList_item *pItem;
if( NEVER(pList==0) ) return 0;
zDb = pFix->zDb;
for(i=0, pItem=pList->a; i<pList->nSrc; i++, pItem++){
if( pItem->zDatabase==0 ){
pItem->zDatabase = sqlite3DbStrDup(pFix->pParse->db, zDb);
}else if( sqlite3StrICmp(pItem->zDatabase,zDb)!=0 ){
sqlite3ErrorMsg(pFix->pParse,
"%s %T cannot reference objects in database %s",
pFix->zType, pFix->pName, pItem->zDatabase);
return 1;
}
#if !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_TRIGGER)
if( sqlite3FixSelect(pFix, pItem->pSelect) ) return 1;
if( sqlite3FixExpr(pFix, pItem->pOn) ) return 1;
#endif
}
return 0;
}