Fixed strict aliasing warnings in GCC 4.8.1 / Android NDK 9c (#152)

This commit is contained in:
Christophe Riccio 2014-03-16 03:08:56 +01:00
parent 4b9e2d4028
commit 658d7e2788
2 changed files with 5 additions and 2 deletions

View File

@ -171,7 +171,8 @@ namespace glm
GLM_STATIC_ASSERT(sizeof(uint) == sizeof(uint32), "uint and uint32 size mismatch");
uint64 Value64 = static_cast<uint64>(x) * static_cast<uint64>(y);
msb = *(reinterpret_cast<uint32*>(&Value64) + 1);
uint32* PointerMSB = (reinterpret_cast<uint32*>(&Value64) + 1);
msb = *PointerMSB;
lsb = reinterpret_cast<uint32&>(Value64);
}
@ -230,7 +231,8 @@ namespace glm
GLM_STATIC_ASSERT(sizeof(int) == sizeof(int32), "int and int32 size mismatch");
int64 Value64 = static_cast<int64>(x) * static_cast<int64>(y);
msb = *(reinterpret_cast<int32*>(&Value64) + 1);
int32* PointerMSB = (reinterpret_cast<int32*>(&Value64) + 1);
msb = *PointerMSB;
lsb = reinterpret_cast<int32&>(Value64);
}

View File

@ -46,6 +46,7 @@ GLM 0.9.5.3: 2014-0X-XX
- Added GLM_GTX_matrix_transform_2d extension (#178, #176)
- Fixed CUDA issues (#169, #168, #183, #182)
- Added support for all extensions but GTX_string_cast to CUDA
- Fixed strict aliasing warnings in GCC 4.8.1 / Android NDK 9c (#152)
================================================================================
GLM 0.9.5.2: 2014-02-08