diff --git a/include/libtorrent/announce_entry.hpp b/include/libtorrent/announce_entry.hpp index 94c914f53..c8e361816 100644 --- a/include/libtorrent/announce_entry.hpp +++ b/include/libtorrent/announce_entry.hpp @@ -176,7 +176,7 @@ TORRENT_VERSION_NAMESPACE_2 { // the tracker was part of the .torrent file source_torrent = 1, - // the tracker was added programatically via the add_tracker() function + // the tracker was added programmatically via the add_tracker() function source_client = 2, // the tracker was part of a magnet link source_magnet_link = 4, diff --git a/include/libtorrent/aux_/listen_socket_handle.hpp b/include/libtorrent/aux_/listen_socket_handle.hpp index bb451aca1..066256560 100644 --- a/include/libtorrent/aux_/listen_socket_handle.hpp +++ b/include/libtorrent/aux_/listen_socket_handle.hpp @@ -45,13 +45,14 @@ namespace libtorrent { namespace aux { { friend struct session_impl; - listen_socket_handle() {} + listen_socket_handle() = default; listen_socket_handle(std::shared_ptr s) // NOLINT : m_sock(s) {} listen_socket_handle(listen_socket_handle const& o) = default; + listen_socket_handle& operator=(listen_socket_handle const& o) = default; explicit operator bool() const { return !m_sock.expired(); } @@ -73,12 +74,6 @@ namespace libtorrent { namespace aux { bool operator<(listen_socket_handle const& o) const { return m_sock.owner_before(o.m_sock); } - listen_socket_handle& operator=(listen_socket_handle const& o) - { - m_sock = o.m_sock; - return *this; - } - listen_socket_t* get() const; private: diff --git a/include/libtorrent/aux_/socket_type.hpp b/include/libtorrent/aux_/socket_type.hpp index 018642bb0..1342d39ad 100644 --- a/include/libtorrent/aux_/socket_type.hpp +++ b/include/libtorrent/aux_/socket_type.hpp @@ -297,9 +297,10 @@ namespace aux { return reinterpret_cast(&m_data); } - private: // explicitly disallow assignment, to silence msvc warning - socket_type& operator=(socket_type const&); + socket_type& operator=(socket_type const&) = delete; + + private: void destruct(); void construct(int type, void* userdata); diff --git a/src/identify_client.cpp b/src/identify_client.cpp index 65605ae28..f85696b32 100644 --- a/src/identify_client.cpp +++ b/src/identify_client.cpp @@ -429,4 +429,3 @@ namespace aux { } // aux } // libtorrent - diff --git a/src/ip_voter.cpp b/src/ip_voter.cpp index 2dfd16930..357c7fc51 100644 --- a/src/ip_voter.cpp +++ b/src/ip_voter.cpp @@ -65,7 +65,6 @@ namespace libtorrent { if (m_external_addresses.empty()) return false; // if there's just one vote, go with that - std::vector::iterator i; if (m_external_addresses.size() == 1) { // avoid flapping. We need more votes to change our mind on the @@ -84,7 +83,7 @@ namespace libtorrent { return false; } - i = m_external_addresses.begin(); + auto const i = m_external_addresses.begin(); bool ret = m_external_address != i->addr; m_external_address = i->addr; diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 93488a8d5..49d17599e 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -1015,7 +1015,7 @@ namespace aux { peer_class_info session_impl::get_peer_class(peer_class_t const cid) const { - peer_class_info ret; + peer_class_info ret{}; peer_class const* pc = m_classes.at(cid); // if you hit this assert, you're passing in an invalid cid TORRENT_ASSERT_PRECOND(pc); @@ -6785,8 +6785,7 @@ namespace aux { auto i = iface.m_sock.lock(); TORRENT_ASSERT(i); if (!i) return; - set_external_address(std::static_pointer_cast(i), ip - , source_dht, source); + set_external_address(i, ip, source_dht, source); } void session_impl::get_peers(sha1_hash const& ih)