diff --git a/glm/common.hpp b/glm/common.hpp
index 0328dc91..0a114eb9 100644
--- a/glm/common.hpp
+++ b/glm/common.hpp
@@ -424,7 +424,7 @@ namespace glm
///
/// @see GLSL floatBitsToUint man page
/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
- GLM_FUNC_DECL uint floatBitsToUint(float const& v);
+ GLM_FUNC_DECL uint floatBitsToUint(float v);
/// Returns a unsigned integer value representing
/// the encoding of a floating-point value. The floatingpoint
@@ -446,7 +446,7 @@ namespace glm
///
/// @see GLSL intBitsToFloat man page
/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
- GLM_FUNC_DECL float intBitsToFloat(int const& v);
+ GLM_FUNC_DECL float intBitsToFloat(int v);
/// Returns a floating-point value corresponding to a signed
/// integer encoding of a floating-point value.
@@ -470,7 +470,7 @@ namespace glm
///
/// @see GLSL uintBitsToFloat man page
/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
- GLM_FUNC_DECL float uintBitsToFloat(uint const& v);
+ GLM_FUNC_DECL float uintBitsToFloat(uint v);
/// Returns a floating-point value corresponding to a
/// unsigned integer encoding of a floating-point value.
diff --git a/glm/detail/func_common.inl b/glm/detail/func_common.inl
index 86560be9..f7a10168 100644
--- a/glm/detail/func_common.inl
+++ b/glm/detail/func_common.inl
@@ -662,7 +662,7 @@ namespace detail
return Result;
}
- GLM_FUNC_QUALIFIER int floatBitsToInt(float const& v)
+ GLM_FUNC_QUALIFIER int floatBitsToInt(float v)
{
union
{
@@ -678,10 +678,10 @@ namespace detail
template
GLM_FUNC_QUALIFIER vec floatBitsToInt(vec const& v)
{
- return reinterpret_cast&>(const_cast&>(v));
+ return detail::functor1::call(floatBitsToInt, v);
}
- GLM_FUNC_QUALIFIER uint floatBitsToUint(float const& v)
+ GLM_FUNC_QUALIFIER uint floatBitsToUint(float v)
{
union
{
@@ -697,7 +697,7 @@ namespace detail
template
GLM_FUNC_QUALIFIER vec floatBitsToUint(vec const& v)
{
- return reinterpret_cast&>(const_cast&>(v));
+ return detail::functor1::call(floatBitsToUint, v);
}
GLM_FUNC_QUALIFIER float intBitsToFloat(int const& v)
@@ -716,10 +716,10 @@ namespace detail
template
GLM_FUNC_QUALIFIER vec intBitsToFloat(vec const& v)
{
- return reinterpret_cast&>(const_cast&>(v));
+ return detail::functor1::call(intBitsToFloat, v);
}
- GLM_FUNC_QUALIFIER float uintBitsToFloat(uint const& v)
+ GLM_FUNC_QUALIFIER float uintBitsToFloat(uint v)
{
union
{
diff --git a/glm/detail/func_integer.inl b/glm/detail/func_integer.inl
index 0443debb..1d2b367d 100644
--- a/glm/detail/func_integer.inl
+++ b/glm/detail/func_integer.inl
@@ -317,7 +317,7 @@ namespace detail
# pragma warning(disable : 4310) //cast truncates constant value
# endif
- vec::type, Q> x(*reinterpret_cast::type, Q> const *>(&v));
+ vec::type, Q> x(v);
x = detail::compute_bitfieldBitCountStep::type, Q, detail::is_aligned::value, sizeof(T) * 8>= 2>::call(x, typename detail::make_unsigned::type(0x5555555555555555ull), typename detail::make_unsigned::type( 1));
x = detail::compute_bitfieldBitCountStep::type, Q, detail::is_aligned::value, sizeof(T) * 8>= 4>::call(x, typename detail::make_unsigned::type(0x3333333333333333ull), typename detail::make_unsigned::type( 2));
x = detail::compute_bitfieldBitCountStep::type, Q, detail::is_aligned::value, sizeof(T) * 8>= 8>::call(x, typename detail::make_unsigned::type(0x0F0F0F0F0F0F0F0Full), typename detail::make_unsigned::type( 4));