mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-07-04 23:31:19 +01:00
Merge pull request #3126 from yuzu-emu/revert-3106-bitfield
Revert "common/bit_field: Silence sign-conversion warnings"
This commit is contained in:
commit
67a8bd1e70
1 changed files with 2 additions and 3 deletions
|
@ -135,8 +135,7 @@ public:
|
||||||
/// Constants to allow limited introspection of fields if needed
|
/// Constants to allow limited introspection of fields if needed
|
||||||
static constexpr std::size_t position = Position;
|
static constexpr std::size_t position = Position;
|
||||||
static constexpr std::size_t bits = Bits;
|
static constexpr std::size_t bits = Bits;
|
||||||
static constexpr StorageType mask = StorageType(
|
static constexpr StorageType mask = (((StorageType)~0) >> (8 * sizeof(T) - bits)) << position;
|
||||||
(std::numeric_limits<StorageType>::max() >> (8 * sizeof(T) - bits)) << position);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Formats a value by masking and shifting it according to the field parameters. A value
|
* Formats a value by masking and shifting it according to the field parameters. A value
|
||||||
|
@ -144,7 +143,7 @@ public:
|
||||||
* the results together.
|
* the results together.
|
||||||
*/
|
*/
|
||||||
static constexpr FORCE_INLINE StorageType FormatValue(const T& value) {
|
static constexpr FORCE_INLINE StorageType FormatValue(const T& value) {
|
||||||
return (static_cast<StorageType>(value) << position) & mask;
|
return ((StorageType)value << position) & mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue