aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bitfield.h6
-rw-r--r--log.h2
-rw-r--r--option.h2
-rw-r--r--test/bitfield.cc1
-rw-r--r--test/option.cc2
-rw-r--r--test/ring.cc1
6 files changed, 9 insertions, 5 deletions
diff --git a/bitfield.h b/bitfield.h
index a49a997..be7eed8 100644
--- a/bitfield.h
+++ b/bitfield.h
@@ -20,7 +20,7 @@ static constexpr bool is_bitfield_type_v =
/// compute_mask<4, 7, uint32_t>() -> 0xf0
template <std::uint8_t LowBit, std::uint8_t HighBit, typename ValueType>
static constexpr inline ValueType compute_mask() {
- using unsigned_t = typename std::make_unsigned<ValueType>::type;
+ using unsigned_t = std::make_unsigned_t<ValueType>;
constexpr unsigned_t kMaxBits = sizeof(unsigned_t) * 8;
static_assert(HighBit < kMaxBits, "HighBit exceeds bits of ValueType");
@@ -67,7 +67,7 @@ struct field_ref {
private:
ValueType& m_val;
- enum : ValueType {
+ enum : ValueType { // NOLINT(performance-enum-size)
kMask = impl::compute_mask<LowBit, HighBit, ValueType>(),
};
};
@@ -89,7 +89,7 @@ struct const_field_ref {
private:
const ValueType& m_val;
- enum : ValueType {
+ enum : ValueType { // NOLINT(performance-enum-size)
kMask = impl::compute_mask<LowBit, HighBit, ValueType>(),
};
};
diff --git a/log.h b/log.h
index 8e8035b..3664b62 100644
--- a/log.h
+++ b/log.h
@@ -45,7 +45,7 @@ namespace logging {
M(kDbg0, "DBG0")
#define M(val, ignore) val,
-enum log_level { LOG_LEVELS(M) };
+enum log_level : char { LOG_LEVELS(M) };
#undef M
#define M(ignore, val) val,
diff --git a/option.h b/option.h
index a3ad60a..20104d7 100644
--- a/option.h
+++ b/option.h
@@ -15,7 +15,7 @@ constexpr bool is_trivially_destructible_v =
/// Definition of std::enable_if_t for older c++ std versions.
template <bool Cond, typename T = bool>
-using enable_if_t = typename std::enable_if<Cond, T>::type;
+using enable_if_t = std::enable_if_t<Cond, T>;
} // namespace impl
/// The NONE type.
diff --git a/test/bitfield.cc b/test/bitfield.cc
index 0d4dcac..f02abf5 100644
--- a/test/bitfield.cc
+++ b/test/bitfield.cc
@@ -1,6 +1,7 @@
#include <bitfield.h>
#include <cassert>
+#include <cstdint>
#include <cstdio>
BITFIELD_START(MOOSE, std::uint32_t)
diff --git a/test/option.cc b/test/option.cc
index cf80374..09c0fdf 100644
--- a/test/option.cc
+++ b/test/option.cc
@@ -1,6 +1,8 @@
#include <option.h>
+#include <cassert>
#include <cstdio>
#include <cstdlib>
+#include <utility>
struct checker {
static unsigned cnt;
diff --git a/test/ring.cc b/test/ring.cc
index 657fdfa..59dcc7c 100644
--- a/test/ring.cc
+++ b/test/ring.cc
@@ -1,5 +1,6 @@
#include <ring.h>
+#include <cassert>
#include <cstdio>
#define LOG \