Merge pull request #3115 from niello/master

Compilation warning fixes
This commit is contained in:
erwincoumans
2020-11-17 16:29:22 -08:00
committed by GitHub
3 changed files with 6 additions and 3 deletions

View File

@@ -2,8 +2,11 @@
#include "btMiniSDF.h"
#include "LinearMath/btAabbUtil2.h"
struct btSdfCollisionShapeInternalData
ATTRIBUTE_ALIGNED16(struct)
btSdfCollisionShapeInternalData
{
BT_DECLARE_ALIGNED_ALLOCATOR();
btVector3 m_localScaling;
btScalar m_margin;
btMiniSDF m_sdf;

View File

@@ -852,7 +852,7 @@ static void setupSpatialGridBatchesMt(
memHelper.addChunk((void**)&constraintRowBatchIds, sizeof(int) * numConstraintRows);
size_t scratchSize = memHelper.getSizeToAllocate();
// if we need to reallocate
if (scratchMemory->capacity() < scratchSize)
if (static_cast<size_t>(scratchMemory->capacity()) < scratchSize)
{
// allocate 6.25% extra to avoid repeated reallocs
scratchMemory->reserve(scratchSize + scratchSize / 16);

View File

@@ -267,7 +267,7 @@ public:
std::sort(tuples.begin(), tuples.end());
btAlignedObjectArray<int> new_indices;
btAlignedObjectArray<btVector3> new_vecs;
for (int i = 0; i < tuples.size(); ++i)
for (size_t i = 0; i < tuples.size(); ++i)
{
new_indices.push_back(tuples[i].b);
new_vecs.push_back(m_vecs[tuples[i].a]);