diff --git a/test/boost/network_topology_strategy_test.cc b/test/boost/network_topology_strategy_test.cc index 97e1ff2969..4a3dec92bb 100644 --- a/test/boost/network_topology_strategy_test.cc +++ b/test/boost/network_topology_strategy_test.cc @@ -126,7 +126,8 @@ auto d2t = [](double d) -> int64_t { // Double to unsigned long conversion will overflow if the // input is greater than numeric_limits::max(), so divide by two and // multiply again later. - return static_cast(d*(std::numeric_limits::max() >> 1)) << 1; + auto scale = std::numeric_limits::max(); + return static_cast(d * static_cast(scale >> 1)) << 1; }; /**