Bug 940329: avoid warnings from using size_t in ImplCycleCollectionTraverse() r=ehsan
☠☠ backed out by ec96cdad9097 ☠ ☠
authorRandell Jesup <rjesup@jesup.org>
Sun, 27 Apr 2014 00:29:18 -0400
changeset 198961 18034a2d0732a1cefd859c5d576ffa2abf1a27dd
parent 198960 f2203bec9507a7e0964ef37fb58258acd3fe5604
child 198962 f656d5bc051e2f69615e33b62fa5e117bfe3e7be
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) {
+  nsTArray::size_type length = aField.Length();
+  for (nsTArray::size_type 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) {
+  nsTArray::size_type length = aField.Length();
+  for (nsTArray::size_type 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_) \