diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-05-10 16:42:16 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-05-10 16:42:16 +0200 |
commit | 14cd5182c5f64c43581c82db8c958369152226ac (patch) | |
tree | 57f150ba2707f29214eeb9b1eaad2373780d1b15 /i18npool | |
parent | e4bb2b4f4875c15bd68297b5be716edd6859841e (diff) |
Replace fallthrough comments with new SAL_FALLTHROUGH macro
...which (in LIBO_INTERNAL_ONLY) for Clang expands to [[clang::fallthrough]] in
preparation of enabling -Wimplicit-fallthrough. (This is only relevant for
C++11, as neither C nor old C++ has a way to annotate intended fallthroughs.)
Could use BOOST_FALLTHROUGH instead of introducing our own SAL_FALLTHROUGH, but
that would require adding back in dependencies on boost_headers to many
libraries where we carefully removed any remaining Boost dependencies only
recently. (At least make SAL_FALLTHROUGH strictly LIBO_INTERNAL_ONLY, so its
future evolution will not have any impact on the stable URE interface.) C++17
will have a proper [[fallthroug]], eventually removing the need for a macro
altogether.
Change-Id: I342a7610a107db7d7a344ea9cbddfd9714d7e9ca
Diffstat (limited to 'i18npool')
7 files changed, 13 insertions, 13 deletions
diff --git a/i18npool/source/calendar/calendar_gregorian.cxx b/i18npool/source/calendar/calendar_gregorian.cxx index 5e24deebd877..fc470e109e8e 100644 --- a/i18npool/source/calendar/calendar_gregorian.cxx +++ b/i18npool/source/calendar/calendar_gregorian.cxx @@ -868,7 +868,7 @@ static sal_Int16 SAL_CALL NatNumForCalendar(const css::lang::Locale& aLocale, case NativeNumberMode::NATNUM4: if (isKorean) return isShort ? NativeNumberMode::NATNUM9 : NativeNumberMode::NATNUM11; - // fall through + SAL_FALLTHROUGH; default: return 0; } } @@ -1092,7 +1092,7 @@ Calendar_gregorian::getDisplayStringImpl( sal_Int32 nCalendarDisplayCode, sal_In switch( nCalendarDisplayCode ) { case CalendarDisplayCode::SHORT_MONTH: value += 1; // month is zero based - // fall through + SAL_FALLTHROUGH; case CalendarDisplayCode::SHORT_DAY: sprintf(aStr, "%d", value); // #100211# - checked break; diff --git a/i18npool/source/characterclassification/cclass_unicode_parser.cxx b/i18npool/source/characterclassification/cclass_unicode_parser.cxx index 2a6f9548eeda..94019c73d56f 100644 --- a/i18npool/source/characterclassification/cclass_unicode_parser.cxx +++ b/i18npool/source/characterclassification/cclass_unicode_parser.cxx @@ -372,7 +372,7 @@ sal_Int32 cclass_Unicode::getParseTokensType(sal_uInt32 const c, bool const isFi case U_OTHER_LETTER : // Non_Spacing_Mark could not be as leading character if (isFirst) break; - // fall through, treat it as Other_Letter. + SAL_FALLTHROUGH; // treat it as Other_Letter. case U_NON_SPACING_MARK : return KParseTokens::UNI_OTHER_LETTER; case U_DECIMAL_DIGIT_NUMBER : @@ -642,7 +642,7 @@ UPT_FLAG_TYPE cclass_Unicode::getFlagsExtended(sal_uInt32 const c) // nor can a spacing combining mark. if (bStart) return TOKEN_ILLEGAL; - // fall through, treat it as Other_Letter. + SAL_FALLTHROUGH; // treat it as Other_Letter. case U_OTHER_LETTER : return (nTypes & KParseTokens::UNI_OTHER_LETTER) ? (bStart ? TOKEN_CHAR_WORD : TOKEN_WORD) : @@ -890,7 +890,7 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32 break; case ssGetWordFirstChar : eState = ssGetWord; - // fall through + SAL_FALLTHROUGH; case ssGetWord : { if ( nMask & TOKEN_WORD ) diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx index f0c76e4da59f..5428d2a815b8 100644 --- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx +++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx @@ -318,8 +318,8 @@ OUString toRoman( sal_Int32 n ) } switch( nZahl ) { - case 3: sTmp.append(*cRomanStr); //no break! - case 2: sTmp.append(*cRomanStr); //no break! + case 3: sTmp.append(*cRomanStr); SAL_FALLTHROUGH; + case 2: sTmp.append(*cRomanStr); SAL_FALLTHROUGH; case 1: sTmp.append(*cRomanStr); break; case 4: sTmp.append(*cRomanStr).append(*(cRomanStr-nDiff)); break; case 5: sTmp.append(*(cRomanStr-nDiff)); break; diff --git a/i18npool/source/indexentry/indexentrysupplier_default.cxx b/i18npool/source/indexentry/indexentrysupplier_default.cxx index 72967bd1d5cd..6db7a116c0eb 100644 --- a/i18npool/source/indexentry/indexentrysupplier_default.cxx +++ b/i18npool/source/indexentry/indexentrysupplier_default.cxx @@ -214,7 +214,7 @@ void Index::makeIndexKeys(const lang::Locale &rLocale, const OUString &algorithm break; case sal_Unicode('{'): close = '}'; - //fall-through + SAL_FALLTHROUGH; case sal_Unicode('('): if (key_count > 0) { sal_Int16 end = i+1; diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx index a811fb211f64..840a0720d86c 100644 --- a/i18npool/source/localedata/LocaleNode.cxx +++ b/i18npool/source/localedata/LocaleNode.cxx @@ -784,7 +784,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const sTheCompatibleCurrency = aCode.copy( nStart + 2, nHyphen - nStart - 2); } } - // fallthru + SAL_FALLTHROUGH; case cssi::NumberFormatIndex::CURRENCY_1000INT : case cssi::NumberFormatIndex::CURRENCY_1000INT_RED : case cssi::NumberFormatIndex::CURRENCY_1000DEC2_RED : @@ -1117,7 +1117,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const // separators and generate a second pattern with the // format's separator at the current position. cDateSep2 = cChar; - // fallthru + SAL_FALLTHROUGH; default: handleDefault: if (!cDateSep) diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx index 06da7af10a73..5d42f0152c04 100644 --- a/i18npool/source/localedata/localedata.cxx +++ b/i18npool/source/localedata/localedata.cxx @@ -649,7 +649,7 @@ Sequence< CalendarItem2 > &LocaleDataImpl::getCalendarItemByName(const OUString& return ref_cal.PartitiveMonths; default: OSL_FAIL( "LocaleDataImpl::getCalendarItemByName: unhandled REF_* case"); - // fallthru + SAL_FALLTHROUGH; case REF_ERAS: return ref_cal.Eras; } diff --git a/i18npool/source/search/textsearch.cxx b/i18npool/source/search/textsearch.cxx index 5791ff6e2735..c71dea35a3dd 100644 --- a/i18npool/source/search/textsearch.cxx +++ b/i18npool/source/search/textsearch.cxx @@ -251,7 +251,7 @@ void TextSearch::setOptions2( const SearchOptions2& rOptions ) throw( RuntimeExc default: SAL_WARN("i18npool","TextSearch::setOptions2 - default what?"); - // fallthru + SAL_FALLTHROUGH; case SearchAlgorithms2::ABSOLUTE: fnForward = &TextSearch::NSrchFrwrd; fnBackward = &TextSearch::NSrchBkwrd; @@ -272,7 +272,7 @@ void TextSearch::setOptions( const SearchOptions& rOptions ) throw( RuntimeExcep break; default: SAL_WARN("i18npool","TextSearch::setOptions - default what?"); - // fallthru + SAL_FALLTHROUGH; case SearchAlgorithms_ABSOLUTE: nAlgorithmType2 = SearchAlgorithms2::ABSOLUTE; break; |