Skip to content

Commit 6349c11

Browse files
committed
clang-tidy modernize-.* all the things
1 parent 7b88a41 commit 6349c11

27 files changed

+89
-90
lines changed

boost/network/message/directives/remove_header.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ template <class T>
2121
struct remove_header_directive {
2222

2323
explicit remove_header_directive(T header_name)
24-
: header_name_(header_name) {};
24+
: header_name_(std::move(header_name)) {};
2525

2626
template <class MessageTag>
2727
void operator()(basic_message<MessageTag>& msg) const {

boost/network/protocol/http/client/async_impl.hpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,23 @@ struct async_client
4040
async_client(bool cache_resolved, bool follow_redirect,
4141
bool always_verify_peer, int timeout,
4242
boost::shared_ptr<boost::asio::io_service> service,
43-
optional<string_type> const& certificate_filename,
44-
optional<string_type> const& verify_path,
45-
optional<string_type> const& certificate_file,
46-
optional<string_type> const& private_key_file,
47-
optional<string_type> const& ciphers, long ssl_options)
43+
optional<string_type> certificate_filename,
44+
optional<string_type> verify_path,
45+
optional<string_type> certificate_file,
46+
optional<string_type> private_key_file,
47+
optional<string_type> ciphers, long ssl_options)
4848
: connection_base(cache_resolved, follow_redirect, timeout),
4949
service_ptr(service.get()
5050
? service
5151
: boost::make_shared<boost::asio::io_service>()),
5252
service_(*service_ptr),
5353
resolver_(service_),
5454
sentinel_(new boost::asio::io_service::work(service_)),
55-
certificate_filename_(certificate_filename),
56-
verify_path_(verify_path),
57-
certificate_file_(certificate_file),
58-
private_key_file_(private_key_file),
59-
ciphers_(ciphers),
55+
certificate_filename_(std::move(certificate_filename)),
56+
verify_path_(std::move(verify_path)),
57+
certificate_file_(std::move(certificate_file)),
58+
private_key_file_(std::move(private_key_file)),
59+
ciphers_(std::move(ciphers)),
6060
ssl_options_(ssl_options),
6161
always_verify_peer_(always_verify_peer) {
6262
connection_base::resolver_strand_.reset(

boost/network/protocol/http/client/connection/async_normal.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ struct http_async_connection
7878
is_timedout_(false),
7979
follow_redirect_(follow_redirect),
8080
resolver_(resolver),
81-
resolve_(resolve),
81+
resolve_(std::move(resolve)),
8282
request_strand_(resolver.get_io_service()),
83-
delegate_(delegate) {}
83+
delegate_(std::move(delegate)) {}
8484

8585
// This is the main entry point for the connection/request pipeline.
8686
// We're

boost/network/protocol/http/client/connection/normal_delegate.hpp

+17-16
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,29 @@ namespace impl {
2222
struct normal_delegate : connection_delegate {
2323
explicit normal_delegate(asio::io_service &service);
2424

25-
void connect(asio::ip::tcp::endpoint &endpoint, std::string host, boost::uint16_t source_port,
26-
function<void(system::error_code const &)> handler) override;
27-
void write(
28-
asio::streambuf &command_streambuf,
29-
function<void(system::error_code const &, size_t)> handler) override;
30-
void read_some(
31-
asio::mutable_buffers_1 const &read_buffer,
32-
function<void(system::error_code const &, size_t)> handler) override;
25+
void connect(asio::ip::tcp::endpoint &endpoint, std::string host,
26+
boost::uint16_t source_port,
27+
function<void(system::error_code const &)> handler) override;
28+
void write(asio::streambuf &command_streambuf,
29+
function<void(system::error_code const &, size_t)> handler)
30+
override;
31+
void read_some(asio::mutable_buffers_1 const &read_buffer,
32+
function<void(system::error_code const &, size_t)> handler)
33+
override;
3334
void disconnect() override;
34-
~normal_delegate() override;
35+
~normal_delegate() override = default;
36+
37+
normal_delegate(normal_delegate const &) = delete;
38+
normal_delegate &operator=(normal_delegate) = delete;
3539

3640
private:
3741
asio::io_service &service_;
3842
std::unique_ptr<asio::ip::tcp::socket> socket_;
39-
40-
normal_delegate(normal_delegate const &); // = delete
41-
normal_delegate &operator=(normal_delegate); // = delete
4243
};
4344

44-
} // namespace impl
45-
} // namespace http
45+
} // namespace impl
46+
} // namespace http
4647
} // namespace network
47-
} // namespace boost
48+
} // namespace boost
4849

49-
#endif // BOOST_NETWORK_PROTOCOL_HTTP_CLIENT_CONNECTION_NORMAL_DELEGATE_20110819
50+
#endif // BOOST_NETWORK_PROTOCOL_HTTP_CLIENT_CONNECTION_NORMAL_DELEGATE_20110819

boost/network/protocol/http/client/connection/normal_delegate.ipp

-2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,4 @@ void boost::network::http::impl::normal_delegate::disconnect() {
5454
}
5555
}
5656

57-
boost::network::http::impl::normal_delegate::~normal_delegate() {}
58-
5957
#endif // BOOST_NETWORK_PROTOCOL_HTTP_CLIENT_CONNECTION_NORMAL_DELEGATE_IPP_20110819

boost/network/protocol/http/client/connection/ssl_delegate.ipp

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ boost::network::http::impl::ssl_delegate::ssl_delegate(
2020
optional<std::string> ciphers,
2121
long ssl_options)
2222
: service_(service),
23-
certificate_filename_(certificate_filename),
24-
verify_path_(verify_path),
25-
certificate_file_(certificate_file),
26-
private_key_file_(private_key_file),
27-
ciphers_(ciphers),
23+
certificate_filename_(std::move(certificate_filename)),
24+
verify_path_(std::move(verify_path)),
25+
certificate_file_(std::move(certificate_file)),
26+
private_key_file_(std::move(private_key_file)),
27+
ciphers_(std::move(ciphers)),
2828
ssl_options_(ssl_options),
2929
always_verify_peer_(always_verify_peer) {}
3030

boost/network/protocol/http/client/connection/sync_normal.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ struct http_sync_connection
4747
timeout_(timeout),
4848
timer_(resolver.get_io_service()),
4949
resolver_(resolver),
50-
resolve_(resolve),
50+
resolve_(std::move(resolve)),
5151
socket_(resolver.get_io_service()) {}
5252

5353
void init_socket(string_type /*unused*/const& hostname, string_type const& port) {

boost/network/protocol/http/client/connection/sync_ssl.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ struct https_sync_connection
6363
timeout_(timeout),
6464
timer_(resolver.get_io_service()),
6565
resolver_(resolver),
66-
resolve_(resolve),
66+
resolve_(std::move(resolve)),
6767
context_(resolver.get_io_service(),
6868
boost::asio::ssl::context::sslv23_client),
6969
socket_(resolver.get_io_service(), context_) {

boost/network/protocol/http/client/sync_impl.hpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,23 @@ struct sync_client
5252
sync_client(
5353
bool cache_resolved, bool follow_redirect, bool always_verify_peer,
5454
int timeout, boost::shared_ptr<boost::asio::io_service> service,
55-
optional<string_type> const& certificate_filename =
55+
optional<string_type> certificate_filename =
5656
optional<string_type>(),
57-
optional<string_type> const& verify_path = optional<string_type>(),
58-
optional<string_type> const& certificate_file = optional<string_type>(),
59-
optional<string_type> const& private_key_file = optional<string_type>(),
60-
optional<string_type> const& ciphers = optional<string_type>(),
57+
optional<string_type> verify_path = optional<string_type>(),
58+
optional<string_type> certificate_file = optional<string_type>(),
59+
optional<string_type> private_key_file = optional<string_type>(),
60+
optional<string_type> ciphers = optional<string_type>(),
6161
long ssl_options = 0)
6262
: connection_base(cache_resolved, follow_redirect, timeout),
6363
service_ptr(service.get() ? service
6464
: make_shared<boost::asio::io_service>()),
6565
service_(*service_ptr),
6666
resolver_(service_),
67-
certificate_filename_(certificate_filename),
68-
verify_path_(verify_path),
69-
certificate_file_(certificate_file),
70-
private_key_file_(private_key_file),
71-
ciphers_(ciphers),
67+
certificate_filename_(std::move(certificate_filename)),
68+
verify_path_(std::move(verify_path)),
69+
certificate_file_(std::move(certificate_file)),
70+
private_key_file_(std::move(private_key_file)),
71+
ciphers_(std::move(ciphers)),
7272
ssl_options_(ssl_options),
7373
always_verify_peer_(always_verify_peer) {}
7474

boost/network/protocol/http/impl/response.ipp

+1-2
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ struct basic_response<tags::http_server> {
108108
static const char crlf[] = {'\r', '\n'};
109109
std::vector<const_buffer> buffers;
110110
buffers.push_back(to_buffer(status));
111-
for (std::size_t i = 0; i < headers.size(); ++i) {
112-
header_type &h = headers[i];
111+
for (auto & h : headers) {
113112
buffers.push_back(buffer(h.name));
114113
buffers.push_back(buffer(name_value_separator));
115114
buffers.push_back(buffer(h.value));

boost/network/protocol/http/policies/pooled_connection.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ struct pooled_connection_policy : resolver_policy<Tag>::type {
6565
ssl_options)),
6666
resolver_(resolver),
6767
connection_follow_redirect_(follow_redirect),
68-
get_connection_(get_connection),
68+
get_connection_(std::move(get_connection)),
6969
certificate_filename_(certificate_filename),
7070
verify_path_(verify_path),
7171
certificate_file_(certificate_file),

boost/network/protocol/http/server/async_connection.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ struct async_connection
559559
headers_buffer.consume(headers_buffer.size());
560560
headers_already_sent = true;
561561
thread_pool().post(callback);
562-
pending_actions_list::iterator start = pending_actions.begin(),
562+
auto start = pending_actions.begin(),
563563
end = pending_actions.end();
564564
while (start != end) {
565565
thread_pool().post(*start++);

boost/network/protocol/http/server/sync_connection.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ struct sync_connection
8484
if (done) {
8585
if (request_.method[0] == 'P') {
8686
// look for the content-length header
87-
typename std::vector<typename request_header<Tag>::type>::iterator
87+
auto
8888
it = std::find_if(request_.headers.begin(),
8989
request_.headers.end(), is_content_length());
9090
if (it == request_.headers.end()) {

boost/network/protocol/stream_handler.hpp

+15-14
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,23 @@
1010
#pragma once
1111
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
1212

13-
#include <cstddef>
14-
#include <boost/asio/detail/throw_error.hpp>
15-
#include <boost/asio/error.hpp>
1613
#include <boost/asio.hpp>
17-
#ifdef BOOST_NETWORK_ENABLE_HTTPS
18-
#include <boost/asio/ssl.hpp>
19-
#endif
20-
#include <boost/asio/detail/push_options.hpp>
14+
#include <boost/asio/async_result.hpp>
15+
#include <boost/asio/async_result.hpp>
16+
#include <boost/asio/basic_socket.hpp>
17+
#include <boost/asio/detail/config.hpp>
2118
#include <boost/asio/detail/config.hpp>
2219
#include <boost/asio/detail/handler_type_requirements.hpp>
20+
#include <boost/asio/detail/push_options.hpp>
21+
#include <boost/asio/detail/throw_error.hpp>
22+
#include <boost/asio/error.hpp>
2323
#include <boost/asio/stream_socket_service.hpp>
24-
#include <boost/asio/async_result.hpp>
2524
#include <boost/make_shared.hpp>
26-
#include <boost/asio/detail/config.hpp>
27-
#include <boost/asio/async_result.hpp>
28-
#include <boost/asio/basic_socket.hpp>
25+
#include <cstddef>
26+
27+
#ifdef BOOST_NETWORK_ENABLE_HTTPS
28+
#include <boost/asio/ssl.hpp>
29+
#endif
2930

3031
namespace boost {
3132
namespace network {
@@ -43,12 +44,12 @@ typedef boost::asio::ssl::context ssl_context;
4344
struct stream_handler {
4445
public:
4546
stream_handler(boost::shared_ptr<tcp_socket> socket)
46-
: tcp_sock_(socket), ssl_enabled(false) {}
47+
: tcp_sock_(std::move(socket)), ssl_enabled(false) {}
4748

48-
~stream_handler() {}
49+
~stream_handler() = default;
4950

5051
stream_handler(boost::shared_ptr<ssl_socket> socket)
51-
: ssl_sock_(socket), ssl_enabled(true) {}
52+
: ssl_sock_(std::move(socket)), ssl_enabled(true) {}
5253

5354
stream_handler(boost::asio::io_service& io,
5455
boost::shared_ptr<ssl_context> ctx =

boost/network/uri/directives/authority.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ namespace uri {
1414

1515
struct authority_directive {
1616

17-
explicit authority_directive(const std::string &authority)
18-
: authority_(authority) {}
17+
explicit authority_directive(std::string authority)
18+
: authority_(std::move(authority)) {}
1919

2020
template <class Uri>
2121
void operator()(Uri &uri) const {

boost/network/uri/directives/fragment.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ namespace network {
1616
namespace uri {
1717
struct fragment_directive {
1818

19-
explicit fragment_directive(const std::string &fragment)
20-
: fragment_(fragment) {}
19+
explicit fragment_directive(std::string fragment)
20+
: fragment_(std::move(fragment)) {}
2121

2222
template <class Uri>
2323
void operator()(Uri &uri) const {

boost/network/uri/directives/host.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace network {
1515
namespace uri {
1616
struct host_directive {
1717

18-
explicit host_directive(const std::string & host) : host_(host) {}
18+
explicit host_directive(std::string host) : host_(std::move(host)) {}
1919

2020
template <class Uri>
2121
void operator()(Uri &uri) const {

boost/network/uri/directives/path.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace network {
1616
namespace uri {
1717
struct path_directive {
1818

19-
explicit path_directive(const std::string &path) : path_(path) {}
19+
explicit path_directive(std::string path) : path_(std::move(path)) {}
2020

2121
template <class Uri>
2222
void operator()(Uri &uri) const {
@@ -28,7 +28,7 @@ struct path_directive {
2828

2929
struct encoded_path_directive {
3030

31-
explicit encoded_path_directive(const std::string & path) : path_(path) {}
31+
explicit encoded_path_directive(std::string path) : path_(std::move(path)) {}
3232

3333
void operator()(uri &uri_) const {
3434
std::string encoded_path;

boost/network/uri/directives/port.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace network {
1616
namespace uri {
1717
struct port_directive {
1818

19-
explicit port_directive(const std::string &port) : port_(port) {}
19+
explicit port_directive(std::string port) : port_(std::move(port)) {}
2020

2121
explicit port_directive(boost::uint16_t port)
2222
: port_(boost::lexical_cast<std::string>(port)) {}

boost/network/uri/directives/query.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace network {
1717
namespace uri {
1818
struct query_directive {
1919

20-
explicit query_directive(const std::string & query) : query_(query) {}
20+
explicit query_directive(std::string query) : query_(std::move(query)) {}
2121

2222
template <class Uri>
2323
void operator()(Uri &uri) const {
@@ -34,8 +34,8 @@ inline query_directive query(const std::string &query) {
3434

3535
struct query_key_query_directive {
3636

37-
query_key_query_directive(const std::string & key, const std::string & query)
38-
: key_(key), query_(query) {}
37+
query_key_query_directive(std::string key, std::string query)
38+
: key_(std::move(key)), query_(std::move(query)) {}
3939

4040
template <class Uri>
4141
void operator()(Uri &uri) const {

boost/network/uri/directives/scheme.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace network {
1616
namespace uri {
1717
struct scheme_directive {
1818

19-
explicit scheme_directive(const std::string &scheme) : scheme(scheme) {}
19+
explicit scheme_directive(std::string scheme) : scheme(std::move(scheme)) {}
2020

2121
template <class Uri>
2222
void operator()(Uri &uri) const {

boost/network/uri/directives/user_info.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ namespace network {
1515
namespace uri {
1616
struct user_info_directive {
1717

18-
explicit user_info_directive(const std::string &user_info)
19-
: user_info_(user_info) {}
18+
explicit user_info_directive(std::string user_info)
19+
: user_info_(std::move(user_info)) {}
2020

2121
template <class Uri>
2222
void operator()(Uri &uri) const {

boost/network/uri/uri.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class BOOST_URI_DECL uri {
4646
// parse();
4747
//}
4848

49-
uri(const string_type &str) : uri_(str), is_valid_(false) { parse(); }
49+
uri(string_type str) : uri_(std::move(str)), is_valid_(false) { parse(); }
5050

5151
template <class FwdIter>
5252
uri(const FwdIter &first, const FwdIter &last)

boost/network/utils/thread_pool.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ struct basic_thread_pool {
3535
io_service_ptr io_service = io_service_ptr(),
3636
worker_threads_ptr worker_threads = worker_threads_ptr())
3737
: threads_(threads),
38-
io_service_(io_service),
39-
worker_threads_(worker_threads),
38+
io_service_(std::move(io_service)),
39+
worker_threads_(std::move(worker_threads)),
4040
sentinel_() {
4141
bool commit = false;
4242
BOOST_SCOPE_EXIT_TPL(

libs/mime/test/mime-roundtrip.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ test_suite *init_unit_test_suite(int, char **)
107107
#ifdef BOOST_TEST_DYN_LINK
108108
true;
109109
#else
110-
0;
110+
nullptr;
111111
#endif
112112
}
113113

0 commit comments

Comments
 (0)