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 180863 18034a2d0732a1cefd859c5d576ffa2abf1a27dd
parent 180862 f2203bec9507a7e0964ef37fb58258acd3fe5604
child 180864 f656d5bc051e2f69615e33b62fa5e117bfe3e7be
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersehsan
bugs940329
milestone31.0a1
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_) \