diff --git a/include/libtorrent/broadcast_socket.hpp b/include/libtorrent/broadcast_socket.hpp index 27ef2e935..540455b14 100644 --- a/include/libtorrent/broadcast_socket.hpp +++ b/include/libtorrent/broadcast_socket.hpp @@ -74,7 +74,6 @@ namespace libtorrent { void close(); int num_send_sockets() const { return int(m_unicast_sockets.size()); } - void enable_ip_broadcast(bool e); private: diff --git a/include/libtorrent/bt_peer_connection.hpp b/include/libtorrent/bt_peer_connection.hpp index cfaf0cb2b..b3111cabc 100644 --- a/include/libtorrent/bt_peer_connection.hpp +++ b/include/libtorrent/bt_peer_connection.hpp @@ -247,9 +247,6 @@ namespace libtorrent { void write_share_mode(); void write_holepunch_msg(int type, tcp::endpoint const& ep, int error); #endif - void write_metadata(std::pair req); - void write_metadata_request(std::pair req); - // DHT extension void write_dht_port(int listen_port); diff --git a/include/libtorrent/buffer.hpp b/include/libtorrent/buffer.hpp index 2cd47238a..ffed302a5 100644 --- a/include/libtorrent/buffer.hpp +++ b/include/libtorrent/buffer.hpp @@ -100,7 +100,7 @@ public: : buffer(size) { TORRENT_ASSERT(initialize.size() <= size); - if (initialize.size() > 0) + if (!initialize.empty()) { std::memcpy(m_begin, initialize.data(), (std::min)(initialize.size(), size)); } diff --git a/include/libtorrent/heterogeneous_queue.hpp b/include/libtorrent/heterogeneous_queue.hpp index 195108522..ebf18dac5 100644 --- a/include/libtorrent/heterogeneous_queue.hpp +++ b/include/libtorrent/heterogeneous_queue.hpp @@ -49,7 +49,7 @@ namespace libtorrent { struct free_deleter { void operator()(char* ptr) { return std::free(ptr); } }; - inline std::size_t calculate_pad_bytes(char* inptr, std::size_t alignment) + inline std::size_t calculate_pad_bytes(char const* inptr, std::size_t alignment) { std::uintptr_t const ptr = reinterpret_cast(inptr); std::uintptr_t const offset = ptr & (alignment - 1); @@ -78,7 +78,7 @@ namespace libtorrent { std::size_t const pad_bytes = aux::calculate_pad_bytes(ptr + sizeof(header_t), alignof(U)); // pad_bytes is only 8 bits in the header, so types that need more than - // 256 byte alignment may not be suppored + // 256 byte alignment may not be supported static_assert(alignof(U) <= 256 , "heterogeneous_queue does not support types with alignment requirements > 256"); @@ -207,7 +207,7 @@ namespace libtorrent { static_cast(std::malloc(std::size_t(m_capacity + amount_to_grow))) , aux::free_deleter()); - if (new_storage.get() == nullptr) + if (!new_storage) aux::throw_ex(); char* src = m_storage.get(); diff --git a/include/libtorrent/peer_connection.hpp b/include/libtorrent/peer_connection.hpp index 1e8e0012a..a4d482ff1 100644 --- a/include/libtorrent/peer_connection.hpp +++ b/include/libtorrent/peer_connection.hpp @@ -1182,7 +1182,7 @@ namespace aux { // pretend that there's an outstanding send operation already, to // prevent future calls to setup_send() from actually causing an - // asyc_send() to be issued. + // async_send() to be issued. m_pc.m_channel_state[peer_connection::upload_channel] |= peer_info::bw_network; m_need_uncork = true; } diff --git a/include/libtorrent/peer_connection_handle.hpp b/include/libtorrent/peer_connection_handle.hpp index 438aa7ddd..261499905 100644 --- a/include/libtorrent/peer_connection_handle.hpp +++ b/include/libtorrent/peer_connection_handle.hpp @@ -51,7 +51,7 @@ struct crypto_plugin; struct TORRENT_EXPORT peer_connection_handle { explicit peer_connection_handle(std::weak_ptr impl) - : m_connection(impl) + : m_connection(std::move(impl)) {} connection_type type() const; @@ -133,7 +133,7 @@ private: struct TORRENT_EXPORT bt_peer_connection_handle : peer_connection_handle { explicit bt_peer_connection_handle(peer_connection_handle pc) - : peer_connection_handle(pc) + : peer_connection_handle(std::move(pc)) {} bool packet_finished() const; diff --git a/include/libtorrent/piece_picker.hpp b/include/libtorrent/piece_picker.hpp index cfe74b8fc..ab21d7872 100644 --- a/include/libtorrent/piece_picker.hpp +++ b/include/libtorrent/piece_picker.hpp @@ -708,7 +708,7 @@ namespace libtorrent { // this maps pieces to a range of blocks that are pad files and should not // be picked - // TOOD: this could be a much more efficient data structure + // TODO: this could be a much more efficient data structure std::set m_pad_blocks; // the number of seeds. These are not added to diff --git a/include/libtorrent/utp_socket_manager.hpp b/include/libtorrent/utp_socket_manager.hpp index 54e0415e8..c6d0e5fdb 100644 --- a/include/libtorrent/utp_socket_manager.hpp +++ b/include/libtorrent/utp_socket_manager.hpp @@ -175,22 +175,6 @@ namespace libtorrent { aux::session_settings const& m_sett; - // this is a copy of the routing table, used - // to initialize MTU sizes of uTP sockets - mutable std::vector m_routes; - - // the timestamp for the last time we updated - // the routing table - mutable time_point m_last_route_update = min_time(); - - // cache of interfaces - mutable std::vector m_interfaces; - mutable time_point m_last_if_update = min_time(); - - // the buffer size of the socket. This is used - // to now lower the buffer size - int m_sock_buf_size = 0; - // stats counters counters& m_counters; diff --git a/include/libtorrent/utp_stream.hpp b/include/libtorrent/utp_stream.hpp index a6ea95dec..883801ab0 100644 --- a/include/libtorrent/utp_stream.hpp +++ b/include/libtorrent/utp_stream.hpp @@ -377,9 +377,6 @@ struct TORRENT_EXTRA_EXPORT utp_stream issue_read(); } - void do_async_connect(endpoint_type const& ep - , std::function const& handler); - template void open(Protocol const&, error_code&) { m_open = true; }