From 920fa14898d055d61b399160981271a45f49832a Mon Sep 17 00:00:00 2001 From: Dominic Hamon Date: Wed, 8 Jun 2022 10:32:20 +0100 Subject: [PATCH] fix some build warnings on type conversions --- src/benchmark_register.h | 2 +- test/complexity_test.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/benchmark_register.h b/src/benchmark_register.h index caefe3d9..a5a250cc 100644 --- a/src/benchmark_register.h +++ b/src/benchmark_register.h @@ -23,7 +23,7 @@ typename std::vector::iterator AddPowers(std::vector* dst, T lo, T hi, static const T kmax = std::numeric_limits::max(); // Space out the values in multiples of "mult" - for (T i = static_cast(1); i <= hi; i *= mult) { + for (T i = static_cast(1); i <= hi; i *= static_cast(mult)) { if (i >= lo) { dst->push_back(i); } diff --git a/test/complexity_test.cc b/test/complexity_test.cc index e51dc346..3e14c4f9 100644 --- a/test/complexity_test.cc +++ b/test/complexity_test.cc @@ -174,7 +174,7 @@ BENCHMARK(BM_Complexity_O_N_log_N) ->RangeMultiplier(2) ->Range(1 << 10, 1 << 16) ->Complexity([](benchmark::IterationCount n) { - return kLog2E * n * log(static_cast(n)); + return kLog2E * static_cast(n) * log(static_cast(n)); }); BENCHMARK(BM_Complexity_O_N_log_N) ->RangeMultiplier(2)