Bug 803641: Fix signed/unsigned-comparison build warnings in TestTArray.cpp, and mark its directory as warning-free. r=jlebar
authorDaniel Holbert <dholbert@cs.stanford.edu>
Fri, 19 Oct 2012 13:26:50 -0700
changeset 110946 fcc8dc83fa784c64f6a22be4ae609e0e7523556d
parent 110945 bf8679d1a2f0b66905118c4c39b4d5e60ab2d595
child 110947 b47dfc639029e7b6b2aab2b923822641e665d001
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersjlebar
bugs803641
milestone19.0a1
Bug 803641: Fix signed/unsigned-comparison build warnings in TestTArray.cpp, and mark its directory as warning-free. r=jlebar
xpcom/tests/TestTArray.cpp
--- a/xpcom/tests/TestTArray.cpp
+++ b/xpcom/tests/TestTArray.cpp
@@ -716,37 +716,37 @@ static bool test_swap() {
 
     CHECK_ARRAY(a, data2);
     CHECK_EQ_INT(b.Length(), 0);
     CHECK_IS_USING_AUTO(b);
   }
 
   // Swap two big auto arrays.
   {
-    const int size = 8192;
-    nsAutoTArray<int, size> a;
-    nsAutoTArray<int, size> b;
+    const unsigned size = 8192;
+    nsAutoTArray<unsigned, size> a;
+    nsAutoTArray<unsigned, size> b;
 
-    for (int i = 0; i < size; i++) {
+    for (unsigned i = 0; i < size; i++) {
       a.AppendElement(i);
       b.AppendElement(i + 1);
     }
 
     CHECK_IS_USING_AUTO(a);
     CHECK_IS_USING_AUTO(b);
 
     a.SwapElements(b);
 
     CHECK_IS_USING_AUTO(a);
     CHECK_IS_USING_AUTO(b);
 
     CHECK_EQ_INT(a.Length(), size);
     CHECK_EQ_INT(b.Length(), size);
 
-    for (int i = 0; i < size; i++) {
+    for (unsigned i = 0; i < size; i++) {
       CHECK_EQ_INT(a[i], i + 1);
       CHECK_EQ_INT(b[i], i);
     }
   }
 
   // Swap two arrays and make sure that their capacities don't increase
   // unnecessarily.
   {