From da78f3cec4554bc6ea10a27315387d3b8a309a61 Mon Sep 17 00:00:00 2001 From: seelabs Date: Tue, 10 May 2016 21:21:19 -0400 Subject: [PATCH] Tidying and fix warnings --- CMakeLists.txt | 2 +- extras/beast/test/yield_to.hpp | 4 ++-- extras/beast/unit_test/suite.hpp | 2 +- include/beast/http/detail/basic_parser_v1.hpp | 2 +- include/beast/http/impl/write.ipp | 7 +++---- include/beast/http/message.hpp | 2 -- include/beast/websocket/detail/endian.hpp | 6 +++--- test/http/basic_parser_v1.cpp | 11 +++++----- test/http/message.cpp | 10 +++++----- test/http/read.cpp | 20 +++++++++---------- test/http/write.cpp | 2 +- test/websocket/detail/frame.cpp | 2 +- test/websocket/stream.cpp | 1 - 13 files changed, 33 insertions(+), 38 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d6850aa5..956f7133 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ else() find_package(Threads) set(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} -g -std=c++11 -Wall -Wextra -Wpedantic -Wconversion -Wno-unused-variable") + "${CMAKE_CXX_FLAGS} -g -std=c++11 -Wall -Wpedantic") endif() message ("cxx Flags: " ${CMAKE_CXX_FLAGS}) diff --git a/extras/beast/test/yield_to.hpp b/extras/beast/test/yield_to.hpp index 114efe7e..5c4d3c01 100644 --- a/extras/beast/test/yield_to.hpp +++ b/extras/beast/test/yield_to.hpp @@ -35,7 +35,7 @@ private: std::thread thread_; std::mutex m_; std::condition_variable cv_; - bool running_ = false;; + bool running_ = false; public: /// The type of yield context passed to functions. @@ -70,7 +70,7 @@ public: This call will block until the coroutine terminates. Function will be called with this signature: - + @code void f(yield_context); @endcode diff --git a/extras/beast/unit_test/suite.hpp b/extras/beast/unit_test/suite.hpp index 8d0e81f1..6ffa6eb2 100644 --- a/extras/beast/unit_test/suite.hpp +++ b/extras/beast/unit_test/suite.hpp @@ -543,7 +543,7 @@ suite::run (runner& r) #define BEAST_DEFINE_TESTSUITE_INSERT(Class,Module,Library,manual) \ static beast::unit_test::detail::insert_suite \ Library ## Module ## Class ## _test_instance ( \ - #Class, #Module, #Library, manual); + #Class, #Module, #Library, manual) //------------------------------------------------------------------------------ diff --git a/include/beast/http/detail/basic_parser_v1.hpp b/include/beast/http/detail/basic_parser_v1.hpp index ebb4040d..7568296d 100644 --- a/include/beast/http/detail/basic_parser_v1.hpp +++ b/include/beast/http/detail/basic_parser_v1.hpp @@ -146,7 +146,7 @@ unhex(char c) -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 // 112 }}; return tab[static_cast(c)]; -}; +} template struct parser_str_t diff --git a/include/beast/http/impl/write.ipp b/include/beast/http/impl/write.ipp index 72408558..8153dfc9 100644 --- a/include/beast/http/impl/write.ipp +++ b/include/beast/http/impl/write.ipp @@ -478,10 +478,9 @@ write(SyncWriteStream& stream, cv.notify_one(); }}; auto copy = resume; - boost::tribool result; - result = wp.w(std::move(copy), ec, - detail::writef0_lambda{ - stream, wp.sb, wp.chunked, ec}); + boost::tribool result = wp.w(std::move(copy), + ec, detail::writef0_lambda{stream, wp.sb, wp.chunked, ec}); if(ec) return; if(boost::indeterminate(result)) diff --git a/include/beast/http/message.hpp b/include/beast/http/message.hpp index 6b06816a..1be051c0 100644 --- a/include/beast/http/message.hpp +++ b/include/beast/http/message.hpp @@ -93,7 +93,6 @@ struct message @param v An argument forwarded to the headers constructor. */ template - explicit message(U&& u, V&& v) : headers(std::forward(v)) , body(std::forward(u)) @@ -118,7 +117,6 @@ struct message @param vn A tuple forwarded as a parameter pack to the headers constructor. */ template - explicit message(std::piecewise_construct_t, std::tuple&& un, std::tuple&& vn) : message(std::piecewise_construct, un, vn, diff --git a/include/beast/websocket/detail/endian.hpp b/include/beast/websocket/detail/endian.hpp index addfd60a..c4f21bd3 100644 --- a/include/beast/websocket/detail/endian.hpp +++ b/include/beast/websocket/detail/endian.hpp @@ -48,9 +48,9 @@ little_uint32_to_native(void const* buf) std::uint8_t const*>(buf); return p[0] + - (static_cast(p[1])<< 8) + - (static_cast(p[2])<<16) + - (static_cast(p[3])<<24); + (static_cast(p[1])<< 8) + + (static_cast(p[2])<<16) + + (static_cast(p[3])<<24); } inline diff --git a/test/http/basic_parser_v1.cpp b/test/http/basic_parser_v1.cpp index 145954db..99355e01 100644 --- a/test/http/basic_parser_v1.cpp +++ b/test/http/basic_parser_v1.cpp @@ -474,14 +474,14 @@ public: [](null_parser const&) { }); - + parse_ev( "GET / HTTP/1.0\r\n" "Content-Length: 1\r\n" "Content-Length: 2\r\n" "\r\n", parse_error::bad_content_length); - + parse_ev( "GET / HTTP/1.0\r\n" "Transfer-Encoding: chunked\r\n" @@ -489,7 +489,7 @@ public: "fffffffffffffffff\r\n" "0\r\n\r\n", parse_error::bad_content_length); - + parse_ev("GET / HTTP/1.0\r\nContent-Length: 1e9\r\n\r\n", parse_error::bad_content_length); @@ -533,9 +533,8 @@ public: { using boost::asio::buffer; std::string s; - std::size_t n; - for(n = 0;; ++n) + for(std::size_t n = 0;; ++n) { // Create a request and set one octet to an invalid char s = @@ -572,7 +571,7 @@ public: } } - for(n = 0;; ++n) + for(std::size_t n = 0;; ++n) { // Create a response and set one octet to an invalid char s = diff --git a/test/http/message.cpp b/test/http/message.cpp index 9152bfa7..6d46ed47 100644 --- a/test/http/message.cpp +++ b/test/http/message.cpp @@ -72,19 +72,19 @@ public: { static_assert(std::is_constructible< message>::value, ""); - + static_assert(std::is_constructible< message, Arg1>::value, ""); - + static_assert(std::is_constructible< message, Arg1 const>::value, ""); - + static_assert(std::is_constructible< message, Arg1 const&>::value, ""); - + static_assert(std::is_constructible< message, Arg1&&>::value, ""); - + static_assert(! std::is_constructible< message>::value, ""); diff --git a/test/http/read.cpp b/test/http/read.cpp index 49cf8dfe..5b8280ce 100644 --- a/test/http/read.cpp +++ b/test/http/read.cpp @@ -42,53 +42,53 @@ public: { fc_.fail(ec); } - + void on_method(boost::string_ref const&, error_code& ec) { fc_.fail(ec); } - + void on_uri(boost::string_ref const&, error_code& ec) { fc_.fail(ec); } - + void on_reason(boost::string_ref const&, error_code& ec) { fc_.fail(ec); } - + void on_request(error_code& ec) { fc_.fail(ec); } - + void on_response(error_code& ec) { fc_.fail(ec); } - + void on_field(boost::string_ref const&, error_code& ec) { fc_.fail(ec); } - + void on_value(boost::string_ref const&, error_code& ec) { fc_.fail(ec); } - + int on_headers(error_code& ec) { fc_.fail(ec); return 0; } - + void on_body(boost::string_ref const&, error_code& ec) { fc_.fail(ec); } - + void on_complete(error_code& ec) { fc_.fail(ec); diff --git a/test/http/write.cpp b/test/http/write.cpp index 883e1903..0143a795 100644 --- a/test/http/write.cpp +++ b/test/http/write.cpp @@ -34,7 +34,7 @@ public: class string_write_stream { boost::asio::io_service& ios_; - + public: std::string str; diff --git a/test/websocket/detail/frame.cpp b/test/websocket/detail/frame.cpp index 94b28800..30f38927 100644 --- a/test/websocket/detail/frame.cpp +++ b/test/websocket/detail/frame.cpp @@ -181,7 +181,7 @@ public: check(fh); } } - + void bad(std::initializer_list bs) { using boost::asio::buffer; diff --git a/test/websocket/stream.cpp b/test/websocket/stream.cpp index 67f3fea0..1d402f9d 100644 --- a/test/websocket/stream.cpp +++ b/test/websocket/stream.cpp @@ -481,7 +481,6 @@ public: { stream ws; - explicit con(endpoint_type const& ep, boost::asio::io_service& ios) : ws(ios) {