diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-05-10 15:25:12 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-05-10 15:25:12 +0200 |
commit | fcbd824f1b45ae7242cd7b86e98b5d947441759e (patch) | |
tree | 0589a837d2e4e1463fafd49efa10c1f060d3aa76 | |
parent | a0d546cdcad435bdabd007b4921043716be6e2b5 (diff) |
Use BOOST_FALLTHROUGH in external code
...in preparation of enabling Clang's -Wimplicit-fallthrough
Change-Id: If64f9b18591b3cd2528adc6c2d6011d509d4afcd
-rw-r--r-- | external/boost/UnpackedTarball_boost.mk | 2 | ||||
-rw-r--r-- | external/boost/fallthrough.patch.0 | 26 | ||||
-rw-r--r-- | mysqlc/source/mysqlc_preparedstatement.cxx | 4 |
3 files changed, 30 insertions, 2 deletions
diff --git a/external/boost/UnpackedTarball_boost.mk b/external/boost/UnpackedTarball_boost.mk index a97964b0940a..35f77ad6a61d 100644 --- a/external/boost/UnpackedTarball_boost.mk +++ b/external/boost/UnpackedTarball_boost.mk @@ -84,6 +84,8 @@ boost_patches += boost_1_60_0.undef.warning.patch boost_patches += boost.wdeprecated-auto_ptr.patch.0 boost_patches += boost_1_60_0.android.undef.warning.patch +boost_patches += fallthrough.patch.0 + $(eval $(call gb_UnpackedTarball_UnpackedTarball,boost)) $(eval $(call gb_UnpackedTarball_set_tarball,boost,$(BOOST_TARBALL))) diff --git a/external/boost/fallthrough.patch.0 b/external/boost/fallthrough.patch.0 new file mode 100644 index 000000000000..f8985bd7a9f0 --- /dev/null +++ b/external/boost/fallthrough.patch.0 @@ -0,0 +1,26 @@ +--- boost/format/parsing.hpp ++++ boost/format/parsing.hpp +@@ -267,6 +267,7 @@ + switch ( wrap_narrow(fac, *start, 0) ) { + case 'X': + fpar->fmtstate_.flags_ |= std::ios_base::uppercase; ++ BOOST_FALLTHROUGH; + case 'p': // pointer => set hex. + case 'x': + fpar->fmtstate_.flags_ &= ~std::ios_base::basefield; +@@ -280,6 +281,7 @@ + + case 'E': + fpar->fmtstate_.flags_ |= std::ios_base::uppercase; ++ BOOST_FALLTHROUGH; + case 'e': + fpar->fmtstate_.flags_ &= ~std::ios_base::floatfield; + fpar->fmtstate_.flags_ |= std::ios_base::scientific; +@@ -291,6 +293,7 @@ + case 'f': + fpar->fmtstate_.flags_ &= ~std::ios_base::floatfield; + fpar->fmtstate_.flags_ |= std::ios_base::fixed; ++ BOOST_FALLTHROUGH; + case 'u': + case 'd': + case 'i': diff --git a/mysqlc/source/mysqlc_preparedstatement.cxx b/mysqlc/source/mysqlc_preparedstatement.cxx index a0d3f8ff5625..81224246f926 100644 --- a/mysqlc/source/mysqlc_preparedstatement.cxx +++ b/mysqlc/source/mysqlc_preparedstatement.cxx @@ -564,8 +564,8 @@ void SAL_CALL OPreparedStatement::setObjectWithInfo(sal_Int32 _parameterIndex, c setDouble( _parameterIndex, nValue ); break; } + BOOST_FALLTHROUGH; } - // run through case DataType::CHAR: case DataType::VARCHAR: @@ -591,8 +591,8 @@ void SAL_CALL OPreparedStatement::setObjectWithInfo(sal_Int32 _parameterIndex, c setFloat(_parameterIndex,nValue); break; } + BOOST_FALLTHROUGH; } - // run through if we couldn't set a float value case DataType::DOUBLE: { |