From 9af2072bc9c80aab551e717598c5f6df11c09a8f Mon Sep 17 00:00:00 2001 From: Alden Torres Date: Mon, 25 Jul 2016 17:58:00 -0400 Subject: [PATCH] minor changes, typos and gcc tests in windows (#947) minor changes, typos and gcc tests in windows --- appveyor.yml | 6 ++---- include/libtorrent/disk_buffer_pool.hpp | 3 +-- include/libtorrent/entry.hpp | 5 ++--- include/libtorrent/error.hpp | 1 - include/libtorrent/extensions/smart_ban.hpp | 4 ++-- include/libtorrent/extensions/ut_metadata.hpp | 1 - include/libtorrent/extensions/ut_pex.hpp | 3 +-- include/libtorrent/peer_connection.hpp | 2 +- include/libtorrent/span.hpp | 4 ++-- include/libtorrent/torrent.hpp | 8 ++++---- src/bt_peer_connection.cpp | 3 +-- src/http_connection.cpp | 1 - src/torrent.cpp | 9 ++++----- src/ut_pex.cpp | 7 +++---- 14 files changed, 23 insertions(+), 34 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 65c36da01..9bddd844c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -99,10 +99,8 @@ build_script: test_script: - cd %ROOT_DIRECTORY%\test -# mingw tests crash currently. needs resolving -- if not %compiler% == gcc ( - b2.exe -l400 --hash warnings-as-errors=on -j2 %compiler% address-model=%model% debug-iterators=on picker-debugging=on invariant-checks=full variant=%variant% %linkflags% %include% link=shared ssl=%ssl% crypto=%crypto% win-tests - ) +- b2.exe -l400 --hash warnings-as-errors=on -j2 %compiler% address-model=%model% debug-iterators=on picker-debugging=on invariant-checks=full variant=%variant% %linkflags% %include% link=shared ssl=%ssl% crypto=%crypto% win-tests + - cd %ROOT_DIRECTORY%\bindings\python # we use 64 bit python build - if defined python ( c:\Python35-x64\python.exe test.py ) diff --git a/include/libtorrent/disk_buffer_pool.hpp b/include/libtorrent/disk_buffer_pool.hpp index db2711b69..54711ec6f 100644 --- a/include/libtorrent/disk_buffer_pool.hpp +++ b/include/libtorrent/disk_buffer_pool.hpp @@ -122,7 +122,7 @@ namespace libtorrent // adding up callbacks to this queue. Once the number // of buffers in use drops below the low watermark, // we start calling these functions back - std::vector > m_observers; + std::vector> m_observers; // callback used to tell the cache it needs to free up some blocks boost::function m_trigger_cache_trim; @@ -192,4 +192,3 @@ namespace libtorrent } #endif // TORRENT_DISK_BUFFER_POOL_HPP - diff --git a/include/libtorrent/entry.hpp b/include/libtorrent/entry.hpp index dbd223194..5062e1e5b 100644 --- a/include/libtorrent/entry.hpp +++ b/include/libtorrent/entry.hpp @@ -119,7 +119,7 @@ namespace libtorrent entry(span); template ::value - || std::is_same::value >::type> + || std::is_same::value>::type> entry(U v) : m_type(undefined_t) { @@ -163,7 +163,7 @@ namespace libtorrent entry& operator=(span); template ::value - || std::is_same::value >::type> + || std::is_same::value>::type> entry& operator=(U v) { destruct(); @@ -327,4 +327,3 @@ namespace libtorrent } #endif // TORRENT_ENTRY_HPP_INCLUDED - diff --git a/include/libtorrent/error.hpp b/include/libtorrent/error.hpp index 2f3dfccb9..6be1d5a9d 100644 --- a/include/libtorrent/error.hpp +++ b/include/libtorrent/error.hpp @@ -49,4 +49,3 @@ namespace libtorrent } #endif - diff --git a/include/libtorrent/extensions/smart_ban.hpp b/include/libtorrent/extensions/smart_ban.hpp index 73147c8a9..0111229b4 100644 --- a/include/libtorrent/extensions/smart_ban.hpp +++ b/include/libtorrent/extensions/smart_ban.hpp @@ -35,10 +35,11 @@ POSSIBILITY OF SUCH DAMAGE. #ifndef TORRENT_DISABLE_EXTENSIONS +#include "libtorrent/config.hpp" + #include "libtorrent/aux_/disable_warnings_push.hpp" #include -#include "libtorrent/config.hpp" #include "libtorrent/aux_/disable_warnings_pop.hpp" @@ -59,4 +60,3 @@ namespace libtorrent #endif // TORRENT_DISABLE_EXTENSIONS #endif // TORRENT_SMART_BAN_HPP_INCLUDED - diff --git a/include/libtorrent/extensions/ut_metadata.hpp b/include/libtorrent/extensions/ut_metadata.hpp index 8c03d8967..923a3458b 100644 --- a/include/libtorrent/extensions/ut_metadata.hpp +++ b/include/libtorrent/extensions/ut_metadata.hpp @@ -62,4 +62,3 @@ namespace libtorrent #endif // TORRENT_DISABLE_EXTENSIONS #endif // TORRENT_UT_METADATA_HPP_INCLUDED - diff --git a/include/libtorrent/extensions/ut_pex.hpp b/include/libtorrent/extensions/ut_pex.hpp index 00da8c1f9..97ca3e246 100644 --- a/include/libtorrent/extensions/ut_pex.hpp +++ b/include/libtorrent/extensions/ut_pex.hpp @@ -33,10 +33,9 @@ POSSIBILITY OF SUCH DAMAGE. #ifndef TORRENT_UT_PEX_EXTENSION_HPP_INCLUDED #define TORRENT_UT_PEX_EXTENSION_HPP_INCLUDED -#include "libtorrent/config.hpp" - #ifndef TORRENT_DISABLE_EXTENSIONS +#include "libtorrent/config.hpp" #include "libtorrent/socket.hpp" // for endpoint #include "libtorrent/aux_/disable_warnings_push.hpp" diff --git a/include/libtorrent/peer_connection.hpp b/include/libtorrent/peer_connection.hpp index 6c5620777..c9702ce7d 100644 --- a/include/libtorrent/peer_connection.hpp +++ b/include/libtorrent/peer_connection.hpp @@ -870,7 +870,7 @@ namespace libtorrent public: #ifndef TORRENT_DISABLE_EXTENSIONS - typedef std::list > extension_list_t; + typedef std::list> extension_list_t; extension_list_t m_extensions; #endif private: diff --git a/include/libtorrent/span.hpp b/include/libtorrent/span.hpp index 8a333b19b..058d6fdc9 100644 --- a/include/libtorrent/span.hpp +++ b/include/libtorrent/span.hpp @@ -50,7 +50,7 @@ namespace libtorrent : m_ptr(v.data()), m_len(v.size()) {} span(T& p) : m_ptr(&p), m_len(1) {} - span(T* p, size_t l) : m_ptr(p), m_len(l) {} + span(T* p, size_t const l) : m_ptr(p), m_len(l) {} template span(std::array& arr) @@ -98,7 +98,7 @@ namespace libtorrent return { data() + offset, size() - offset }; } - span subspan(size_t const offset, size_t count) const + span subspan(size_t const offset, size_t const count) const { TORRENT_ASSERT(size() >= offset); TORRENT_ASSERT(size() >= offset + count); diff --git a/include/libtorrent/torrent.hpp b/include/libtorrent/torrent.hpp index f4312f31e..fdb691d26 100644 --- a/include/libtorrent/torrent.hpp +++ b/include/libtorrent/torrent.hpp @@ -1199,13 +1199,13 @@ namespace libtorrent void setup_peer_class(); // The list of web seeds in this torrent. Seeds with fatal errors are - // removed from the set. It's important that iteratores are not + // removed from the set. It's important that iterators are not // invalidated as entries are added and removed from this list, hence the // std::list std::list m_web_seeds; #ifndef TORRENT_DISABLE_EXTENSIONS - std::list > m_extensions; + std::list> m_extensions; #endif // used for tracker announces @@ -1414,11 +1414,11 @@ namespace libtorrent // if we're currently in upload-mode std::uint16_t m_upload_mode_time; - // true when this torrent should anncounce to + // true when this torrent should announce to // trackers bool m_announce_to_trackers:1; - // true when this torrent should anncounce to + // true when this torrent should announce to // the local network bool m_announce_to_lsd:1; diff --git a/src/bt_peer_connection.cpp b/src/bt_peer_connection.cpp index d3249c706..55a42836b 100644 --- a/src/bt_peer_connection.cpp +++ b/src/bt_peer_connection.cpp @@ -1463,7 +1463,6 @@ namespace libtorrent else { #ifndef TORRENT_DISABLE_LOGGING - error_code ec; static const char* hp_msg_name[] = {"rendezvous", "connect", "failed"}; peer_log(peer_log_alert::incoming_message, "HOLEPUNCH" , "msg: %s from %s to: unknown address type" @@ -2741,7 +2740,7 @@ namespace libtorrent wr_recv_buf.begin += 28; const char sh_vc[] = {0,0,0,0, 0,0,0,0}; - if (!std::equal(sh_vc, sh_vc+8, recv_buffer.begin + 20)) + if (!std::equal(sh_vc, sh_vc + 8, recv_buffer.begin + 20)) { disconnect(errors::invalid_encryption_constant, op_encryption, 2); return; diff --git a/src/http_connection.cpp b/src/http_connection.cpp index 5f5a949f6..390a7e272 100644 --- a/src/http_connection.cpp +++ b/src/http_connection.cpp @@ -899,4 +899,3 @@ void http_connection::rate_limit(int limit) } } - diff --git a/src/torrent.cpp b/src/torrent.cpp index 1c97324ab..545791939 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -104,6 +104,10 @@ POSSIBILITY OF SUCH DAMAGE. // TODO: factor out cache_status to its own header #include "libtorrent/disk_io_thread.hpp" // for cache_status +#ifndef TORRENT_DISABLE_EXTENSIONS +#include "libtorrent/extensions/ut_pex.hpp" // for was_introduced_by +#endif + #ifndef TORRENT_DISABLE_LOGGING #include "libtorrent/aux_/session_impl.hpp" // for tracker_logger #endif @@ -162,11 +166,6 @@ namespace libtorrent restart_request.length = -1; } -#ifndef TORRENT_DISABLE_EXTENSIONS - // defined in ut_pex.cpp - bool was_introduced_by(peer_plugin const*, tcp::endpoint const&); -#endif - torrent_hot_members::torrent_hot_members(aux::session_interface& ses , add_torrent_params const& p, int const block_size , bool const session_paused) diff --git a/src/ut_pex.cpp b/src/ut_pex.cpp index 242e12eab..545525c88 100644 --- a/src/ut_pex.cpp +++ b/src/ut_pex.cpp @@ -626,7 +626,7 @@ namespace libtorrent { namespace torrent& m_torrent; peer_connection& m_pc; ut_pex_plugin& m_tp; - // stores all peers this this peer is connected to. These lists + // stores all peers this peer is connected to. These lists // are updated with each pex message and are limited in size // to protect against malicious clients. These lists are also // used for looking up which peer a peer that supports holepunch @@ -634,10 +634,10 @@ namespace libtorrent { namespace // these are vectors to save memory and keep the items close // together for performance. Inserting and removing is relatively // cheap since the lists' size is limited - typedef std::vector > peers4_t; + typedef std::vector> peers4_t; peers4_t m_peers; #if TORRENT_USE_IPV6 - typedef std::vector > peers6_t; + typedef std::vector> peers6_t; peers6_t m_peers6; #endif // the last pex messages we received @@ -710,4 +710,3 @@ namespace libtorrent } #endif -