From c66761f98d8c64e2b20dd3a0f7a33be5880c6b47 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 12 May 2016 14:17:48 +0200 Subject: Silence -Werror,-Wimplicit-fallthrough under NDEBUG Change-Id: Iff742ad9a53086028049dd2df3bf63303c32c317 --- unotools/source/i18n/textsearch.cxx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'unotools') diff --git a/unotools/source/i18n/textsearch.cxx b/unotools/source/i18n/textsearch.cxx index f61ad1841039..fa520d0d3a3e 100644 --- a/unotools/source/i18n/textsearch.cxx +++ b/unotools/source/i18n/textsearch.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include + +#include + #include #include #include @@ -163,12 +167,11 @@ css::util::SearchOptions2 TextSearch::UpgradeToSearchOptions2( const css::util:: case SearchAlgorithms_APPROXIMATE: nAlgorithmType2 = SearchAlgorithms2::APPROXIMATE; break; - default: - assert(!"utl::TextSearch::UpgradeToSearchOptions2 - default what?"); - // fallthru case SearchAlgorithms_ABSOLUTE: nAlgorithmType2 = SearchAlgorithms2::ABSOLUTE; break; + default: + for (;;) std::abort(); } // It would be nice if an inherited struct had a ctor that takes an // instance of the object the struct derived from.. @@ -222,15 +225,15 @@ void TextSearch::Init( const SearchParam & rParam, aSOpt.searchFlag |= SearchFlags::LEV_RELAXED; break; - default: - assert(!"utl::TextSearch::Init - default what?"); - // fallthru case SearchParam::SRCH_NORMAL: aSOpt.AlgorithmType2 = SearchAlgorithms2::ABSOLUTE; aSOpt.algorithmType = SearchAlgorithms_ABSOLUTE; if( rParam.IsSrchWordOnly() ) aSOpt.searchFlag |= SearchFlags::NORM_WORD_ONLY; break; + + default: + for (;;) std::abort(); } aSOpt.searchString = rParam.GetSrchStr(); aSOpt.replaceString = rParam.GetReplaceStr(); -- cgit