From 6adf5ea4879f4631a4c7eae335cb436e897741b7 Mon Sep 17 00:00:00 2001 From: orbea Date: Tue, 8 Oct 2019 16:37:31 -0700 Subject: [PATCH] wx: Silence -Woverloaded-virtual warnings with debug builds. The Clone function seem unused, the AcceptsFocus and HasFocus functions are marked as const and Show is renamed to ShowAddr to not conflict with unrelated functions. [187/196] Building CXX object src/wx/CMakeFiles/visualboyadvance-m.dir/viewsupt.cpp.o In file included from ../src/wx/viewsupt.cpp:1: ../src/wx/viewsupt.h:197:10: warning: 'Viewers::MemView::Show' hides overloaded virtual function [-Woverloaded-virtual] void Show(uint32_t addr, bool force_update = false); ^ /usr/include/wx-3.0/wx/gtk/window.h:64:18: note: hidden overloaded virtual function 'wxWindow::Show' declared here: different number of parameters (1 vs 2) virtual bool Show( bool show = true ); ^ In file included from ../src/wx/viewsupt.cpp:1: ../src/wx/viewsupt.h:410:10: warning: 'Viewers::DispCheckBox::AcceptsFocus' hides overloaded virtual function [-Woverloaded-virtual] bool AcceptsFocus() ^ /usr/include/wx-3.0/wx/window.h:724:18: note: hidden overloaded virtual function 'wxWindowBase::AcceptsFocus' declared here: different qualifiers ('const' vs unqualified) virtual bool AcceptsFocus() const { return true; } ^ In file included from ../src/wx/viewsupt.cpp:3: In file included from ../src/wx/wxvbam.h:14: In file included from ../src/wx/widgets/wx/joyedit.h:9: ../src/wx/widgets/wx/sdljoy.h:115:14: warning: 'wxSDLJoyEvent::Clone' hides overloaded virtual function [-Woverloaded-virtual] wxEvent* Clone(); ^ /usr/include/wx-3.0/wx/event.h:1569:22: note: hidden overloaded virtual function 'wxCommandEvent::Clone' declared here: different qualifiers ('const' vs unqualified) virtual wxEvent *Clone() const { return new wxCommandEvent(*this); } ^ In file included from ../src/wx/viewsupt.cpp:3: ../src/wx/wxvbam.h:286:10: warning: 'MainFrame::HasFocus' hides overloaded virtual function [-Woverloaded-virtual] bool HasFocus() ^ /usr/include/wx-3.0/wx/window.h:715:18: note: hidden overloaded virtual function 'wxWindowBase::HasFocus' declared here: different qualifiers ('const' vs unqualified) virtual bool HasFocus() const; ^ 4 warnings generated. --- src/wx/viewers.cpp | 2 +- src/wx/viewsupt.cpp | 2 +- src/wx/viewsupt.h | 4 ++-- src/wx/widgets/wx/sdljoy.h | 2 -- src/wx/wxvbam.h | 2 +- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/wx/viewers.cpp b/src/wx/viewers.cpp index 1a98d6f0..ce8466cd 100644 --- a/src/wx/viewers.cpp +++ b/src/wx/viewers.cpp @@ -679,7 +679,7 @@ public: } void Goto(uint32_t addr) { - mv->Show(addr, true); + mv->ShowAddr(addr, true); } void RefreshCmd(wxCommandEvent& ev) { diff --git a/src/wx/viewsupt.cpp b/src/wx/viewsupt.cpp index 7276175d..3df1c6d1 100644 --- a/src/wx/viewsupt.cpp +++ b/src/wx/viewsupt.cpp @@ -725,7 +725,7 @@ void MemView::Resize(wxSizeEvent& ev) Refill(); } -void MemView::Show(uint32_t addr, bool force_update) +void MemView::ShowAddr(uint32_t addr, bool force_update) { if (addr < topaddr || addr >= topaddr + (nlines - 1) * 16) { // align to nearest 16-byte block diff --git a/src/wx/viewsupt.h b/src/wx/viewsupt.h index 1d9d01d7..e08c9f72 100644 --- a/src/wx/viewsupt.h +++ b/src/wx/viewsupt.h @@ -194,7 +194,7 @@ private: public: // make addr visible - void Show(uint32_t addr, bool force_update = false); + void ShowAddr(uint32_t addr, bool force_update = false); // current selection, or topaddr if none uint32_t GetAddr(); @@ -407,7 +407,7 @@ protected: // a display-only checkbox which does not look like it's disabled class DispCheckBox : public wxCheckBox { public: - bool AcceptsFocus() + bool AcceptsFocus() const { return false; } diff --git a/src/wx/widgets/wx/sdljoy.h b/src/wx/widgets/wx/sdljoy.h index d99cd7cf..b80a7a28 100644 --- a/src/wx/widgets/wx/sdljoy.h +++ b/src/wx/widgets/wx/sdljoy.h @@ -111,8 +111,6 @@ public: { return prev_val; } - // required for PostEvent, apparently - wxEvent* Clone(); protected: unsigned short joy; diff --git a/src/wx/wxvbam.h b/src/wx/wxvbam.h index 2da0eadc..618fe64c 100644 --- a/src/wx/wxvbam.h +++ b/src/wx/wxvbam.h @@ -283,7 +283,7 @@ public: void set_global_accels(); // 2.8 has no HasFocus(), and FindFocus() doesn't work right - bool HasFocus() + bool HasFocus() const { return focused; }