From 8ed0d92e32db961fb6307ebaa31908a1f8e08461 Mon Sep 17 00:00:00 2001
From: Rodrigo Locatti <reinuseslisp@airmail.cc>
Date: Sat, 16 Nov 2019 03:29:37 -0300
Subject: [PATCH] Revert "common/bit_field: Silence sign-conversion warnings"

---
 src/common/bit_field.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/common/bit_field.h b/src/common/bit_field.h
index 2dbe37839..fd2bbbd99 100644
--- a/src/common/bit_field.h
+++ b/src/common/bit_field.h
@@ -135,8 +135,7 @@ public:
     /// Constants to allow limited introspection of fields if needed
     static constexpr std::size_t position = Position;
     static constexpr std::size_t bits = Bits;
-    static constexpr StorageType mask = StorageType(
-        (std::numeric_limits<StorageType>::max() >> (8 * sizeof(T) - bits)) << position);
+    static constexpr StorageType mask = (((StorageType)~0) >> (8 * sizeof(T) - bits)) << position;
 
     /**
      * Formats a value by masking and shifting it according to the field parameters. A value
@@ -144,7 +143,7 @@ public:
      * the results together.
      */
     static constexpr FORCE_INLINE StorageType FormatValue(const T& value) {
-        return (static_cast<StorageType>(value) << position) & mask;
+        return ((StorageType)value << position) & mask;
     }
 
     /**