Tidy up fallthrough warning

This commit is contained in:
Vinnie Falco committed 2017-10-27 17:03:44 -07:00
1 parent 79bb602a20
commit 970daa340a
5 files changed
+31 -20

No files matched your search

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