From f12eeb6b9f8f73c23fee1d75e9d18ca90b064dfc Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 8 Feb 2022 22:55:08 +0200 Subject: [PATCH] Avoid -Wlong-long in bit_rotate_test.cpp --- test/bit_rotate_test.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/test/bit_rotate_test.cpp b/test/bit_rotate_test.cpp index 51bc154..d37569e 100644 --- a/test/bit_rotate_test.cpp +++ b/test/bit_rotate_test.cpp @@ -103,26 +103,28 @@ int main() BOOST_TEST_EQ( +boost::core::rotr( x, 1 ), 0x44444444 ); } +#define CONST64(x) ((boost::uint64_t(x) << 32) + (x)) + { - boost::uint64_t x = 0x1111111111111111; + boost::uint64_t x = CONST64(0x11111111); - BOOST_TEST_EQ( +boost::core::rotl( x, 1 ), 0x2222222222222222 ); - BOOST_TEST_EQ( +boost::core::rotr( x, 1 ), 0x8888888888888888 ); + BOOST_TEST_EQ( +boost::core::rotl( x, 1 ), CONST64(0x22222222) ); + BOOST_TEST_EQ( +boost::core::rotr( x, 1 ), CONST64(0x88888888) ); - x = 0x2222222222222222; + x = CONST64(0x22222222); - BOOST_TEST_EQ( +boost::core::rotl( x, 1 ), 0x4444444444444444 ); - BOOST_TEST_EQ( +boost::core::rotr( x, 1 ), 0x1111111111111111 ); + BOOST_TEST_EQ( +boost::core::rotl( x, 1 ), CONST64(0x44444444) ); + BOOST_TEST_EQ( +boost::core::rotr( x, 1 ), CONST64(0x11111111) ); - x = 0x4444444444444444; + x = CONST64(0x44444444); - BOOST_TEST_EQ( +boost::core::rotl( x, 1 ), 0x8888888888888888 ); - BOOST_TEST_EQ( +boost::core::rotr( x, 1 ), 0x2222222222222222 ); + BOOST_TEST_EQ( +boost::core::rotl( x, 1 ), CONST64(0x88888888) ); + BOOST_TEST_EQ( +boost::core::rotr( x, 1 ), CONST64(0x22222222) ); - x = 0x8888888888888888; + x = CONST64(0x88888888); - BOOST_TEST_EQ( +boost::core::rotl( x, 1 ), 0x1111111111111111 ); - BOOST_TEST_EQ( +boost::core::rotr( x, 1 ), 0x4444444444444444 ); + BOOST_TEST_EQ( +boost::core::rotl( x, 1 ), CONST64(0x11111111) ); + BOOST_TEST_EQ( +boost::core::rotr( x, 1 ), CONST64(0x44444444) ); } for( int i = -M; i <= M; ++i )