[Misc] Replaced const with constexpr where possible

This commit is contained in:
Xphalnos
2025-03-20 21:16:32 +01:00
committed by Radosław Gliński
parent d20620eb5e
commit 5f918ef28d
64 changed files with 191 additions and 190 deletions

View File

@@ -221,7 +221,7 @@ dword_result_t XGetAVPack_entry() {
DECLARE_XAM_EXPORT1(XGetAVPack, kNone, kStub);
uint32_t xeXGetGameRegion() {
static uint32_t const table[] = {
static uint32_t constexpr table[] = {
0xFFFFu, 0x03FFu, 0x02FEu, 0x02FEu, 0x03FFu, 0x02FEu, 0x0201u, 0x03FFu,
0x02FEu, 0x02FEu, 0x03FFu, 0x03FFu, 0x03FFu, 0x03FFu, 0x02FEu, 0x03FFu,
0x00FFu, 0xFFFFu, 0x02FEu, 0x03FFu, 0x0102u, 0x03FFu, 0x03FFu, 0x02FEu,

View File

@@ -36,7 +36,7 @@ namespace xam {
// Table lookups.
uint8_t xeXamGetOnlineCountryFromLocale(uint8_t id) {
static uint8_t const table[] = {
static uint8_t constexpr table[] = {
2, 6, 5, 8, 13, 16, 19, 20, 21, 23, 25, 32, 34, 24, 37,
39, 42, 46, 44, 50, 53, 56, 71, 74, 76, 75, 82, 84, 91, 93,
109, 31, 90, 18, 101, 35, 103, 88, 236, 99, 4, 89, 45, 1,
@@ -120,7 +120,7 @@ const char16_t* xeXamGetLocaleString(uint8_t id) {
}
uint8_t xeXamGetLocaleFromOnlineCountry(uint8_t id) {
static uint8_t const table[] = {
static uint8_t constexpr table[] = {
0, 43, 0, 0, 40, 2, 1, 0, 3, 0, 0, 0, 0, 4, 0, 0, 5, 0, 33,
6, 7, 8, 0, 9, 13, 10, 0, 0, 0, 0, 0, 31, 11, 0, 12, 35, 0, 14,
0, 15, 0, 0, 16, 0, 18, 42, 17, 0, 0, 0, 19, 0, 0, 20, 0, 0, 21,
@@ -140,7 +140,7 @@ uint8_t xeXamGetLocaleFromOnlineCountry(uint8_t id) {
}
uint8_t xeXamGetLanguageFromOnlineLanguage(uint8_t id) {
static uint8_t const table[] = {
static uint8_t constexpr table[] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 17, 11, 12, 1, 1, 15, 16, 13, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 14, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -164,7 +164,7 @@ const char16_t* xeXamGetOnlineLanguageString(uint8_t id) {
}
uint8_t xeXamGetCountryFromOnlineCountry(uint8_t id) {
static uint8_t const table[] = {
static uint8_t constexpr table[] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
@@ -186,7 +186,7 @@ uint8_t xeXamGetCountryFromOnlineCountry(uint8_t id) {
}
uint8_t xeXamGetLocaleFromCountry(uint8_t id) {
static uint8_t const table[] = {
static uint8_t constexpr table[] = {
0, 43, 0, 0, 40, 2, 1, 0, 3, 0, 0, 0, 0, 4, 0, 0, 5, 0, 33,
6, 7, 8, 0, 9, 13, 10, 0, 0, 0, 0, 0, 31, 11, 0, 12, 35, 0, 14,
0, 15, 0, 0, 16, 0, 18, 42, 17, 0, 0, 0, 19, 0, 0, 20, 0, 0, 21,

View File

@@ -23,7 +23,7 @@ namespace xam {
bool xeXamIsUIActive();
static const std::string kXamModuleLoaderDataFileName = "launch_data.bin";
static constexpr std::string kXamModuleLoaderDataFileName = "launch_data.bin";
class XamModule : public KernelModule {
public:

View File

@@ -451,25 +451,25 @@ DECLARE_XAM_EXPORT1(NetDll_WSASetEvent, kNetworking, kImplemented);
struct XnAddrStatus {
// Address acquisition is not yet complete
static const uint32_t XNET_GET_XNADDR_PENDING = 0x00000000;
static constexpr uint32_t XNET_GET_XNADDR_PENDING = 0x00000000;
// XNet is uninitialized or no debugger found
static const uint32_t XNET_GET_XNADDR_NONE = 0x00000001;
static constexpr uint32_t XNET_GET_XNADDR_NONE = 0x00000001;
// Host has ethernet address (no IP address)
static const uint32_t XNET_GET_XNADDR_ETHERNET = 0x00000002;
static constexpr uint32_t XNET_GET_XNADDR_ETHERNET = 0x00000002;
// Host has statically assigned IP address
static const uint32_t XNET_GET_XNADDR_STATIC = 0x00000004;
static constexpr uint32_t XNET_GET_XNADDR_STATIC = 0x00000004;
// Host has DHCP assigned IP address
static const uint32_t XNET_GET_XNADDR_DHCP = 0x00000008;
static constexpr uint32_t XNET_GET_XNADDR_DHCP = 0x00000008;
// Host has PPPoE assigned IP address
static const uint32_t XNET_GET_XNADDR_PPPOE = 0x00000010;
static constexpr uint32_t XNET_GET_XNADDR_PPPOE = 0x00000010;
// Host has one or more gateways configured
static const uint32_t XNET_GET_XNADDR_GATEWAY = 0x00000020;
static constexpr uint32_t XNET_GET_XNADDR_GATEWAY = 0x00000020;
// Host has one or more DNS servers configured
static const uint32_t XNET_GET_XNADDR_DNS = 0x00000040;
static constexpr uint32_t XNET_GET_XNADDR_DNS = 0x00000040;
// Host is currently connected to online service
static const uint32_t XNET_GET_XNADDR_ONLINE = 0x00000080;
static constexpr uint32_t XNET_GET_XNADDR_ONLINE = 0x00000080;
// Network configuration requires troubleshooting
static const uint32_t XNET_GET_XNADDR_TROUBLESHOOT = 0x00008000;
static constexpr uint32_t XNET_GET_XNADDR_TROUBLESHOOT = 0x00008000;
};
dword_result_t NetDll_XNetGetTitleXnAddr_entry(dword_t caller,