From c4c644b285527b1769e13c17bbc341f88fa97828 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 11 Apr 2019 16:30:52 -0400 Subject: [PATCH] kernel: Make handle type declarations constexpr Some objects declare their handle type as const, while others declare it as constexpr. This makes the const ones constexpr for consistency, and prevent unexpected compilation errors if these happen to be attempted to be used within a constexpr context. --- src/core/hle/kernel/address_arbiter.h | 2 +- src/core/hle/kernel/client_port.h | 2 +- src/core/hle/kernel/client_session.h | 2 +- src/core/hle/kernel/event.h | 2 +- src/core/hle/kernel/mutex.h | 2 +- src/core/hle/kernel/process.h | 4 ++-- src/core/hle/kernel/resource_limit.h | 2 +- src/core/hle/kernel/semaphore.h | 2 +- src/core/hle/kernel/server_port.h | 2 +- src/core/hle/kernel/server_session.h | 2 +- src/core/hle/kernel/shared_memory.h | 2 +- src/core/hle/kernel/thread.h | 2 +- src/core/hle/kernel/timer.h | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/core/hle/kernel/address_arbiter.h b/src/core/hle/kernel/address_arbiter.h index 8d154b6db6..a4aff6a6ef 100644 --- a/src/core/hle/kernel/address_arbiter.h +++ b/src/core/hle/kernel/address_arbiter.h @@ -42,7 +42,7 @@ public: return name; } - static const HandleType HANDLE_TYPE = HandleType::AddressArbiter; + static constexpr HandleType HANDLE_TYPE = HandleType::AddressArbiter; HandleType GetHandleType() const override { return HANDLE_TYPE; } diff --git a/src/core/hle/kernel/client_port.h b/src/core/hle/kernel/client_port.h index 75264a0a68..423db01723 100644 --- a/src/core/hle/kernel/client_port.h +++ b/src/core/hle/kernel/client_port.h @@ -28,7 +28,7 @@ public: return name; } - static const HandleType HANDLE_TYPE = HandleType::ClientPort; + static constexpr HandleType HANDLE_TYPE = HandleType::ClientPort; HandleType GetHandleType() const override { return HANDLE_TYPE; } diff --git a/src/core/hle/kernel/client_session.h b/src/core/hle/kernel/client_session.h index c193fb0a71..de2c7b0baa 100644 --- a/src/core/hle/kernel/client_session.h +++ b/src/core/hle/kernel/client_session.h @@ -30,7 +30,7 @@ public: return name; } - static const HandleType HANDLE_TYPE = HandleType::ClientSession; + static constexpr HandleType HANDLE_TYPE = HandleType::ClientSession; HandleType GetHandleType() const override { return HANDLE_TYPE; } diff --git a/src/core/hle/kernel/event.h b/src/core/hle/kernel/event.h index a7737edf54..d102f069a6 100644 --- a/src/core/hle/kernel/event.h +++ b/src/core/hle/kernel/event.h @@ -25,7 +25,7 @@ public: this->name = name; } - static const HandleType HANDLE_TYPE = HandleType::Event; + static constexpr HandleType HANDLE_TYPE = HandleType::Event; HandleType GetHandleType() const override { return HANDLE_TYPE; } diff --git a/src/core/hle/kernel/mutex.h b/src/core/hle/kernel/mutex.h index 8cfbfa5403..6ec401aca5 100644 --- a/src/core/hle/kernel/mutex.h +++ b/src/core/hle/kernel/mutex.h @@ -27,7 +27,7 @@ public: return name; } - static const HandleType HANDLE_TYPE = HandleType::Mutex; + static constexpr HandleType HANDLE_TYPE = HandleType::Mutex; HandleType GetHandleType() const override { return HANDLE_TYPE; } diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h index 6b595336c6..4c5dbe93d0 100644 --- a/src/core/hle/kernel/process.h +++ b/src/core/hle/kernel/process.h @@ -68,7 +68,7 @@ public: return name; } - static const HandleType HANDLE_TYPE = HandleType::CodeSet; + static constexpr HandleType HANDLE_TYPE = HandleType::CodeSet; HandleType GetHandleType() const override { return HANDLE_TYPE; } @@ -120,7 +120,7 @@ public: return codeset->name; } - static const HandleType HANDLE_TYPE = HandleType::Process; + static constexpr HandleType HANDLE_TYPE = HandleType::Process; HandleType GetHandleType() const override { return HANDLE_TYPE; } diff --git a/src/core/hle/kernel/resource_limit.h b/src/core/hle/kernel/resource_limit.h index 582cca43d6..99ae8f2cf4 100644 --- a/src/core/hle/kernel/resource_limit.h +++ b/src/core/hle/kernel/resource_limit.h @@ -49,7 +49,7 @@ public: return name; } - static const HandleType HANDLE_TYPE = HandleType::ResourceLimit; + static constexpr HandleType HANDLE_TYPE = HandleType::ResourceLimit; HandleType GetHandleType() const override { return HANDLE_TYPE; } diff --git a/src/core/hle/kernel/semaphore.h b/src/core/hle/kernel/semaphore.h index 31c9fa8b5d..8c4d8e6796 100644 --- a/src/core/hle/kernel/semaphore.h +++ b/src/core/hle/kernel/semaphore.h @@ -25,7 +25,7 @@ public: return name; } - static const HandleType HANDLE_TYPE = HandleType::Semaphore; + static constexpr HandleType HANDLE_TYPE = HandleType::Semaphore; HandleType GetHandleType() const override { return HANDLE_TYPE; } diff --git a/src/core/hle/kernel/server_port.h b/src/core/hle/kernel/server_port.h index eb6c1e0aaa..8cc94d6ab1 100644 --- a/src/core/hle/kernel/server_port.h +++ b/src/core/hle/kernel/server_port.h @@ -30,7 +30,7 @@ public: return name; } - static const HandleType HANDLE_TYPE = HandleType::ServerPort; + static constexpr HandleType HANDLE_TYPE = HandleType::ServerPort; HandleType GetHandleType() const override { return HANDLE_TYPE; } diff --git a/src/core/hle/kernel/server_session.h b/src/core/hle/kernel/server_session.h index f1f36f392f..079dbd8174 100644 --- a/src/core/hle/kernel/server_session.h +++ b/src/core/hle/kernel/server_session.h @@ -47,7 +47,7 @@ public: return "ServerSession"; } - static const HandleType HANDLE_TYPE = HandleType::ServerSession; + static constexpr HandleType HANDLE_TYPE = HandleType::ServerSession; HandleType GetHandleType() const override { return HANDLE_TYPE; } diff --git a/src/core/hle/kernel/shared_memory.h b/src/core/hle/kernel/shared_memory.h index d4eeec6699..0d781cfcc8 100644 --- a/src/core/hle/kernel/shared_memory.h +++ b/src/core/hle/kernel/shared_memory.h @@ -28,7 +28,7 @@ public: this->name = std::move(name); } - static const HandleType HANDLE_TYPE = HandleType::SharedMemory; + static constexpr HandleType HANDLE_TYPE = HandleType::SharedMemory; HandleType GetHandleType() const override { return HANDLE_TYPE; } diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index 7ab90ccc43..ce69087c6b 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h @@ -160,7 +160,7 @@ public: return "Thread"; } - static const HandleType HANDLE_TYPE = HandleType::Thread; + static constexpr HandleType HANDLE_TYPE = HandleType::Thread; HandleType GetHandleType() const override { return HANDLE_TYPE; } diff --git a/src/core/hle/kernel/timer.h b/src/core/hle/kernel/timer.h index 91825e7af9..21bab1c422 100644 --- a/src/core/hle/kernel/timer.h +++ b/src/core/hle/kernel/timer.h @@ -47,7 +47,7 @@ public: return name; } - static const HandleType HANDLE_TYPE = HandleType::Timer; + static constexpr HandleType HANDLE_TYPE = HandleType::Timer; HandleType GetHandleType() const override { return HANDLE_TYPE; }