fix warning about size_t >= 0 (which must always be true)

git-svn-id: http://skia.googlecode.com/svn/trunk@760 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@google.com 2011-02-07 13:20:30 +00:00
parent 686abdfab0
commit b89a643b69

View File

@ -274,17 +274,19 @@ static int countMatches(const GrTextureEntry* head, const GrTextureEntry* target
return count; return count;
} }
#if GR_DEBUG
static bool both_zero_or_nonzero(int count, size_t bytes) {
return (count == 0 && bytes == 0) || (count > 0 && bytes > 0);
}
#endif
void GrTextureCache::validate() const { void GrTextureCache::validate() const {
GrAssert(!fHead == !fTail); GrAssert(!fHead == !fTail);
GrAssert(!fEntryCount == !fEntryBytes); GrAssert(both_zero_or_nonzero(fEntryCount, fEntryBytes));
GrAssert(!fClientDetachedBytes == !fClientDetachedBytes); GrAssert(both_zero_or_nonzero(fClientDetachedCount, fClientDetachedBytes));
GrAssert(fClientDetachedBytes <= fEntryBytes); GrAssert(fClientDetachedBytes <= fEntryBytes);
GrAssert(fClientDetachedCount <= fEntryCount); GrAssert(fClientDetachedCount <= fEntryCount);
GrAssert((fEntryCount - fClientDetachedCount) == fCache.count()); GrAssert((fEntryCount - fClientDetachedCount) == fCache.count());
GrAssert(fEntryBytes >= 0);
GrAssert(fEntryCount >= 0);
GrAssert(fClientDetachedCount >= 0);
GrAssert(fClientDetachedBytes >= 0);
fCache.validate(); fCache.validate();