Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMartin Hořeňovský2023-09-16 21:18:44 +0200
committerMartin Hořeňovský2023-09-16 21:18:44 +0200
commit56fcd584c1a4ca7f9449843e239559e69a084a63 (patch)
tree7dfb132783dca37882487ce3bac6c049d70a972d
parentaafe09bc1cb5211ebd63d5941cf51f848aa30465 (diff)
downloadcatch3-56fcd584c1a4ca7f9449843e239559e69a084a63.tar.gz
Make directCompare TU-local to stats.cpp
-rw-r--r--src/catch2/benchmark/detail/catch_stats.cpp22
-rw-r--r--src/catch2/benchmark/detail/catch_stats.hpp4
2 files changed, 13 insertions, 13 deletions
diff --git a/src/catch2/benchmark/detail/catch_stats.cpp b/src/catch2/benchmark/detail/catch_stats.cpp
index fe64b1c5..d745bb1f 100644
--- a/src/catch2/benchmark/detail/catch_stats.cpp
+++ b/src/catch2/benchmark/detail/catch_stats.cpp
@@ -184,6 +184,19 @@ namespace Catch {
return std::sqrt( variance );
}
+#if defined( __GNUC__ ) || defined( __clang__ )
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+ // Used when we know we want == comparison of two doubles
+ // to centralize warning suppression
+ static bool directCompare( double lhs, double rhs ) {
+ return lhs == rhs;
+ }
+#if defined( __GNUC__ ) || defined( __clang__ )
+# pragma GCC diagnostic pop
+#endif
+
} // namespace
} // namespace Detail
} // namespace Benchmark
@@ -193,15 +206,6 @@ namespace Catch {
namespace Benchmark {
namespace Detail {
-#if defined( __GNUC__ ) || defined( __clang__ )
-# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wfloat-equal"
-#endif
- bool directCompare( double lhs, double rhs ) { return lhs == rhs; }
-#if defined( __GNUC__ ) || defined( __clang__ )
-# pragma GCC diagnostic pop
-#endif
-
double weighted_average_quantile( int k,
int q,
double* first,
diff --git a/src/catch2/benchmark/detail/catch_stats.hpp b/src/catch2/benchmark/detail/catch_stats.hpp
index 9450406b..5b7c8808 100644
--- a/src/catch2/benchmark/detail/catch_stats.hpp
+++ b/src/catch2/benchmark/detail/catch_stats.hpp
@@ -20,10 +20,6 @@ namespace Catch {
namespace Detail {
using sample = std::vector<double>;
- // Used when we know we want == comparison of two doubles
- // to centralize warning suppression
- bool directCompare( double lhs, double rhs );
-
double weighted_average_quantile( int k,
int q,
double* first,