From a605dd0a3fad1c80321b6d546b67f41aac874308 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sat, 22 Sep 2018 22:35:52 +0300 Subject: [PATCH] Add missing deleted operators --- Utilities/Config.h | 3 ++- Utilities/Thread.h | 8 ++++++-- Utilities/VirtualMemory.h | 2 ++ rpcs3/Emu/Memory/vm.h | 2 ++ rpcs3/Emu/Memory/vm_var.h | 5 ++++- 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Utilities/Config.h b/Utilities/Config.h index 3803a29758..57ad9fb359 100644 --- a/Utilities/Config.h +++ b/Utilities/Config.h @@ -49,9 +49,10 @@ namespace cfg _base(type _type, class node* owner, const std::string& name); public: - // Disallow copy/move constructors and assignments _base(const _base&) = delete; + _base& operator=(const _base&) = delete; + // Get type type get_type() const { return m_type; } diff --git a/Utilities/Thread.h b/Utilities/Thread.h index e0573baa95..5c3c53feb1 100644 --- a/Utilities/Thread.h +++ b/Utilities/Thread.h @@ -164,6 +164,8 @@ public: thread_ctrl(const thread_ctrl&) = delete; + thread_ctrl& operator=(const thread_ctrl&) = delete; + ~thread_ctrl(); // Get thread name @@ -279,9 +281,10 @@ public: virtual ~named_thread(); - // Deleted copy/move constructors + copy/move operators named_thread(const named_thread&) = delete; + named_thread& operator=(const named_thread&) = delete; + // Get thread name virtual std::string get_name() const; @@ -340,9 +343,10 @@ public: thread_ctrl::spawn(m_thread, std::forward(name), std::forward(func)); } - // Deleted copy/move constructors + copy/move operators scope_thread(const scope_thread&) = delete; + scope_thread& operator=(const scope_thread&) = delete; + // Destructor with exceptions allowed ~scope_thread() noexcept(false) { diff --git a/Utilities/VirtualMemory.h b/Utilities/VirtualMemory.h index e43c663078..f6fd0df133 100644 --- a/Utilities/VirtualMemory.h +++ b/Utilities/VirtualMemory.h @@ -52,6 +52,8 @@ namespace utils shm(const shm&) = delete; + shm& operator=(const shm&) = delete; + ~shm(); // Map shared memory diff --git a/rpcs3/Emu/Memory/vm.h b/rpcs3/Emu/Memory/vm.h index 062d557d7c..f9df163378 100644 --- a/rpcs3/Emu/Memory/vm.h +++ b/rpcs3/Emu/Memory/vm.h @@ -71,6 +71,7 @@ namespace vm public: reader_lock(const reader_lock&) = delete; + reader_lock& operator=(const reader_lock&) = delete; reader_lock(); ~reader_lock(); @@ -82,6 +83,7 @@ namespace vm const bool locked; writer_lock(const writer_lock&) = delete; + writer_lock& operator=(const writer_lock&) = delete; writer_lock(int full); ~writer_lock(); diff --git a/rpcs3/Emu/Memory/vm_var.h b/rpcs3/Emu/Memory/vm_var.h index a1c9c4d054..05c8b9f717 100644 --- a/rpcs3/Emu/Memory/vm_var.h +++ b/rpcs3/Emu/Memory/vm_var.h @@ -42,6 +42,8 @@ namespace vm // Unmoveable object _var_base(const _var_base&) = delete; + _var_base& operator=(const _var_base&) = delete; + _var_base() : pointer(A::alloc(sizeof(T), alignof(T))) { @@ -71,9 +73,10 @@ namespace vm u32 m_size; public: - // Unmoveable object _var_base(const _var_base&) = delete; + _var_base& operator=(const _var_base&) = delete; + _var_base(u32 count) : pointer(A::alloc(u32{sizeof(T)} * count, alignof(T))) , m_size(u32{sizeof(T)} * count)