diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-05-10 16:42:16 +0200 |
---|---|---|
committer | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2016-07-20 01:26:06 -0400 |
commit | e7b11300cd813f821d1ec5cb4633ce2c5f7d1b9f (patch) | |
tree | a6c39d9d4cde1baa84a9d788affbce3508af89a8 /tools | |
parent | 34f591ca95c4c63be092da4c4b2294230404f336 (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.
(cherry picked from commit 14cd5182c5f64c43581c82db8c958369152226ac)
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 771c3bbce588..60ce75146316 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -4681,7 +4681,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); @@ -4726,7 +4726,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 b04fc17d6a1e..cc664c21ebbc 100644 --- a/tools/source/inet/inetmime.cxx +++ b/tools/source/inet/inetmime.cxx @@ -1201,8 +1201,8 @@ void INetMIMEEncodedWordOutputSink::finish(bool bWriteTrailer) m_rSink << '_'; } m_rSink << "?="; + SAL_FALLTHROUGH; } - //fall-through case CODING_ENCODED_TERMINATED: m_rSink << ' '; break; |