diff --git a/src/catch2/benchmark/catch_constructor.hpp b/src/catch2/benchmark/catch_constructor.hpp index 9da1eaaf..3e2b87e5 100644 --- a/src/catch2/benchmark/catch_constructor.hpp +++ b/src/catch2/benchmark/catch_constructor.hpp @@ -51,10 +51,10 @@ namespace Catch { private: // If this is a constructor benchmark, destruct the underlying object template - void destruct_on_exit(std::enable_if_t* = 0) { destruct(); } + void destruct_on_exit(std::enable_if_t* = nullptr) { destruct(); } // Otherwise, don't template - void destruct_on_exit(std::enable_if_t* = 0) { } + void destruct_on_exit(std::enable_if_t* = nullptr) { } T& stored_object() { return *static_cast(static_cast(&data)); diff --git a/src/catch2/benchmark/detail/catch_stats.hpp b/src/catch2/benchmark/detail/catch_stats.hpp index 93c4fd60..998616e1 100644 --- a/src/catch2/benchmark/detail/catch_stats.hpp +++ b/src/catch2/benchmark/detail/catch_stats.hpp @@ -54,7 +54,7 @@ namespace Catch { double mean(Iterator first, Iterator last) { auto count = last - first; double sum = std::accumulate(first, last, 0.); - return sum / count; + return sum / static_cast(count); } template @@ -100,7 +100,7 @@ namespace Catch { }); double accel = sum_cubes / (6 * std::pow(sum_squares, 1.5)); - int n = static_cast(resample.size()); + long n = static_cast(resample.size()); double prob_n = std::count_if(resample.begin(), resample.end(), [point](double x) { return x < point; }) / static_cast(n); // degenerate case with uniform samples if (prob_n == 0) return { point, point, point, confidence_level }; @@ -108,7 +108,7 @@ namespace Catch { double bias = normal_quantile(prob_n); double z1 = normal_quantile((1. - confidence_level) / 2.); - auto cumn = [n]( double x ) -> int { + auto cumn = [n]( double x ) -> long { return std::lround( normal_cdf( x ) * n ); }; auto a = [bias, accel](double b) { return bias + b / (1. - accel * b); }; @@ -116,7 +116,7 @@ namespace Catch { double b2 = bias - z1; double a1 = a(b1); double a2 = a(b2); - auto lo = static_cast((std::max)(cumn(a1), 0)); + auto lo = static_cast((std::max)(cumn(a1), 0l)); auto hi = static_cast((std::min)(cumn(a2), n - 1)); return { point, resample[lo], resample[hi], confidence_level }; diff --git a/src/catch2/catch_translate_exception.hpp b/src/catch2/catch_translate_exception.hpp index dfd95cd6..4a0be629 100644 --- a/src/catch2/catch_translate_exception.hpp +++ b/src/catch2/catch_translate_exception.hpp @@ -81,4 +81,4 @@ namespace Catch { #endif -#endif // CATCH_TRANSLATE_EXCEPTION_HPP_INCLUDED \ No newline at end of file +#endif // CATCH_TRANSLATE_EXCEPTION_HPP_INCLUDED diff --git a/src/catch2/internal/catch_case_insensitive_comparisons.hpp b/src/catch2/internal/catch_case_insensitive_comparisons.hpp index c182e13e..a97b7b4b 100644 --- a/src/catch2/internal/catch_case_insensitive_comparisons.hpp +++ b/src/catch2/internal/catch_case_insensitive_comparisons.hpp @@ -27,4 +27,4 @@ namespace Catch { } // namespace Detail } // namespace Catch -#endif // CATCH_CASE_INSENSITIVE_COMPARISONS_HPP_INCLUDED \ No newline at end of file +#endif // CATCH_CASE_INSENSITIVE_COMPARISONS_HPP_INCLUDED diff --git a/src/catch2/internal/catch_console_width.hpp b/src/catch2/internal/catch_console_width.hpp index 52ef0f0e..ad868e33 100644 --- a/src/catch2/internal/catch_console_width.hpp +++ b/src/catch2/internal/catch_console_width.hpp @@ -12,4 +12,4 @@ #define CATCH_CONFIG_CONSOLE_WIDTH 80 #endif -#endif // CATCH_CONSOLE_WIDTH_HPP_INCLUDED \ No newline at end of file +#endif // CATCH_CONSOLE_WIDTH_HPP_INCLUDED diff --git a/tests/SelfTest/IntrospectiveTests/Sharding.tests.cpp b/tests/SelfTest/IntrospectiveTests/Sharding.tests.cpp index ec316347..78e4858a 100644 --- a/tests/SelfTest/IntrospectiveTests/Sharding.tests.cpp +++ b/tests/SelfTest/IntrospectiveTests/Sharding.tests.cpp @@ -42,4 +42,4 @@ TEST_CASE("Sharding Function", "[approvals]") { for(std::size_t i = 0; i < sizes[shardIndex]; i++) { CHECK(result[i] == testContainer[i + startIndex]); } -} \ No newline at end of file +}