From c4c644b285527b1769e13c17bbc341f88fa97828 Mon Sep 17 00:00:00 2001
From: Lioncash <mathew1800@gmail.com>
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 8d154b6db..a4aff6a6e 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 75264a0a6..423db0172 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 c193fb0a7..de2c7b0ba 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 a7737edf5..d102f069a 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 8cfbfa540..6ec401aca 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 6b595336c..4c5dbe93d 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 582cca43d..99ae8f2cf 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 31c9fa8b5..8c4d8e679 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 eb6c1e0aa..8cc94d6ab 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 f1f36f392..079dbd817 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 d4eeec669..0d781cfcc 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 7ab90ccc4..ce69087c6 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 91825e7af..21bab1c42 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;
     }