diff options
| author | Scott Hutchinson | 2021-01-23 12:58:20 -0800 |
|---|---|---|
| committer | Martin Hořeňovský | 2021-05-09 18:10:50 +0200 |
| commit | ea44e73961c234149abda2362d4e94664c1f35ae (patch) | |
| tree | 85576edba73577b2e57331b1826f11218c975f85 /src | |
| parent | d61fe3ecc3c953cc92abdbbd25eae09b62c60849 (diff) | |
| download | catch3-ea44e73961c234149abda2362d4e94664c1f35ae.tar.gz | |
Wrap all std::min and std::max calls in parentheses
Diffstat (limited to 'src')
| -rw-r--r-- | src/catch2/benchmark/detail/catch_estimate_clock.hpp | 4 | ||||
| -rw-r--r-- | src/catch2/benchmark/detail/catch_stats.cpp | 4 | ||||
| -rw-r--r-- | src/catch2/benchmark/detail/catch_stats.hpp | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/src/catch2/benchmark/detail/catch_estimate_clock.hpp b/src/catch2/benchmark/detail/catch_estimate_clock.hpp index 0a49e513..984acd11 100644 --- a/src/catch2/benchmark/detail/catch_estimate_clock.hpp +++ b/src/catch2/benchmark/detail/catch_estimate_clock.hpp @@ -66,7 +66,9 @@ namespace Catch { } template <typename Clock> EnvironmentEstimate<FloatDuration<Clock>> estimate_clock_cost(FloatDuration<Clock> resolution) { - auto time_limit = std::min(resolution * clock_cost_estimation_tick_limit, FloatDuration<Clock>(clock_cost_estimation_time_limit)); + auto time_limit = (std::min)( + resolution * clock_cost_estimation_tick_limit, + FloatDuration<Clock>(clock_cost_estimation_time_limit)); auto time_clock = [](int k) { return Detail::measure<Clock>([k] { for (int i = 0; i < k; ++i) { diff --git a/src/catch2/benchmark/detail/catch_stats.cpp b/src/catch2/benchmark/detail/catch_stats.cpp index 8e14bfd7..45190da8 100644 --- a/src/catch2/benchmark/detail/catch_stats.cpp +++ b/src/catch2/benchmark/detail/catch_stats.cpp @@ -171,7 +171,7 @@ namespace Catch { double sb = stddev.point; double mn = mean.point / n; double mg_min = mn / 2.; - double sg = std::min(mg_min / 4., sb / std::sqrt(n)); + double sg = (std::min)(mg_min / 4., sb / std::sqrt(n)); double sg2 = sg * sg; double sb2 = sb * sb; @@ -190,7 +190,7 @@ namespace Catch { return (nc / n) * (sb2 - nc * sg2); }; - return std::min(var_out(1), var_out(std::min(c_max(0.), c_max(mg_min)))) / sb2; + return (std::min)(var_out(1), var_out((std::min)(c_max(0.), c_max(mg_min)))) / sb2; } diff --git a/src/catch2/benchmark/detail/catch_stats.hpp b/src/catch2/benchmark/detail/catch_stats.hpp index b8044131..41f487b2 100644 --- a/src/catch2/benchmark/detail/catch_stats.hpp +++ b/src/catch2/benchmark/detail/catch_stats.hpp @@ -116,8 +116,8 @@ namespace Catch { double b2 = bias - z1; double a1 = a(b1); double a2 = a(b2); - auto lo = std::max(cumn(a1), 0); - auto hi = std::min(cumn(a2), n - 1); + auto lo = (std::max)(cumn(a1), 0); + auto hi = (std::min)(cumn(a2), n - 1); return { point, resample[lo], resample[hi], confidence_level }; } |