From c9325cea0aa43f328644157dee4eafe3d7b45e6f Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Tue, 8 Oct 2024 15:34:56 +0200 Subject: Name local variables using lower_case ...and private members using lower_case_ --- src/utils/cpp/hex_string.hpp | 2 +- src/utils/cpp/type_safe_arithmetic.hpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/utils/cpp') diff --git a/src/utils/cpp/hex_string.hpp b/src/utils/cpp/hex_string.hpp index 4b0124c4..5cca094a 100644 --- a/src/utils/cpp/hex_string.hpp +++ b/src/utils/cpp/hex_string.hpp @@ -44,7 +44,7 @@ [[nodiscard]] static inline auto FromHexString(std::string const& hexstring) -> std::optional { try { - const std::size_t kHexBase = 16; + static constexpr std::size_t kHexBase = 16; std::stringstream ss{}; for (std::size_t i = 0; i < hexstring.length(); i += 2) { unsigned char c = diff --git a/src/utils/cpp/type_safe_arithmetic.hpp b/src/utils/cpp/type_safe_arithmetic.hpp index 1ff53ce8..2076a5bf 100644 --- a/src/utils/cpp/type_safe_arithmetic.hpp +++ b/src/utils/cpp/type_safe_arithmetic.hpp @@ -49,7 +49,7 @@ struct TypeSafeArithmeticTag { /// \tparam TAG The actual \ref TypeSafeArithmeticTag template class TypeSafeArithmetic { - typename TAG::value_t m_value{}; + typename TAG::value_t value_{}; public: using tag_t = TAG; @@ -81,17 +81,17 @@ class TypeSafeArithmetic { } // NOLINTNEXTLINE - constexpr /*explicit*/ operator value_t() const { return m_value; } + constexpr /*explicit*/ operator value_t() const { return value_; } - constexpr auto get() const -> value_t { return m_value; } + constexpr auto get() const -> value_t { return value_; } constexpr void set(value_t value) { Expects(value >= kMinValue and value <= kMaxValue and "value output of range"); - m_value = value; + value_ = value; } - auto pointer() const -> const_pointer_t { return &m_value; } + auto pointer() const -> const_pointer_t { return &value_; } }; // template -- cgit v1.2.3