Fix unannotated fall-through warnings

This commit is contained in:
Maarten Bent
2018-11-25 20:22:44 +01:00
parent 39ff5b90e5
commit eb23d4735c
47 changed files with 84 additions and 77 deletions

View File

@@ -625,7 +625,7 @@ void MyFrame::OnCalRClick(wxMouseEvent& event)
{
default:
wxFAIL_MSG( "unexpected" );
// fall through
wxFALLTHROUGH;
case wxCAL_HITTEST_NOWHERE:
msg += "nowhere";

View File

@@ -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

View File

@@ -3707,6 +3707,7 @@ long TestMessageBoxDialog::GetStyle()
{
case MsgDlgIcon_Max:
wxFAIL_MSG( "unexpected selection" );
wxFALLTHROUGH;
case MsgDlgIcon_No:
break;

View File

@@ -627,7 +627,7 @@ void MyFrame::OnKill(wxCommandEvent& WXUNUSED(event))
{
default:
wxFAIL_MSG( "unexpected return value" );
// fall through
wxFALLTHROUGH;
case -1:
// cancelled

View File

@@ -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";

View File

@@ -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";

View File

@@ -1074,8 +1074,7 @@ bool RegTreeCtrl::TreeNode::OnExpand()
m_pKey->QueryValue(str, &l);
strItem << l;
}
// fall through
wxFALLTHROUGH;
default:
icon = RegImageList::BinaryValue;

View File

@@ -695,7 +695,7 @@ void MyFrame::OnItemContextMenu(wxTreeListEvent& event)
default:
wxFAIL_MSG( "Unexpected menu selection" );
// Fall through.
wxFALLTHROUGH;
case wxID_NONE:
return;

View File

@@ -433,7 +433,7 @@ void BitmapComboBoxWidgetsPage::CreateCombo()
{
default:
wxFAIL_MSG( "unknown combo kind" );
// fall through
wxFALLTHROUGH;
case ComboKind_Default:
break;

View File

@@ -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)

View File

@@ -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;

View File

@@ -431,7 +431,7 @@ void ComboboxWidgetsPage::CreateCombo()
{
default:
wxFAIL_MSG( "unknown combo kind" );
// fall through
wxFALLTHROUGH;
case ComboKind_Default:
break;

View File

@@ -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;

View File

@@ -343,7 +343,7 @@ void BookWidgetsPage::RecreateBook()
{
default:
wxFAIL_MSG( "unknown orientation" );
// fall through
wxFALLTHROUGH;
case Orient_Top:
flags |= wxBK_TOP;

View File

@@ -376,7 +376,7 @@ void RadioWidgetsPage::CreateRadio()
{
default:
wxFAIL_MSG( "unexpected wxRadioBox layout direction" );
// fall through
wxFALLTHROUGH;
case RadioDir_Default:
break;

View File

@@ -368,7 +368,7 @@ void SpinBtnWidgetsPage::CreateSpin()
{
default:
wxFAIL_MSG("unexpected radiobox selection");
// fall through
wxFALLTHROUGH;
case Align_Left:
textFlags |= wxALIGN_LEFT; // no-op

View File

@@ -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;

View File

@@ -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;

View File

@@ -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)

View File

@@ -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;
}