diff --git a/CHANGELOG.md b/CHANGELOG.md index 41aa4719..cb95ccb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +Version 130: + +* Tidy up fallthrough warning + +-------------------------------------------------------------------------------- + Version 129: * Add autobahn test report to doc diff --git a/include/boost/beast/http/impl/serializer.ipp b/include/boost/beast/http/impl/serializer.ipp index c57cdd5a..11cf8578 100644 --- a/include/boost/beast/http/impl/serializer.ipp +++ b/include/boost/beast/http/impl/serializer.ipp @@ -113,6 +113,7 @@ next(error_code& ec, Visit&& visit) go_header_only: v_.template emplace<1>(frd_->get()); s_ = do_header_only; + BOOST_BEAST_FALLTHROUGH; case do_header_only: do_visit<1>(ec, visit); break; @@ -140,8 +141,9 @@ next(error_code& ec, Visit&& visit) //---------------------------------------------------------------------- - go_init_c: - s_ = do_init_c; + go_init_c: + s_ = do_init_c; + BOOST_BEAST_FALLTHROUGH; case do_init_c: { rd_.init(ec); @@ -240,12 +242,14 @@ next(error_code& ec, Visit&& visit) go_body_final_c: s_ = do_body_final_c; + BOOST_BEAST_FALLTHROUGH; case do_body_final_c: do_visit<6>(ec, visit); break; go_all_c: s_ = do_all_c; + BOOST_BEAST_FALLTHROUGH; case do_all_c: do_visit<7>(ec, visit); break; diff --git a/include/boost/beast/websocket/detail/mask.hpp b/include/boost/beast/websocket/detail/mask.hpp index e5729aa2..92ea0a42 100644 --- a/include/boost/beast/websocket/detail/mask.hpp +++ b/include/boost/beast/websocket/detail/mask.hpp @@ -10,6 +10,7 @@ #ifndef BOOST_BEAST_WEBSOCKET_DETAIL_MASK_HPP #define BOOST_BEAST_WEBSOCKET_DETAIL_MASK_HPP +#include #include #include #include @@ -131,15 +132,15 @@ mask_inplace_fast( std::uintptr_t>(p) & (sizeof(key)-1); switch(i) { - case 1: p[2] ^= static_cast(key >> 16); - case 2: p[1] ^= static_cast(key >> 8); + case 1: p[2] ^= static_cast(key >> 16); BOOST_BEAST_FALLTHROUGH; + case 2: p[1] ^= static_cast(key >> 8); BOOST_BEAST_FALLTHROUGH; case 3: p[0] ^= static_cast(key); { - auto const d = static_cast< - unsigned>(sizeof(key) - i); + auto const d = static_cast(sizeof(key) - i); key = ror(key, 8*d); n -= d; p += d; + BOOST_BEAST_FALLTHROUGH; } default: break; @@ -158,10 +159,11 @@ mask_inplace_fast( n &= sizeof(key)-1; switch(n) { - case 3: p[2] ^= static_cast(key >> 16); - case 2: p[1] ^= static_cast(key >> 8); + case 3: p[2] ^= static_cast(key >> 16); BOOST_BEAST_FALLTHROUGH; + case 2: p[1] ^= static_cast(key >> 8); BOOST_BEAST_FALLTHROUGH; case 1: p[0] ^= static_cast(key); key = ror(key, static_cast(8*n)); + BOOST_BEAST_FALLTHROUGH; default: break; } diff --git a/include/boost/beast/websocket/detail/utf8_checker.hpp b/include/boost/beast/websocket/detail/utf8_checker.hpp index 8db2f6c3..e86310f0 100644 --- a/include/boost/beast/websocket/detail/utf8_checker.hpp +++ b/include/boost/beast/websocket/detail/utf8_checker.hpp @@ -160,7 +160,6 @@ write(std::uint8_t const* in, std::size_t size) BOOST_BEAST_FALLTHROUGH; case 3: cp_[3] = 0x81; - BOOST_BEAST_FALLTHROUGH; break; } std::uint8_t const* p = cp_; diff --git a/include/boost/beast/zlib/detail/inflate_stream.hpp b/include/boost/beast/zlib/detail/inflate_stream.hpp index cf6e2b8b..57be1723 100644 --- a/include/boost/beast/zlib/detail/inflate_stream.hpp +++ b/include/boost/beast/zlib/detail/inflate_stream.hpp @@ -380,12 +380,12 @@ doWrite(z_params& zs, Flush flush, error_code& ec) mode_ = COPY_; if(flush == Flush::trees) return done(); - // fall through + BOOST_BEAST_FALLTHROUGH; } case COPY_: mode_ = COPY; - // fall through + BOOST_BEAST_FALLTHROUGH; case COPY: { @@ -419,7 +419,7 @@ doWrite(z_params& zs, Flush flush, error_code& ec) return err(error::too_many_symbols); have_ = 0; mode_ = LENLENS; - // fall through + BOOST_BEAST_FALLTHROUGH; case LENLENS: { @@ -447,7 +447,7 @@ doWrite(z_params& zs, Flush flush, error_code& ec) } have_ = 0; mode_ = CODELENS; - // fall through + BOOST_BEAST_FALLTHROUGH; } case CODELENS: @@ -536,12 +536,12 @@ doWrite(z_params& zs, Flush flush, error_code& ec) mode_ = LEN_; if(flush == Flush::trees) return done(); - // fall through + BOOST_BEAST_FALLTHROUGH; } case LEN_: mode_ = LEN; - // fall through + BOOST_BEAST_FALLTHROUGH; case LEN: { @@ -594,7 +594,7 @@ doWrite(z_params& zs, Flush flush, error_code& ec) return err(error::invalid_literal_length); extra_ = cp->op & 15; mode_ = LENEXT; - // fall through + BOOST_BEAST_FALLTHROUGH; } case LENEXT: @@ -609,7 +609,7 @@ doWrite(z_params& zs, Flush flush, error_code& ec) } was_ = length_; mode_ = DIST; - // fall through + BOOST_BEAST_FALLTHROUGH; case DIST: { @@ -638,7 +638,7 @@ doWrite(z_params& zs, Flush flush, error_code& ec) offset_ = cp->val; extra_ = cp->op & 15; mode_ = DISTEXT; - // fall through + BOOST_BEAST_FALLTHROUGH; } case DISTEXT: @@ -656,7 +656,7 @@ doWrite(z_params& zs, Flush flush, error_code& ec) return err(error::invalid_distance); #endif mode_ = MATCH; - // fall through + BOOST_BEAST_FALLTHROUGH; case MATCH: { @@ -701,7 +701,7 @@ doWrite(z_params& zs, Flush flush, error_code& ec) case CHECK: mode_ = DONE; - // fall through + BOOST_BEAST_FALLTHROUGH; case DONE: ec = error::end_of_stream;