Tidy up fallthrough warning

This commit is contained in:
Vinnie Falco
2017-10-27 16:05:09 -07:00
parent 79bb602a20
commit 970daa340a
5 changed files with 31 additions and 20 deletions

View File

@ -1,3 +1,9 @@
Version 130:
* Tidy up fallthrough warning
--------------------------------------------------------------------------------
Version 129:
* Add autobahn test report to doc

View File

@ -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;

View File

@ -10,6 +10,7 @@
#ifndef BOOST_BEAST_WEBSOCKET_DETAIL_MASK_HPP
#define BOOST_BEAST_WEBSOCKET_DETAIL_MASK_HPP
#include <boost/beast/core/detail/config.hpp>
#include <boost/asio/buffer.hpp>
#include <array>
#include <climits>
@ -131,15 +132,15 @@ mask_inplace_fast(
std::uintptr_t>(p) & (sizeof(key)-1);
switch(i)
{
case 1: p[2] ^= static_cast<std::uint8_t>(key >> 16);
case 2: p[1] ^= static_cast<std::uint8_t>(key >> 8);
case 1: p[2] ^= static_cast<std::uint8_t>(key >> 16); BOOST_BEAST_FALLTHROUGH;
case 2: p[1] ^= static_cast<std::uint8_t>(key >> 8); BOOST_BEAST_FALLTHROUGH;
case 3: p[0] ^= static_cast<std::uint8_t>(key);
{
auto const d = static_cast<
unsigned>(sizeof(key) - i);
auto const d = static_cast<unsigned>(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<std::uint8_t>(key >> 16);
case 2: p[1] ^= static_cast<std::uint8_t>(key >> 8);
case 3: p[2] ^= static_cast<std::uint8_t>(key >> 16); BOOST_BEAST_FALLTHROUGH;
case 2: p[1] ^= static_cast<std::uint8_t>(key >> 8); BOOST_BEAST_FALLTHROUGH;
case 1: p[0] ^= static_cast<std::uint8_t>(key);
key = ror(key, static_cast<unsigned>(8*n));
BOOST_BEAST_FALLTHROUGH;
default:
break;
}

View File

@ -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_;

View File

@ -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;