warnings on gcc

When using the headers from box2d, I get two warnings.
One is about the typecasting in the inlined b2Math.h :: b2InvSqrt. The other is for the NOT_USED macro in b2WorldCallbacks.h.

I tend to dislike having warnings in my code. Makes me squirmish or something. For the b2InvSqrt, I hacked together an alternative:

Code:
inline float32 b2InvSqrt(float32 x)
{
   union {
      float32 f;
      int32 i;
   } union32;
   
   float32 xhalf = 0.5f * x;
#if 1
   union32.f = xhalf;
   // what the hell does this do!?!?
   union32.i = 0x5f3759df - (union32.i >> 1);
   x = union32.f;
   
#else // compiler complains about this
   int32 i = *(int32*)&x;
   i = 0x5f3759df - (i >> 1);
   x = *(float32*)&i;
#endif
   
   x = x * (1.5f - xhalf * x * x);
   return x;
}


Also, a question about the NOT_USED() macro. I commented that line (#54 in b2WorldCallbacks.h) out, since g++ said something about it having no effect. Is that semantically right?

I am compiling on ubuntu using gcc from Box2D v1.4.0, though I checked the 1.4.3 source, and these things weren't changed from the 1.4.0 source. Just something to think about (?)
That's ironic. I'm using NOT_USED to avoid some VC8 warnings. VC8 complains when a variable is not used.

We either have to turn off the VC8 warning or turn off the GCC warning. Let's wait until Box2D 2.0 comes out to resolve this.

Original thread: https://box2d.org/forum/viewtopic.php?t=282