diff --git a/include/libtorrent/bt_peer_connection.hpp b/include/libtorrent/bt_peer_connection.hpp index c11815a8f..d1aabeb1d 100644 --- a/include/libtorrent/bt_peer_connection.hpp +++ b/include/libtorrent/bt_peer_connection.hpp @@ -451,4 +451,3 @@ private: } #endif // TORRENT_BT_PEER_CONNECTION_HPP_INCLUDED - diff --git a/include/libtorrent/extensions.hpp b/include/libtorrent/extensions.hpp index cc39299fd..0727a3b22 100644 --- a/include/libtorrent/extensions.hpp +++ b/include/libtorrent/extensions.hpp @@ -162,10 +162,7 @@ POSSIBILITY OF SUCH DAMAGE. #include #include "libtorrent/config.hpp" -#include "libtorrent/buffer.hpp" -#include "libtorrent/socket.hpp" #include "libtorrent/sha1_hash.hpp" // for sha1_hash -#include "libtorrent/error_code.hpp" #include "libtorrent/session_handle.hpp" #include "libtorrent/peer_connection_handle.hpp" #include "libtorrent/span.hpp" @@ -268,7 +265,7 @@ namespace libtorrent { return std::numeric_limits::max(); } // called when saving settings state - virtual void save_state(entry&) const {} + virtual void save_state(entry&) {} // called when loading settings state virtual void load_state(bdecode_node const&) {} diff --git a/include/libtorrent/identify_client.hpp b/include/libtorrent/identify_client.hpp index e1816a7d5..20c0de84f 100644 --- a/include/libtorrent/identify_client.hpp +++ b/include/libtorrent/identify_client.hpp @@ -47,7 +47,7 @@ POSSIBILITY OF SUCH DAMAGE. namespace libtorrent { - // TODO: hide these declarations when deprecaated functions are disabled, and + // TODO: hide these declarations when deprecated functions are disabled, and // expose them internally in a header under aux_. // these functions don't really need to be public. This mechanism of @@ -70,4 +70,3 @@ namespace libtorrent } #endif // TORRENT_IDENTIFY_CLIENT_HPP_INCLUDED - diff --git a/include/libtorrent/span.hpp b/include/libtorrent/span.hpp index f3fcef97b..e7bc5ccfa 100644 --- a/include/libtorrent/span.hpp +++ b/include/libtorrent/span.hpp @@ -83,7 +83,7 @@ namespace libtorrent span first(size_t const n) const { TORRENT_ASSERT(size() >= n); - return { data(), size() - n }; + return { data(), n }; } span last(size_t const n) const diff --git a/src/bt_peer_connection.cpp b/src/bt_peer_connection.cpp index 147b02dff..c0765432a 100644 --- a/src/bt_peer_connection.cpp +++ b/src/bt_peer_connection.cpp @@ -64,7 +64,6 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/io.hpp" #include "libtorrent/aux_/io.hpp" #include "libtorrent/socket_io.hpp" -#include "libtorrent/version.hpp" #include "libtorrent/extensions.hpp" #include "libtorrent/aux_/session_interface.hpp" #include "libtorrent/alert_types.hpp" @@ -753,7 +752,7 @@ namespace libtorrent // add handshake to the send buffer const char version_string[] = "BitTorrent protocol"; - const int string_len = sizeof(version_string)-1; + const int string_len = sizeof(version_string) - 1; char handshake[1 + string_len + 8 + 20 + 20]; char* ptr = handshake; diff --git a/src/http_connection.cpp b/src/http_connection.cpp index 7419664dc..183776f39 100644 --- a/src/http_connection.cpp +++ b/src/http_connection.cpp @@ -745,7 +745,7 @@ void http_connection::on_read(error_code const& e { span rcv_buf(m_recvbuffer); bool error = false; - m_parser.incoming(rcv_buf.subspan(0, m_read_pos), error); + m_parser.incoming(rcv_buf.first(m_read_pos), error); if (error) { // HTTP parse error diff --git a/src/receive_buffer.cpp b/src/receive_buffer.cpp index 09dc3f6ec..98d32f4e5 100644 --- a/src/receive_buffer.cpp +++ b/src/receive_buffer.cpp @@ -320,7 +320,7 @@ span crypto_receive_buffer::get() const { span recv_buffer = m_connection_buffer.get(); if (m_recv_pos < m_connection_buffer.pos()) - recv_buffer = recv_buffer.subspan(0, m_recv_pos); + recv_buffer = recv_buffer.first(m_recv_pos); return recv_buffer; }