Fixes #52: ("Invalid casting in BOOST_INTRUSIVE_BSR_INTRINSIC")

This commit is contained in:
Ion Gaztañaga
2020-08-31 23:15:19 +02:00
parent d8761780b0
commit d61acfb8cd
2 changed files with 10 additions and 2 deletions

View File

@@ -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 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] [section:release_notes_boost_1_73_00 Boost 1.73 Release]
* Fixed bugs: * Fixed bugs:

View File

@@ -76,8 +76,8 @@ namespace detail {
inline std::size_t floor_log2 (std::size_t x) inline std::size_t floor_log2 (std::size_t x)
{ {
unsigned long log2; unsigned long log2;
BOOST_INTRUSIVE_BSR_INTRINSIC( &log2, (unsigned long)x ); BOOST_INTRUSIVE_BSR_INTRINSIC( &log2, x );
return log2; return static_cast<std::size_t>(log2);
} }
#undef BOOST_INTRUSIVE_BSR_INTRINSIC #undef BOOST_INTRUSIVE_BSR_INTRINSIC