From a281f6d70df11bd72784fd4b290f48c5ecee3ac3 Mon Sep 17 00:00:00 2001 From: sephiroth99 Date: Thu, 17 Dec 2015 01:04:44 -0500 Subject: [PATCH] ObjectTable: Remove explicit specialization in class scope Function template 'LookupObject' in ObjectTable class has a specialization in class scope, which is not allowed. While MSVC seems OK with that, clang complains about it. Fix this issue by moving the definition of the specialisation outside the class scope, and moving the declaration in the '.cc' file. --- src/xenia/kernel/util/object_table.cc | 8 ++++++++ src/xenia/kernel/util/object_table.h | 12 ++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/xenia/kernel/util/object_table.cc b/src/xenia/kernel/util/object_table.cc index 2fe774cc8..55f6f48e9 100644 --- a/src/xenia/kernel/util/object_table.cc +++ b/src/xenia/kernel/util/object_table.cc @@ -202,6 +202,14 @@ ObjectTable::ObjectTableEntry* ObjectTable::LookupTable(X_HANDLE handle) { return nullptr; } +// Generic lookup +template <> +object_ref ObjectTable::LookupObject(X_HANDLE handle) { + auto object = ObjectTable::LookupObject(handle, false); + auto result = object_ref(reinterpret_cast(object)); + return result; +} + XObject* ObjectTable::LookupObject(X_HANDLE handle, bool already_locked) { handle = TranslateHandle(handle); if (!handle) { diff --git a/src/xenia/kernel/util/object_table.h b/src/xenia/kernel/util/object_table.h index f1f7e7d0d..731f03e03 100644 --- a/src/xenia/kernel/util/object_table.h +++ b/src/xenia/kernel/util/object_table.h @@ -46,14 +46,6 @@ class ObjectTable { return result; } - // Generic lookup - template <> - object_ref LookupObject(X_HANDLE handle) { - auto object = LookupObject(handle, false); - auto result = object_ref(reinterpret_cast(object)); - return result; - } - X_STATUS AddNameMapping(const std::string& name, X_HANDLE handle); void RemoveNameMapping(const std::string& name); X_STATUS GetObjectByName(const std::string& name, X_HANDLE* out_handle); @@ -86,6 +78,10 @@ class ObjectTable { std::unordered_map name_table_; }; +// Generic lookup +template <> +object_ref ObjectTable::LookupObject(X_HANDLE handle); + } // namespace util } // namespace kernel } // namespace xe