Bug 592551 - dist\include\nsTArray.h(416) : warning C4244: 'return' : conversion from '__int64' to 'nsTArray_base::index_type', possible loss of data. r=bsmedberg a=bsmedberg
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Wed, 17 Nov 2010 14:51:05 +0900
changeset 57644 150c89c9132689b7d9a42659350989405ec0051b
parent 57643 21fa0a3a8c5a9b116d59f9a768641f6aab43ee4b
child 57645 46a51d427820594ffd77236d4ff7a8b80cada2ad
push idunknown
push userunknown
push dateunknown
reviewersbsmedberg, bsmedberg
bugs592551
milestone2.0b8pre
Bug 592551 - dist\include\nsTArray.h(416) : warning C4244: 'return' : conversion from '__int64' to 'nsTArray_base::index_type', possible loss of data. r=bsmedberg a=bsmedberg
xpcom/glue/nsTArray.h
--- a/xpcom/glue/nsTArray.h
+++ b/xpcom/glue/nsTArray.h
@@ -520,17 +520,17 @@ public:
   // @param comp   The Comparator used to determine element equality.
   // @return       The index of the found element or NoIndex if not found.
   template<class Item, class Comparator>
   index_type IndexOf(const Item& item, index_type start,
                      const Comparator& comp) const {
     const elem_type* iter = Elements() + start, *end = Elements() + Length();
     for (; iter != end; ++iter) {
       if (comp.Equals(*iter, item))
-        return iter - Elements();
+        return index_type(iter - Elements());
     }
     return NoIndex;
   }
 
   // This method searches for the offset of the first element in this
   // array that is equal to the given element.  This method assumes
   // that 'operator==' is defined for elem_type.
   // @param item   The item to search for.