From cf619432a73372dbddc5dd7434ea0fcedb37700e Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 8 Feb 2022 22:00:42 +0200 Subject: [PATCH] Fix GCC -Wlong-long warnings --- include/boost/core/bit.hpp | 10 +++++----- test/bit_ceil_test.cpp | 4 ++-- test/bit_countl_test.cpp | 4 ++-- test/bit_countr_test.cpp | 4 ++-- test/bit_endian_test.cpp | 2 +- test/bit_floor_test.cpp | 4 ++-- test/bit_popcount_test.cpp | 4 ++-- test/bit_rotate_test.cpp | 4 ++-- test/bit_width_test.cpp | 2 +- test/has_single_bit_test.cpp | 2 +- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/include/boost/core/bit.hpp b/include/boost/core/bit.hpp index 7efb7c7..1288979 100644 --- a/include/boost/core/bit.hpp +++ b/include/boost/core/bit.hpp @@ -82,9 +82,9 @@ BOOST_CONSTEXPR inline int countl_impl( unsigned long x ) BOOST_NOEXCEPT return x? __builtin_clzl( x ): std::numeric_limits::digits; } -BOOST_CONSTEXPR inline int countl_impl( unsigned long long x ) BOOST_NOEXCEPT +BOOST_CONSTEXPR inline int countl_impl( boost::ulong_long_type x ) BOOST_NOEXCEPT { - return x? __builtin_clzll( x ): std::numeric_limits::digits; + return x? __builtin_clzll( x ): std::numeric_limits::digits; } } // namespace detail @@ -224,9 +224,9 @@ BOOST_CONSTEXPR inline int countr_impl( unsigned long x ) BOOST_NOEXCEPT return x? __builtin_ctzl( x ): std::numeric_limits::digits; } -BOOST_CONSTEXPR inline int countr_impl( unsigned long long x ) BOOST_NOEXCEPT +BOOST_CONSTEXPR inline int countr_impl( boost::ulong_long_type x ) BOOST_NOEXCEPT { - return x? __builtin_ctzll( x ): std::numeric_limits::digits; + return x? __builtin_ctzll( x ): std::numeric_limits::digits; } } // namespace detail @@ -365,7 +365,7 @@ BOOST_CORE_POPCOUNT_CONSTEXPR inline int popcount_impl( unsigned long x ) BOOST_ return __builtin_popcountl( x ); } -BOOST_CORE_POPCOUNT_CONSTEXPR inline int popcount_impl( unsigned long long x ) BOOST_NOEXCEPT +BOOST_CORE_POPCOUNT_CONSTEXPR inline int popcount_impl( boost::ulong_long_type x ) BOOST_NOEXCEPT { return __builtin_popcountll( x ); } diff --git a/test/bit_ceil_test.cpp b/test/bit_ceil_test.cpp index 1509d55..53fbb84 100644 --- a/test/bit_ceil_test.cpp +++ b/test/bit_ceil_test.cpp @@ -38,7 +38,7 @@ int main() test_bit_ceil( static_cast( 0 ) ); test_bit_ceil( static_cast( 0 ) ); test_bit_ceil( static_cast( 0 ) ); - test_bit_ceil( static_cast( 0 ) ); + test_bit_ceil( static_cast( 0 ) ); } { @@ -58,7 +58,7 @@ int main() test_bit_ceil( static_cast( x ) ); test_bit_ceil( static_cast( x ) ); test_bit_ceil( static_cast( x ) ); - test_bit_ceil( static_cast( x ) ); + test_bit_ceil( static_cast( x ) ); } return boost::report_errors(); diff --git a/test/bit_countl_test.cpp b/test/bit_countl_test.cpp index e9473c8..c25423e 100644 --- a/test/bit_countl_test.cpp +++ b/test/bit_countl_test.cpp @@ -27,7 +27,7 @@ int main() test_countl( static_cast( 0 ) ); test_countl( static_cast( 0 ) ); test_countl( static_cast( 0 ) ); - test_countl( static_cast( 0 ) ); + test_countl( static_cast( 0 ) ); boost::detail::splitmix64 rng; @@ -39,7 +39,7 @@ int main() test_countl( static_cast( x ) ); test_countl( static_cast( x ) ); test_countl( static_cast( x ) ); - test_countl( static_cast( x ) ); + test_countl( static_cast( x ) ); } return boost::report_errors(); diff --git a/test/bit_countr_test.cpp b/test/bit_countr_test.cpp index dedcf9e..a3b0c96 100644 --- a/test/bit_countr_test.cpp +++ b/test/bit_countr_test.cpp @@ -27,7 +27,7 @@ int main() test_countr( static_cast( 0 ) ); test_countr( static_cast( 0 ) ); test_countr( static_cast( 0 ) ); - test_countr( static_cast( 0 ) ); + test_countr( static_cast( 0 ) ); boost::detail::splitmix64 rng; @@ -39,7 +39,7 @@ int main() test_countr( static_cast( x ) ); test_countr( static_cast( x ) ); test_countr( static_cast( x ) ); - test_countr( static_cast( x ) ); + test_countr( static_cast( x ) ); } return boost::report_errors(); diff --git a/test/bit_endian_test.cpp b/test/bit_endian_test.cpp index b682e1b..06f415e 100644 --- a/test/bit_endian_test.cpp +++ b/test/bit_endian_test.cpp @@ -15,7 +15,7 @@ int main() { - boost::uint64_t v = static_cast( 0x0102030405060708ull ); + boost::uint64_t v = ( static_cast( 0x01020304u ) << 32 ) + 0x05060708u; if( boost::core::endian::native == boost::core::endian::little ) { diff --git a/test/bit_floor_test.cpp b/test/bit_floor_test.cpp index 6afa11e..04dc720 100644 --- a/test/bit_floor_test.cpp +++ b/test/bit_floor_test.cpp @@ -33,7 +33,7 @@ int main() test_bit_floor( static_cast( 0 ) ); test_bit_floor( static_cast( 0 ) ); test_bit_floor( static_cast( 0 ) ); - test_bit_floor( static_cast( 0 ) ); + test_bit_floor( static_cast( 0 ) ); } boost::detail::splitmix64 rng; @@ -46,7 +46,7 @@ int main() test_bit_floor( static_cast( x ) ); test_bit_floor( static_cast( x ) ); test_bit_floor( static_cast( x ) ); - test_bit_floor( static_cast( x ) ); + test_bit_floor( static_cast( x ) ); } return boost::report_errors(); diff --git a/test/bit_popcount_test.cpp b/test/bit_popcount_test.cpp index d5cc678..30d4777 100644 --- a/test/bit_popcount_test.cpp +++ b/test/bit_popcount_test.cpp @@ -26,7 +26,7 @@ int main() test_popcount( static_cast( 0 ) ); test_popcount( static_cast( 0 ) ); test_popcount( static_cast( 0 ) ); - test_popcount( static_cast( 0 ) ); + test_popcount( static_cast( 0 ) ); } boost::detail::splitmix64 rng; @@ -39,7 +39,7 @@ int main() test_popcount( static_cast( x ) ); test_popcount( static_cast( x ) ); test_popcount( static_cast( x ) ); - test_popcount( static_cast( x ) ); + test_popcount( static_cast( x ) ); } return boost::report_errors(); diff --git a/test/bit_rotate_test.cpp b/test/bit_rotate_test.cpp index c99f29c..51bc154 100644 --- a/test/bit_rotate_test.cpp +++ b/test/bit_rotate_test.cpp @@ -152,7 +152,7 @@ int main() } { - unsigned long long x = 0; + boost::ulong_long_type x = 0; BOOST_TEST_EQ( boost::core::rotl( x, i ), x ); BOOST_TEST_EQ( boost::core::rotr( x, i ), x ); } @@ -168,7 +168,7 @@ int main() test_rotate( static_cast( x ) ); test_rotate( static_cast( x ) ); test_rotate( static_cast( x ) ); - test_rotate( static_cast( x ) ); + test_rotate( static_cast( x ) ); } return boost::report_errors(); diff --git a/test/bit_width_test.cpp b/test/bit_width_test.cpp index 1447b90..15ac76d 100644 --- a/test/bit_width_test.cpp +++ b/test/bit_width_test.cpp @@ -87,7 +87,7 @@ int main() test_width( static_cast( x ) ); test_width( static_cast( x ) ); test_width( static_cast( x ) ); - test_width( static_cast( x ) ); + test_width( static_cast( x ) ); } return boost::report_errors(); diff --git a/test/has_single_bit_test.cpp b/test/has_single_bit_test.cpp index 0be8fcd..1e0fe39 100644 --- a/test/has_single_bit_test.cpp +++ b/test/has_single_bit_test.cpp @@ -103,7 +103,7 @@ int main() test_single_bit( static_cast( x ) ); test_single_bit( static_cast( x ) ); test_single_bit( static_cast( x ) ); - test_single_bit( static_cast( x ) ); + test_single_bit( static_cast( x ) ); } return boost::report_errors();