mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
fix(build): Fix incorrect type conversion (#5037)
It's incorrect to convert between different enum classes using initialisation. However, it's OK to convert between different enum classes using the same underlying type using static_cast. Signed-off-by: Oleg Girko <ol@infoserver.lv> Signed-off-by: Oleg Girko <ol@infoserver.lv> Co-authored-by: Oleg Girko <ol@infoserver.lv>
This commit is contained in:
parent
d8991c7f3d
commit
0b162ff599
@ -133,10 +133,10 @@ private:
|
|||||||
|
|
||||||
static constexpr std::byte to_byte(const Flag flag)
|
static constexpr std::byte to_byte(const Flag flag)
|
||||||
{
|
{
|
||||||
return std::byte{flag};
|
return static_cast<std::byte>(flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr std::byte VERSION_BIT_MASK = std::byte{Flag::VERSION_BIT_0} | std::byte{Flag::VERSION_BIT_1} | std::byte{Flag::VERSION_BIT_2};
|
static constexpr std::byte VERSION_BIT_MASK = static_cast<std::byte>(Flag::VERSION_BIT_0) | static_cast<std::byte>(Flag::VERSION_BIT_1) | static_cast<std::byte>(Flag::VERSION_BIT_2);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CompressibleBlockHeader : CBlockHeader {
|
struct CompressibleBlockHeader : CBlockHeader {
|
||||||
|
Loading…
Reference in New Issue
Block a user