aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-04-14 12:05:54 -0700
committerChris Robinson <[email protected]>2020-04-14 12:05:54 -0700
commit78e789bf7b02ec8ed30dd8d3b682a2dd7e50adf2 (patch)
tree8b7477683866814063e208367dadd9f36f0c474c
parent6ac581635406328f50a3552aeddd0b95790594ef (diff)
Silence a type conversion warning with GCC
-rw-r--r--common/albyte.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/common/albyte.h b/common/albyte.h
index a2f6ec28..2df96ac3 100644
--- a/common/albyte.h
+++ b/common/albyte.h
@@ -72,7 +72,8 @@ class bitfield {
static constexpr size_t bits_per_byte{std::numeric_limits<unsigned char>::digits};
static constexpr size_t NumElems{(N+bits_per_byte-1) / bits_per_byte};
- typename detail_::ElemT<NumElems> vals{};
+ using storage_type = detail_::ElemT<NumElems>;
+ storage_type vals{};
public:
template<size_t b>
@@ -85,7 +86,7 @@ public:
inline void unset() noexcept
{
static_assert(b < N, "Bit index out of range");
- vals &= ~(1 << b);
+ vals &= static_cast<storage_type>(~(1 << b));
}
template<size_t b>
inline bool get() const noexcept