]> OCCT Git - occt-copy.git/commitdiff
0022773: Compiler warnings on 64-bit MSVC in NCollection_Vector.hxx
authorDBV <>
Fri, 23 Dec 2011 14:32:59 +0000 (14:32 +0000)
committerbugmaster <bugmaster@opencascade.com>
Mon, 5 Mar 2012 15:31:49 +0000 (19:31 +0400)
src/NCollection/NCollection_BaseVector.cxx
src/NCollection/NCollection_BaseVector.hxx
src/NCollection/NCollection_Vector.hxx

index f830bbbc58299ed9dc6fd2d5d4f12711310854bd..633ba1e48dce919f320702cfd390336496ef5c5b 100755 (executable)
@@ -125,7 +125,7 @@ void * NCollection_BaseVector::ExpandV (const Standard_Integer theIndex)
     MemBlock& aLastBlock = myData [myNBlocks - 1];
     Standard_RangeError_Raise_if (theIndex < aLastBlock.FirstIndex(),
                                   "NColelction_BaseVector::ExpandV");
-    const unsigned int anIndLastBlock = theIndex - aLastBlock.FirstIndex();
+    Standard_Integer anIndLastBlock = theIndex - aLastBlock.FirstIndex();
     //  Is there still room for 1 item in the last array?
     if (anIndLastBlock < aLastBlock.Size()) {
       myLength = aNewLength;
index bf1d1473fed066703ce93b88beb53f8bbcce5539..f57cac706895d455d8545ba5dfc621b287a7aaa4 100755 (executable)
@@ -45,14 +45,14 @@ class NCollection_BaseVector
       : myAlloc(theAlloc),
         myFirstInd(theFirstInd), myLength(0), mySize(theLength), myData(0L) {}
     virtual void        Reinit     (const Standard_Integer,
-                                    const size_t) {}
+                                    const Standard_Integer) {}
     Standard_Integer    FirstIndex () const     { return myFirstInd; }
-    size_t              Size       () const     { return mySize; }
+    Standard_Integer    Size       () const     { return mySize; }
   public:
     virtual             ~MemBlock () {}
-    void                SetLength  (const size_t theLen)
+    void                SetLength  (const Standard_Integer theLen)
                                                 { myLength = theLen; }
-    size_t              Length     () const     { return myLength; }
+    Standard_Integer    Length     () const     { return myLength; }
     void *              Find       (const Standard_Integer theInd,
                                     const size_t           theSize) const
                                     { return ((char *) myData)+theInd*theSize;}
@@ -60,8 +60,8 @@ class NCollection_BaseVector
                         GetIndexV  (void * theItem, const size_t theSz) const;
   protected:
     Standard_Integer             myFirstInd;
-    size_t                       myLength;
-    size_t                       mySize;
+    Standard_Integer             myLength;
+    Standard_Integer             mySize;
     NCollection_BaseAllocator    * myAlloc;
     void                         * myData;
     friend class NCollection_BaseVector;
@@ -85,10 +85,10 @@ class NCollection_BaseVector
         { return &myVector -> myData[myICurBlock]; }
 
     const NCollection_BaseVector * myVector;   // the Master vector
-    size_t                       myICurBlock;  // # of the current block
-    size_t                       myIEndBlock;
-    size_t                       myCurIndex;   // Index in the current block
-    size_t                       myEndIndex;
+    Standard_Integer             myICurBlock;  // # of the current block
+    Standard_Integer             myIEndBlock;
+    Standard_Integer             myCurIndex;   // Index in the current block
+    Standard_Integer             myEndIndex;
   };
 
  protected:
index fa687d308d62feb65026742e1f423c56165ef8ac..d18f669ab622adceaee04d24faca49a1e9a9ccc3 100755 (executable)
@@ -67,7 +67,7 @@ template <class TheItemType> class NCollection_Vector
       : NCollection_BaseVector::MemBlock (theFirstInd, theSize, theAlloc)
     {
       myData = myAlloc->Allocate(theSize * sizeof(TheItemType));
-      for (size_t i=0; i < theSize; i++)
+      for (Standard_Integer i=0; i < theSize; i++)
         new (&((TheItemType *) myData)[i]) TheItemType;
     }
     //! Copy constructor
@@ -77,7 +77,7 @@ template <class TheItemType> class NCollection_Vector
     {
       myLength = theOther.Length();
       myData = myAlloc->Allocate(Size() * sizeof(TheItemType));
-      size_t i;
+      Standard_Integer i;
       for (i=0; i < Length(); i++)
         new (&((TheItemType *) myData)[i]) TheItemType(theOther.Value(i));
       for (; i < Size(); i++)
@@ -85,17 +85,17 @@ template <class TheItemType> class NCollection_Vector
     }
     //! Reinit
     virtual void Reinit (const Standard_Integer theFirst,
-                         const size_t           theSize)
+                         const Standard_Integer theSize)
     {
       if (myData) {
-        for (size_t i=0; i < mySize; i++)
+        for (Standard_Integer i=0; i < mySize; i++)
           ((TheItemType *) myData)[i].~TheItemTypeD();
         myAlloc->Free(myData);
         myData = NULL;
       }
       if (theSize > 0) {
         myData = myAlloc->Allocate(theSize * sizeof(TheItemType));
-        for (size_t i=0; i < theSize; i++)
+        for (Standard_Integer i=0; i < theSize; i++)
           new (&((TheItemType *) myData)[i]) TheItemType;
       }
       myFirstInd = theFirst;
@@ -106,7 +106,7 @@ template <class TheItemType> class NCollection_Vector
     virtual ~MemBlock ()
     {
       if (myData) {
-        for (size_t i=0; i < Size(); i++)
+        for (Standard_Integer i=0; i < Size(); i++)
           ((TheItemType *) myData)[i].~TheItemTypeD();
         myAlloc->Free(myData);
         myData = NULL;