Skip to content

Commit

Permalink
core/gui: use = default instead of trivial constructor/destructor
Browse files Browse the repository at this point in the history
reported by clang-tidy

Note: drop throw() specifier as it is the 'default' in C++11 for
destructor
  • Loading branch information
gregory38 committed May 13, 2017
1 parent 9e101c9 commit d332bb1
Show file tree
Hide file tree
Showing 28 changed files with 69 additions and 117 deletions.
4 changes: 2 additions & 2 deletions pcsx2/gui/AppAccelerators.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class CommandDictionary : public std::unordered_map<std::string, const GlobalCom

public:
using _parent::operator[];
virtual ~CommandDictionary() throw();
virtual ~CommandDictionary() = default;
};

// --------------------------------------------------------------------------------------
Expand All @@ -128,6 +128,6 @@ class AcceleratorDictionary : public std::unordered_map<int, const GlobalCommand
public:
using _parent::operator[];

virtual ~AcceleratorDictionary() throw();
virtual ~AcceleratorDictionary() = default;
void Map( const KeyAcceleratorCode& acode, const char *searchfor );
};
6 changes: 3 additions & 3 deletions pcsx2/gui/AppConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,7 @@ class pxDudConfig : public wxConfigBase
wxString m_empty;

public:
virtual ~pxDudConfig() {}
virtual ~pxDudConfig() = default;

virtual void SetPath(const wxString& ) {}
virtual const wxString& GetPath() const { return m_empty; }
Expand Down Expand Up @@ -1222,14 +1222,14 @@ class AppIniSaver : public IniSaver
{
public:
AppIniSaver();
virtual ~AppIniSaver() throw() {}
virtual ~AppIniSaver() = default;
};

class AppIniLoader : public IniLoader
{
public:
AppIniLoader();
virtual ~AppIniLoader() throw() {}
virtual ~AppIniLoader() = default;
};

AppIniSaver::AppIniSaver()
Expand Down
31 changes: 12 additions & 19 deletions pcsx2/gui/AppCorePlugins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class CorePluginsEvent : public pxActionEvent
PluginEventType m_evt;

public:
virtual ~CorePluginsEvent() throw() {}
virtual ~CorePluginsEvent() = default;
CorePluginsEvent* Clone() const { return new CorePluginsEvent( *this ); }

explicit CorePluginsEvent( PluginEventType evt, SynchronousActionState* sema=NULL )
Expand Down Expand Up @@ -107,17 +107,17 @@ class SysExecEvent_AppPluginManager : public SysExecEvent
{
protected:
FnPtr_AppPluginManager m_method;

public:
wxString GetEventName() const { return L"CorePluginsMethod"; }
virtual ~SysExecEvent_AppPluginManager() throw() {}
virtual ~SysExecEvent_AppPluginManager() = default;
SysExecEvent_AppPluginManager* Clone() const { return new SysExecEvent_AppPluginManager( *this ); }

SysExecEvent_AppPluginManager( FnPtr_AppPluginManager method )
{
m_method = method;
}

protected:
void InvokeEvent()
{
Expand All @@ -138,9 +138,9 @@ class LoadSinglePluginEvent : public pxActionEvent
PluginsEnum_t m_pid;

public:
virtual ~LoadSinglePluginEvent() throw() { }
virtual ~LoadSinglePluginEvent() = default;
virtual LoadSinglePluginEvent *Clone() const { return new LoadSinglePluginEvent(*this); }

LoadSinglePluginEvent( PluginsEnum_t pid = PluginId_GS, const wxString& filename=wxEmptyString )
: m_filename( filename )
{
Expand All @@ -167,15 +167,15 @@ class SinglePluginMethodEvent : public pxActionEvent
FnPtr_AppPluginPid m_method;

public:
virtual ~SinglePluginMethodEvent() throw() { }
virtual ~SinglePluginMethodEvent() = default;
virtual SinglePluginMethodEvent *Clone() const { return new SinglePluginMethodEvent(*this); }

SinglePluginMethodEvent( FnPtr_AppPluginPid method=NULL, PluginsEnum_t pid = PluginId_GS )
{
m_pid = pid;
m_method = method;
}

protected:
void InvokeEvent()
{
Expand Down Expand Up @@ -203,13 +203,6 @@ IMPLEMENT_DYNAMIC_CLASS( SinglePluginMethodEvent, pxActionEvent );
// the main thread from being completely busy while plugins are loaded and initialized.
// (responsiveness is bliss!!) -- air
//
AppCorePlugins::AppCorePlugins()
{
}

AppCorePlugins::~AppCorePlugins() throw()
{
}

static void _SetSettingsFolder()
{
Expand Down Expand Up @@ -409,7 +402,7 @@ class LoadCorePluginsEvent : public SysExecEvent
{
CorePlugins.Load( m_folders );
}
~LoadCorePluginsEvent() throw() {}
~LoadCorePluginsEvent() = default;
};

// --------------------------------------------------------------------------------------
Expand Down Expand Up @@ -507,7 +500,7 @@ class SysExecEvent_UnloadPlugins : public SysExecEvent
public:
wxString GetEventName() const { return L"UnloadPlugins"; }

virtual ~SysExecEvent_UnloadPlugins() throw() {}
virtual ~SysExecEvent_UnloadPlugins() = default;
SysExecEvent_UnloadPlugins* Clone() const { return new SysExecEvent_UnloadPlugins(*this); }

virtual bool AllowCancelOnExit() const { return false; }
Expand All @@ -525,7 +518,7 @@ class SysExecEvent_ShutdownPlugins : public SysExecEvent
public:
wxString GetEventName() const { return L"ShutdownPlugins"; }

virtual ~SysExecEvent_ShutdownPlugins() throw() {}
virtual ~SysExecEvent_ShutdownPlugins() = default;
SysExecEvent_ShutdownPlugins* Clone() const { return new SysExecEvent_ShutdownPlugins(*this); }

virtual bool AllowCancelOnExit() const { return false; }
Expand Down
6 changes: 3 additions & 3 deletions pcsx2/gui/AppCorePlugins.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class AppCorePlugins : public SysCorePlugins
typedef SysCorePlugins _parent;

public:
AppCorePlugins();
virtual ~AppCorePlugins() throw();
AppCorePlugins() = default;
virtual ~AppCorePlugins() = default;

void Load( const wxString (&folders)[PluginId_Count] );
void Load( PluginsEnum_t pid, const wxString& srcfile );
Expand All @@ -43,7 +43,7 @@ class AppCorePlugins : public SysCorePlugins
void Init( PluginsEnum_t pid );
void Shutdown( PluginsEnum_t pid );
bool Shutdown();
void Close();
void Close();
void Open();

protected:
Expand Down
6 changes: 2 additions & 4 deletions pcsx2/gui/AppCoreThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class SysExecEvent_InvokeCoreThreadMethod : public SysExecEvent

public:
wxString GetEventName() const { return L"CoreThreadMethod"; }
virtual ~SysExecEvent_InvokeCoreThreadMethod() throw() {}
virtual ~SysExecEvent_InvokeCoreThreadMethod() = default;
SysExecEvent_InvokeCoreThreadMethod* Clone() const { return new SysExecEvent_InvokeCoreThreadMethod(*this); }

bool AllowCancelOnExit() const { return false; }
Expand Down Expand Up @@ -708,9 +708,7 @@ BaseScopedCoreThread::BaseScopedCoreThread()
m_alreadyScoped = false;
}

BaseScopedCoreThread::~BaseScopedCoreThread() throw()
{
}
BaseScopedCoreThread::~BaseScopedCoreThread() throw() = default;

// Allows the object to resume execution upon object destruction. Typically called as the last thing
// in the object's scope. Any code prior to this call that causes exceptions will not resume the emulator,
Expand Down
10 changes: 5 additions & 5 deletions pcsx2/gui/AppMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class PluginErrorEvent : public pxExceptionEvent
PluginErrorEvent( BaseException* ex=NULL ) : _parent( ex ) {}
PluginErrorEvent( const BaseException& ex ) : _parent( ex ) {}

virtual ~PluginErrorEvent() throw() { }
virtual ~PluginErrorEvent() = default;
virtual PluginErrorEvent *Clone() const { return new PluginErrorEvent(*this); }

protected:
Expand All @@ -110,7 +110,7 @@ class PluginInitErrorEvent : public pxExceptionEvent
PluginInitErrorEvent( BaseException* ex=NULL ) : _parent( ex ) {}
PluginInitErrorEvent( const BaseException& ex ) : _parent( ex ) {}

virtual ~PluginInitErrorEvent() throw() { }
virtual ~PluginInitErrorEvent() = default;
virtual PluginInitErrorEvent *Clone() const { return new PluginInitErrorEvent(*this); }

protected:
Expand Down Expand Up @@ -163,7 +163,7 @@ class BIOSLoadErrorEvent : public pxExceptionEvent
BIOSLoadErrorEvent(BaseException* ex = NULL) : _parent(ex) {}
BIOSLoadErrorEvent(const BaseException& ex) : _parent(ex) {}

virtual ~BIOSLoadErrorEvent() throw() { }
virtual ~BIOSLoadErrorEvent() = default;
virtual BIOSLoadErrorEvent *Clone() const { return new BIOSLoadErrorEvent(*this); }

protected:
Expand Down Expand Up @@ -233,7 +233,7 @@ class Pcsx2AppMethodEvent : public pxActionEvent
FnPtr_Pcsx2App m_Method;

public:
virtual ~Pcsx2AppMethodEvent() throw() { }
virtual ~Pcsx2AppMethodEvent() = default;
virtual Pcsx2AppMethodEvent *Clone() const { return new Pcsx2AppMethodEvent(*this); }

explicit Pcsx2AppMethodEvent( FnPtr_Pcsx2App method=NULL, SynchronousActionState* sema=NULL )
Expand Down Expand Up @@ -1048,7 +1048,7 @@ class SysExecEvent_Execute : public SysExecEvent
wxString m_elf_override;

public:
virtual ~SysExecEvent_Execute() throw() {}
virtual ~SysExecEvent_Execute() = default;
SysExecEvent_Execute* Clone() const { return new SysExecEvent_Execute(*this); }

wxString GetEventName() const
Expand Down
2 changes: 1 addition & 1 deletion pcsx2/gui/AppRes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pxAppResources::pxAppResources()
{
}

pxAppResources::~pxAppResources() throw() {}
pxAppResources::~pxAppResources() throw() = default;

wxMenu& Pcsx2App::GetRecentIsoMenu()
{
Expand Down
8 changes: 2 additions & 6 deletions pcsx2/gui/ConsoleLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ wxDEFINE_EVENT(pxEvt_SetTitleText, wxCommandEvent);
wxDEFINE_EVENT(pxEvt_FlushQueue, wxCommandEvent);

// C++ requires abstract destructors to exist, even though they're abstract.
PipeRedirectionBase::~PipeRedirectionBase() throw() {}
PipeRedirectionBase::~PipeRedirectionBase() throw() = default;

// ----------------------------------------------------------------------------
//
Expand Down Expand Up @@ -149,10 +149,6 @@ ConsoleLogFrame::ColorArray::ColorArray( int fontsize )
SetFont( fontsize );
}

ConsoleLogFrame::ColorArray::~ColorArray() throw()
{
}

void ConsoleLogFrame::ColorArray::SetFont( int fontsize )
{
const wxFont fixed( pxGetFixedFont( fontsize ) );
Expand Down Expand Up @@ -274,7 +270,7 @@ class ScopedLogLock : public ScopedLock
WindowPtr = pxTheApp.m_ptr_ProgramLog;
}

virtual ~ScopedLogLock() throw() {}
virtual ~ScopedLogLock() = default;

bool HasWindow() const
{
Expand Down
2 changes: 1 addition & 1 deletion pcsx2/gui/ConsoleLogger.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class ConsoleLogFrame : public wxFrame
std::array<wxTextAttr, ConsoleColors_Count> m_table;

public:
virtual ~ColorArray() throw();
virtual ~ColorArray() = default;
ColorArray( int fontsize=8 );

void SetFont( const wxFont& font );
Expand Down
4 changes: 1 addition & 3 deletions pcsx2/gui/CpuUsageProviderLnx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,4 @@ CpuUsageProvider::CpuUsageProvider() :
{
}

CpuUsageProvider::~CpuUsageProvider() throw()
{
}
CpuUsageProvider::~CpuUsageProvider() throw() = default;
4 changes: 0 additions & 4 deletions pcsx2/gui/Dialogs/BaseConfigurationDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,6 @@ void Dialogs::BaseConfigurationDialog::AddOkCancel( wxSizer* sizer )
*m_extraButtonSizer += screenshotButton|pxMiddle;
}

Dialogs::BaseConfigurationDialog::~BaseConfigurationDialog() throw()
{
}

void Dialogs::BaseConfigurationDialog::OnSetSettingsPage( wxCommandEvent& evt )
{
if( !m_listbook ) return;
Expand Down
2 changes: 1 addition & 1 deletion pcsx2/gui/Dialogs/ConfigurationDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace Dialogs
bool m_allowApplyActivation;

public:
virtual ~BaseConfigurationDialog() throw();
virtual ~BaseConfigurationDialog() = default;
BaseConfigurationDialog(wxWindow* parent, const wxString& title, int idealWidth);

public:
Expand Down
7 changes: 1 addition & 6 deletions pcsx2/gui/Dialogs/FirstTimeWizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace Panels
{
public:
FirstTimeIntroPanel( wxWindow* parent );
virtual ~FirstTimeIntroPanel() throw() {}
virtual ~FirstTimeIntroPanel() = default;
};
}

Expand Down Expand Up @@ -163,11 +163,6 @@ FirstTimeWizard::FirstTimeWizard( wxWindow* parent )
Bind(wxEVT_BUTTON, &FirstTimeWizard::OnRestartWizard, this, pxID_RestartWizard);
}

FirstTimeWizard::~FirstTimeWizard() throw()
{

}

void FirstTimeWizard::OnRestartWizard( wxCommandEvent& evt )
{
EndModal( pxID_RestartWizard );
Expand Down
2 changes: 1 addition & 1 deletion pcsx2/gui/Dialogs/ModalPopups.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class FirstTimeWizard : public wxWizard

public:
FirstTimeWizard( wxWindow* parent );
virtual ~FirstTimeWizard() throw();
virtual ~FirstTimeWizard() = default;

wxWizardPage *GetFirstPage() const { return &m_page_intro; }

Expand Down
4 changes: 0 additions & 4 deletions pcsx2/gui/FrameForGS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,10 +468,6 @@ GSFrame::GSFrame( const wxString& title)
Bind(wxEVT_TIMER, &GSFrame::OnUpdateTitle, this, m_timer_UpdateTitle.GetId());
}

GSFrame::~GSFrame() throw()
{
}

void GSFrame::OnCloseWindow(wxCloseEvent& evt)
{
sApp.OnGsFrameClosed( GetId() );
Expand Down
2 changes: 1 addition & 1 deletion pcsx2/gui/GSFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class GSFrame : public wxFrame

public:
GSFrame( const wxString& title);
virtual ~GSFrame() throw();
virtual ~GSFrame() = default;

GSPanel* GetViewport();
void SetFocus();
Expand Down
4 changes: 0 additions & 4 deletions pcsx2/gui/GlobalCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -625,10 +625,6 @@ static const GlobalCommandDescriptor CommandDeclarations[] =
{ NULL }
};

CommandDictionary::~CommandDictionary() throw() {}

AcceleratorDictionary::~AcceleratorDictionary() throw() {}

void AcceleratorDictionary::Map( const KeyAcceleratorCode& _acode, const char *searchfor )
{
// Search override mapping at ini file
Expand Down
6 changes: 3 additions & 3 deletions pcsx2/gui/IsoDropTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class DroppedTooManyFiles : public pxActionEvent
m_ownerid = window->GetId();
}

virtual ~DroppedTooManyFiles() throw() { }
virtual ~DroppedTooManyFiles() = default;
virtual DroppedTooManyFiles *Clone() const { return new DroppedTooManyFiles(*this); }

protected:
Expand Down Expand Up @@ -73,7 +73,7 @@ class DroppedElf : public pxActionEvent
m_ownerid = window->GetId();
}

virtual ~DroppedElf() throw() { }
virtual ~DroppedElf() = default;
virtual DroppedElf *Clone() const { return new DroppedElf(*this); }

protected:
Expand Down Expand Up @@ -122,7 +122,7 @@ class DroppedIso : public pxActionEvent
m_ownerid = window->GetId();
}

virtual ~DroppedIso() throw() { }
virtual ~DroppedIso() = default;
virtual DroppedIso *Clone() const { return new DroppedIso(*this); }

protected:
Expand Down
Loading

0 comments on commit d332bb1

Please sign in to comment.