From 0b73091c7fbd1939e9bf4e20afe8407cf42b16f2 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 16 Mar 2014 11:15:56 +0100 Subject: [PATCH] Fixed aliasing warnings --- glm/detail/func_integer.inl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/glm/detail/func_integer.inl b/glm/detail/func_integer.inl index d6f6c7ce..ee010146 100644 --- a/glm/detail/func_integer.inl +++ b/glm/detail/func_integer.inl @@ -111,7 +111,7 @@ namespace glm Borrow = x >= y ? static_cast(0) : static_cast(1); if(x > y) - return static_cast(static_cast(x) -static_cast(y)); + return static_cast(static_cast(x) - static_cast(y)); else return static_cast((static_cast(1) << static_cast(32)) + static_cast(x) - static_cast(y)); } @@ -173,7 +173,8 @@ namespace glm uint64 Value64 = static_cast(x) * static_cast(y); uint32* PointerMSB = (reinterpret_cast(&Value64) + 1); msb = *PointerMSB; - lsb = reinterpret_cast(Value64); + uint32* PointerLSB = (reinterpret_cast(&Value64) + 0); + lsb = *PointerLSB; } template <> @@ -233,7 +234,8 @@ namespace glm int64 Value64 = static_cast(x) * static_cast(y); int32* PointerMSB = (reinterpret_cast(&Value64) + 1); msb = *PointerMSB; - lsb = reinterpret_cast(Value64); + int32* PointerLSB = (reinterpret_cast(&Value64)); + lsb = *PointerLSB; } template <>