From 0bfeabfd63181f0bd488767481b3c66a7d20c659 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 2 Feb 2023 05:20:06 +0200 Subject: [PATCH] Hardcode q*q to avoid 'integral constant overflow' warnings --- include/boost/container_hash/detail/hash_range.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/container_hash/detail/hash_range.hpp b/include/boost/container_hash/detail/hash_range.hpp index 6df98c1..5ddf358 100644 --- a/include/boost/container_hash/detail/hash_range.hpp +++ b/include/boost/container_hash/detail/hash_range.hpp @@ -98,7 +98,7 @@ std::size_t>::type std::size_t n = static_cast( last - first ); boost::uint32_t const q = 0x9e3779b9U; - boost::uint32_t const k = q * q; + boost::uint32_t const k = 0xe35e67b1U; // q * q boost::uint64_t h = mul32( static_cast( seed ) + q, k ); boost::uint32_t w = static_cast( h ); @@ -150,7 +150,7 @@ std::size_t>::type std::size_t n = 0; boost::uint32_t const q = 0x9e3779b9U; - boost::uint32_t const k = q * q; + boost::uint32_t const k = 0xe35e67b1U; // q * q boost::uint64_t h = mul32( static_cast( seed ) + q, k ); boost::uint32_t w = static_cast( h );