EnumUtils: Add Common::ToUnderlying

Mirrors the C++23 <utility> function, std::to_underlying
This commit is contained in:
get
2023-06-17 00:08:07 -05:00
parent 5029924ba1
commit 07ad75f34f
22 changed files with 118 additions and 78 deletions

View File

@ -7,6 +7,7 @@
#include <type_traits>
#include "Common/ChunkFile.h"
#include "Common/EnumUtils.h"
#include "Common/Logging/Log.h"
#include "Core/DolphinAnalytics.h"
#include "VideoCommon/CommandProcessor.h"
@ -110,7 +111,7 @@ void CPState::LoadCPReg(u8 sub_cmd, u32 value)
WARN_LOG_FMT(VIDEO,
"CP MATINDEX_A: an exact value of {:02x} was expected "
"but instead a value of {:02x} was seen",
static_cast<u16>(MATINDEX_A), sub_cmd);
Common::ToUnderlying(MATINDEX_A), sub_cmd);
}
matrix_index_a.Hex = value;
@ -123,7 +124,7 @@ void CPState::LoadCPReg(u8 sub_cmd, u32 value)
WARN_LOG_FMT(VIDEO,
"CP MATINDEX_B: an exact value of {:02x} was expected "
"but instead a value of {:02x} was seen",
static_cast<u16>(MATINDEX_B), sub_cmd);
Common::ToUnderlying(MATINDEX_B), sub_cmd);
}
matrix_index_b.Hex = value;
@ -136,7 +137,7 @@ void CPState::LoadCPReg(u8 sub_cmd, u32 value)
WARN_LOG_FMT(VIDEO,
"CP VCD_LO: an exact value of {:02x} was expected "
"but instead a value of {:02x} was seen",
static_cast<u16>(VCD_LO), sub_cmd);
Common::ToUnderlying(VCD_LO), sub_cmd);
}
vtx_desc.low.Hex = value;
@ -149,7 +150,7 @@ void CPState::LoadCPReg(u8 sub_cmd, u32 value)
WARN_LOG_FMT(VIDEO,
"CP VCD_HI: an exact value of {:02x} was expected "
"but instead a value of {:02x} was seen",
static_cast<u16>(VCD_HI), sub_cmd);
Common::ToUnderlying(VCD_HI), sub_cmd);
}
vtx_desc.high.Hex = value;