Bug 940329: avoid warnings from using size_t in ImplCycleCollectionTraverse() r=ehsan
authorRandell Jesup <rjesup@jesup.org>
Sun, 27 Apr 2014 00:29:18 -0400
changeset 198969 e248f673c2f222e9a3aeafc5673e8bd7000e6db1
parent 198968 ea4471fb806febd3454ccd076ca7ef4cddf55a72
child 198970 ea25086073c8faa8df41a0e1aeb9cb7f8f4e32b6
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs940329
milestone31.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 940329: avoid warnings from using size_t in ImplCycleCollectionTraverse() r=ehsan
xpcom/glue/nsTArray.h
xpcom/glue/nsTObserverArray.h
--- a/xpcom/glue/nsTArray.h
+++ b/xpcom/glue/nsTArray.h
@@ -1639,18 +1639,18 @@ ImplCycleCollectionUnlink(nsTArray_Impl<
 template <typename E, typename Alloc>
 inline void
 ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback,
                             nsTArray_Impl<E, Alloc>& aField,
                             const char* aName,
                             uint32_t aFlags = 0)
 {
   aFlags |= CycleCollectionEdgeNameArrayFlag;
-  size_t length = aField.Length();
-  for (size_t i = 0; i < length; ++i) {
+  uint32_t length = aField.Length();
+  for (uint32_t i = 0; i < length; ++i) {
     ImplCycleCollectionTraverse(aCallback, aField[i], aName, aFlags);
   }
 }
 
 //
 // nsTArray is an infallible vector class.  See the comment at the top of this
 // file for more details.
 //
--- a/xpcom/glue/nsTObserverArray.h
+++ b/xpcom/glue/nsTObserverArray.h
@@ -381,18 +381,18 @@ ImplCycleCollectionUnlink(nsAutoTObserve
 template <typename T, uint32_t N>
 inline void
 ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback,
                             nsAutoTObserverArray<T, N>& aField,
                             const char* aName,
                             uint32_t aFlags = 0)
 {
   aFlags |= CycleCollectionEdgeNameArrayFlag;
-  size_t length = aField.Length();
-  for (size_t i = 0; i < length; ++i) {
+  uint32_t length = aField.Length();
+  for (uint32_t i = 0; i < length; ++i) {
     ImplCycleCollectionTraverse(aCallback, aField.ElementAt(i), aName, aFlags);
   }
 }
 
 // XXXbz I wish I didn't have to pass in the observer type, but I
 // don't see a way to get it out of array_.
 // Note that this macro only works if the array holds pointers to XPCOM objects.
 #define NS_OBSERVER_ARRAY_NOTIFY_XPCOM_OBSERVERS(array_, obstype_, func_, params_) \