c++23: Replace Common::ToUnderlying with std::to_underlying

Requires at least GCC 11, Clang 13, MSVC 19.30 (VS2022 17.0), or AppleClang 13.1.6 (XCode 13.3).
This commit is contained in:
Joshua Vandaële
2026-01-09 23:49:10 +01:00
parent cc0ce62e7f
commit 55f0715ad4
38 changed files with 148 additions and 167 deletions
+5 -5
View File
@@ -5,9 +5,9 @@
#include <cstring>
#include <type_traits>
#include <utility>
#include "Common/ChunkFile.h"
#include "Common/EnumUtils.h"
#include "Common/Logging/Log.h"
#include "Core/DolphinAnalytics.h"
#include "Core/System.h"
@@ -112,7 +112,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",
Common::ToUnderlying(MATINDEX_A), sub_cmd);
std::to_underlying(MATINDEX_A), sub_cmd);
}
matrix_index_a.Hex = value;
@@ -125,7 +125,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",
Common::ToUnderlying(MATINDEX_B), sub_cmd);
std::to_underlying(MATINDEX_B), sub_cmd);
}
matrix_index_b.Hex = value;
@@ -138,7 +138,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",
Common::ToUnderlying(VCD_LO), sub_cmd);
std::to_underlying(VCD_LO), sub_cmd);
}
vtx_desc.low.Hex = value;
@@ -151,7 +151,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",
Common::ToUnderlying(VCD_HI), sub_cmd);
std::to_underlying(VCD_HI), sub_cmd);
}
vtx_desc.high.Hex = value;