Fix fallthrough warnings

fix #1019
This commit is contained in:
Benjamin Roland Buch
2018-02-13 11:54:44 +01:00
committed by Vinnie Falco
parent ab32400d00
commit b7750de15f
4 changed files with 18 additions and 13 deletions

View File

@ -2,6 +2,7 @@ Version 155:
* Fix memory leak in advanced server examples * Fix memory leak in advanced server examples
* Fix soft-mutex assert in websocket stream * Fix soft-mutex assert in websocket stream
* Fix fallthrough warnings
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------

View File

@ -216,6 +216,8 @@ next(error_code& ec, Visit&& visit)
go_header_only_c: go_header_only_c:
v_.template emplace<1>(fwr_->get()); v_.template emplace<1>(fwr_->get());
s_ = do_header_only_c; s_ = do_header_only_c;
BOOST_FALLTHROUGH;
case do_header_only_c: case do_header_only_c:
do_visit<1>(ec, visit); do_visit<1>(ec, visit);
break; break;

View File

@ -186,12 +186,12 @@ mask_inplace_fast(
std::uintptr_t>(p) & (sizeof(key)-1); std::uintptr_t>(p) & (sizeof(key)-1);
switch(i) switch(i)
{ {
case 1: p[6] ^= static_cast<std::uint8_t>(key >> 48); case 1: p[6] ^= static_cast<std::uint8_t>(key >> 48); BOOST_FALLTHROUGH;
case 2: p[5] ^= static_cast<std::uint8_t>(key >> 40); case 2: p[5] ^= static_cast<std::uint8_t>(key >> 40); BOOST_FALLTHROUGH;
case 3: p[4] ^= static_cast<std::uint8_t>(key >> 32); case 3: p[4] ^= static_cast<std::uint8_t>(key >> 32); BOOST_FALLTHROUGH;
case 4: p[3] ^= static_cast<std::uint8_t>(key >> 24); case 4: p[3] ^= static_cast<std::uint8_t>(key >> 24); BOOST_FALLTHROUGH;
case 5: p[2] ^= static_cast<std::uint8_t>(key >> 16); case 5: p[2] ^= static_cast<std::uint8_t>(key >> 16); BOOST_FALLTHROUGH;
case 6: p[1] ^= static_cast<std::uint8_t>(key >> 8); case 6: p[1] ^= static_cast<std::uint8_t>(key >> 8); BOOST_FALLTHROUGH;
case 7: p[0] ^= static_cast<std::uint8_t>(key); case 7: p[0] ^= static_cast<std::uint8_t>(key);
{ {
auto const d = static_cast< auto const d = static_cast<
@ -199,6 +199,7 @@ mask_inplace_fast(
key = ror(key, 8*d); key = ror(key, 8*d);
n -= d; n -= d;
p += d; p += d;
BOOST_FALLTHROUGH;
} }
default: default:
break; break;
@ -217,14 +218,15 @@ mask_inplace_fast(
n &= sizeof(key)-1; n &= sizeof(key)-1;
switch(n) switch(n)
{ {
case 7: p[6] ^= static_cast<std::uint8_t>(key >> 48); case 7: p[6] ^= static_cast<std::uint8_t>(key >> 48); BOOST_FALLTHROUGH;
case 6: p[5] ^= static_cast<std::uint8_t>(key >> 40); case 6: p[5] ^= static_cast<std::uint8_t>(key >> 40); BOOST_FALLTHROUGH;
case 5: p[4] ^= static_cast<std::uint8_t>(key >> 32); case 5: p[4] ^= static_cast<std::uint8_t>(key >> 32); BOOST_FALLTHROUGH;
case 4: p[3] ^= static_cast<std::uint8_t>(key >> 24); case 4: p[3] ^= static_cast<std::uint8_t>(key >> 24); BOOST_FALLTHROUGH;
case 3: p[2] ^= static_cast<std::uint8_t>(key >> 16); case 3: p[2] ^= static_cast<std::uint8_t>(key >> 16); BOOST_FALLTHROUGH;
case 2: p[1] ^= static_cast<std::uint8_t>(key >> 8); case 2: p[1] ^= static_cast<std::uint8_t>(key >> 8); BOOST_FALLTHROUGH;
case 1: p[0] ^= static_cast<std::uint8_t>(key); case 1: p[0] ^= static_cast<std::uint8_t>(key);
key = ror(key, static_cast<unsigned>(8*n)); key = ror(key, static_cast<unsigned>(8*n));
BOOST_FALLTHROUGH;
default: default:
break; break;
} }

View File

@ -110,7 +110,7 @@ operator()(error_code ec, std::size_t)
break; break;
case 2: case 2:
step_ = 3; step_ = 3; BOOST_FALLTHROUGH;
case 3: case 3:
if(ec != boost::asio::error::would_block) if(ec != boost::asio::error::would_block)