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 109318 2b80eca0f4fb9ea498ef27f9bd0c0472d650615f
parent 109317 9fd65b219801594ba2328c7f8c336f3f9bff3abb
child 109319 ccdf4f53d3cb9112e5da6b6b65b51d251d9a1834
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewersBenWa
bugs797666
milestone18.0a1
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()