preserve constness to avoid compiler warnings

This commit is contained in:
Robert Haschke 2018-08-24 00:29:54 +02:00 committed by GitHub
parent d44571a4b3
commit 5088f71e7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1238,9 +1238,9 @@ public:
///btSwapVector3Endian swaps vector endianness, useful for network and cross-platform serialization ///btSwapVector3Endian swaps vector endianness, useful for network and cross-platform serialization
SIMD_FORCE_INLINE void btSwapScalarEndian(const btScalar& sourceVal, btScalar& destVal) SIMD_FORCE_INLINE void btSwapScalarEndian(const btScalar& sourceVal, btScalar& destVal)
{ {
#ifdef BT_USE_DOUBLE_PRECISION #ifdef BT_USE_DOUBLE_PRECISION
unsigned char* dest = (unsigned char*) &destVal; unsigned char* dest = (unsigned char*) &destVal;
unsigned char* src = (unsigned char*) &sourceVal; const unsigned char* src = (const unsigned char*) &sourceVal;
dest[0] = src[7]; dest[0] = src[7];
dest[1] = src[6]; dest[1] = src[6];
dest[2] = src[5]; dest[2] = src[5];
@ -1251,7 +1251,8 @@ SIMD_FORCE_INLINE void btSwapScalarEndian(const btScalar& sourceVal, btScalar& d
dest[7] = src[0]; dest[7] = src[0];
#else #else
unsigned char* dest = (unsigned char*) &destVal; unsigned char* dest = (unsigned char*) &destVal;
unsigned char* src = (unsigned char*) &sourceVal; const unsigned char* src = (const unsigned char*) &sourceVal;
dest[0] = src[3]; dest[0] = src[3];
dest[1] = src[2]; dest[1] = src[2];
dest[2] = src[1]; dest[2] = src[1];