From 0438ca19c1c8da2ed714df5511aaf969d7056697 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Tue, 22 Dec 2020 15:42:56 +0100 Subject: [PATCH] Fix implicit-fallthrough warning --- src/aui/tabartgtk.cpp | 2 +- src/common/txtstrm.cpp | 2 +- src/generic/timectrlg.cpp | 2 +- src/gtk/anybutton.cpp | 2 +- src/gtk/evtloop.cpp | 2 +- src/gtk/menu.cpp | 2 +- src/gtk/msgdlg.cpp | 2 +- src/gtk/scrolwin.cpp | 2 +- src/gtk/toolbar.cpp | 2 +- src/gtk/window.cpp | 2 +- src/osx/carbon/font.cpp | 1 + src/unix/fontutil.cpp | 2 +- 12 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/aui/tabartgtk.cpp b/src/aui/tabartgtk.cpp index 7a9949d5bd..ac6d6bb2ee 100644 --- a/src/aui/tabartgtk.cpp +++ b/src/aui/tabartgtk.cpp @@ -218,7 +218,7 @@ void wxAuiGtkTabArt::DrawTab(wxDC& dc, wxWindow* wnd, const wxAuiNotebookPage& p if (!page.active) tab_rect.y += 2 * GTK_NOTEBOOK (wxGTKPrivate::GetNotebookWidget())->tab_hborder; gap_rect_y = tab_rect.y + tab_rect.height - GTK_NOTEBOOK (wxGTKPrivate::GetNotebookWidget())->tab_hborder / 2; - // fall through + wxFALLTHROUGH; case wxAUI_NB_BOTTOM: gap_start = tab_rect.x - GTK_NOTEBOOK (wxGTKPrivate::GetNotebookWidget())->tab_vborder / 2; gap_width = tab_rect.width; diff --git a/src/common/txtstrm.cpp b/src/common/txtstrm.cpp index 645fc61f73..4bf9214cae 100644 --- a/src/common/txtstrm.cpp +++ b/src/common/txtstrm.cpp @@ -148,8 +148,8 @@ wxChar wxTextInputStream::GetChar() // remember the second one for the next call, as there is no // way to fit both of them into a single wxChar in this case. m_lastWChar = wbuf[1]; -#endif // SIZEOF_WCHAR_T == 2 wxFALLTHROUGH; +#endif // SIZEOF_WCHAR_T == 2 case 1: m_validBegin = inlen + 1; diff --git a/src/generic/timectrlg.cpp b/src/generic/timectrlg.cpp index f6ed886fd7..1bb32d2aab 100644 --- a/src/generic/timectrlg.cpp +++ b/src/generic/timectrlg.cpp @@ -288,7 +288,7 @@ private: case wxTE_HT_BELOW: // This shouldn't happen for single line control. wxFAIL_MSG( "Unreachable" ); - // fall through + wxFALLTHROUGH; case wxTE_HT_BEYOND: // Select the last field. diff --git a/src/gtk/anybutton.cpp b/src/gtk/anybutton.cpp index 1b57953fb9..a35f01addc 100644 --- a/src/gtk/anybutton.cpp +++ b/src/gtk/anybutton.cpp @@ -393,7 +393,7 @@ void wxAnyButton::DoSetBitmapPosition(wxDirection dir) { default: wxFAIL_MSG( "invalid position" ); - // fall through + wxFALLTHROUGH; case wxLEFT: gtkpos = GTK_POS_LEFT; diff --git a/src/gtk/evtloop.cpp b/src/gtk/evtloop.cpp index 795620da3e..eb9751c85a 100644 --- a/src/gtk/evtloop.cpp +++ b/src/gtk/evtloop.cpp @@ -301,7 +301,7 @@ static void wxgtk_main_do_event(GdkEvent* event, void* data) // examine the event itself to distinguish between the two cases but // this would be unnecessarily complicated). cat2 = wxEVT_CATEGORY_CLIPBOARD; - // Fall through. + wxFALLTHROUGH; case GDK_PROXIMITY_IN: case GDK_PROXIMITY_OUT: diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp index 8b21013b7d..708e93fc9a 100644 --- a/src/gtk/menu.cpp +++ b/src/gtk/menu.cpp @@ -901,7 +901,7 @@ void wxMenu::GtkAppend(wxMenuItem* mitem, int pos) break; default: wxFAIL_MSG("unexpected menu item kind"); - // fall through + wxFALLTHROUGH; case wxITEM_NORMAL: #ifdef __WXGTK4__ //TODO GtkImageMenuItem is gone, have to implement it ourselves with diff --git a/src/gtk/msgdlg.cpp b/src/gtk/msgdlg.cpp index 5530d8bb5c..b617297f11 100644 --- a/src/gtk/msgdlg.cpp +++ b/src/gtk/msgdlg.cpp @@ -279,7 +279,7 @@ int wxMessageDialog::ShowModal() { default: wxFAIL_MSG(wxT("unexpected GtkMessageDialog return code")); - // fall through + wxFALLTHROUGH; case GTK_RESPONSE_CANCEL: case GTK_RESPONSE_DELETE_EVENT: diff --git a/src/gtk/scrolwin.cpp b/src/gtk/scrolwin.cpp index 977b166f60..c885abf067 100644 --- a/src/gtk/scrolwin.cpp +++ b/src/gtk/scrolwin.cpp @@ -189,7 +189,7 @@ GtkPolicyType GtkPolicyFromWX(wxScrollbarVisibility visibility) default: wxFAIL_MSG( wxS("unknown scrollbar visibility") ); - // fall through + wxFALLTHROUGH; case wxSHOW_SB_ALWAYS: policy = GTK_POLICY_ALWAYS; diff --git a/src/gtk/toolbar.cpp b/src/gtk/toolbar.cpp index 99be10ff57..40df27abb1 100644 --- a/src/gtk/toolbar.cpp +++ b/src/gtk/toolbar.cpp @@ -572,7 +572,7 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase) break; default: wxFAIL_MSG("unknown toolbar child type"); - // fall through + wxFALLTHROUGH; case wxITEM_DROPDOWN: case wxITEM_NORMAL: tool->m_item = gtk_tool_button_new(NULL, ""); diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 20cbea46c9..2e0e7f2ed2 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -5181,7 +5181,7 @@ void wxWindowGTK::GTKSendPaintEvents(const GdkRegion* region) break; } } - // fall through + wxFALLTHROUGH; case wxBG_STYLE_SYSTEM: if ( GetThemeEnabled() ) diff --git a/src/osx/carbon/font.cpp b/src/osx/carbon/font.cpp index 76888bbb7b..3e243ee927 100644 --- a/src/osx/carbon/font.cpp +++ b/src/osx/carbon/font.cpp @@ -472,6 +472,7 @@ wxFont::wxFont(wxOSXSystemFont font) break; case wxOSX_SYSTEM_FONT_FIXED: uifont = kCTFontUIFontUserFixedPitch; + break; default: break; } diff --git a/src/unix/fontutil.cpp b/src/unix/fontutil.cpp index f6f1c63de2..070371268f 100644 --- a/src/unix/fontutil.cpp +++ b/src/unix/fontutil.cpp @@ -229,7 +229,7 @@ void wxNativeFontInfo::SetStyle(wxFontStyle style) break; default: wxFAIL_MSG( "unknown font style" ); - // fall through + wxFALLTHROUGH; case wxFONTSTYLE_NORMAL: pango_font_description_set_style( description, PANGO_STYLE_NORMAL ); break;