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 /tools | |
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 'tools')
-rw-r--r-- | tools/source/fsys/urlobj.cxx | 4 | ||||
-rw-r--r-- | tools/source/fsys/wldcrd.cxx | 6 | ||||
-rw-r--r-- | tools/source/inet/inetmime.cxx | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx index 8f869d869329..41761d9724b7 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -4620,7 +4620,7 @@ void INetURLObject::appendUCS4(OUStringBuffer& rTheText, sal_uInt32 nUCS4, { default: OSL_FAIL("INetURLObject::appendUCS4(): Unsupported charset"); - //fallthrough + SAL_FALLTHROUGH; case RTL_TEXTENCODING_ASCII_US: case RTL_TEXTENCODING_ISO_8859_1: appendEscape(rTheText, nUCS4); @@ -4665,7 +4665,7 @@ sal_uInt32 INetURLObject::getUTF32(sal_Unicode const *& rBegin, default: OSL_FAIL( "INetURLObject::getUTF32(): Unsupported charset"); - //fall-through + SAL_FALLTHROUGH; case RTL_TEXTENCODING_ASCII_US: rEscapeType = rtl::isAscii(nUTF32) ? ESCAPE_UTF32 : ESCAPE_OCTET; diff --git a/tools/source/fsys/wldcrd.cxx b/tools/source/fsys/wldcrd.cxx index 4adfb7c3850e..c0750b7098b1 100644 --- a/tools/source/fsys/wldcrd.cxx +++ b/tools/source/fsys/wldcrd.cxx @@ -48,8 +48,10 @@ bool WildCard::ImpMatch( const char *pWild, const char *pStr ) else pWild += pos; else - break; // WARNING: may cause execution of next case - // in some circumstances! + break; + // WARNING/TODO: may cause execution of next case in some + // circumstances! + SAL_FALLTHROUGH; case '*': while ( *pWild == '*' ) pWild++; diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx index d530500a41c2..ce123e8bd49e 100644 --- a/tools/source/inet/inetmime.cxx +++ b/tools/source/inet/inetmime.cxx @@ -1193,8 +1193,8 @@ void INetMIMEEncodedWordOutputSink::finish(bool bWriteTrailer) m_rSink << '_'; } m_rSink << "?="; + SAL_FALLTHROUGH; } - //fall-through case CODING_ENCODED_TERMINATED: m_rSink << ' '; break; |