From 3623e6bc4dd3d9c366bc5c7765a0136a7c58f0ed Mon Sep 17 00:00:00 2001 From: posophe Date: Mon, 16 Nov 2015 15:26:32 +0100 Subject: [PATCH] Fix aliasing --- glm/detail/func_common.inl | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/glm/detail/func_common.inl b/glm/detail/func_common.inl index 83252de4..479d9b6a 100644 --- a/glm/detail/func_common.inl +++ b/glm/detail/func_common.inl @@ -609,7 +609,9 @@ namespace detail GLM_FUNC_QUALIFIER int floatBitsToInt(float const & v) { - return reinterpret_cast(const_cast(v)); + int Bits; + std::memcpy(&Bits, &v, sizeof(Bits)); + return Bits; } template