diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-02-07 13:20:30 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-02-07 13:20:30 +0000 |
commit | b89a643b6992d478c0b8bda3abc53f37a87dbd22 (patch) | |
tree | 2708c7d0e5981edb15b3541269203e09724c432b /gpu/src | |
parent | 686abdfab0e4c45de1fd30774896c46e43a299ac (diff) |
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
Diffstat (limited to 'gpu/src')
-rw-r--r-- | gpu/src/GrTextureCache.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/gpu/src/GrTextureCache.cpp b/gpu/src/GrTextureCache.cpp index bc2a9043e6..e27272ec25 100644 --- a/gpu/src/GrTextureCache.cpp +++ b/gpu/src/GrTextureCache.cpp @@ -274,17 +274,19 @@ static int countMatches(const GrTextureEntry* head, const GrTextureEntry* target 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 { GrAssert(!fHead == !fTail); - GrAssert(!fEntryCount == !fEntryBytes); - GrAssert(!fClientDetachedBytes == !fClientDetachedBytes); + GrAssert(both_zero_or_nonzero(fEntryCount, fEntryBytes)); + GrAssert(both_zero_or_nonzero(fClientDetachedCount, fClientDetachedBytes)); GrAssert(fClientDetachedBytes <= fEntryBytes); GrAssert(fClientDetachedCount <= fEntryCount); GrAssert((fEntryCount - fClientDetachedCount) == fCache.count()); - GrAssert(fEntryBytes >= 0); - GrAssert(fEntryCount >= 0); - GrAssert(fClientDetachedCount >= 0); - GrAssert(fClientDetachedBytes >= 0); fCache.validate(); |