summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-11-16 19:23:15 +0100
committerGitHub <noreply@github.com>2019-11-16 19:23:15 +0100
commit67a8bd1e701e9da6ec47d877b2e21b2e86d1603b (patch)
treeddfd5d15ff0a055cdd4b4aa5df85c0b2bfc56713 /src
parentMerge pull request #3106 from lioncash/bitfield (diff)
parentRevert "common/bit_field: Silence sign-conversion warnings" (diff)
downloadyuzu-67a8bd1e701e9da6ec47d877b2e21b2e86d1603b.tar
yuzu-67a8bd1e701e9da6ec47d877b2e21b2e86d1603b.tar.gz
yuzu-67a8bd1e701e9da6ec47d877b2e21b2e86d1603b.tar.bz2
yuzu-67a8bd1e701e9da6ec47d877b2e21b2e86d1603b.tar.lz
yuzu-67a8bd1e701e9da6ec47d877b2e21b2e86d1603b.tar.xz
yuzu-67a8bd1e701e9da6ec47d877b2e21b2e86d1603b.tar.zst
yuzu-67a8bd1e701e9da6ec47d877b2e21b2e86d1603b.zip
Diffstat (limited to 'src')
-rw-r--r--src/common/bit_field.h5
1 files 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;
}
/**