diff options
-rw-r--r-- | bitfield.h | 6 | ||||
-rw-r--r-- | log.h | 2 | ||||
-rw-r--r-- | option.h | 2 | ||||
-rw-r--r-- | test/bitfield.cc | 1 | ||||
-rw-r--r-- | test/option.cc | 2 | ||||
-rw-r--r-- | test/ring.cc | 1 |
6 files changed, 9 insertions, 5 deletions
@@ -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>(), }; }; @@ -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, @@ -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 \ |