From 8977e6d010e964a782d624aa45c8852d6196c69e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Wed, 28 Jan 2015 09:57:55 +0100 Subject: [PATCH] Fixed (u)int64 MSB/LSB handling on BE archs --- glm/detail/func_integer.inl | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/glm/detail/func_integer.inl b/glm/detail/func_integer.inl index 31eddf9b..6d204b40 100644 --- a/glm/detail/func_integer.inl +++ b/glm/detail/func_integer.inl @@ -248,10 +248,8 @@ namespace detail GLM_STATIC_ASSERT(sizeof(uint) == sizeof(uint32), "uint and uint32 size mismatch"); uint64 Value64 = static_cast(x) * static_cast(y); - uint32* PointerMSB = (reinterpret_cast(&Value64) + 1); - msb = *PointerMSB; - uint32* PointerLSB = (reinterpret_cast(&Value64) + 0); - lsb = *PointerLSB; + msb = Value64 >> 32; + lsb = Value64; } template class vecType> @@ -270,10 +268,8 @@ namespace detail GLM_STATIC_ASSERT(sizeof(int) == sizeof(int32), "int and int32 size mismatch"); int64 Value64 = static_cast(x) * static_cast(y); - int32* PointerMSB = (reinterpret_cast(&Value64) + 1); - msb = *PointerMSB; - int32* PointerLSB = (reinterpret_cast(&Value64)); - lsb = *PointerLSB; + msb = Value64 >> 32; + lsb = Value64; } template class vecType>