From c03b16b269e89db178223bfe35c5ea2084e12c96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Sun, 14 Mar 2021 08:15:33 +0100 Subject: [PATCH] fast_log2: silence unused variable warning. --- include/boost/intrusive/detail/math.hpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/boost/intrusive/detail/math.hpp b/include/boost/intrusive/detail/math.hpp index c13e745..c83997a 100644 --- a/include/boost/intrusive/detail/math.hpp +++ b/include/boost/intrusive/detail/math.hpp @@ -209,13 +209,12 @@ namespace detail { //http://www.flipcode.com/archives/Fast_log_Function.shtml inline float fast_log2 (float val) { - float f = val; unsigned x; - std::memcpy(&x, &val, sizeof(f)); + std::memcpy(&x, &val, sizeof(float)); const int log_2 = int((x >> 23) & 255) - 128; x &= ~(unsigned(255u) << 23u); x += unsigned(127) << 23u; - std::memcpy(&val, &x, sizeof(f)); + std::memcpy(&val, &x, sizeof(float)); //1+log2(m), m ranging from 1 to 2 //3rd degree polynomial keeping first derivate continuity. //For less precision the line can be commented out