C++ ./out/linux/optimize/src/BulletCollision/CollisionShapes/btOptimizedBvh.o
src/BulletCollision/CollisionShapes/btOptimizedBvh.cpp: In member function ‘bool btOptimizedBvh::serialize(void*, unsigned int, bool)’:
src/BulletCollision/CollisionShapes/btOptimizedBvh.cpp:922: error: cast from ‘void*’ to ‘unsigned int’ loses precision
src/BulletCollision/CollisionShapes/btOptimizedBvh.cpp:962: error: cast from ‘unsigned char*’ to ‘unsigned int’ loses precision
src/BulletCollision/CollisionShapes/btOptimizedBvh.cpp:1037: error: cast from ‘unsigned char*’ to ‘unsigned int’ loses precision
src/BulletCollision/CollisionShapes/btOptimizedBvh.cpp: In static member function ‘static btOptimizedBvh* btOptimizedBvh::deSerializeInPlace(void*, unsigned int, bool)’:
src/BulletCollision/CollisionShapes/btOptimizedBvh.cpp:1084: error: cast from ‘void*’ to ‘unsigned int’ loses precision
src/BulletCollision/CollisionShapes/btOptimizedBvh.cpp:1103: warning: comparison between signed and unsigned integer expressions
src/BulletCollision/CollisionShapes/btOptimizedBvh.cpp:1105: warning: comparison between signed and unsigned integer expressions
src/BulletCollision/CollisionShapes/btOptimizedBvh.cpp:1113: error: cast from ‘unsigned char*’ to ‘unsigned int’ loses precision
src/BulletCollision/CollisionShapes/btOptimizedBvh.cpp:1162: error: cast from ‘unsigned char*’ to ‘unsigned int’ loses precision
This contribution for serialization tries to align the memory to 16 bytes. For this alignment, we don't need full precision of the pointer, we only need the lower 4 bits. So in this case, the cast is safe.
You could replace the (unsigned) by (uintptr_t), but this breaks support on some platforms/compiler. I'll check to see if there is a better way to get rid of this problem. We basically only need to count the bytes from the start of the buffer, instead of using the full buffer address.
If you don't need serialization (saving/loading the BVH data to/from disk) you can just comment it out for now.
Proper solution would be to make a macro taking care of platform specific alignment requirements. Less hacky and safer ( if you consider macros safe that is )