From d61acfb8cdf8fded444c1c05b95302015393da2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Mon, 31 Aug 2020 23:15:19 +0200 Subject: [PATCH] Fixes #52: ("Invalid casting in BOOST_INTRUSIVE_BSR_INTRINSIC") --- doc/intrusive.qbk | 8 ++++++++ include/boost/intrusive/detail/math.hpp | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/intrusive.qbk b/doc/intrusive.qbk index 888c25b..5589df1 100644 --- a/doc/intrusive.qbk +++ b/doc/intrusive.qbk @@ -3886,6 +3886,14 @@ to be inserted in intrusive containers are allocated using `std::vector` or `std [section:release_notes Release Notes] +[section:release_notes_boost_1_75_00 Boost 1.75 Release] + +* Fixed bugs: + * [@https://github.com/boostorg/intrusive/issues/52 GitHub #52: ['Invalid casting in BOOST_INTRUSIVE_BSR_INTRINSIC]] + +[endsect] + + [section:release_notes_boost_1_73_00 Boost 1.73 Release] * Fixed bugs: diff --git a/include/boost/intrusive/detail/math.hpp b/include/boost/intrusive/detail/math.hpp index 0748f1d..c13e745 100644 --- a/include/boost/intrusive/detail/math.hpp +++ b/include/boost/intrusive/detail/math.hpp @@ -76,8 +76,8 @@ namespace detail { inline std::size_t floor_log2 (std::size_t x) { unsigned long log2; - BOOST_INTRUSIVE_BSR_INTRINSIC( &log2, (unsigned long)x ); - return log2; + BOOST_INTRUSIVE_BSR_INTRINSIC( &log2, x ); + return static_cast(log2); } #undef BOOST_INTRUSIVE_BSR_INTRINSIC