More -Wconversion fixes for GCC 10 and below

This commit is contained in:
Peter Dimov
2023-05-31 19:54:43 +03:00
parent 266fbe6449
commit 7ab05d5de0
6 changed files with 8 additions and 8 deletions

View File

@@ -28,7 +28,7 @@ int main()
x = 2;
for( int i = 1; i < 8; ++i, x <<= 1 )
for( int i = 1; i < 8; ++i, x = static_cast<boost::uint8_t>( x << 1 ) )
{
BOOST_TEST_EQ( boost::core::has_single_bit( x ), true );
BOOST_TEST_EQ( boost::core::has_single_bit( static_cast<boost::uint8_t>( x | ( x >> 1 ) ) ), false );
@@ -47,7 +47,7 @@ int main()
x = 2;
for( int i = 1; i < 16; ++i, x <<= 1 )
for( int i = 1; i < 16; ++i, x = static_cast<boost::uint16_t>( x << 1 ) )
{
BOOST_TEST_EQ( boost::core::has_single_bit( x ), true );
BOOST_TEST_EQ( boost::core::has_single_bit( static_cast<boost::uint16_t>( x | ( x >> 1 ) ) ), false );