Bug 797666: Add unsigned cast in assertion within TiledLayerBuffer::Update(), to fix build warning. r=BenWa
authorDaniel Holbert <dholbert@cs.stanford.edu>
Wed, 03 Oct 2012 22:31:59 -0700
changeset 115507 2b80eca0f4fb9ea498ef27f9bd0c0472d650615f
parent 115506 9fd65b219801594ba2328c7f8c336f3f9bff3abb
child 115508 ccdf4f53d3cb9112e5da6b6b65b51d251d9a1834
push id1708
push userakeybl@mozilla.com
push dateMon, 19 Nov 2012 21:10:21 +0000
treeherdermozilla-beta@27b14fe50103 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBenWa
bugs797666
milestone18.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 797666: Add unsigned cast in assertion within TiledLayerBuffer::Update(), to fix build warning. r=BenWa
gfx/layers/TiledLayerBuffer.h
--- a/gfx/layers/TiledLayerBuffer.h
+++ b/gfx/layers/TiledLayerBuffer.h
@@ -360,17 +360,20 @@ TiledLayerBuffer<Derived, Tile>::Update(
 #endif
         y += height;
         continue;
       }
 
       int tileX = floor_div(x - newBufferOrigin.x, GetTileLength());
       int tileY = floor_div(y - newBufferOrigin.y, GetTileLength());
       int index = tileX * mRetainedHeight + tileY;
-      NS_ABORT_IF_FALSE(index >= 0 && index < newRetainedTiles.Length(), "index out of range");
+      NS_ABORT_IF_FALSE(index >= 0 &&
+                        static_cast<unsigned>(index) < newRetainedTiles.Length(),
+                        "index out of range");
+
       Tile newTile = newRetainedTiles[index];
       while (IsPlaceholder(newTile) && oldRetainedTiles.Length() > 0) {
         AsDerived().SwapTiles(newTile, oldRetainedTiles[oldRetainedTiles.Length()-1]);
         oldRetainedTiles.RemoveElementAt(oldRetainedTiles.Length()-1);
       }
 
       // We've done our best effort to recycle a tile but it can be null
       // in which case it's up to the derived class's ValidateTile()