diff --git a/common/include/Utilities/ScopedPtrMT.h b/common/include/Utilities/ScopedPtrMT.h index beb010dd8c..964ce6739a 100644 --- a/common/include/Utilities/ScopedPtrMT.h +++ b/common/include/Utilities/ScopedPtrMT.h @@ -49,7 +49,7 @@ public: return *this; } - ScopedPtrMT &Delete() throw() + ScopedPtrMT &Delete() noexcept { ScopedLock lock(m_mtx); _Delete_unlocked(); @@ -87,19 +87,19 @@ public: // the wx/boost approach (which uses some bizarre member method pointer crap, and can't // allow the T* implicit casting. - bool operator!() const throw() + bool operator!() const noexcept { return m_ptr.load() == nullptr; } // Equality - bool operator==(T *pT) const throw() + bool operator==(T *pT) const noexcept { return m_ptr == pT; } // Inequality - bool operator!=(T *pT) const throw() + bool operator!=(T *pT) const noexcept { return !operator==(pT); } @@ -133,7 +133,7 @@ public: #endif protected: - void _Delete_unlocked() throw() + void _Delete_unlocked() noexcept { delete m_ptr.exchange(nullptr); } diff --git a/common/include/Utilities/Threading.h b/common/include/Utilities/Threading.h index 8f3f1c63a9..36e32a27a8 100644 --- a/common/include/Utilities/Threading.h +++ b/common/include/Utilities/Threading.h @@ -213,7 +213,7 @@ public: NonblockingMutex() { val.clear(); } virtual ~NonblockingMutex() = default; - bool TryAcquire() throw() + bool TryAcquire() noexcept { return !val.test_and_set(); } diff --git a/pcsx2/System.cpp b/pcsx2/System.cpp index 70e19fb6f4..d79c945c00 100644 --- a/pcsx2/System.cpp +++ b/pcsx2/System.cpp @@ -505,7 +505,7 @@ BaseException* SysCpuProviderPack::GetException_SuperVU1() const { return CpuPro #endif -void SysCpuProviderPack::CleanupMess() throw() +void SysCpuProviderPack::CleanupMess() noexcept { try { diff --git a/pcsx2/System.h b/pcsx2/System.h index 456d0de20c..0a3ef3b044 100644 --- a/pcsx2/System.h +++ b/pcsx2/System.h @@ -122,7 +122,7 @@ public: virtual ~SysAllocVM(); protected: - void CleanupMess() throw(); + void CleanupMess() noexcept; }; // -------------------------------------------------------------------------------------- @@ -164,7 +164,7 @@ public: BaseException* GetException_SuperVU1() const; protected: - void CleanupMess() throw(); + void CleanupMess() noexcept; }; // GetCpuProviders - this function is not implemented by PCSX2 core -- it must be diff --git a/pcsx2/VU1microInterp.cpp b/pcsx2/VU1microInterp.cpp index 1ad76ed0b0..eafd877331 100644 --- a/pcsx2/VU1microInterp.cpp +++ b/pcsx2/VU1microInterp.cpp @@ -198,7 +198,7 @@ void InterpVU1::Reset() { vu1Thread.WaitVU(); } -void InterpVU1::Shutdown() throw() { +void InterpVU1::Shutdown() noexcept { vu1Thread.WaitVU(); } diff --git a/pcsx2/VUmicro.h b/pcsx2/VUmicro.h index c52ff0202c..240dd9bb26 100644 --- a/pcsx2/VUmicro.h +++ b/pcsx2/VUmicro.h @@ -139,7 +139,7 @@ public: // Called from the EEcore thread. No locking is performed, so any necessary locks must // be implemented by the CPU provider manually. // - virtual void Vsync() throw() { } + virtual void Vsync() noexcept { } virtual void Step() { // Ideally this would fall back on interpretation for executing single instructions @@ -176,7 +176,7 @@ public: wxString GetLongName() const { return L"VU0 Interpreter"; } void Reserve() { } - void Shutdown() throw() { } + void Shutdown() noexcept { } void Reset() { } void Step(); @@ -197,7 +197,7 @@ public: wxString GetLongName() const { return L"VU1 Interpreter"; } void Reserve() { } - void Shutdown() throw(); + void Shutdown() noexcept; void Reset(); void Step(); @@ -222,12 +222,12 @@ public: wxString GetLongName() const { return L"microVU0 Recompiler"; } void Reserve(); - void Shutdown() throw(); + void Shutdown() noexcept; void Reset(); void Execute(u32 cycles); void Clear(u32 addr, u32 size); - void Vsync() throw(); + void Vsync() noexcept; uint GetCacheReserve() const; void SetCacheReserve( uint reserveInMegs ) const; @@ -243,11 +243,11 @@ public: wxString GetLongName() const { return L"microVU1 Recompiler"; } void Reserve(); - void Shutdown() throw(); + void Shutdown() noexcept; void Reset(); void Execute(u32 cycles); void Clear(u32 addr, u32 size); - void Vsync() throw(); + void Vsync() noexcept; void ResumeXGkick(); uint GetCacheReserve() const; @@ -267,7 +267,7 @@ public: wxString GetLongName() const { return L"SuperVU0 Recompiler"; } void Reserve(); - void Shutdown() throw(); + void Shutdown() noexcept; void Reset(); void Execute(u32 cycles); void Clear(u32 Addr, u32 Size); @@ -285,7 +285,7 @@ public: wxString GetLongName() const { return L"SuperVU1 Recompiler"; } void Reserve(); - void Shutdown() throw(); + void Shutdown() noexcept; void Reset(); void Execute(u32 cycles); void Clear(u32 Addr, u32 Size); diff --git a/pcsx2/gui/ApplyState.h b/pcsx2/gui/ApplyState.h index 339d64e089..0cf39a2c77 100644 --- a/pcsx2/gui/ApplyState.h +++ b/pcsx2/gui/ApplyState.h @@ -95,7 +95,7 @@ struct ApplyStateStruct void StartWizard(); bool ApplyAll(); bool ApplyPage( int pageid ); - void DoCleanup() throw(); + void DoCleanup() noexcept; }; class IApplyState diff --git a/pcsx2/gui/Panels/BaseApplicableConfigPanel.cpp b/pcsx2/gui/Panels/BaseApplicableConfigPanel.cpp index da14157cfe..f92f2f2aa2 100644 --- a/pcsx2/gui/Panels/BaseApplicableConfigPanel.cpp +++ b/pcsx2/gui/Panels/BaseApplicableConfigPanel.cpp @@ -28,7 +28,7 @@ using namespace Dialogs; // on dialog destruction. It asserts if the ApplyList hasn't been cleaned up // and then cleans it up forcefully. // -void ApplyStateStruct::DoCleanup() throw() +void ApplyStateStruct::DoCleanup() noexcept { pxAssertMsg( !PanelList.empty(), L"PanelList list hasn't been cleaned up." ); PanelList.clear(); diff --git a/pcsx2/windows/WinConsolePipe.cpp b/pcsx2/windows/WinConsolePipe.cpp index 372e9c04a0..eb1f79f948 100644 --- a/pcsx2/windows/WinConsolePipe.cpp +++ b/pcsx2/windows/WinConsolePipe.cpp @@ -140,7 +140,7 @@ public: WinPipeRedirection( FILE* stdstream ); virtual ~WinPipeRedirection(); - void Cleanup() throw(); + void Cleanup() noexcept; }; WinPipeRedirection::WinPipeRedirection( FILE* stdstream ) @@ -200,7 +200,7 @@ WinPipeRedirection::~WinPipeRedirection() Cleanup(); } -void WinPipeRedirection::Cleanup() throw() +void WinPipeRedirection::Cleanup() noexcept { // Cleanup Order Notes: // * The redirection thread is most likely blocking on ReadFile(), so we can't Cancel yet, lest we deadlock -- diff --git a/pcsx2/x86/microVU.cpp b/pcsx2/x86/microVU.cpp index 86b783a7d1..36535f171c 100644 --- a/pcsx2/x86/microVU.cpp +++ b/pcsx2/x86/microVU.cpp @@ -302,8 +302,8 @@ _mVUt __fi void* mVUsearchProg(u32 startPC, uptr pState) { //------------------------------------------------------------------ recMicroVU0::recMicroVU0() { m_Idx = 0; IsInterpreter = false; } recMicroVU1::recMicroVU1() { m_Idx = 1; IsInterpreter = false; } -void recMicroVU0::Vsync() throw() { mVUvsyncUpdate(microVU0); } -void recMicroVU1::Vsync() throw() { mVUvsyncUpdate(microVU1); } +void recMicroVU0::Vsync() noexcept { mVUvsyncUpdate(microVU0); } +void recMicroVU1::Vsync() noexcept { mVUvsyncUpdate(microVU1); } void recMicroVU0::Reserve() { if (m_Reserved.exchange(1) == 0) @@ -316,11 +316,11 @@ void recMicroVU1::Reserve() { } } -void recMicroVU0::Shutdown() throw() { +void recMicroVU0::Shutdown() noexcept { if (m_Reserved.exchange(0) == 1) mVUclose(microVU0); } -void recMicroVU1::Shutdown() throw() { +void recMicroVU1::Shutdown() noexcept { if (m_Reserved.exchange(0) == 1) { vu1Thread.WaitVU(); mVUclose(microVU1); diff --git a/pcsx2/x86/sVU_zerorec.cpp b/pcsx2/x86/sVU_zerorec.cpp index eccc4f3bc7..0dc91fb7ca 100644 --- a/pcsx2/x86/sVU_zerorec.cpp +++ b/pcsx2/x86/sVU_zerorec.cpp @@ -4592,7 +4592,7 @@ void recSuperVU0::Reserve() SuperVUAlloc(0); } -void recSuperVU0::Shutdown() throw() +void recSuperVU0::Shutdown() noexcept { SuperVUDestroy( 0 ); } @@ -4639,7 +4639,7 @@ void recSuperVU1::Reserve() SuperVUAlloc(1); } -void recSuperVU1::Shutdown() throw() +void recSuperVU1::Shutdown() noexcept { vu1Thread.WaitVU(); SuperVUDestroy( 1 );