diff options
Diffstat (limited to 'extern/bullet2/src/LinearMath/btAlignedObjectArray.h')
-rw-r--r-- | extern/bullet2/src/LinearMath/btAlignedObjectArray.h | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/extern/bullet2/src/LinearMath/btAlignedObjectArray.h b/extern/bullet2/src/LinearMath/btAlignedObjectArray.h index 24e59ab65d7..6193ef7f427 100644 --- a/extern/bullet2/src/LinearMath/btAlignedObjectArray.h +++ b/extern/bullet2/src/LinearMath/btAlignedObjectArray.h @@ -39,6 +39,12 @@ subject to the following restrictions: #include <new> //for placement new #endif //BT_USE_PLACEMENT_NEW +// The register keyword is deprecated in C++11 so don't use it. +#if __cplusplus > 199711L +#define BT_REGISTER +#else +#define BT_REGISTER register +#endif ///The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods ///It is developed to replace stl::vector to avoid portability issues, including STL alignment issues to add SIMD/SSE data @@ -202,24 +208,16 @@ protected: ///when the new number of elements is smaller, the destructor will be called, but memory will not be freed, to reduce performance overhead of run-time memory (de)allocations. SIMD_FORCE_INLINE void resizeNoInitialize(int newsize) { - int curSize = size(); - - if (newsize < curSize) + if (newsize > size()) { - } else - { - if (newsize > size()) - { - reserve(newsize); - } - //leave this uninitialized + reserve(newsize); } m_size = newsize; } SIMD_FORCE_INLINE void resize(int newsize, const T& fillData=T()) { - int curSize = size(); + const BT_REGISTER int curSize = size(); if (newsize < curSize) { @@ -229,7 +227,7 @@ protected: } } else { - if (newsize > size()) + if (newsize > curSize) { reserve(newsize); } @@ -246,7 +244,7 @@ protected: } SIMD_FORCE_INLINE T& expandNonInitializing( ) { - int sz = size(); + const BT_REGISTER int sz = size(); if( sz == capacity() ) { reserve( allocSize(size()) ); @@ -259,7 +257,7 @@ protected: SIMD_FORCE_INLINE T& expand( const T& fillValue=T()) { - int sz = size(); + const BT_REGISTER int sz = size(); if( sz == capacity() ) { reserve( allocSize(size()) ); @@ -275,7 +273,7 @@ protected: SIMD_FORCE_INLINE void push_back(const T& _Val) { - int sz = size(); + const BT_REGISTER int sz = size(); if( sz == capacity() ) { reserve( allocSize(size()) ); |