Browse Source

Apple - Suppress warnings due to implicit cast to unsigned.

Yao Wei Tjong 姚伟忠 5 years ago
parent
commit
197cb5eb80
1 changed files with 3 additions and 3 deletions
  1. 3 3
      Source/Urho3D/Container/Vector.h

+ 3 - 3
Source/Urho3D/Container/Vector.h

@@ -552,7 +552,7 @@ private:
     template <class RandomIteratorT>
     static void ConstructElements(T* dest, RandomIteratorT start, RandomIteratorT end, CopyTag)
     {
-        const unsigned count = end - start;
+        const auto count = (unsigned)(end - start);
         for (unsigned i = 0; i < count; ++i)
             new(dest + i) T(*(start + i));
     }
@@ -561,7 +561,7 @@ private:
     template <class RandomIteratorT>
     static void ConstructElements(T* dest, RandomIteratorT start, RandomIteratorT end, MoveTag)
     {
-        const unsigned count = end - start;
+        const auto count = (unsigned)(end - start);
         for (unsigned i = 0; i < count; ++i)
             new(dest + i) T(std::move(*(start + i)));
     }
@@ -618,7 +618,7 @@ private:
         if (pos > size_)
             pos = size_;
 
-        const unsigned numElements = end - start;
+        const auto numElements = (unsigned)(end - start);
         if (size_ + numElements > capacity_)
         {
             T* src = Buffer();