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 ] ) ); }