mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Bitfield: Cast value to storage type in assignment operator
This allows us to use enum classes in bitfields.
This commit is contained in:
@ -136,7 +136,7 @@ public:
|
|||||||
|
|
||||||
__forceinline BitField& operator=(T val)
|
__forceinline BitField& operator=(T val)
|
||||||
{
|
{
|
||||||
storage = (storage & ~GetMask()) | ((val << position) & GetMask());
|
storage = (storage & ~GetMask()) | ((static_cast<StorageType>(val) << position) & GetMask());
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user