diff options
| author | 2022-02-02 12:12:22 -0500 | |
|---|---|---|
| committer | 2022-02-02 12:17:08 -0500 | |
| commit | 76d83ffbece12d9509c5cc753dd6c69d8abeb458 (patch) | |
| tree | d514d72b25ccea9a7405bd36e8caf7a79da4d909 /src/core/hle/kernel | |
| parent | Merge pull request #7807 from german77/moar-buttons (diff) | |
| download | yuzu-76d83ffbece12d9509c5cc753dd6c69d8abeb458.tar.gz yuzu-76d83ffbece12d9509c5cc753dd6c69d8abeb458.tar.xz yuzu-76d83ffbece12d9509c5cc753dd6c69d8abeb458.zip | |
general: Move deleted copy/move constructor/assignment operators to public interface
This allows for better compiler errors, where the compiler will state a
copy or move couldn't occur due to the relevant function being deleted.
Previously a compiler would warn about the relevant function not being
accessible (which, while true, isn't as informative as it could be).
Diffstat (limited to 'src/core/hle/kernel')
| -rw-r--r-- | src/core/hle/kernel/k_auto_object.h | 7 | ||||
| -rw-r--r-- | src/core/hle/kernel/k_auto_object_container.h | 4 | ||||
| -rw-r--r-- | src/core/hle/kernel/k_handle_table.h | 3 |
3 files changed, 6 insertions, 8 deletions
diff --git a/src/core/hle/kernel/k_auto_object.h b/src/core/hle/kernel/k_auto_object.h index 165b76747..05779f2d5 100644 --- a/src/core/hle/kernel/k_auto_object.h +++ b/src/core/hle/kernel/k_auto_object.h | |||
| @@ -20,8 +20,6 @@ class KernelCore; | |||
| 20 | class KProcess; | 20 | class KProcess; |
| 21 | 21 | ||
| 22 | #define KERNEL_AUTOOBJECT_TRAITS(CLASS, BASE_CLASS) \ | 22 | #define KERNEL_AUTOOBJECT_TRAITS(CLASS, BASE_CLASS) \ |
| 23 | YUZU_NON_COPYABLE(CLASS); \ | ||
| 24 | YUZU_NON_MOVEABLE(CLASS); \ | ||
| 25 | \ | 23 | \ |
| 26 | private: \ | 24 | private: \ |
| 27 | friend class ::Kernel::KClassTokenGenerator; \ | 25 | friend class ::Kernel::KClassTokenGenerator; \ |
| @@ -32,6 +30,9 @@ private: | |||
| 32 | } \ | 30 | } \ |
| 33 | \ | 31 | \ |
| 34 | public: \ | 32 | public: \ |
| 33 | YUZU_NON_COPYABLE(CLASS); \ | ||
| 34 | YUZU_NON_MOVEABLE(CLASS); \ | ||
| 35 | \ | ||
| 35 | using BaseClass = BASE_CLASS; \ | 36 | using BaseClass = BASE_CLASS; \ |
| 36 | static constexpr TypeObj GetStaticTypeObj() { \ | 37 | static constexpr TypeObj GetStaticTypeObj() { \ |
| 37 | constexpr ClassTokenType Token = ClassToken(); \ | 38 | constexpr ClassTokenType Token = ClassToken(); \ |
| @@ -224,9 +225,9 @@ private: | |||
| 224 | 225 | ||
| 225 | template <typename T> | 226 | template <typename T> |
| 226 | class KScopedAutoObject { | 227 | class KScopedAutoObject { |
| 228 | public: | ||
| 227 | YUZU_NON_COPYABLE(KScopedAutoObject); | 229 | YUZU_NON_COPYABLE(KScopedAutoObject); |
| 228 | 230 | ||
| 229 | public: | ||
| 230 | constexpr KScopedAutoObject() = default; | 231 | constexpr KScopedAutoObject() = default; |
| 231 | 232 | ||
| 232 | constexpr KScopedAutoObject(T* o) : m_obj(o) { | 233 | constexpr KScopedAutoObject(T* o) : m_obj(o) { |
diff --git a/src/core/hle/kernel/k_auto_object_container.h b/src/core/hle/kernel/k_auto_object_container.h index 4eadfe99d..697cc4289 100644 --- a/src/core/hle/kernel/k_auto_object_container.h +++ b/src/core/hle/kernel/k_auto_object_container.h | |||
| @@ -16,13 +16,12 @@ class KernelCore; | |||
| 16 | class KProcess; | 16 | class KProcess; |
| 17 | 17 | ||
| 18 | class KAutoObjectWithListContainer { | 18 | class KAutoObjectWithListContainer { |
| 19 | public: | ||
| 19 | YUZU_NON_COPYABLE(KAutoObjectWithListContainer); | 20 | YUZU_NON_COPYABLE(KAutoObjectWithListContainer); |
| 20 | YUZU_NON_MOVEABLE(KAutoObjectWithListContainer); | 21 | YUZU_NON_MOVEABLE(KAutoObjectWithListContainer); |
| 21 | 22 | ||
| 22 | public: | ||
| 23 | using ListType = boost::intrusive::rbtree<KAutoObjectWithList>; | 23 | using ListType = boost::intrusive::rbtree<KAutoObjectWithList>; |
| 24 | 24 | ||
| 25 | public: | ||
| 26 | class ListAccessor : public KScopedLightLock { | 25 | class ListAccessor : public KScopedLightLock { |
| 27 | public: | 26 | public: |
| 28 | explicit ListAccessor(KAutoObjectWithListContainer* container) | 27 | explicit ListAccessor(KAutoObjectWithListContainer* container) |
| @@ -48,7 +47,6 @@ public: | |||
| 48 | 47 | ||
| 49 | friend class ListAccessor; | 48 | friend class ListAccessor; |
| 50 | 49 | ||
| 51 | public: | ||
| 52 | KAutoObjectWithListContainer(KernelCore& kernel) : m_lock(kernel), m_object_list() {} | 50 | KAutoObjectWithListContainer(KernelCore& kernel) : m_lock(kernel), m_object_list() {} |
| 53 | 51 | ||
| 54 | void Initialize() {} | 52 | void Initialize() {} |
diff --git a/src/core/hle/kernel/k_handle_table.h b/src/core/hle/kernel/k_handle_table.h index 4b114ec2f..87004a0f9 100644 --- a/src/core/hle/kernel/k_handle_table.h +++ b/src/core/hle/kernel/k_handle_table.h | |||
| @@ -22,13 +22,12 @@ namespace Kernel { | |||
| 22 | class KernelCore; | 22 | class KernelCore; |
| 23 | 23 | ||
| 24 | class KHandleTable { | 24 | class KHandleTable { |
| 25 | public: | ||
| 25 | YUZU_NON_COPYABLE(KHandleTable); | 26 | YUZU_NON_COPYABLE(KHandleTable); |
| 26 | YUZU_NON_MOVEABLE(KHandleTable); | 27 | YUZU_NON_MOVEABLE(KHandleTable); |
| 27 | 28 | ||
| 28 | public: | ||
| 29 | static constexpr size_t MaxTableSize = 1024; | 29 | static constexpr size_t MaxTableSize = 1024; |
| 30 | 30 | ||
| 31 | public: | ||
| 32 | explicit KHandleTable(KernelCore& kernel_); | 31 | explicit KHandleTable(KernelCore& kernel_); |
| 33 | ~KHandleTable(); | 32 | ~KHandleTable(); |
| 34 | 33 | ||