From 3786d93feea2e866da0577f778ae2182f62bf014 Mon Sep 17 00:00:00 2001 From: jameswatsoncraft Date: Wed, 12 Aug 2026 04:20:40 +0200 Subject: [PATCH 1/3] fix(msvc): silence C4244 in AddPowers and complexity pow (#826) Signed-off-by: jameswatsoncraft --- src/benchmark_register.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/benchmark_register.h b/src/benchmark_register.h index e0ace51ef0..59349dc007 100644 --- a/src/benchmark_register.h +++ b/src/benchmark_register.h @@ -34,7 +34,8 @@ typename std::vector::iterator AddPowers(std::vector* dst, T lo, T hi, if (i > kmax / mult) break; } - return dst->begin() + static_cast(start_offset); + return dst->begin() + + static_cast::difference_type>(start_offset); } template From 1da011261eddb8c22852d2441bb6dc60e099a88e Mon Sep 17 00:00:00 2001 From: jameswatsoncraft Date: Wed, 12 Aug 2026 04:20:42 +0200 Subject: [PATCH 2/3] fix(msvc): silence C4244 in AddPowers and complexity pow (#826) Signed-off-by: jameswatsoncraft --- src/complexity.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/complexity.cc b/src/complexity.cc index 8fa3f073af..952628ea7d 100644 --- a/src/complexity.cc +++ b/src/complexity.cc @@ -34,9 +34,13 @@ BigOFunc* FittingCurve(BigO complexity) { case oN: return [](IterationCount n) -> double { return static_cast(n); }; case oNSquared: - return [](IterationCount n) -> double { return std::pow(n, 2); }; + return [](IterationCount n) -> double { + return std::pow(static_cast(n), 2); + }; case oNCubed: - return [](IterationCount n) -> double { return std::pow(n, 3); }; + return [](IterationCount n) -> double { + return std::pow(static_cast(n), 3); + }; case oLogN: return [](IterationCount n) -> double { return std::log2(static_cast(n)); From ddba05da7c2e4f2860f4f6c8a94d06766dc55d31 Mon Sep 17 00:00:00 2001 From: jameswatsoncraft Date: Thu, 13 Aug 2026 06:40:12 +0200 Subject: [PATCH 3/3] fix: use size_t offset in AddPowers per review Signed-off-by: jameswatsoncraft --- src/benchmark_register.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/benchmark_register.h b/src/benchmark_register.h index 59349dc007..af644f53d4 100644 --- a/src/benchmark_register.h +++ b/src/benchmark_register.h @@ -34,8 +34,7 @@ typename std::vector::iterator AddPowers(std::vector* dst, T lo, T hi, if (i > kmax / mult) break; } - return dst->begin() + - static_cast::difference_type>(start_offset); + return dst->begin() + start_offset; } template