diff --git a/src/aui/auibar.cpp b/src/aui/auibar.cpp index 5a073344fb..37413d8acf 100644 --- a/src/aui/auibar.cpp +++ b/src/aui/auibar.cpp @@ -784,7 +784,7 @@ static wxOrientation GetOrientation(long style) return wxVERTICAL; default: wxFAIL_MSG("toolbar cannot be locked in both horizontal and vertical orientations (maybe no lock was intended?)"); - // fall through + wxFALLTHROUGH; case 0: return wxBOTH; } diff --git a/src/common/arttango.cpp b/src/common/arttango.cpp index 98e6f00d3c..6404ffc378 100644 --- a/src/common/arttango.cpp +++ b/src/common/arttango.cpp @@ -265,7 +265,7 @@ wxTangoArtProvider::CreateBitmap(const wxArtID& id, { default: wxFAIL_MSG( "Unsupported Tango bitmap size" ); - // fall through + wxFALLTHROUGH; case TangoSize_16: data = entry.data16; diff --git a/src/common/base64.cpp b/src/common/base64.cpp index 5ee3a7a3c7..af50821146 100644 --- a/src/common/base64.cpp +++ b/src/common/base64.cpp @@ -127,7 +127,7 @@ wxBase64Decode(void *dst_, size_t dstLen, case WSP: if ( mode == wxBase64DecodeMode_SkipWS ) continue; - // fall through + wxFALLTHROUGH; case INV: if ( mode == wxBase64DecodeMode_Relaxed ) diff --git a/src/common/bookctrl.cpp b/src/common/bookctrl.cpp index 4b321322b4..1b745ac168 100644 --- a/src/common/bookctrl.cpp +++ b/src/common/bookctrl.cpp @@ -166,11 +166,11 @@ wxRect wxBookCtrlBase::GetPageRect() const { default: wxFAIL_MSG( wxT("unexpected alignment") ); - // fall through + wxFALLTHROUGH; case wxBK_TOP: rectPage.y = size.y + GetInternalBorder(); - // fall through + wxFALLTHROUGH; case wxBK_BOTTOM: rectPage.height -= size.y + GetInternalBorder(); @@ -180,7 +180,7 @@ wxRect wxBookCtrlBase::GetPageRect() const case wxBK_LEFT: rectPage.x = size.x + GetInternalBorder(); - // fall through + wxFALLTHROUGH; case wxBK_RIGHT: rectPage.width -= size.x + GetInternalBorder(); @@ -225,7 +225,7 @@ void wxBookCtrlBase::DoSize() { default: wxFAIL_MSG( wxT("unexpected alignment") ); - // fall through + wxFALLTHROUGH; case wxBK_TOP: case wxBK_LEFT: diff --git a/src/common/cmdline.cpp b/src/common/cmdline.cpp index 3ad232b9b9..92f263a7e1 100644 --- a/src/common/cmdline.cpp +++ b/src/common/cmdline.cpp @@ -626,7 +626,7 @@ void wxCmdLineParser::SetDesc(const wxCmdLineEntryDesc *desc) default: wxFAIL_MSG( wxT("unknown command line entry type") ); - // still fall through + wxFALLTHROUGH; case wxCMD_LINE_NONE: return; @@ -1089,7 +1089,7 @@ int wxCmdLineParser::Parse(bool showUsage) { default: wxFAIL_MSG( wxT("unknown option type") ); - // still fall through + wxFALLTHROUGH; case wxCMD_LINE_VAL_STRING: opt.SetStrVal(value); @@ -1470,7 +1470,7 @@ static wxString GetTypeName(wxCmdLineParamType type) { default: wxFAIL_MSG( wxT("unknown option type") ); - // still fall through + wxFALLTHROUGH; case wxCMD_LINE_VAL_STRING: s = _("str"); diff --git a/src/common/config.cpp b/src/common/config.cpp index 852dd13f17..688f5c2330 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -494,7 +494,7 @@ wxString wxExpandEnvVars(const wxString& str) break; } - //else: fall through + wxFALLTHROUGH; default: strResult += str[n]; diff --git a/src/common/ctrlsub.cpp b/src/common/ctrlsub.cpp index 7bf15a9295..81a5a39a93 100644 --- a/src/common/ctrlsub.cpp +++ b/src/common/ctrlsub.cpp @@ -255,7 +255,7 @@ void wxItemContainer::AssignNewItemClientData(unsigned int pos, default: wxFAIL_MSG( wxT("unknown client data type") ); - // fall through + wxFALLTHROUGH; case wxClientData_None: // nothing to do diff --git a/src/common/datetimefmt.cpp b/src/common/datetimefmt.cpp index 4855025050..651401fc10 100644 --- a/src/common/datetimefmt.cpp +++ b/src/common/datetimefmt.cpp @@ -712,7 +712,7 @@ wxString wxDateTime::Format(const wxString& formatp, const TimeZone& tz) const // no, it wasn't the width wxFAIL_MSG(wxT("unknown format specifier")); - // fall through and just copy it nevertheless + wxFALLTHROUGH; case wxT('%'): // a percent sign res += *p; @@ -1495,7 +1495,7 @@ wxDateTime::ParseFormat(const wxString& date, case 0: // the end of string wxFAIL_MSG(wxT("unexpected format end")); - // fall through + wxFALLTHROUGH; default: // not a known format spec return false; @@ -2262,7 +2262,7 @@ wxString wxTimeSpan::Format(const wxString& format) const { default: wxFAIL_MSG( wxT("invalid format character") ); - // fall through + wxFALLTHROUGH; case wxT('%'): str += ch; diff --git a/src/common/dircmn.cpp b/src/common/dircmn.cpp index 311d1ca983..167836f588 100644 --- a/src/common/dircmn.cpp +++ b/src/common/dircmn.cpp @@ -126,7 +126,7 @@ size_t wxDir::Traverse(wxDirTraverser& sink, { default: wxFAIL_MSG(wxT("unexpected OnDir() return value") ); - // fall through + wxFALLTHROUGH; case wxDIR_STOP: cont = false; @@ -154,11 +154,11 @@ size_t wxDir::Traverse(wxDirTraverser& sink, { default: wxFAIL_MSG(wxT("unexpected OnOpenError() return value") ); - // fall through + wxFALLTHROUGH; case wxDIR_STOP: cont = false; - // fall through + wxFALLTHROUGH; case wxDIR_IGNORE: tryagain = false; diff --git a/src/common/dlgcmn.cpp b/src/common/dlgcmn.cpp index 4b23e83b7e..483b2307b2 100644 --- a/src/common/dlgcmn.cpp +++ b/src/common/dlgcmn.cpp @@ -442,7 +442,7 @@ bool wxDialogBase::SendCloseButtonClickEvent() if ( EmulateButtonClickIfPresent(wxID_CANCEL) ) return true; idCancel = GetAffirmativeId(); - // fall through + wxFALLTHROUGH; default: // translate Esc to button press for the button with given id diff --git a/src/common/event.cpp b/src/common/event.cpp index 914995e2fa..b28bf49e1e 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -601,7 +601,7 @@ bool wxMouseEvent::ButtonDClick(int but) const { default: wxFAIL_MSG(wxT("invalid parameter in wxMouseEvent::ButtonDClick")); - // fall through + wxFALLTHROUGH; case wxMOUSE_BTN_ANY: return (LeftDClick() || MiddleDClick() || RightDClick() || @@ -631,7 +631,7 @@ bool wxMouseEvent::ButtonDown(int but) const { default: wxFAIL_MSG(wxT("invalid parameter in wxMouseEvent::ButtonDown")); - // fall through + wxFALLTHROUGH; case wxMOUSE_BTN_ANY: return (LeftDown() || MiddleDown() || RightDown() || @@ -661,7 +661,7 @@ bool wxMouseEvent::ButtonUp(int but) const { default: wxFAIL_MSG(wxT("invalid parameter in wxMouseEvent::ButtonUp")); - // fall through + wxFALLTHROUGH; case wxMOUSE_BTN_ANY: return (LeftUp() || MiddleUp() || RightUp() || @@ -691,7 +691,7 @@ bool wxMouseEvent::Button(int but) const { default: wxFAIL_MSG(wxT("invalid parameter in wxMouseEvent::Button")); - // fall through + wxFALLTHROUGH; case wxMOUSE_BTN_ANY: return ButtonUp(wxMOUSE_BTN_ANY) || diff --git a/src/common/ffile.cpp b/src/common/ffile.cpp index 5efeec9f5c..688be54b57 100644 --- a/src/common/ffile.cpp +++ b/src/common/ffile.cpp @@ -195,7 +195,7 @@ bool wxFFile::Seek(wxFileOffset ofs, wxSeekMode mode) { default: wxFAIL_MSG(wxT("unknown seek mode")); - // still fall through + wxFALLTHROUGH; case wxFromStart: origin = SEEK_SET; diff --git a/src/common/file.cpp b/src/common/file.cpp index 6ef8e2dc60..a0647252a1 100644 --- a/src/common/file.cpp +++ b/src/common/file.cpp @@ -147,7 +147,7 @@ bool wxFile::Access(const wxString& name, OpenMode mode) { default: wxFAIL_MSG(wxT("bad wxFile::Access mode parameter.")); - // fall through + wxFALLTHROUGH; case read: how = R_OK; @@ -232,6 +232,7 @@ bool wxFile::Open(const wxString& fileName, OpenMode mode, int accessMode) } //else: fall through as write_append is the same as write if the // file doesn't exist + wxFALLTHROUGH; case write: flags |= O_WRONLY | O_CREAT | O_TRUNC; @@ -406,7 +407,7 @@ wxFileOffset wxFile::Seek(wxFileOffset ofs, wxSeekMode mode) switch ( mode ) { default: wxFAIL_MSG(wxT("unknown seek origin")); - + wxFALLTHROUGH; case wxFromStart: origin = SEEK_SET; break; diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index dd60bb34d2..8bf2f8a588 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -2056,7 +2056,7 @@ static wxString FilterOutValue(const wxString& str) c = wxT('"'); break; } - //else: fall through + wxFALLTHROUGH; default: strResult += str[n]; diff --git a/src/common/filename.cpp b/src/common/filename.cpp index 6acde7603c..817fc45552 100644 --- a/src/common/filename.cpp +++ b/src/common/filename.cpp @@ -495,7 +495,7 @@ void wxFileName::SetPath( const wxString& pathOrig, wxPathFormat format ) default: wxFAIL_MSG( wxT("Unknown path format") ); - // !! Fall through !! + wxFALLTHROUGH; case wxPATH_UNIX: m_relative = leadingChar != wxT('/'); @@ -1890,7 +1890,7 @@ wxString wxFileName::GetForbiddenChars(wxPathFormat format) { default : wxFAIL_MSG( wxT("Unknown path format") ); - // !! Fall through !! + wxFALLTHROUGH; case wxPATH_UNIX: break; @@ -1945,7 +1945,7 @@ wxString wxFileName::GetPathSeparators(wxPathFormat format) default: wxFAIL_MSG( wxT("Unknown wxPATH_XXX style") ); - // fall through + wxFALLTHROUGH; case wxPATH_UNIX: seps = wxFILE_SEP_PATH_UNIX; @@ -2094,7 +2094,7 @@ wxString wxFileName::GetPath( int flags, wxPathFormat format ) const default: wxFAIL_MSG( wxT("Unknown path format") ); - // fall through + wxFALLTHROUGH; case wxPATH_UNIX: if ( !m_relative ) @@ -2143,7 +2143,7 @@ wxString wxFileName::GetPath( int flags, wxPathFormat format ) const default: wxFAIL_MSG( wxT("Unexpected path format") ); - // still fall through + wxFALLTHROUGH; case wxPATH_DOS: case wxPATH_UNIX: diff --git a/src/common/fontcmn.cpp b/src/common/fontcmn.cpp index b8f46fef70..328e6d342f 100644 --- a/src/common/fontcmn.cpp +++ b/src/common/fontcmn.cpp @@ -808,7 +808,7 @@ wxString wxNativeFontInfo::ToUserString() const { default: wxFAIL_MSG( wxT("unknown font weight") ); - // fall through + wxFALLTHROUGH; case wxFONTWEIGHT_NORMAL: break; @@ -826,7 +826,7 @@ wxString wxNativeFontInfo::ToUserString() const { default: wxFAIL_MSG( wxT("unknown font style") ); - // fall through + wxFALLTHROUGH; case wxFONTSTYLE_NORMAL: break; diff --git a/src/common/ftp.cpp b/src/common/ftp.cpp index c205cd7592..0861710b25 100644 --- a/src/common/ftp.cpp +++ b/src/common/ftp.cpp @@ -388,7 +388,7 @@ bool wxFTP::SetTransferMode(TransferMode transferMode) { default: wxFAIL_MSG(wxT("unknown FTP transfer mode")); - // fall through + wxFALLTHROUGH; case BINARY: mode = wxT('I'); diff --git a/src/common/imagbmp.cpp b/src/common/imagbmp.cpp index 0bc97e12e0..401e83d606 100644 --- a/src/common/imagbmp.cpp +++ b/src/common/imagbmp.cpp @@ -204,18 +204,18 @@ bool wxBMPHandler::SaveDib(wxImage *image, { default: wxFAIL_MSG( wxT("unexpected image resolution units") ); - // fall through + wxFALLTHROUGH; case wxIMAGE_RESOLUTION_NONE: hres = vres = 72; - // fall through to convert it to correct units + wxFALLTHROUGH;// fall through to convert it to correct units case wxIMAGE_RESOLUTION_INCHES: // convert resolution in inches to resolution in centimeters hres = (int)(10*mm2inches*hres); vres = (int)(10*mm2inches*vres); - // fall through to convert it to resolution in meters + wxFALLTHROUGH;// fall through to convert it to resolution in meters case wxIMAGE_RESOLUTION_CM: // convert resolution in centimeters to resolution in meters diff --git a/src/common/imagpng.cpp b/src/common/imagpng.cpp index 5a27ca92f7..00e27e2c09 100644 --- a/src/common/imagpng.cpp +++ b/src/common/imagpng.cpp @@ -387,12 +387,12 @@ void CopyDataFromPNG(wxImage *image, // using the mask at all wxASSERT_MSG( IsOpaque(a), wxT("logic error") ); - // fall through + wxFALLTHROUGH; case Transparency_Alpha: if ( alpha ) *alpha++ = a; - // fall through + wxFALLTHROUGH; case Transparency_None: *ptrDst++ = g; @@ -466,12 +466,12 @@ void CopyDataFromPNG(wxImage *image, } } - // fall through + wxFALLTHROUGH; case Transparency_Alpha: if ( alpha ) *alpha++ = a; - // fall through + wxFALLTHROUGH; case Transparency_None: *ptrDst++ = r; @@ -612,7 +612,7 @@ wxPNGHandler::LoadFile(wxImage *image, { default: wxLogWarning(_("Unknown PNG resolution unit %d"), unitType); - // fall through + wxFALLTHROUGH; case PNG_RESOLUTION_UNKNOWN: image->SetOption(wxIMAGE_OPTION_RESOLUTIONX, resX); @@ -1004,7 +1004,7 @@ bool wxPNGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbos { default: wxFAIL_MSG( wxT("unknown wxPNG_TYPE_XXX") ); - // fall through + wxFALLTHROUGH; case wxPNG_TYPE_COLOUR: *pData++ = clr.red; diff --git a/src/common/imagtiff.cpp b/src/common/imagtiff.cpp index 628c645084..876a989e61 100644 --- a/src/common/imagtiff.cpp +++ b/src/common/imagtiff.cpp @@ -531,7 +531,7 @@ bool wxTIFFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbos default: wxLogWarning(_("Unknown TIFF resolution unit %d ignored"), tiffRes); - // fall through + wxFALLTHROUGH; case RESUNIT_NONE: resUnit = wxIMAGE_RESOLUTION_NONE; @@ -628,7 +628,7 @@ bool wxTIFFHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbo { default: wxFAIL_MSG( wxT("unknown image resolution units") ); - // fall through + wxFALLTHROUGH; case wxIMAGE_RESOLUTION_NONE: tiffRes = RESUNIT_NONE; diff --git a/src/common/markupparser.cpp b/src/common/markupparser.cpp index 9e20730100..2b26a04c6a 100644 --- a/src/common/markupparser.cpp +++ b/src/common/markupparser.cpp @@ -386,7 +386,7 @@ bool wxMarkupParser::Parse(const wxString& text) if ( n < WXSIZEOF(xmlEntities) ) break; - //else: fall through, '&' is not special + wxFALLTHROUGH;//else: fall through, '&' is not special } default: diff --git a/src/common/popupcmn.cpp b/src/common/popupcmn.cpp index e50dc3e626..014ae9d8ce 100644 --- a/src/common/popupcmn.cpp +++ b/src/common/popupcmn.cpp @@ -608,7 +608,7 @@ void wxPopupWindowHandler::OnLeftDown(wxMouseEvent& event) default: // forgot to update the switch after adding a new hit test code? wxFAIL_MSG( wxT("unexpected HitTest() return value") ); - // fall through + wxFALLTHROUGH; case wxHT_WINDOW_CORNER: // don't actually know if this one is good for anything, but let it diff --git a/src/common/process.cpp b/src/common/process.cpp index 6dd44d891b..ca19db0fa6 100644 --- a/src/common/process.cpp +++ b/src/common/process.cpp @@ -169,7 +169,7 @@ bool wxProcess::Exists(int pid) case wxKILL_ERROR: case wxKILL_BAD_SIGNAL: wxFAIL_MSG( wxT("unexpected wxProcess::Kill() return code") ); - // fall through + wxFALLTHROUGH; case wxKILL_NO_PROCESS: return false; diff --git a/src/common/radiocmn.cpp b/src/common/radiocmn.cpp index 5d69bf5952..ab683b1cb7 100644 --- a/src/common/radiocmn.cpp +++ b/src/common/radiocmn.cpp @@ -349,7 +349,7 @@ wxString wxRadioBoxBase::DoGetHelpTextAtPoint(const wxWindow *derived, default: wxFAIL_MSG( "unknown help even origin" ); - // fall through + wxFALLTHROUGH; case wxHelpEvent::Origin_Unknown: // this value is used when we're called from GetHelpText() for the diff --git a/src/common/regex.cpp b/src/common/regex.cpp index a93ca08bf5..cba2ea7e07 100644 --- a/src/common/regex.cpp +++ b/src/common/regex.cpp @@ -433,7 +433,7 @@ bool wxRegExImpl::Matches(const wxRegChar *str, // an error occurred wxLogError(_("Failed to find match for regular expression: %s"), GetErrorMsg(rc, !str).c_str()); - // fall through + wxFALLTHROUGH; case REG_NOMATCH: // no match diff --git a/src/common/string.cpp b/src/common/string.cpp index cc2e759631..0de02c8b31 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -2201,7 +2201,7 @@ bool wxString::Matches(const wxString& mask) const // (however note that we don't quote '[' and ']' to allow // using them for Unix shell like matching) pattern += wxT('\\'); - // fall through + wxFALLTHROUGH; default: pattern += *pszMask; diff --git a/src/common/strvararg.cpp b/src/common/strvararg.cpp index 1ec3d06690..aa698a58b3 100644 --- a/src/common/strvararg.cpp +++ b/src/common/strvararg.cpp @@ -211,7 +211,7 @@ public: format++; break; } - //else: fall through + wxFALLTHROUGH; default: size = Size_Default; diff --git a/src/common/textbuf.cpp b/src/common/textbuf.cpp index 406043e58e..4a45c9444a 100644 --- a/src/common/textbuf.cpp +++ b/src/common/textbuf.cpp @@ -52,7 +52,7 @@ const wxChar *wxTextBuffer::GetEOL(wxTextFileType type) switch ( type ) { default: wxFAIL_MSG(wxT("bad buffer type in wxTextBuffer::GetEOL.")); - // fall through nevertheless - we must return something... + wxFALLTHROUGH; // fall through nevertheless - we must return something... case wxTextFileType_None: return wxEmptyString; case wxTextFileType_Unix: return wxT("\n"); diff --git a/src/common/textfile.cpp b/src/common/textfile.cpp index 6cb4e68783..67983e6a99 100644 --- a/src/common/textfile.cpp +++ b/src/common/textfile.cpp @@ -64,7 +64,7 @@ bool wxTextFile::OnOpen(const wxString &strBufferName, wxTextBufferOpenMode Open { default: wxFAIL_MSG( wxT("unknown open mode in wxTextFile::Open") ); - // fall through + wxFALLTHROUGH; case ReadAccess : FileOpenMode = wxFile::read; diff --git a/src/common/tokenzr.cpp b/src/common/tokenzr.cpp index 9d7926919b..50e08672ac 100644 --- a/src/common/tokenzr.cpp +++ b/src/common/tokenzr.cpp @@ -190,7 +190,7 @@ bool wxStringTokenizer::DoHasMoreTokens() const case wxTOKEN_INVALID: case wxTOKEN_DEFAULT: wxFAIL_MSG( wxT("unexpected tokenizer mode") ); - // fall through + wxFALLTHROUGH; case wxTOKEN_STRTOK: // never return empty delimiters diff --git a/src/common/treebase.cpp b/src/common/treebase.cpp index 7283ea3981..7ca9427e7b 100644 --- a/src/common/treebase.cpp +++ b/src/common/treebase.cpp @@ -359,7 +359,7 @@ void wxTreeCtrlBase::OnCharHook(wxKeyEvent& event) { case WXK_ESCAPE: discardChanges = true; - // fall through + wxFALLTHROUGH; case WXK_RETURN: EndEditLabel(GetFocusedItem(), discardChanges); diff --git a/src/common/txtstrm.cpp b/src/common/txtstrm.cpp index ca786620e7..dd3f3eefcd 100644 --- a/src/common/txtstrm.cpp +++ b/src/common/txtstrm.cpp @@ -92,7 +92,7 @@ wxChar wxTextInputStream::NextChar() // loop iteration we shouldn't be able to decode 2 or more of // them with an extra single byte, something fishy is going on wxFAIL_MSG("unexpected decoding result"); - // fall through nevertheless and return at least something + wxFALLTHROUGH;// fall through nevertheless and return at least something case 1: // we finally decoded a character @@ -457,7 +457,7 @@ void wxTextOutputStream::WriteString(const wxString& string) default: wxFAIL_MSG( wxT("unknown EOL mode in wxTextOutputStream") ); - // fall through + wxFALLTHROUGH; case wxEOL_UNIX: // don't treat '\n' specially diff --git a/src/generic/calctrlg.cpp b/src/generic/calctrlg.cpp index ae814e767b..352f867412 100644 --- a/src/generic/calctrlg.cpp +++ b/src/generic/calctrlg.cpp @@ -1378,7 +1378,7 @@ void wxGenericCalendarCtrl::OnClick(wxMouseEvent& event) default: wxFAIL_MSG(wxT("unknown hittest code")); - // fall through + wxFALLTHROUGH; case wxCAL_HITTEST_NOWHERE: event.Skip(); diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index c4fe5662b2..6030c7fb28 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -4958,7 +4958,7 @@ void wxGrid::OnKeyDown( wxKeyEvent& event ) MoveCursorRight(false); break; } - //else: fall through + wxFALLTHROUGH; default: event.Skip(); @@ -5173,7 +5173,7 @@ wxGrid::UpdateBlockBeingSelected(int topRow, int leftCol, { default: wxFAIL_MSG( "unknown selection mode" ); - // fall through + wxFALLTHROUGH; case wxGridSelectCells: // arbitrary blocks selection allowed so just use the cell diff --git a/src/generic/gridsel.cpp b/src/generic/gridsel.cpp index e79f7f2031..c6cf59f389 100644 --- a/src/generic/gridsel.cpp +++ b/src/generic/gridsel.cpp @@ -379,7 +379,7 @@ void wxGridSelection::SelectBlock( int topRow, int leftCol, { default: wxFAIL_MSG( "unknown selection mode" ); - // fall through + wxFALLTHROUGH; case wxGrid::wxGridSelectCells: // nothing to do -- in this mode arbitrary blocks can be selected diff --git a/src/generic/infobar.cpp b/src/generic/infobar.cpp index 3ae926223a..4da119c55a 100644 --- a/src/generic/infobar.cpp +++ b/src/generic/infobar.cpp @@ -154,7 +154,7 @@ wxShowEffect wxInfoBarGeneric::GetShowEffect() const default: wxFAIL_MSG( "unknown info bar placement" ); - // fall through + wxFALLTHROUGH; case BarPlacement_Unknown: return wxSHOW_EFFECT_NONE; @@ -176,7 +176,7 @@ wxShowEffect wxInfoBarGeneric::GetHideEffect() const default: wxFAIL_MSG( "unknown info bar placement" ); - // fall through + wxFALLTHROUGH; case BarPlacement_Unknown: return wxSHOW_EFFECT_NONE; diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 4079194002..04c2a0d082 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -1110,7 +1110,7 @@ void wxListHeaderWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) { default: wxFAIL_MSG( wxT("unknown list item format") ); - // fall through + wxFALLTHROUGH; case wxLIST_FORMAT_LEFT: xAligned = x; diff --git a/src/generic/logg.cpp b/src/generic/logg.cpp index 600db2a3e4..9b35e5e10d 100644 --- a/src/generic/logg.cpp +++ b/src/generic/logg.cpp @@ -238,7 +238,7 @@ wxString wxLogGui::GetTitle() const default: wxFAIL_MSG( "unexpected icon severity" ); - // fall through + wxFALLTHROUGH; case wxICON_INFORMATION: titleFormat = _("%s Information"); @@ -396,7 +396,7 @@ void wxLogGui::DoLogRecord(wxLogLevel level, #endif // wxUSE_LOG_DIALOG m_bErrors = true; } - // fall through + wxFALLTHROUGH; case wxLOG_Warning: if ( !m_bErrors ) { diff --git a/src/generic/scrlwing.cpp b/src/generic/scrlwing.cpp index d3256ed378..ff248ce2d1 100644 --- a/src/generic/scrlwing.cpp +++ b/src/generic/scrlwing.cpp @@ -882,7 +882,7 @@ void wxAnyScrollHelperBase::HandleOnChar(wxKeyEvent& event) case WXK_LEFT: newEvent.SetOrientation(wxHORIZONTAL); - // fall through + wxFALLTHROUGH; case WXK_UP: newEvent.SetEventType(wxEVT_SCROLLWIN_LINEUP); @@ -890,7 +890,7 @@ void wxAnyScrollHelperBase::HandleOnChar(wxKeyEvent& event) case WXK_RIGHT: newEvent.SetOrientation(wxHORIZONTAL); - // fall through + wxFALLTHROUGH; case WXK_DOWN: newEvent.SetEventType(wxEVT_SCROLLWIN_LINEDOWN); @@ -1292,7 +1292,7 @@ wxScrollHelper::DoAdjustScrollbar(int orient, default: wxFAIL_MSG( wxS("unknown scrollbar visibility") ); - // fall through + wxFALLTHROUGH; case wxSHOW_SB_DEFAULT: range = scrollUnits; diff --git a/src/generic/spinctlg.cpp b/src/generic/spinctlg.cpp index cc88bf177f..95ff8c966b 100644 --- a/src/generic/spinctlg.cpp +++ b/src/generic/spinctlg.cpp @@ -680,7 +680,7 @@ wxString wxSpinCtrl::DoValueToText(double val) default: wxFAIL_MSG( wxS("Unsupported spin control base") ); - // Fall through + wxFALLTHROUGH; case 10: return wxString::Format("%ld", static_cast(val)); diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index da1c4dcb01..6e49cdf008 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -3122,7 +3122,7 @@ void wxGenericTreeCtrl::OnChar( wxKeyEvent &event ) ExpandAllChildren(m_current); break; } - //else: fall through to Collapse() it + wxFALLTHROUGH;//else: fall through to Collapse() it case '-': case WXK_SUBTRACT: @@ -3236,7 +3236,7 @@ void wxGenericTreeCtrl::OnChar( wxKeyEvent &event ) //else: don't try to expand hidden root item (which can be the // current one when the tree is empty) - // fall through + wxFALLTHROUGH; case WXK_DOWN: { diff --git a/src/html/helpwnd.cpp b/src/html/helpwnd.cpp index 0496a078ee..73db426634 100644 --- a/src/html/helpwnd.cpp +++ b/src/html/helpwnd.cpp @@ -918,7 +918,7 @@ bool wxHtmlHelpWindow::KeywordSearch(const wxString& keyword, { default: wxFAIL_MSG( wxT("unknown help search mode") ); - // fall back + wxFALLTHROUGH; case wxHELP_SEARCH_ALL: { diff --git a/src/html/htmltag.cpp b/src/html/htmltag.cpp index d507d5373a..7f6febb770 100644 --- a/src/html/htmltag.cpp +++ b/src/html/htmltag.cpp @@ -276,7 +276,7 @@ void wxHtmlTagsCache::QueryTag(const wxString::const_iterator& at, case wxHtmlCacheItem::Type_EndingTag: wxFAIL_MSG("QueryTag called for ending tag - can't be"); - // but if it does happen, fall through, better than crashing + wxFALLTHROUGH;// but if it does happen, fall through, better than crashing case wxHtmlCacheItem::Type_NoMatchingEndingTag: // If input HTML is invalid and there's no closing tag for this diff --git a/src/html/m_pre.cpp b/src/html/m_pre.cpp index cc0664f86a..ab8ac01cd0 100644 --- a/src/html/m_pre.cpp +++ b/src/html/m_pre.cpp @@ -57,7 +57,7 @@ static wxString LINKAGEMODE HtmlizeLinebreaks(const wxString& str) if ( j != end && *j == '\n' ) i = j; } - // fall through + wxFALLTHROUGH; case '\n': out << "
"; break; diff --git a/src/osx/cocoa/button.mm b/src/osx/cocoa/button.mm index fa542ac219..8566d8e07d 100644 --- a/src/osx/cocoa/button.mm +++ b/src/osx/cocoa/button.mm @@ -249,7 +249,7 @@ SetBezelStyleFromBorderFlags(NSButton *v, default: wxFAIL_MSG( "Unknown border style" ); - // fall through + wxFALLTHROUGH; case 0: case wxBORDER_STATIC: diff --git a/src/osx/cocoa/dataview.mm b/src/osx/cocoa/dataview.mm index f33a1a1b2d..2e55255af0 100644 --- a/src/osx/cocoa/dataview.mm +++ b/src/osx/cocoa/dataview.mm @@ -3338,7 +3338,7 @@ void wxDataViewColumn::SetWidth(int width) case wxCOL_WIDTH_DEFAULT: width = wxDVC_DEFAULT_WIDTH; - // fall through + wxFALLTHROUGH; default: [m_NativeDataPtr->GetNativeColumnPtr() setWidth:width]; diff --git a/src/osx/cocoa/menuitem.mm b/src/osx/cocoa/menuitem.mm index a29cbce960..df189aae79 100644 --- a/src/osx/cocoa/menuitem.mm +++ b/src/osx/cocoa/menuitem.mm @@ -173,28 +173,28 @@ void wxMacCocoaMenuItemSetAccelerator( NSMenuItem* menuItem, wxAcceleratorEntry* case WXK_NUMPAD_LEFT : modifiers |= NSNumericPadKeyMask; - // pass through + wxFALLTHROUGH; case WXK_LEFT : shortcut = NSLeftArrowFunctionKey ; break ; case WXK_NUMPAD_UP : modifiers |= NSNumericPadKeyMask; - // pass through + wxFALLTHROUGH; case WXK_UP : shortcut = NSUpArrowFunctionKey ; break ; case WXK_NUMPAD_RIGHT : modifiers |= NSNumericPadKeyMask; - // pass through + wxFALLTHROUGH; case WXK_RIGHT : shortcut = NSRightArrowFunctionKey ; break ; case WXK_NUMPAD_DOWN : modifiers |= NSNumericPadKeyMask; - // pass through + wxFALLTHROUGH; case WXK_DOWN : shortcut = NSDownArrowFunctionKey ; break ; diff --git a/src/osx/uiaction_osx.cpp b/src/osx/uiaction_osx.cpp index c916923a3f..78112ef07e 100644 --- a/src/osx/uiaction_osx.cpp +++ b/src/osx/uiaction_osx.cpp @@ -46,7 +46,7 @@ CGEventType CGEventTypeForMouseButton(int button, bool isDown) // want to check for invalid parameters so assert first default: wxFAIL_MSG("Unsupported button passed in."); - // fall back to the only known remaining case + wxFALLTHROUGH;// fall back to the only known remaining case case wxMOUSE_BTN_MIDDLE: return isDown ? kCGEventOtherMouseDown : kCGEventOtherMouseUp; @@ -69,7 +69,7 @@ CGEventType CGEventTypeForMouseDrag(int button) // want to check for invalid parameters so assert first default: wxFAIL_MSG("Unsupported button passed in."); - // fall back to the only known remaining case + wxFALLTHROUGH;// fall back to the only known remaining case case wxMOUSE_BTN_MIDDLE: return kCGEventOtherMouseDragged; @@ -92,7 +92,7 @@ CGMouseButton CGButtonForMouseButton(int button) // want to check for invalid parameters so assert first default: wxFAIL_MSG("Unsupported button passed in."); - // fall back to the only known remaining case + wxFALLTHROUGH;// fall back to the only known remaining case case wxMOUSE_BTN_MIDDLE: return kCGMouseButtonCenter; diff --git a/src/ribbon/art_msw.cpp b/src/ribbon/art_msw.cpp index 39cd79ca1a..2a25092a3e 100644 --- a/src/ribbon/art_msw.cpp +++ b/src/ribbon/art_msw.cpp @@ -3053,7 +3053,7 @@ bool wxRibbonMSWArtProvider::GetButtonBarButtonSize( break; case wxRIBBON_BUTTON_HYBRID: dropdown_region->SetX(dropdown_region->GetX() + text_size); - // no break + wxFALLTHROUGH;// no break case wxRIBBON_BUTTON_NORMAL: case wxRIBBON_BUTTON_TOGGLE: normal_region->SetWidth(normal_region->GetWidth() + text_size); diff --git a/src/ribbon/buttonbar.cpp b/src/ribbon/buttonbar.cpp index 47932ec4d4..ea13d73fe2 100644 --- a/src/ribbon/buttonbar.cpp +++ b/src/ribbon/buttonbar.cpp @@ -95,12 +95,14 @@ public: *size = wxRIBBON_BUTTONBAR_BUTTON_MEDIUM; break; } + wxFALLTHROUGH; case wxRIBBON_BUTTONBAR_BUTTON_MEDIUM: if(sizes[wxRIBBON_BUTTONBAR_BUTTON_SMALL].is_supported) { *size = wxRIBBON_BUTTONBAR_BUTTON_SMALL; break; } + wxFALLTHROUGH; case wxRIBBON_BUTTONBAR_BUTTON_SMALL: default: return false; diff --git a/src/stc/ScintillaWX.cpp b/src/stc/ScintillaWX.cpp index 0a6614d344..66c978d387 100644 --- a/src/stc/ScintillaWX.cpp +++ b/src/stc/ScintillaWX.cpp @@ -1005,13 +1005,13 @@ int ScintillaWX::DoKeyDown(const wxKeyEvent& evt, bool* consumed) case WXK_ESCAPE: key = SCK_ESCAPE; break; case WXK_BACK: key = SCK_BACK; break; case WXK_TAB: key = SCK_TAB; break; - case WXK_NUMPAD_ENTER: // fall through + case WXK_NUMPAD_ENTER: wxFALLTHROUGH; case WXK_RETURN: key = SCK_RETURN; break; - case WXK_ADD: // fall through + case WXK_ADD: wxFALLTHROUGH; case WXK_NUMPAD_ADD: key = SCK_ADD; break; - case WXK_SUBTRACT: // fall through + case WXK_SUBTRACT: wxFALLTHROUGH; case WXK_NUMPAD_SUBTRACT: key = SCK_SUBTRACT; break; - case WXK_DIVIDE: // fall through + case WXK_DIVIDE: wxFALLTHROUGH; case WXK_NUMPAD_DIVIDE: key = SCK_DIVIDE; break; case WXK_CONTROL: key = 0; break; case WXK_ALT: key = 0; break; diff --git a/src/unix/sockunix.cpp b/src/unix/sockunix.cpp index 7d47f18e95..af723e0dd9 100644 --- a/src/unix/sockunix.cpp +++ b/src/unix/sockunix.cpp @@ -178,7 +178,7 @@ void wxSocketImplUnix::OnReadWaiting() default: wxFAIL_MSG( "unexpected CheckForInput() return value" ); - // fall through + wxFALLTHROUGH; case -1: if ( GetLastError() == wxSOCKET_WOULDBLOCK ) diff --git a/src/unix/threadpsx.cpp b/src/unix/threadpsx.cpp index 2b57ca796b..36b461256a 100644 --- a/src/unix/threadpsx.cpp +++ b/src/unix/threadpsx.cpp @@ -237,7 +237,7 @@ wxMutexInternal::wxMutexInternal(wxMutexType mutexType) default: wxFAIL_MSG( wxT("unknown mutex type") ); - // fall through + wxFALLTHROUGH; case wxMUTEX_DEFAULT: err = pthread_mutex_init(&m_mutex, NULL); @@ -1543,7 +1543,7 @@ wxThreadError wxThread::Delete(ExitCode *rc, wxThreadWait WXUNUSED(waitMode)) // PthreadStart() m_internal->SignalRun(); - // fall through + wxFALLTHROUGH; case STATE_EXITED: // nothing to do @@ -1553,7 +1553,7 @@ wxThreadError wxThread::Delete(ExitCode *rc, wxThreadWait WXUNUSED(waitMode)) // resume the thread first m_internal->Resume(); - // fall through + wxFALLTHROUGH; default: if ( !isDetached ) @@ -1595,7 +1595,7 @@ wxThreadError wxThread::Kill() // resume the thread first Resume(); - // fall through + wxFALLTHROUGH; default: #ifdef HAVE_PTHREAD_CANCEL diff --git a/src/unix/utilsunx.cpp b/src/unix/utilsunx.cpp index 450966d1fe..9e7c15bb5c 100644 --- a/src/unix/utilsunx.cpp +++ b/src/unix/utilsunx.cpp @@ -305,14 +305,14 @@ bool wxPipeInputStream::CanRead() const { case -1: wxLogSysError(_("Impossible to get child process input")); - // fall through + wxFALLTHROUGH; case 0: return false; default: wxFAIL_MSG(wxT("unexpected select() return value")); - // still fall through + wxFALLTHROUGH; case 1: // input available -- or maybe not, as select() returns 1 when a @@ -346,7 +346,7 @@ size_t wxPipeOutputStream::OnSysWrite(const void *buffer, size_t size) #endif // do not treat it as an error m_file->ClearLastError(); - // fall through + wxFALLTHROUGH; // no error case 0: diff --git a/src/xrc/xmlres.cpp b/src/xrc/xmlres.cpp index b859f2bccc..06ca0c1c73 100644 --- a/src/xrc/xmlres.cpp +++ b/src/xrc/xmlres.cpp @@ -1560,7 +1560,7 @@ wxString wxXmlResourceHandlerImpl::GetText(const wxString& param, bool translate str2 << wxT('\\'); break; } - // else fall-through to default: branch below + wxFALLTHROUGH;// else fall-through to default: branch below default: str2 << wxT('\\') << *dt;