From fa4fa42aca8bd51372211bd03e8d35a2fd57ae13 Mon Sep 17 00:00:00 2001 From: Ewan Miller Date: Sat, 27 Jul 2024 12:08:54 -0400 Subject: [PATCH] could this be.... it? --- nuTens/logging.hpp | 5 ++++- nuTens/tensors/tensor.hpp | 2 +- tests/test-utils.hpp | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/nuTens/logging.hpp b/nuTens/logging.hpp index 7c249cf..b04fb84 100644 --- a/nuTens/logging.hpp +++ b/nuTens/logging.hpp @@ -69,7 +69,10 @@ const static spdlog::level::level_enum runtimeLogLevel = spdlog::level::off; namespace ntlogging { -static std::once_flag logLevelOnceFlag; +static std::once_flag + logLevelOnceFlag; // NOLINT: Linter gets angry that this is globally accessible and non-const. Needs to be non-const + // so it can be flipped by the call to std::call_once. Could wrap it up so that it's not global + // but that feels like a bit much for what we're doing here /// @brief Set up the logger at runtime, should only be invoked once the very /// first time any of the logging macros below are called diff --git a/nuTens/tensors/tensor.hpp b/nuTens/tensors/tensor.hpp index f364010..31f2a2d 100644 --- a/nuTens/tensors/tensor.hpp +++ b/nuTens/tensors/tensor.hpp @@ -37,7 +37,7 @@ class Tensor */ public: - typedef std::variant indexType; + using indexType = std::variant; /// @name Initialisers /// Use these methods to initialise the tensor diff --git a/tests/test-utils.hpp b/tests/test-utils.hpp index 584b70a..0838dbf 100644 --- a/tests/test-utils.hpp +++ b/tests/test-utils.hpp @@ -25,6 +25,7 @@ float relativeDiff(float f1, float f2) // use when we want to check if a value is equal to some expectation // threshold is fractional difference that is considdered "too different" // will print out some useful information then fail the test +// NOLINTNEXTLINE: Wants me to make this a constexpr... but i prefer it like this so... #define TEST_EXPECTED(value, expectation, varName, threshold) \ { \ if (Testing::relativeDiff((value), (expectation)) > (threshold)) \