From 44d9eaba4d383a93340017fcd6ce83c67b76df0e Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Tue, 5 Feb 2019 08:24:26 -0800 Subject: [PATCH] Tidying --- include/boost/beast/http/detail/basic_parser.hpp | 4 ++-- include/boost/beast/http/serializer.hpp | 2 +- include/boost/beast/websocket/detail/impl/prng.ipp | 4 ++-- test/beast/core/basic_timeout_stream.cpp | 10 +++++----- test/beast/core/buffers_cat.cpp | 6 +++--- test/beast/http/span_body.cpp | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/boost/beast/http/detail/basic_parser.hpp b/include/boost/beast/http/detail/basic_parser.hpp index 782a2048..d2fa7e55 100644 --- a/include/boost/beast/http/detail/basic_parser.hpp +++ b/include/boost/beast/http/detail/basic_parser.hpp @@ -269,8 +269,8 @@ struct basic_parser_base if(BOOST_UNLIKELY(! is_print(*p))) if((BOOST_LIKELY(static_cast< unsigned char>(*p) < '\040') && - BOOST_LIKELY(*p != '\011')) || - BOOST_UNLIKELY(*p == '\177')) + BOOST_LIKELY(*p != 9)) || + BOOST_UNLIKELY(*p == 127)) goto found_control; } found_control: diff --git a/include/boost/beast/http/serializer.hpp b/include/boost/beast/http/serializer.hpp index 9b61a779..df7a7745 100644 --- a/include/boost/beast/http/serializer.hpp +++ b/include/boost/beast/http/serializer.hpp @@ -187,7 +187,7 @@ private: int s_ = do_construct; bool split_ = false; bool header_done_ = false; - bool more_; + bool more_ = false; public: /// Constructor diff --git a/include/boost/beast/websocket/detail/impl/prng.ipp b/include/boost/beast/websocket/detail/impl/prng.ipp index b9eb1f6f..dab0b9ef 100644 --- a/include/boost/beast/websocket/detail/impl/prng.ipp +++ b/include/boost/beast/websocket/detail/impl/prng.ipp @@ -122,7 +122,7 @@ make_prng_no_tls(bool secure) std::minstd_rand r_; public: - fast_prng* next; + fast_prng* next = nullptr; fast_prng() : r_([] @@ -166,7 +166,7 @@ make_prng_no_tls(bool secure) beast::detail::chacha<20> r_; public: - secure_prng* next; + secure_prng* next = nullptr; secure_prng() : r_(prng_seed(), [] diff --git a/test/beast/core/basic_timeout_stream.cpp b/test/beast/core/basic_timeout_stream.cpp index b1947e43..31ef5fa3 100644 --- a/test/beast/core/basic_timeout_stream.cpp +++ b/test/beast/core/basic_timeout_stream.cpp @@ -107,7 +107,7 @@ public: std::thread t_; void - fail(error_code ec, string_view what) + fail(error_code const& ec, string_view what) { if(ec != net::error::operation_aborted) log_ << what << ": " << ec.message() << "\n"; @@ -221,19 +221,19 @@ public: protected: void - on_read(error_code ec) + on_read(error_code const& ec) { boost::ignore_unused(ec); } void - on_write(error_code, std::size_t) + on_write(error_code const& , std::size_t) { } }; void - on_accept(error_code ec) + on_accept(error_code const& ec) { if(! acceptor_.is_open()) return; @@ -410,7 +410,7 @@ public: } void - operator()(error_code ec, std::size_t n) + operator()(error_code const& ec, std::size_t n) { BEAST_EXPECTS(ec == ec_, ec.message()); BEAST_EXPECT(n == n_); diff --git a/test/beast/core/buffers_cat.cpp b/test/beast/core/buffers_cat.cpp index f660d8fe..c48460a2 100644 --- a/test/beast/core/buffers_cat.cpp +++ b/test/beast/core/buffers_cat.cpp @@ -33,7 +33,7 @@ public: testDefaultIterators() { // default ctor is one past the end - char c[2]; + char c[2] = {}; auto bs = buffers_cat( net::const_buffer(&c[0], 1), net::const_buffer(&c[1], 1)); @@ -58,7 +58,7 @@ public: try { it = {}; - *it; + (void)*it; fail(); } catch(std::logic_error const&) @@ -114,7 +114,7 @@ public: checkException( [] { - *(type::const_iterator{}); + (void)*(type::const_iterator{}); }); // Incrementing a default-constructed iterator diff --git a/test/beast/http/span_body.cpp b/test/beast/http/span_body.cpp index 99b7323d..1c858091 100644 --- a/test/beast/http/span_body.cpp +++ b/test/beast/http/span_body.cpp @@ -47,7 +47,7 @@ struct span_body_test BEAST_EXPECT(! buf->second); } { - char buf[5]; + char buf[5] = {}; using B = span_body; request req; req.body() = span{buf, sizeof(buf)};