summaryrefslogtreecommitdiff
path: root/src/utils/cpp
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-10-08 15:34:56 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-10-08 15:41:50 +0200
commitc9325cea0aa43f328644157dee4eafe3d7b45e6f (patch)
tree7c688b9cfd8acf45771193f41d69639f9a47dfab /src/utils/cpp
parent0e024eb055e6e8272f419e898ae9eefd0085c34f (diff)
downloadjustbuild-c9325cea0aa43f328644157dee4eafe3d7b45e6f.tar.gz
Name local variables using lower_case
...and private members using lower_case_
Diffstat (limited to 'src/utils/cpp')
-rw-r--r--src/utils/cpp/hex_string.hpp2
-rw-r--r--src/utils/cpp/type_safe_arithmetic.hpp10
2 files changed, 6 insertions, 6 deletions
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<std::string> {
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 <typename TAG>
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 <typename TAG>