From 77bf86eaa5269a01cd148dcf5a5c93146fd366e7 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Fri, 16 Oct 2015 03:25:39 +0300 Subject: [PATCH] Bugfix --- Utilities/File.h | 4 ++-- rpcs3/Emu/Memory/vm_ptr.h | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Utilities/File.h b/Utilities/File.h index a963fd79f9..d9c614ffac 100644 --- a/Utilities/File.h +++ b/Utilities/File.h @@ -164,8 +164,8 @@ namespace fs dir& operator =(dir&& right) { - m_dd = right.m_dd; - m_path = std::move(right.m_path); + std::swap(m_dd, right.m_dd); + std::swap(m_path, right.m_path); return *this; } diff --git a/rpcs3/Emu/Memory/vm_ptr.h b/rpcs3/Emu/Memory/vm_ptr.h index f053c8e2c3..ad31ef23b5 100644 --- a/rpcs3/Emu/Memory/vm_ptr.h +++ b/rpcs3/Emu/Memory/vm_ptr.h @@ -44,9 +44,9 @@ namespace vm } // get vm pointer to a struct member with array subscription - template> _ptr_base> ptr(MT T2::*const mptr, u32 index) const + template, typename = if_comparable_t> _ptr_base ptr(MT T2::*const mptr, u32 index) const { - return{ VM_CAST(m_addr) + get_offset(mptr) + sizeof32(T) * index, vm::addr }; + return{ VM_CAST(m_addr) + get_offset(mptr) + sizeof32(ET) * index, vm::addr }; } // get vm reference to a struct member @@ -56,9 +56,9 @@ namespace vm } // get vm reference to a struct member with array subscription - template> _ref_base> ref(MT T2::*const mptr, u32 index) const + template, typename = if_comparable_t> _ref_base ref(MT T2::*const mptr, u32 index) const { - return{ VM_CAST(m_addr) + get_offset(mptr) + sizeof32(T) * index, vm::addr }; + return{ VM_CAST(m_addr) + get_offset(mptr) + sizeof32(ET) * index, vm::addr }; } // get vm reference @@ -117,13 +117,13 @@ namespace vm return m_addr != 0; } - // Test address for arbitrary alignment: (addr & (align - 1)) != 0 + // Test address for arbitrary alignment: (addr & (align - 1)) == 0 bool aligned(u32 align) const { return (m_addr & (align - 1)) == 0; } - // Test address for type's alignment using alignof(T) + // Test address alignment using alignof(T) bool aligned() const { static_assert(!std::is_void::value, "vm::_ptr_base<> error: aligned() is not available for void pointers"); @@ -131,10 +131,10 @@ namespace vm return aligned(alignof32(T)); } - // Call aligned(value) + // Test address for arbitrary alignment: (addr & (align - 1)) != 0 explicit_bool_t operator %(u32 align) const { - return aligned(align); + return !aligned(align); } // pointer increment (postfix)