From ee064dc7f87e70a60c84b13361b9ed540e325cff Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 2 Feb 2023 06:11:47 +0200 Subject: [PATCH] Avoid -Wconversion warnings --- include/boost/container_hash/detail/hash_range.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/boost/container_hash/detail/hash_range.hpp b/include/boost/container_hash/detail/hash_range.hpp index d7b789b..97e2c7c 100644 --- a/include/boost/container_hash/detail/hash_range.hpp +++ b/include/boost/container_hash/detail/hash_range.hpp @@ -278,7 +278,7 @@ std::size_t>::type if( n >= 4 ) { - v1 = static_cast( read32le( p + n - 4 ) ) << ( n - 4 ) * 8 | read32le( p ); + v1 = static_cast( read32le( p + static_cast( n - 4 ) ) ) << ( n - 4 ) * 8 | read32le( p ); } else if( n >= 1 ) { @@ -286,8 +286,8 @@ std::size_t>::type std::size_t const x2 = n >> 1; // 1: 0, 2: 1, 3: 1 v1 = - static_cast( static_cast( p[ x1 ] ) ) << x1 * 8 | - static_cast( static_cast( p[ x2 ] ) ) << x2 * 8 | + static_cast( static_cast( p[ static_cast( x1 ) ] ) ) << x1 * 8 | + static_cast( static_cast( p[ static_cast( x2 ) ] ) ) << x2 * 8 | static_cast( static_cast( p[ 0 ] ) ); }