diff --git a/demos/life/life.cpp b/demos/life/life.cpp index c36e9c99d9..60f14a40ca 100644 --- a/demos/life/life.cpp +++ b/demos/life/life.cpp @@ -534,7 +534,7 @@ void LifeFrame::OnNavigate(wxCommandEvent& event) case ID_CENTER: c = m_life->FindCenter(); break; default : wxFAIL; - // Fall through! + wxFALLTHROUGH; case ID_ORIGIN: c.i = c.j = 0; break; } diff --git a/demos/poem/wxpoem.cpp b/demos/poem/wxpoem.cpp index 5b0500e0d7..9f24e2566a 100644 --- a/demos/poem/wxpoem.cpp +++ b/demos/poem/wxpoem.cpp @@ -686,6 +686,8 @@ void MyCanvas::OnChar(wxKeyEvent& event) case WXK_ESCAPE: TheMainWindow->Close(true); + break; + default: break; } diff --git a/samples/calendar/calendar.cpp b/samples/calendar/calendar.cpp index 14e1f616bd..54f02275d2 100644 --- a/samples/calendar/calendar.cpp +++ b/samples/calendar/calendar.cpp @@ -625,7 +625,7 @@ void MyFrame::OnCalRClick(wxMouseEvent& event) { default: wxFAIL_MSG( "unexpected" ); - // fall through + wxFALLTHROUGH; case wxCAL_HITTEST_NOWHERE: msg += "nowhere"; diff --git a/samples/dataview/mymodels.cpp b/samples/dataview/mymodels.cpp index ae40acb021..fcffc59d69 100644 --- a/samples/dataview/mymodels.cpp +++ b/samples/dataview/mymodels.cpp @@ -525,6 +525,7 @@ bool MyListModel::GetAttrByRow( unsigned int row, unsigned int col, return true; } } + wxFALLTHROUGH; case Col_Custom: // do what the labels defined in GetValueByRow() hint at diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index 78b92ed447..578bb940ce 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -3707,6 +3707,7 @@ long TestMessageBoxDialog::GetStyle() { case MsgDlgIcon_Max: wxFAIL_MSG( "unexpected selection" ); + wxFALLTHROUGH; case MsgDlgIcon_No: break; diff --git a/samples/exec/exec.cpp b/samples/exec/exec.cpp index ae5ed8f8ed..130bdcc780 100644 --- a/samples/exec/exec.cpp +++ b/samples/exec/exec.cpp @@ -627,7 +627,7 @@ void MyFrame::OnKill(wxCommandEvent& WXUNUSED(event)) { default: wxFAIL_MSG( "unexpected return value" ); - // fall through + wxFALLTHROUGH; case -1: // cancelled diff --git a/samples/image/image.cpp b/samples/image/image.cpp index 949619960e..819da2578f 100644 --- a/samples/image/image.cpp +++ b/samples/image/image.cpp @@ -802,7 +802,7 @@ void MyFrame::OnImageInfo( wxCommandEvent &WXUNUSED(event) ) { default: wxFAIL_MSG( "unknown image resolution units" ); - // fall through + wxFALLTHROUGH; case wxIMAGE_RESOLUTION_NONE: info += " in default units"; diff --git a/samples/power/power.cpp b/samples/power/power.cpp index 6c0f6454f0..59fdfc96ba 100644 --- a/samples/power/power.cpp +++ b/samples/power/power.cpp @@ -142,7 +142,7 @@ private: default: wxFAIL_MSG("unknown wxPowerType value"); - // fall through + wxFALLTHROUGH; case wxPOWER_UNKNOWN: powerStr = "psychic"; @@ -170,7 +170,7 @@ private: default: wxFAIL_MSG("unknown wxBatteryState value"); - // fall through + wxFALLTHROUGH; case wxBATTERY_UNKNOWN_STATE: batteryStr = "unknown"; diff --git a/samples/regtest/regtest.cpp b/samples/regtest/regtest.cpp index b97f627625..2004e34ce9 100644 --- a/samples/regtest/regtest.cpp +++ b/samples/regtest/regtest.cpp @@ -1074,8 +1074,7 @@ bool RegTreeCtrl::TreeNode::OnExpand() m_pKey->QueryValue(str, &l); strItem << l; } - - // fall through + wxFALLTHROUGH; default: icon = RegImageList::BinaryValue; diff --git a/samples/treelist/treelist.cpp b/samples/treelist/treelist.cpp index 0614f0ef84..b8a43a4039 100644 --- a/samples/treelist/treelist.cpp +++ b/samples/treelist/treelist.cpp @@ -695,7 +695,7 @@ void MyFrame::OnItemContextMenu(wxTreeListEvent& event) default: wxFAIL_MSG( "Unexpected menu selection" ); - // Fall through. + wxFALLTHROUGH; case wxID_NONE: return; diff --git a/samples/widgets/bmpcombobox.cpp b/samples/widgets/bmpcombobox.cpp index 56dd331fd8..bf7e7070a2 100644 --- a/samples/widgets/bmpcombobox.cpp +++ b/samples/widgets/bmpcombobox.cpp @@ -433,7 +433,7 @@ void BitmapComboBoxWidgetsPage::CreateCombo() { default: wxFAIL_MSG( "unknown combo kind" ); - // fall through + wxFALLTHROUGH; case ComboKind_Default: break; diff --git a/samples/widgets/button.cpp b/samples/widgets/button.cpp index 1275372a6d..98d9473a39 100644 --- a/samples/widgets/button.cpp +++ b/samples/widgets/button.cpp @@ -416,7 +416,7 @@ void ButtonWidgetsPage::CreateButton() default: wxFAIL_MSG("unexpected radiobox selection"); - // fall through + wxFALLTHROUGH; case ButtonHAlign_Centre: break; @@ -434,7 +434,7 @@ void ButtonWidgetsPage::CreateButton() default: wxFAIL_MSG("unexpected radiobox selection"); - // fall through + wxFALLTHROUGH; case ButtonVAlign_Centre: // centre vertical alignment is the default (no style) diff --git a/samples/widgets/checkbox.cpp b/samples/widgets/checkbox.cpp index 09893f3029..7e5c6720fd 100644 --- a/samples/widgets/checkbox.cpp +++ b/samples/widgets/checkbox.cpp @@ -259,7 +259,7 @@ void CheckBoxWidgetsPage::CreateCheckbox() { default: wxFAIL_MSG("unexpected radiobox selection"); - // fall through + wxFALLTHROUGH; case CheckboxKind_2State: flags |= wxCHK_2STATE; @@ -267,7 +267,7 @@ void CheckBoxWidgetsPage::CreateCheckbox() case CheckboxKind_3StateUser: flags |= wxCHK_ALLOW_3RD_STATE_FOR_USER; - // fall through + wxFALLTHROUGH; case CheckboxKind_3State: flags |= wxCHK_3STATE; diff --git a/samples/widgets/combobox.cpp b/samples/widgets/combobox.cpp index 57c031802b..6618ceff1a 100644 --- a/samples/widgets/combobox.cpp +++ b/samples/widgets/combobox.cpp @@ -431,7 +431,7 @@ void ComboboxWidgetsPage::CreateCombo() { default: wxFAIL_MSG( "unknown combo kind" ); - // fall through + wxFALLTHROUGH; case ComboKind_Default: break; diff --git a/samples/widgets/hyperlnk.cpp b/samples/widgets/hyperlnk.cpp index fb110f5a71..f71ad23a17 100644 --- a/samples/widgets/hyperlnk.cpp +++ b/samples/widgets/hyperlnk.cpp @@ -366,7 +366,7 @@ void HyperlinkWidgetsPage::OnAlignment(wxCommandEvent& WXUNUSED(event)) default: case Align_Max: wxFAIL_MSG( "unknown alignment" ); - // fall through + wxFALLTHROUGH; case Align_Left: addstyle = wxHL_ALIGN_LEFT; diff --git a/samples/widgets/notebook.cpp b/samples/widgets/notebook.cpp index 08c51f1f3c..598c19f848 100644 --- a/samples/widgets/notebook.cpp +++ b/samples/widgets/notebook.cpp @@ -343,7 +343,7 @@ void BookWidgetsPage::RecreateBook() { default: wxFAIL_MSG( "unknown orientation" ); - // fall through + wxFALLTHROUGH; case Orient_Top: flags |= wxBK_TOP; diff --git a/samples/widgets/radiobox.cpp b/samples/widgets/radiobox.cpp index 2745422475..2d109a51fe 100644 --- a/samples/widgets/radiobox.cpp +++ b/samples/widgets/radiobox.cpp @@ -376,7 +376,7 @@ void RadioWidgetsPage::CreateRadio() { default: wxFAIL_MSG( "unexpected wxRadioBox layout direction" ); - // fall through + wxFALLTHROUGH; case RadioDir_Default: break; diff --git a/samples/widgets/spinbtn.cpp b/samples/widgets/spinbtn.cpp index 4bda25ffef..067a3af999 100644 --- a/samples/widgets/spinbtn.cpp +++ b/samples/widgets/spinbtn.cpp @@ -368,7 +368,7 @@ void SpinBtnWidgetsPage::CreateSpin() { default: wxFAIL_MSG("unexpected radiobox selection"); - // fall through + wxFALLTHROUGH; case Align_Left: textFlags |= wxALIGN_LEFT; // no-op diff --git a/samples/widgets/static.cpp b/samples/widgets/static.cpp index 5ae946b9f8..163d500cda 100644 --- a/samples/widgets/static.cpp +++ b/samples/widgets/static.cpp @@ -417,7 +417,7 @@ void StaticWidgetsPage::CreateStatic() { default: wxFAIL_MSG("unexpected radiobox selection"); - // fall through + wxFALLTHROUGH; case StaticHAlign_Left: align |= wxALIGN_LEFT; @@ -436,7 +436,7 @@ void StaticWidgetsPage::CreateStatic() { default: wxFAIL_MSG("unexpected radiobox selection"); - // fall through + wxFALLTHROUGH; case StaticVAlign_Top: align |= wxALIGN_TOP; @@ -457,7 +457,7 @@ void StaticWidgetsPage::CreateStatic() { default: wxFAIL_MSG("unexpected radiobox selection"); - // fall through + wxFALLTHROUGH; case StaticEllipsize_Start: flagsDummyText |= wxST_ELLIPSIZE_START; diff --git a/samples/widgets/textctrl.cpp b/samples/widgets/textctrl.cpp index 8bd91ce042..8618261215 100644 --- a/samples/widgets/textctrl.cpp +++ b/samples/widgets/textctrl.cpp @@ -293,7 +293,7 @@ private: { default: wxFAIL_MSG( "unexpected HitTest() result" ); - // fall through + wxFALLTHROUGH; case wxTE_HT_UNKNOWN: x = y = -1; @@ -690,6 +690,7 @@ void TextWidgetsPage::CreateText() { default: wxFAIL_MSG( "unexpected lines radio box selection" ); + wxFALLTHROUGH; case TextLines_Single: break; @@ -755,6 +756,7 @@ void TextWidgetsPage::CreateText() { default: wxFAIL_MSG( "unexpected kind radio box selection" ); + wxFALLTHROUGH; case TextKind_Plain: break; diff --git a/samples/widgets/toggle.cpp b/samples/widgets/toggle.cpp index 83289037bc..d435642951 100644 --- a/samples/widgets/toggle.cpp +++ b/samples/widgets/toggle.cpp @@ -379,7 +379,7 @@ void ToggleWidgetsPage::CreateToggle() default: wxFAIL_MSG("unexpected radiobox selection"); - // fall through + wxFALLTHROUGH; case ToggleHAlign_Centre: break; @@ -397,7 +397,7 @@ void ToggleWidgetsPage::CreateToggle() default: wxFAIL_MSG("unexpected radiobox selection"); - // fall through + wxFALLTHROUGH; case ToggleVAlign_Centre: // centre vertical alignment is the default (no style) diff --git a/samples/widgets/widgets.cpp b/samples/widgets/widgets.cpp index 63eee2c2f8..381011490d 100644 --- a/samples/widgets/widgets.cpp +++ b/samples/widgets/widgets.cpp @@ -902,7 +902,7 @@ void WidgetsFrame::OnSetBorder(wxCommandEvent& event) default: wxFAIL_MSG( "unknown border style" ); - // fall through + wxFALLTHROUGH; case Widgets_BorderDefault: border = wxBORDER_DEFAULT; break; } diff --git a/src/msw/anybutton.cpp b/src/msw/anybutton.cpp index a589aed3d7..c4c4d11f53 100644 --- a/src/msw/anybutton.cpp +++ b/src/msw/anybutton.cpp @@ -280,7 +280,7 @@ public: { default: wxFAIL_MSG( "invalid image alignment" ); - // fall through + wxFALLTHROUGH; case BUTTON_IMAGELIST_ALIGN_LEFT: return wxLEFT; @@ -303,7 +303,7 @@ public: { default: wxFAIL_MSG( "invalid direction" ); - // fall through + wxFALLTHROUGH; case wxLEFT: alignNew = BUTTON_IMAGELIST_ALIGN_LEFT; @@ -1343,7 +1343,7 @@ bool wxAnyButton::MSWOnDraw(WXDRAWITEMSTRUCT *wxdis) { default: wxFAIL_MSG( "invalid direction" ); - // fall through + wxFALLTHROUGH; case wxLEFT: rectBitmap.x = rectButton.x + margin.x; diff --git a/src/msw/app.cpp b/src/msw/app.cpp index 2c3d14273b..d6af9e833c 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -978,7 +978,7 @@ terminate the program,\r\n\ default: wxFAIL_MSG( wxT("unexpected MessageBox() return code") ); - // fall through + wxFALLTHROUGH; case IDRETRY: return false; diff --git a/src/msw/bitmap.cpp b/src/msw/bitmap.cpp index 57bcdc4fd4..3ceea0022c 100644 --- a/src/msw/bitmap.cpp +++ b/src/msw/bitmap.cpp @@ -558,6 +558,7 @@ bool wxBitmap::CopyFromIconOrCursor(const wxGDIImage& icon, { default: wxFAIL_MSG( wxT("unknown wxBitmapTransparency value") ); + wxFALLTHROUGH; case wxBitmapTransparency_None: // nothing to do, refData->m_hasAlpha is false by default diff --git a/src/msw/brush.cpp b/src/msw/brush.cpp index f47d6d4bd2..da94288a53 100644 --- a/src/msw/brush.cpp +++ b/src/msw/brush.cpp @@ -186,7 +186,7 @@ HBRUSH wxBrushRefData::GetHBRUSH() default: wxFAIL_MSG( wxT("unknown brush style") ); - // fall through + wxFALLTHROUGH; case wxBRUSHSTYLE_SOLID: m_hBrush = ::CreateSolidBrush(m_colour.GetPixel()); diff --git a/src/msw/calctrl.cpp b/src/msw/calctrl.cpp index a538ff60f1..f03a3f5cbd 100644 --- a/src/msw/calctrl.cpp +++ b/src/msw/calctrl.cpp @@ -196,7 +196,7 @@ wxCalendarCtrl::HitTest(const wxPoint& pos, default: case MCHT_CALENDARWEEKNUM: wxFAIL_MSG( "unexpected" ); - // fall through + wxFALLTHROUGH; case MCHT_NOWHERE: case MCHT_CALENDARBK: diff --git a/src/msw/dialup.cpp b/src/msw/dialup.cpp index c38af22209..dec3014e6c 100644 --- a/src/msw/dialup.cpp +++ b/src/msw/dialup.cpp @@ -541,7 +541,7 @@ HRASCONN wxDialUpManagerMSW::FindActiveConnection() // is used, for example, to select the connection to hang up and so // we may hang up the wrong connection here... wxLogWarning(_("Several active dialup connections found, choosing one randomly.")); - // fall through + wxFALLTHROUGH; case 1: // exactly 1 connection, great @@ -1231,7 +1231,7 @@ static DWORD wxRasMonitorThread(wxRasThreadData *data) default: wxFAIL_MSG( wxT("unexpected return of WaitForMultipleObjects()") ); - // fall through + wxFALLTHROUGH; case WAIT_FAILED: // using wxLogLastError() from here is dangerous: we risk to diff --git a/src/msw/evtloopconsole.cpp b/src/msw/evtloopconsole.cpp index 869ea888fd..17706a16e4 100644 --- a/src/msw/evtloopconsole.cpp +++ b/src/msw/evtloopconsole.cpp @@ -122,7 +122,7 @@ int wxMSWEventLoopBase::GetNextMessageTimeout(WXMSG *msg, unsigned long timeout) default: wxLogDebug("unexpected MsgWaitForMultipleObjects() return " "value %lu", rc); - // fall through + wxFALLTHROUGH; case WAIT_TIMEOUT: return -1; diff --git a/src/msw/filedlg.cpp b/src/msw/filedlg.cpp index 07a9932796..0c6e38681d 100644 --- a/src/msw/filedlg.cpp +++ b/src/msw/filedlg.cpp @@ -517,8 +517,7 @@ int wxFileDialog::ShowModal() case wxT('/'): // convert to backslash ch = wxT('\\'); - - // fall through + wxFALLTHROUGH; case wxT('\\'): while ( i < len - 1 ) @@ -533,7 +532,7 @@ int wxFileDialog::ShowModal() else break; } - // fall through + wxFALLTHROUGH; default: // normal char diff --git a/src/msw/font.cpp b/src/msw/font.cpp index ed9840e0e6..2a74f6d1b2 100644 --- a/src/msw/font.cpp +++ b/src/msw/font.cpp @@ -524,7 +524,7 @@ void wxNativeFontInfo::SetStyle(wxFontStyle style) { default: wxFAIL_MSG( "unknown font style" ); - // fall through + wxFALLTHROUGH; case wxFONTSTYLE_NORMAL: lf.lfItalic = FALSE; diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 45041dcf6f..c557c559f3 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -2145,7 +2145,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) case HDN_BEGINTRACKA: case HDN_BEGINTRACKW: eventType = wxEVT_LIST_COL_BEGIN_DRAG; - // fall through + wxFALLTHROUGH; case HDN_ITEMCHANGING: if ( eventType == wxEVT_NULL ) @@ -2171,7 +2171,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) eventType = wxEVT_LIST_COL_DRAGGING; } - // fall through + wxFALLTHROUGH; case HDN_ENDTRACKA: case HDN_ENDTRACKW: @@ -2244,7 +2244,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) { case LVN_BEGINRDRAG: eventType = wxEVT_LIST_BEGIN_RDRAG; - // fall through + wxFALLTHROUGH; case LVN_BEGINDRAG: if ( eventType == wxEVT_NULL ) @@ -2675,7 +2675,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) return true; } - // fall through + wxFALLTHROUGH; default: processed = false; diff --git a/src/msw/mdi.cpp b/src/msw/mdi.cpp index 6870069d38..98e819ec92 100644 --- a/src/msw/mdi.cpp +++ b/src/msw/mdi.cpp @@ -722,7 +722,7 @@ void wxMDIParentFrame::OnMDICommand(wxCommandEvent& event) case wxID_MDI_WINDOW_TILE_HORZ: wParam |= MDITILE_HORIZONTAL; - // fall through + wxFALLTHROUGH; case wxID_MDI_WINDOW_TILE_VERT: if ( !wParam ) @@ -1152,7 +1152,7 @@ WXLRESULT wxMDIChildFrame::MSWWindowProc(WXUINT message, processed = HandleMDIActivate(act, hwndAct, hwndDeact); } - // fall through + wxFALLTHROUGH; case WM_MOVE: // must pass WM_MOVE to DefMDIChildProc() to recalculate MDI client diff --git a/src/msw/mediactrl_am.cpp b/src/msw/mediactrl_am.cpp index 4a15fc7fc5..5bffd76681 100644 --- a/src/msw/mediactrl_am.cpp +++ b/src/msw/mediactrl_am.cpp @@ -1369,7 +1369,7 @@ wxLongLong wxAMMediaBackend::GetDuration() { default: wxAMLOG(hr); - // fall through + wxFALLTHROUGH; case S_FALSE: return 0; diff --git a/src/msw/msgdlg.cpp b/src/msw/msgdlg.cpp index 61a0a878a8..6ffc80b43d 100644 --- a/src/msw/msgdlg.cpp +++ b/src/msw/msgdlg.cpp @@ -830,7 +830,7 @@ int wxMSWMessageDialog::MSWTranslateReturnCode(int msAns) { default: wxFAIL_MSG(wxT("unexpected return code")); - // fall through + wxFALLTHROUGH; case IDCANCEL: ans = wxID_CANCEL; diff --git a/src/msw/ole/droptgt.cpp b/src/msw/ole/droptgt.cpp index e34c8d039a..acb7e44017 100644 --- a/src/msw/ole/droptgt.cpp +++ b/src/msw/ole/droptgt.cpp @@ -681,7 +681,7 @@ static wxDragResult ConvertDragEffectToResult(DWORD dwEffect) default: wxFAIL_MSG(wxT("invalid value in ConvertDragEffectToResult")); - // fall through + wxFALLTHROUGH; case DROPEFFECT_NONE: return wxDragNone; @@ -702,7 +702,7 @@ static DWORD ConvertDragResultToEffect(wxDragResult result) default: wxFAIL_MSG(wxT("invalid value in ConvertDragResultToEffect")); - // fall through + wxFALLTHROUGH; case wxDragNone: return DROPEFFECT_NONE; diff --git a/src/msw/pen.cpp b/src/msw/pen.cpp index 61a8648d3b..17360fb899 100644 --- a/src/msw/pen.cpp +++ b/src/msw/pen.cpp @@ -205,7 +205,7 @@ static int ConvertPenStyle(wxPenStyle style) default: wxFAIL_MSG( wxT("unknown pen style") ); - // fall through + wxFALLTHROUGH; case wxPENSTYLE_DOT: return PS_DOT; @@ -241,7 +241,7 @@ static int ConvertJoinStyle(wxPenJoin join) default: wxFAIL_MSG( wxT("unknown pen join style") ); - // fall through + wxFALLTHROUGH; case wxJOIN_ROUND: return PS_JOIN_ROUND; @@ -260,7 +260,7 @@ static int ConvertCapStyle(wxPenCap cap) default: wxFAIL_MSG( wxT("unknown pen cap style") ); - // fall through + wxFALLTHROUGH; case wxCAP_ROUND: return PS_ENDCAP_ROUND; diff --git a/src/msw/power.cpp b/src/msw/power.cpp index af74be0d88..92ff808675 100644 --- a/src/msw/power.cpp +++ b/src/msw/power.cpp @@ -143,6 +143,7 @@ wxPowerType wxGetPowerType() default: wxLogDebug(wxT("Unknown ACLineStatus=%u"), sps.ACLineStatus); + wxFALLTHROUGH; case 255: break; } diff --git a/src/msw/region.cpp b/src/msw/region.cpp index 8ff88073b3..b7e18d85fd 100644 --- a/src/msw/region.cpp +++ b/src/msw/region.cpp @@ -206,7 +206,7 @@ bool wxRegion::DoCombine(const wxRegion& rgn, wxRegionOp op) default: wxFAIL_MSG( wxT("unknown region operation") ); - // fall through + wxFALLTHROUGH; case wxRGN_AND: case wxRGN_DIFF: @@ -239,7 +239,7 @@ bool wxRegion::DoCombine(const wxRegion& rgn, wxRegionOp op) default: wxFAIL_MSG( wxT("unknown region operation") ); - // fall through + wxFALLTHROUGH; case wxRGN_COPY: mode = RGN_COPY; diff --git a/src/msw/registry.cpp b/src/msw/registry.cpp index 63d2e1bf70..73631b105c 100644 --- a/src/msw/registry.cpp +++ b/src/msw/registry.cpp @@ -1332,7 +1332,7 @@ wxString wxRegKey::FormatValue(const wxString& name) const case wxT('\\'): // escape special symbol rhs += wxT('\\'); - // fall through + wxFALLTHROUGH; default: rhs += *p; @@ -1527,7 +1527,7 @@ long GetMSWViewFlags(wxRegKey::WOW64ViewMode viewMode) default: wxFAIL_MSG("Unknown registry view."); - // fall through + wxFALLTHROUGH; case wxRegKey::WOW64ViewMode_Default: // Use default registry view for the current application, diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index ec96a10635..52637d901c 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -1997,7 +1997,7 @@ bool wxTextCtrl::MSWShouldPreProcessMessage(WXMSG* msg) { default: wxFAIL_MSG( wxT("how many modifiers have we got?") ); - // fall through + wxFALLTHROUGH; case 0: switch ( vkey ) @@ -2006,14 +2006,14 @@ bool wxTextCtrl::MSWShouldPreProcessMessage(WXMSG* msg) // This one is only special for multi line controls. if ( !IsMultiLine() ) break; - // fall through + wxFALLTHROUGH; case VK_DELETE: case VK_HOME: case VK_END: return false; } - // fall through + wxFALLTHROUGH; case 2: break; @@ -2297,7 +2297,7 @@ bool wxTextCtrl::SendUpdateEvent() default: wxFAIL_MSG( wxT("unexpected wxTextCtrl::m_updatesCount value") ); - // fall through + wxFALLTHROUGH; case -1: // we hadn't updated the control ourselves, this event comes from diff --git a/src/msw/thread.cpp b/src/msw/thread.cpp index 5c94613f46..a04625d4fd 100644 --- a/src/msw/thread.cpp +++ b/src/msw/thread.cpp @@ -258,7 +258,7 @@ wxMutexError wxMutexInternal::LockTimeout(DWORD milliseconds) // the previous caller died without releasing the mutex, so even // though we did get it, log a message about this wxLogDebug(wxT("WaitForSingleObject() returned WAIT_ABANDONED")); - // fall through + wxFALLTHROUGH; case WAIT_OBJECT_0: // ok @@ -269,7 +269,7 @@ wxMutexError wxMutexInternal::LockTimeout(DWORD milliseconds) default: wxFAIL_MSG(wxT("impossible return value in wxMutex::Lock")); - // fall through + wxFALLTHROUGH; case WAIT_FAILED: wxLogLastError(wxT("WaitForSingleObject(mutex)")); diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index d7e9094a02..e9f9defff4 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -3114,8 +3114,7 @@ wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) processed = true; } } - - // fall through + wxFALLTHROUGH; case WM_RBUTTONUP: #if wxUSE_DRAGIMAGE @@ -3288,7 +3287,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) { case TVN_BEGINDRAG: eventType = wxEVT_TREE_BEGIN_DRAG; - // fall through + wxFALLTHROUGH; case TVN_BEGINRDRAG: { @@ -3379,7 +3378,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) case TVN_GETDISPINFO: eventType = wxEVT_TREE_GET_INFO; - // fall through + wxFALLTHROUGH; case TVN_SETDISPINFO: { @@ -3403,7 +3402,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) { default: wxLogDebug(wxT("unexpected code %d in TVN_ITEMEXPAND message"), tv->action); - // fall through + wxFALLTHROUGH; case TVE_EXPAND: what = IDX_EXPAND; @@ -3471,7 +3470,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) { eventType = wxEVT_TREE_SEL_CHANGED; } - // fall through + wxFALLTHROUGH; case TVN_SELCHANGINGA: case TVN_SELCHANGINGW: @@ -3690,7 +3689,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) break; } } - // fall through + wxFALLTHROUGH; default: return wxControl::MSWOnNotify(idCtrl, lParam, result); diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index 45f52c8d77..74a3a596c3 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -713,11 +713,11 @@ int wxKill(long pid, wxSignal sig, wxKillError *krc, int flags) default: wxFAIL_MSG( wxT("unexpected WaitForSingleObject() return") ); - // fall through + wxFALLTHROUGH; case WAIT_FAILED: wxLogLastError(wxT("WaitForSingleObject")); - // fall through + wxFALLTHROUGH; case WAIT_TIMEOUT: // Process didn't terminate: normally this is a failure but not @@ -1274,6 +1274,7 @@ wxWinVersion wxGetWinVersion() case 10: return wxWinVersion_10; } + break; default: // Do nothing just to silence GCC warning break; diff --git a/src/msw/window.cpp b/src/msw/window.cpp index d17cf3f39e..e17b851b59 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1561,7 +1561,7 @@ WXDWORD wxWindowMSW::MSWGetStyle(long flags, WXDWORD *exstyle) const default: case wxBORDER_DEFAULT: wxFAIL_MSG( wxT("unknown border style") ); - // fall through + wxFALLTHROUGH; case wxBORDER_NONE: case wxBORDER_SIMPLE: @@ -2257,7 +2257,7 @@ wxSize wxWindowMSW::DoGetBorderSize() const default: wxFAIL_MSG( wxT("unknown border style") ); - // fall through + wxFALLTHROUGH; case wxBORDER_NONE: border = 0; @@ -2540,7 +2540,7 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg) case VK_PRIOR: bForward = false; - // fall through + wxFALLTHROUGH; case VK_NEXT: // we treat PageUp/Dn as arrows because chances are that @@ -4502,7 +4502,7 @@ bool wxWindowMSW::HandlePower(WXWPARAM wParam, default: wxLogDebug(wxT("Unknown WM_POWERBROADCAST(%d) event"), wParam); - // fall through + wxFALLTHROUGH; // these messages are currently not mapped to wx events case PBT_APMQUERYSTANDBY: @@ -5106,7 +5106,7 @@ bool wxWindowMSW::HandleEraseBkgnd(WXHDC hdc) return true; } } - // fall through + wxFALLTHROUGH; case wxBG_STYLE_SYSTEM: if ( !DoEraseBackground(hdc) ) diff --git a/src/richtext/richtextctrl.cpp b/src/richtext/richtextctrl.cpp index b0aab5b388..844f264419 100644 --- a/src/richtext/richtextctrl.cpp +++ b/src/richtext/richtextctrl.cpp @@ -878,6 +878,7 @@ void wxRichTextCtrl::OnMoveMouse(wxMouseEvent& event) Refresh(); // This is needed in wxMSW, otherwise resetting the position doesn't 'take' SetCaretPosition(oldPos); SetFocusObject(oldFocus, false); + wxFALLTHROUGH; default: break; } EndBatchUndo(); diff --git a/tests/regex/regextest.cpp b/tests/regex/regextest.cpp index 2c26019dc5..cc9449e9b7 100644 --- a/tests/regex/regextest.cpp +++ b/tests/regex/regextest.cpp @@ -204,7 +204,7 @@ void RegExTestCase::parseFlags(const wxString& flags) case 'i': m_compileFlags |= wxRE_ICASE; break; case 'o': m_compileFlags |= wxRE_NOSUB; break; case 'n': m_compileFlags |= wxRE_NEWLINE; break; - case 't': if (strchr("ep", m_mode)) break; // else fall through... + case 't': if (strchr("ep", m_mode)) break; wxFALLTHROUGH; // anything else we must skip the test default: