1
0
forked from boostorg/core

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

@@ -24,7 +24,7 @@ int main()
x = 1;
for( int i = 0; i < 8; ++i, x <<= 1 )
for( int i = 0; i < 8; ++i, x = static_cast<boost::uint8_t>( x << 1 ) )
{
BOOST_TEST_EQ( boost::core::bit_width( x ), i+1 );
BOOST_TEST_EQ( boost::core::bit_width( static_cast<boost::uint8_t>( x | ( x >> 1 ) ) ), i+1 );
@@ -39,7 +39,7 @@ int main()
x = 1;
for( int i = 0; i < 16; ++i, x <<= 1 )
for( int i = 0; i < 16; ++i, x = static_cast<boost::uint16_t>( x << 1 ) )
{
BOOST_TEST_EQ( boost::core::bit_width( x ), i+1 );
BOOST_TEST_EQ( boost::core::bit_width( static_cast<boost::uint16_t>( x | ( x >> 1 ) ) ), i+1 );