From 9e101c9ef039c7202f2d87a3bcee0ab4fda05fe0 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Sat, 6 May 2017 13:00:55 +0200 Subject: [PATCH] common: use = default instead of trivial constructor/destructor reported by clang-tidy Note: drop throw() specifier as it is the 'default' in C++11 for destructor --- common/include/Utilities/Exceptions.h | 2 +- common/include/Utilities/IniInterface.h | 4 ++-- common/include/Utilities/StringHelpers.h | 4 ++-- common/include/Utilities/pxEvents.h | 4 ++-- common/include/Utilities/wxGuiTools.h | 2 +- common/src/Utilities/Exceptions.cpp | 2 -- common/src/Utilities/FastFormatString.cpp | 8 -------- common/src/Utilities/IniInterface.cpp | 7 ++----- common/src/Utilities/wxAppWithHelpers.cpp | 2 +- common/src/Utilities/wxHelpers.cpp | 4 ---- common/src/x86emitter/LnxCpuDetect.cpp | 4 ++-- 11 files changed, 13 insertions(+), 30 deletions(-) diff --git a/common/include/Utilities/Exceptions.h b/common/include/Utilities/Exceptions.h index 05476615e0..718ea8ffba 100644 --- a/common/include/Utilities/Exceptions.h +++ b/common/include/Utilities/Exceptions.h @@ -85,7 +85,7 @@ protected: wxString m_message_user; // (translated) a "detailed" message of what disastrous thing has occurred! public: - virtual ~BaseException() throw() = 0; // the =0; syntax forces this class into "abstract" mode. + virtual ~BaseException() = default; const wxString &DiagMsg() const { return m_message_diag; } const wxString &UserMsg() const { return m_message_user; } diff --git a/common/include/Utilities/IniInterface.h b/common/include/Utilities/IniInterface.h index 1110f2a626..f044f9cdc8 100644 --- a/common/include/Utilities/IniInterface.h +++ b/common/include/Utilities/IniInterface.h @@ -110,7 +110,7 @@ public: class IniLoader : public IniInterface { public: - virtual ~IniLoader() throw(); + virtual ~IniLoader() = default; explicit IniLoader(); explicit IniLoader(wxConfigBase &config); explicit IniLoader(wxConfigBase *config); @@ -148,7 +148,7 @@ protected: class IniSaver : public IniInterface { public: - virtual ~IniSaver(); + virtual ~IniSaver() = default; explicit IniSaver(); explicit IniSaver(wxConfigBase &config); explicit IniSaver(wxConfigBase *config); diff --git a/common/include/Utilities/StringHelpers.h b/common/include/Utilities/StringHelpers.h index 3fd00b0cbb..d64ac41652 100644 --- a/common/include/Utilities/StringHelpers.h +++ b/common/include/Utilities/StringHelpers.h @@ -144,7 +144,7 @@ protected: public: FastFormatAscii(); - ~FastFormatAscii() throw(); + ~FastFormatAscii() = default; FastFormatAscii &Write(const char *fmt, ...); FastFormatAscii &WriteV(const char *fmt, va_list argptr); @@ -187,7 +187,7 @@ protected: public: FastFormatUnicode(); - ~FastFormatUnicode() throw(); + ~FastFormatUnicode() = default; FastFormatUnicode &Write(const char *fmt, ...); FastFormatUnicode &Write(const wxChar *fmt, ...); diff --git a/common/include/Utilities/pxEvents.h b/common/include/Utilities/pxEvents.h index 643c780722..c9bcb54661 100644 --- a/common/include/Utilities/pxEvents.h +++ b/common/include/Utilities/pxEvents.h @@ -380,7 +380,7 @@ protected: MsgButtons m_Buttons; public: - virtual ~pxMessageBoxEvent() throw() {} + virtual ~pxMessageBoxEvent() = default; virtual pxMessageBoxEvent *Clone() const { return new pxMessageBoxEvent(*this); } pxMessageBoxEvent() {} @@ -404,7 +404,7 @@ protected: wxString m_Stacktrace; public: - virtual ~pxAssertionEvent() throw() {} + virtual ~pxAssertionEvent() = default; virtual pxAssertionEvent *Clone() const { return new pxAssertionEvent(*this); } pxAssertionEvent(const wxString &content = wxEmptyString, const wxString &trace = wxEmptyString, SynchronousActionState *instdata = NULL); diff --git a/common/include/Utilities/wxGuiTools.h b/common/include/Utilities/wxGuiTools.h index 33e520fd7a..b2ac85f947 100644 --- a/common/include/Utilities/wxGuiTools.h +++ b/common/include/Utilities/wxGuiTools.h @@ -511,7 +511,7 @@ protected: public: wxDialogWithHelpers(); wxDialogWithHelpers(wxWindow *parent, const wxString &title, const pxDialogCreationFlags &cflags = pxDialogCreationFlags()); - virtual ~wxDialogWithHelpers() throw(); + virtual ~wxDialogWithHelpers() = default; void Init(const pxDialogCreationFlags &cflags); void AddOkCancel(wxSizer &sizer, bool hasApply = false); diff --git a/common/src/Utilities/Exceptions.cpp b/common/src/Utilities/Exceptions.cpp index 2a6d43f544..b0944bf30f 100644 --- a/common/src/Utilities/Exceptions.cpp +++ b/common/src/Utilities/Exceptions.cpp @@ -143,8 +143,6 @@ __fi void pxOnAssert(const DiagnosticOrigin &origin, const FastFormatUnicode &ms // BaseException (implementations) // -------------------------------------------------------------------------------------- -BaseException::~BaseException() throw() {} - BaseException &BaseException::SetBothMsgs(const wxChar *msg_diag) { m_message_user = msg_diag ? wxString(wxGetTranslation(msg_diag)) : wxString(""); diff --git a/common/src/Utilities/FastFormatString.cpp b/common/src/Utilities/FastFormatString.cpp index 4823fc4cf4..cc8323fc29 100644 --- a/common/src/Utilities/FastFormatString.cpp +++ b/common/src/Utilities/FastFormatString.cpp @@ -132,10 +132,6 @@ FastFormatUnicode::FastFormatUnicode() Clear(); } -FastFormatUnicode::~FastFormatUnicode() throw() -{ -} - void FastFormatUnicode::Clear() { m_Length = 0; @@ -261,10 +257,6 @@ FastFormatAscii::FastFormatAscii() Clear(); } -FastFormatAscii::~FastFormatAscii() throw() -{ -} - void FastFormatAscii::Clear() { m_dest.GetPtr()[0] = 0; diff --git a/common/src/Utilities/IniInterface.cpp b/common/src/Utilities/IniInterface.cpp index d4acc7b615..1c32c09612 100644 --- a/common/src/Utilities/IniInterface.cpp +++ b/common/src/Utilities/IniInterface.cpp @@ -98,6 +98,7 @@ IniLoader::IniLoader(wxConfigBase &config) : IniInterface(config) { } + IniLoader::IniLoader(wxConfigBase *config) : IniInterface(config) { @@ -107,8 +108,6 @@ IniLoader::IniLoader() : IniInterface() { } -IniLoader::~IniLoader() throw() {} - void IniLoader::Entry(const wxString &var, wxString &value, const wxString defvalue) { @@ -118,7 +117,6 @@ void IniLoader::Entry(const wxString &var, wxString &value, const wxString defva value = defvalue; } - void IniLoader::Entry(const wxString &var, wxDirName &value, const wxDirName defvalue, bool isAllowRelative) { wxString dest; @@ -271,17 +269,16 @@ IniSaver::IniSaver(wxConfigBase &config) : IniInterface(config) { } + IniSaver::IniSaver(wxConfigBase *config) : IniInterface(config) { } - IniSaver::IniSaver() : IniInterface() { } -IniSaver::~IniSaver() {} void IniSaver::Entry(const wxString &var, wxString &value, const wxString defvalue) { diff --git a/common/src/Utilities/wxAppWithHelpers.cpp b/common/src/Utilities/wxAppWithHelpers.cpp index 21179a4ecc..39cfbb5d65 100644 --- a/common/src/Utilities/wxAppWithHelpers.cpp +++ b/common/src/Utilities/wxAppWithHelpers.cpp @@ -229,7 +229,7 @@ protected: void (*m_Method)(); public: - virtual ~pxRpcEvent() throw() {} + virtual ~pxRpcEvent() = default; virtual pxRpcEvent *Clone() const { return new pxRpcEvent(*this); } explicit pxRpcEvent(void (*method)() = NULL, SynchronousActionState *sema = NULL) diff --git a/common/src/Utilities/wxHelpers.cpp b/common/src/Utilities/wxHelpers.cpp index d490544ed4..a095dd7d24 100644 --- a/common/src/Utilities/wxHelpers.cpp +++ b/common/src/Utilities/wxHelpers.cpp @@ -132,10 +132,6 @@ wxDialogWithHelpers::wxDialogWithHelpers(wxWindow *parent, const wxString &title SetMinSize(cflags.MinimumSize); } -wxDialogWithHelpers::~wxDialogWithHelpers() throw() -{ -} - void wxDialogWithHelpers::Init(const pxDialogCreationFlags &cflags) { // Note to self: if any comments indicate platform specific behaviour then diff --git a/common/src/x86emitter/LnxCpuDetect.cpp b/common/src/x86emitter/LnxCpuDetect.cpp index 66a5b4caba..41de22c563 100644 --- a/common/src/x86emitter/LnxCpuDetect.cpp +++ b/common/src/x86emitter/LnxCpuDetect.cpp @@ -29,5 +29,5 @@ void x86capabilities::CountLogicalCores() } // Not implemented yet for linux (see cpudetect_internal.h for details) -SingleCoreAffinity::SingleCoreAffinity() {} -SingleCoreAffinity::~SingleCoreAffinity() throw() {} +SingleCoreAffinity::SingleCoreAffinity() = default; +SingleCoreAffinity::~SingleCoreAffinity() throw() = default;