• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ NEVER函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中NEVER函数的典型用法代码示例。如果您正苦于以下问题:C++ NEVER函数的具体用法?C++ NEVER怎么用?C++ NEVER使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了NEVER函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:30,代码来源:TxtOp.cpp


示例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;
}
开发者ID:gitpan,项目名称:zxid,代码行数:61,代码来源:zxbusent.c


示例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;
}
开发者ID:wangyiran126,项目名称:sqlite,代码行数:72,代码来源:vtab.c


示例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;
}
开发者ID:cris-auts,项目名称:linux_c_study,代码行数:46,代码来源:attach.c


示例5: NEVER

IconDes::Slot& IconDes::Current()
{
	if(ilist.IsCursor())
		return slot[ilist.GetKey()];
	NEVER();
	return dummy;
}
开发者ID:ultimatepp,项目名称:mirror,代码行数:7,代码来源:IconDes.cpp


示例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();
	}
	
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:34,代码来源:Marker.cpp


示例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;
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:60,代码来源:TimeDate.cpp


示例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;
}
开发者ID:blingstorm,项目名称:sqlcipher,代码行数:34,代码来源:func.c


示例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;
}
开发者ID:antonywcl,项目名称:AR-5315u_PLD,代码行数:30,代码来源:pcache.c


示例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;
}
开发者ID:qtekfun,项目名称:htcDesire820Kernel,代码行数:27,代码来源:pcache.c


示例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();
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:29,代码来源:main.cpp


示例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;
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:31,代码来源:ODBC.cpp


示例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;
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:40,代码来源:Updater.cpp


示例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;
		}
	}
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:26,代码来源:gdal.cpp


示例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;
}
开发者ID:FarazShaikh,项目名称:LikewiseSMB2,代码行数:40,代码来源:attach.c


示例16: checkColumnOverlap

/*
 ** pEList is the SET clause of an UPDATE statement.  Each entry
 ** in pEList is of the format <id>=<expr>.  If any of the entries
 ** in pEList have an <id> which matches an identifier in pIdList,
 ** then return TRUE.  If pIdList==NULL, then it is considered a
 ** wildcard that matches anything.  Likewise if pEList==NULL then
 ** it matches anything so always return true.  Return false only
 ** if there is no match.
 */
static int checkColumnOverlap(IdList *pIdList, ExprList *pEList){
    int e;
    if( pIdList==0 || NEVER(pEList==0) ) return 1;
    for(e=0; e<pEList->nExpr; e++){
        if( sqlite3IdListIndex(pIdList, pEList->a[e].zName)>=0 ) return 1;
    }
    return 0;
}
开发者ID:pchernev,项目名称:Objective-C-iOS-Categories,代码行数:17,代码来源:trigger.c


示例17: NEVER

MultiButton::SubButton& MultiButton::MainButton()
{
	for(int i = 0; i < button.GetCount(); i++)
		if(button[i].main)
			return button[i];
	NEVER();
	return button[0];
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:8,代码来源:MultiButton.cpp


示例18: png_create_write_struct

void PNGEncoder::Data::Start(Stream& stream, Size size_, int bpp, ImageKind kind_, bool interlace_,
	const RGBA *imgpal)
{
	size = size_;
	kind = kind_;
	interlace = interlace_;

	png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, png_user_error_fn, png_user_warning_fn);
	if(!png_ptr) {
		stream.SetError();
		return;
	}

	/* Allocate/initialize the image information data.  REQUIRED */
	info_ptr = png_create_info_struct(png_ptr);
	if(!info_ptr) {
		stream.SetError();
		return;
	}

/*
	if (setjmp(png_jmpbuf(png_ptr))) {
		png_destroy_write_struct(&png_ptr, &info_ptr);
		sptr -> SetError();
		return;
	}
*/
	png_set_write_fn(png_ptr, (void *)&stream, png_write_stream, png_flush_stream);

	int color_type, bit_depth;
	Vector<png_color> palette;

	do_alpha = (kind != IMAGE_OPAQUE && bpp != 1);
	do_mask = (do_alpha && kind == IMAGE_MASK);
	do_palette = (bpp <= 8);

	if(do_palette) {
		switch(bpp) {
			case 1: format.Set1mf(); break;
			case 2: format.Set2mf(); break;
			case 4: format.Set4mf(); break;
			default: NEVER();
			case 8: format.Set8(); break;
		}
		bit_depth = bpp;
		color_type = PNG_COLOR_TYPE_PALETTE;
		palette.SetCount(1 << bpp);
		for(int i = 0; i < palette.GetCount(); i++) {
			png_color& c = palette[i];
			c.red = imgpal[i].r;
			c.green = imgpal[i].g;
			c.blue = imgpal[i].b;
		}
		rowbytes = (size.cx * bpp + 31) >> 5 << 2;
	}
	else {
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:56,代码来源:pngupp.cpp


示例19: sqlite3MemdbInit

/* 
** This routine is called when the extension is loaded.
** Register the new VFS.
*/
int sqlite3MemdbInit(void){
  sqlite3_vfs *pLower = sqlite3_vfs_find(0);
  int sz = pLower->szOsFile;
  memdb_vfs.pAppData = pLower;
  /* In all known configurations of SQLite, the size of a default
  ** sqlite3_file is greater than the size of a memdb sqlite3_file.
  ** Should that ever change, remove the following NEVER() */
  if( NEVER(sz<sizeof(MemFile)) ) sz = sizeof(MemFile);
  memdb_vfs.szOsFile = sz;
  return sqlite3_vfs_register(&memdb_vfs, 0);
}
开发者ID:cris-auts,项目名称:linux_c_study,代码行数:15,代码来源:memdb.c


示例20: switch

// lays toolbars inside frame
void XMLToolBarFrame::Layout(void)
{
	// don't layout if still no parent
	if(!parent)
		return;
	for(int iRow = 0; iRow < posMapper.GetCount(); iRow++)
	{
		int rowPos = posMapper.GetKey(iRow);
		VectorMap<int, int> &rowMapper = posMapper[iRow];
		for(int iCol = 0; iCol < rowMapper.GetCount(); iCol++)
		{
			int colPos = rowMapper.GetKey(iCol);
			int idx = rowMapper[iCol];
			XMLToolBarCtrl &tb = *toolBars[idx];
			Ctrl::LogPos pos;
			Size sz;
			int x1, y1, x2, y2;
			switch(toolBarState)
			{
				case TOOLBAR_LEFT :
				case TOOLBAR_RIGHT :
					sz = tb.GetVertSize();
					x1 = rowPos;
					y1 = colPos;
					break;
					
				case TOOLBAR_TOP :
				case TOOLBAR_BOTTOM :
					sz = tb.GetHorzSize();
					x1 = colPos;
					y1 = rowPos;
					break;
					
				default : 
					NEVER();
					break;
			}
			x2 = x1 + sz.cx;
			y2 = y1 + sz.cy;

			// don't add last toolbar as a child if predocking
			if(!preDocking || &tb != toolBars.Top())
			{
				pos = Ctrl::LogPos(
					Ctrl::PosLeft(x1, x2 - x1),
					Ctrl::PosTop(y1, y2 - y1)
				);
				tb.SetPos(pos);
			}
			if(preDocking && &tb == toolBars.Top())
				preDockRect = Rect(x1, y1, x2, y2);
		}
	}
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:55,代码来源:XMLToolBarFrame.cpp



注:本文中的NEVER函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ NEW2函数代码示例发布时间:2022-05-30
下一篇:
C++ NETuint8_t函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap