favreau / bullet

Automatically exported from code.google.com/p/bullet
0 stars 0 forks source link

Bullet -WConversion Conformance #521

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The following changes made Bullet r2387 conformate to the -WConversion switch 
in GCC (which is very handy, and frustrating to have to disable for individual 
files):

Below I changed the variable from an int to a long unsigned. Unsure of whether 
this will change functionality (shouldn't...) 

btSerializer.h:477
long unsigned mysize = 0;
btSerializer.h:492 
long unsigned int curLength = sizeof(btChunk) + m_chunkPtrs[i]->m_length;

Below I made the explicit conversion to cease compiler fits. Should have no 
effect except avoiding warnings.

btBoxShape.h:147
    virtual void getVertex(int i,btVector3& vtx) const
    {
        btVector3 halfExtents = getHalfExtentsWithMargin();

        int i1 = 1 - (i&1);
        int i2 = 1 - ((i&2)>>1);
        int i4 = 1 - ((i&4)>>2);

        vtx = btVector3(
                halfExtents.x() * btScalar(i1) - halfExtents.x() * btScalar(i1),
                halfExtents.y() * btScalar(i2) - halfExtents.y() * btScalar(i2),
                halfExtents.z() * btScalar(i4) - halfExtents.z() * btScalar(i4));
    }

Original issue reported on code.google.com by daniel2...@gmail.com on 13 Jun 2011 at 9:39

GoogleCodeExporter commented 9 years ago
Thanks for the patch, I'll check it out.

Original comment by erwin.coumans on 14 Jun 2011 at 6:55

GoogleCodeExporter commented 9 years ago
See https://github.com/bulletphysics/bullet3/issues/141

Original comment by erwin.coumans on 30 Mar 2014 at 7:44