summaryrefslogtreecommitdiff
path: root/thirdparty/bullet/LinearMath
diff options
context:
space:
mode:
Diffstat (limited to 'thirdparty/bullet/LinearMath')
-rw-r--r--thirdparty/bullet/LinearMath/TaskScheduler/btThreadSupportPosix.cpp6
-rw-r--r--thirdparty/bullet/LinearMath/btAlignedObjectArray.h15
-rw-r--r--thirdparty/bullet/LinearMath/btMatrixX.h7
-rw-r--r--thirdparty/bullet/LinearMath/btScalar.h4
-rw-r--r--thirdparty/bullet/LinearMath/btVector3.h2
5 files changed, 15 insertions, 19 deletions
diff --git a/thirdparty/bullet/LinearMath/TaskScheduler/btThreadSupportPosix.cpp b/thirdparty/bullet/LinearMath/TaskScheduler/btThreadSupportPosix.cpp
index 02f4ed1631..a03f6dc570 100644
--- a/thirdparty/bullet/LinearMath/TaskScheduler/btThreadSupportPosix.cpp
+++ b/thirdparty/bullet/LinearMath/TaskScheduler/btThreadSupportPosix.cpp
@@ -45,14 +45,14 @@ subject to the following restrictions:
int btGetNumHardwareThreads()
{
- return btMin<int>(BT_MAX_THREAD_COUNT, std::thread::hardware_concurrency());
+ return btMax(1u, btMin(BT_MAX_THREAD_COUNT, std::thread::hardware_concurrency()));
}
#else
int btGetNumHardwareThreads()
{
- return btMin<int>(BT_MAX_THREAD_COUNT, sysconf(_SC_NPROCESSORS_ONLN));
+ return btMax(1, btMin<int>(BT_MAX_THREAD_COUNT, sysconf(_SC_NPROCESSORS_ONLN)));
}
#endif
@@ -304,8 +304,8 @@ void btThreadSupportPosix::stopThreads()
checkPThreadFunction(sem_post(threadStatus.startSemaphore));
checkPThreadFunction(sem_wait(m_mainSemaphore));
- destroySem(threadStatus.startSemaphore);
checkPThreadFunction(pthread_join(threadStatus.thread, 0));
+ destroySem(threadStatus.startSemaphore);
}
destroySem(m_mainSemaphore);
m_activeThreadStatus.clear();
diff --git a/thirdparty/bullet/LinearMath/btAlignedObjectArray.h b/thirdparty/bullet/LinearMath/btAlignedObjectArray.h
index b4671bc19f..b3d5d64b58 100644
--- a/thirdparty/bullet/LinearMath/btAlignedObjectArray.h
+++ b/thirdparty/bullet/LinearMath/btAlignedObjectArray.h
@@ -38,13 +38,6 @@ 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
template <typename T>
@@ -209,7 +202,7 @@ public:
SIMD_FORCE_INLINE void resize(int newsize, const T& fillData = T())
{
- const BT_REGISTER int curSize = size();
+ const int curSize = size();
if (newsize < curSize)
{
@@ -236,7 +229,7 @@ public:
}
SIMD_FORCE_INLINE T& expandNonInitializing()
{
- const BT_REGISTER int sz = size();
+ const int sz = size();
if (sz == capacity())
{
reserve(allocSize(size()));
@@ -248,7 +241,7 @@ public:
SIMD_FORCE_INLINE T& expand(const T& fillValue = T())
{
- const BT_REGISTER int sz = size();
+ const int sz = size();
if (sz == capacity())
{
reserve(allocSize(size()));
@@ -263,7 +256,7 @@ public:
SIMD_FORCE_INLINE void push_back(const T& _Val)
{
- const BT_REGISTER int sz = size();
+ const int sz = size();
if (sz == capacity())
{
reserve(allocSize(size()));
diff --git a/thirdparty/bullet/LinearMath/btMatrixX.h b/thirdparty/bullet/LinearMath/btMatrixX.h
index 9df9e49469..388c57c2d7 100644
--- a/thirdparty/bullet/LinearMath/btMatrixX.h
+++ b/thirdparty/bullet/LinearMath/btMatrixX.h
@@ -263,7 +263,10 @@ struct btMatrixX
{
{
BT_PROFILE("storage=0");
- btSetZero(&m_storage[0], m_storage.size());
+ if (m_storage.size())
+ {
+ btSetZero(&m_storage[0], m_storage.size());
+ }
//memset(&m_storage[0],0,sizeof(T)*m_storage.size());
//for (int i=0;i<m_storage.size();i++)
// m_storage[i]=0;
@@ -281,7 +284,7 @@ struct btMatrixX
}
}
- void printMatrix(const char* msg)
+ void printMatrix(const char* msg) const
{
printf("%s ---------------------\n", msg);
for (int i = 0; i < rows(); i++)
diff --git a/thirdparty/bullet/LinearMath/btScalar.h b/thirdparty/bullet/LinearMath/btScalar.h
index c198bd4b35..ba49d6700b 100644
--- a/thirdparty/bullet/LinearMath/btScalar.h
+++ b/thirdparty/bullet/LinearMath/btScalar.h
@@ -124,7 +124,7 @@ inline int btGetVersion()
#ifdef BT_DEBUG
#ifdef _MSC_VER
#include <stdio.h>
- #define btAssert(x) { if(!(x)){printf("Assert "__FILE__ ":%u (%s)\n", __LINE__, #x);__debugbreak(); }}
+ #define btAssert(x) { if(!(x)){printf("Assert " __FILE__ ":%u (%s)\n", __LINE__, #x);__debugbreak(); }}
#else//_MSC_VER
#include <assert.h>
#define btAssert assert
@@ -152,7 +152,7 @@ inline int btGetVersion()
#ifdef __SPU__
#include <spu_printf.h>
#define printf spu_printf
- #define btAssert(x) {if(!(x)){printf("Assert "__FILE__ ":%u ("#x")\n", __LINE__);spu_hcmpeq(0,0);}}
+ #define btAssert(x) {if(!(x)){printf("Assert " __FILE__ ":%u ("#x")\n", __LINE__);spu_hcmpeq(0,0);}}
#else
#define btAssert assert
#endif
diff --git a/thirdparty/bullet/LinearMath/btVector3.h b/thirdparty/bullet/LinearMath/btVector3.h
index 61fd8d1e46..d65ed9808d 100644
--- a/thirdparty/bullet/LinearMath/btVector3.h
+++ b/thirdparty/bullet/LinearMath/btVector3.h
@@ -36,7 +36,7 @@ subject to the following restrictions:
#pragma warning(disable : 4556) // value of intrinsic immediate argument '4294967239' is out of range '0 - 255'
#endif
-#define BT_SHUFFLE(x, y, z, w) ((w) << 6 | (z) << 4 | (y) << 2 | (x))
+#define BT_SHUFFLE(x, y, z, w) (((w) << 6 | (z) << 4 | (y) << 2 | (x)) & 0xff)
//#define bt_pshufd_ps( _a, _mask ) (__m128) _mm_shuffle_epi32((__m128i)(_a), (_mask) )
#define bt_pshufd_ps(_a, _mask) _mm_shuffle_ps((_a), (_a), (_mask))
#define bt_splat3_ps(_a, _i) bt_pshufd_ps((_a), BT_SHUFFLE(_i, _i, _i, 3))