From a6f345181f9cf86a5b567152f56df260a7c4c79c Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Mon, 7 Jul 2014 06:28:48 +0000 Subject: [PATCH] fixed some unused argument warnings --- include/libtorrent/extensions.hpp | 4 ++-- .../libtorrent/http_tracker_connection.hpp | 2 +- include/libtorrent/i2p_stream.hpp | 2 +- .../kademlia/traversal_algorithm.hpp | 2 +- include/libtorrent/lsd.hpp | 3 +-- include/libtorrent/peer_connection.hpp | 1 - include/libtorrent/proxy_base.hpp | 8 ++++---- include/libtorrent/storage.hpp | 10 +++++----- include/libtorrent/thread_pool.hpp | 2 +- include/libtorrent/tracker_manager.hpp | 9 +++++---- include/libtorrent/udp_socket.hpp | 4 ++-- include/libtorrent/utp_socket_manager.hpp | 2 +- include/libtorrent/utp_stream.hpp | 20 +++++++++---------- include/libtorrent/web_connection_base.hpp | 13 ++++++------ src/alert_manager.cpp | 3 ++- src/bt_peer_connection.cpp | 7 ++++--- src/lsd.cpp | 3 +-- src/lt_trackers.cpp | 2 +- src/peer_connection.cpp | 2 +- src/policy.cpp | 2 +- src/session_impl.cpp | 1 - src/utp_stream.cpp | 9 +++++---- test/test_auto_unchoke.cpp | 1 - 23 files changed, 56 insertions(+), 56 deletions(-) diff --git a/include/libtorrent/extensions.hpp b/include/libtorrent/extensions.hpp index 8290b2475..8e0f2302f 100644 --- a/include/libtorrent/extensions.hpp +++ b/include/libtorrent/extensions.hpp @@ -229,8 +229,8 @@ namespace libtorrent virtual void on_alert(alert const*) {} // return true if the add_torrent_params should be added - virtual bool on_unknown_torrent(sha1_hash const& info_hash - , peer_connection* pc, add_torrent_params& p) + virtual bool on_unknown_torrent(sha1_hash const& /* info_hash */ + , peer_connection* /* pc */, add_torrent_params& /* p */) { return false; } // called once per second diff --git a/include/libtorrent/http_tracker_connection.hpp b/include/libtorrent/http_tracker_connection.hpp index b8e60f475..12b3bb57d 100644 --- a/include/libtorrent/http_tracker_connection.hpp +++ b/include/libtorrent/http_tracker_connection.hpp @@ -93,7 +93,7 @@ namespace libtorrent void on_response(error_code const& ec, http_parser const& parser , char const* data, int size); - virtual void on_timeout(error_code const& ec) {} + virtual void on_timeout(error_code const&) {} void parse(int status_code, lazy_entry const& e); bool extract_peer_info(lazy_entry const& e, peer_entry& ret); diff --git a/include/libtorrent/i2p_stream.hpp b/include/libtorrent/i2p_stream.hpp index 4f03d998a..b050f48fd 100644 --- a/include/libtorrent/i2p_stream.hpp +++ b/include/libtorrent/i2p_stream.hpp @@ -95,7 +95,7 @@ public: std::string const& destination() { return m_dest; } template - void async_connect(endpoint_type const& endpoint, Handler const& handler) + void async_connect(endpoint_type const&, Handler const& handler) { // since we don't support regular endpoints, just ignore the one // provided and use m_dest. diff --git a/include/libtorrent/kademlia/traversal_algorithm.hpp b/include/libtorrent/kademlia/traversal_algorithm.hpp index f3b5095bc..fd0e34eac 100644 --- a/include/libtorrent/kademlia/traversal_algorithm.hpp +++ b/include/libtorrent/kademlia/traversal_algorithm.hpp @@ -98,7 +98,7 @@ protected: virtual observer_ptr new_observer(void* ptr , udp::endpoint const& ep, node_id const& id); - virtual bool invoke(observer_ptr o) { return false; } + virtual bool invoke(observer_ptr) { return false; } friend void intrusive_ptr_add_ref(traversal_algorithm* p) { diff --git a/include/libtorrent/lsd.hpp b/include/libtorrent/lsd.hpp index fcbf0a808..7715a3151 100644 --- a/include/libtorrent/lsd.hpp +++ b/include/libtorrent/lsd.hpp @@ -55,8 +55,7 @@ typedef boost::function peer_callback_t; class lsd : public intrusive_ptr_base { public: - lsd(io_service& ios, address const& listen_interface - , peer_callback_t const& cb); + lsd(io_service& ios, peer_callback_t const& cb); ~lsd(); // void rebind(address const& listen_interface); diff --git a/include/libtorrent/peer_connection.hpp b/include/libtorrent/peer_connection.hpp index 09f8aa46c..99c2a19a3 100644 --- a/include/libtorrent/peer_connection.hpp +++ b/include/libtorrent/peer_connection.hpp @@ -153,7 +153,6 @@ namespace libtorrent boost::weak_ptr t , aux::session_interface& ses , aux::session_settings const& sett - , boost::shared_ptr const& sock , bool outgoing) : m_torrent(t) , m_ses(ses) diff --git a/include/libtorrent/proxy_base.hpp b/include/libtorrent/proxy_base.hpp index 0a058a139..6b28a6e54 100644 --- a/include/libtorrent/proxy_base.hpp +++ b/include/libtorrent/proxy_base.hpp @@ -148,13 +148,13 @@ public: } #ifndef BOOST_NO_EXCEPTIONS - void bind(endpoint_type const& endpoint) + void bind(endpoint_type const& /* endpoint */) { // m_sock.bind(endpoint); } #endif - void bind(endpoint_type const& endpoint, error_code& ec) + void bind(endpoint_type const& /* endpoint */, error_code& /* ec */) { // the reason why we ignore binds here is because we don't // (necessarily) yet know what address family the proxy @@ -168,13 +168,13 @@ public: } #ifndef BOOST_NO_EXCEPTIONS - void open(protocol_type const& p) + void open(protocol_type const&) { // m_sock.open(p); } #endif - void open(protocol_type const& p, error_code& ec) + void open(protocol_type const&, error_code&) { // we need to ignore this for the same reason as stated // for ignoring bind() diff --git a/include/libtorrent/storage.hpp b/include/libtorrent/storage.hpp index 6c7350c7e..9a8fb884d 100644 --- a/include/libtorrent/storage.hpp +++ b/include/libtorrent/storage.hpp @@ -511,15 +511,15 @@ namespace libtorrent void release_files(storage_error&) {} void delete_files(storage_error&) {} void initialize(storage_error&) {} - int move_storage(std::string const&, int flags, storage_error&) { return 0; } + int move_storage(std::string const&, int, storage_error&) { return 0; } int readv(file::iovec_t const* bufs, int num_bufs, int piece , int offset, int flags, storage_error& ec); int writev(file::iovec_t const* bufs, int num_bufs, int piece , int offset, int flags, storage_error& ec); - bool verify_resume_data(lazy_entry const& rd, storage_error& error) { return false; } - void write_resume_data(entry& rd, storage_error& ec) const {} + bool verify_resume_data(lazy_entry const&, storage_error&) { return false; } + void write_resume_data(entry&, storage_error&) const {} int m_piece_size; }; @@ -528,7 +528,7 @@ namespace libtorrent // anything written to it struct zero_storage : storage_interface { - virtual void initialize(storage_error& ec) {} + virtual void initialize(storage_error&) {} virtual int readv(file::iovec_t const* bufs, int num_bufs , int piece, int offset, int flags, storage_error& ec); @@ -543,7 +543,7 @@ namespace libtorrent virtual bool verify_resume_data(lazy_entry const& /* rd */, storage_error&) { return false; } virtual void write_resume_data(entry&, storage_error&) const {} - virtual void release_files(storage_error& ec) {} + virtual void release_files(storage_error&) {} virtual void rename_file(int /* index */ , std::string const& /* new_filenamem */, storage_error&) {} virtual void delete_files(storage_error&) {} diff --git a/include/libtorrent/thread_pool.hpp b/include/libtorrent/thread_pool.hpp index a2a1c82db..9e3f9c91c 100644 --- a/include/libtorrent/thread_pool.hpp +++ b/include/libtorrent/thread_pool.hpp @@ -104,7 +104,7 @@ namespace libtorrent protected: virtual void process_job(T const& j, bool post) = 0; - virtual void retain_job(T& j) {} + virtual void retain_job(T&) {} private: diff --git a/include/libtorrent/tracker_manager.hpp b/include/libtorrent/tracker_manager.hpp index 514bc3006..ceb7f95b8 100644 --- a/include/libtorrent/tracker_manager.hpp +++ b/include/libtorrent/tracker_manager.hpp @@ -240,10 +240,11 @@ namespace libtorrent address const& bind_interface() const { return m_req.bind_ip; } void sent_bytes(int bytes); void received_bytes(int bytes); - virtual bool on_receive(error_code const& ec, udp::endpoint const& ep - , char const* buf, int size) { return false; } - virtual bool on_receive_hostname(error_code const& ec, char const* hostname - , char const* buf, int size) { return false; } + virtual bool on_receive(error_code const&, udp::endpoint const& + , char const* /* buf */, int /* size */) { return false; } + virtual bool on_receive_hostname(error_code const& + , char const* /* hostname */ + , char const* /* buf */, int /* size */) { return false; } boost::intrusive_ptr self() { return boost::intrusive_ptr(this); } diff --git a/include/libtorrent/udp_socket.hpp b/include/libtorrent/udp_socket.hpp index 8ec74d792..6a826f313 100644 --- a/include/libtorrent/udp_socket.hpp +++ b/include/libtorrent/udp_socket.hpp @@ -55,8 +55,8 @@ namespace libtorrent // propagated to the next observer) virtual bool incoming_packet(error_code const& ec , udp::endpoint const&, char const* buf, int size) = 0; - virtual bool incoming_packet(error_code const& ec - , char const* hostname, char const* buf, int size) { return false; } + virtual bool incoming_packet(error_code const& /* ec */ + , char const* /* hostname */, char const* /* buf */, int /* size */) { return false; } // called when the socket becomes writeable, after having // failed with EWOULDBLOCK diff --git a/include/libtorrent/utp_socket_manager.hpp b/include/libtorrent/utp_socket_manager.hpp index 6305429e5..3439ae2bc 100644 --- a/include/libtorrent/utp_socket_manager.hpp +++ b/include/libtorrent/utp_socket_manager.hpp @@ -59,7 +59,7 @@ namespace libtorrent // return false if this is not a uTP packet virtual bool incoming_packet(error_code const& ec, udp::endpoint const& ep , char const* p, int size); - virtual bool incoming_packet(error_code const& ec, char const* host, char const* p, int size) + virtual bool incoming_packet(error_code const&, char const*, char const*, int) { return false; } virtual void writable(); diff --git a/include/libtorrent/utp_stream.hpp b/include/libtorrent/utp_stream.hpp index 5761c81fa..79905c4dc 100644 --- a/include/libtorrent/utp_stream.hpp +++ b/include/libtorrent/utp_stream.hpp @@ -190,33 +190,33 @@ public: #ifndef BOOST_NO_EXCEPTIONS template - void io_control(IO_Control_Command& ioc) {} + void io_control(IO_Control_Command&) {} #endif template - void io_control(IO_Control_Command& ioc, error_code& ec) {} + void io_control(IO_Control_Command&, error_code&) {} #ifndef BOOST_NO_EXCEPTIONS void bind(endpoint_type const& /*endpoint*/) {} #endif - void bind(endpoint_type const& endpoint, error_code& ec); + void bind(endpoint_type const&, error_code&); #ifndef BOOST_NO_EXCEPTIONS template - void set_option(SettableSocketOption const& opt) {} + void set_option(SettableSocketOption const&) {} #endif template - error_code set_option(SettableSocketOption const& opt, error_code& ec) { return ec; } + error_code set_option(SettableSocketOption const&, error_code& ec) { return ec; } #ifndef BOOST_NO_EXCEPTIONS template - void get_option(GettableSocketOption& opt) {} + void get_option(GettableSocketOption&) {} #endif template - error_code get_option(GettableSocketOption& opt, error_code& ec) { return ec; } + error_code get_option(GettableSocketOption&, error_code& ec) { return ec; } void close(); @@ -342,11 +342,11 @@ public: , boost::function const& handler); template - void open(Protocol const& p, error_code& ec) + void open(Protocol const&, error_code&) { m_open = true; } template - void open(Protocol const& p) + void open(Protocol const&) { m_open = true; } template @@ -385,7 +385,7 @@ public: } template - std::size_t write_some(Const_Buffers const& buffers, error_code& ec) + std::size_t write_some(Const_Buffers const& /* buffers */, error_code& /* ec */) { TORRENT_ASSERT(false && "not implemented!"); // TODO: implement blocking write. Low priority since it's not used (yet) diff --git a/include/libtorrent/web_connection_base.hpp b/include/libtorrent/web_connection_base.hpp index a31125772..8d0c73baf 100644 --- a/include/libtorrent/web_connection_base.hpp +++ b/include/libtorrent/web_connection_base.hpp @@ -114,16 +114,17 @@ namespace libtorrent void write_unchoke() {} void write_interested() {} void write_not_interested() {} - virtual void write_request(peer_request const& r) = 0; - void write_cancel(peer_request const& r) {} - void write_have(int index) {} - void write_dont_have(int index) {} - void write_piece(peer_request const& r, disk_buffer_holder& buffer) { TORRENT_ASSERT(false); } + virtual void write_request(peer_request const&) = 0; + void write_cancel(peer_request const&) {} + void write_have(int) {} + void write_dont_have(int) {} + void write_piece(peer_request const&, disk_buffer_holder&) + { TORRENT_ASSERT(false); } void write_keepalive() {} void on_connected(); void write_reject_request(peer_request const&) {} void write_allow_fast(int) {} - void write_suggest(int piece) {} + void write_suggest(int) {} void write_bitfield() {} #if TORRENT_USE_INVARIANT_CHECKS diff --git a/src/alert_manager.cpp b/src/alert_manager.cpp index 4f6dd6005..b0b108dc2 100644 --- a/src/alert_manager.cpp +++ b/src/alert_manager.cpp @@ -134,7 +134,8 @@ namespace libtorrent post_impl(a, lock); } - void alert_manager::post_impl(std::auto_ptr& alert_, mutex::scoped_lock& l) + void alert_manager::post_impl(std::auto_ptr& alert_ + , mutex::scoped_lock& /* l */) { if (m_dispatch) { diff --git a/src/bt_peer_connection.cpp b/src/bt_peer_connection.cpp index 8618a3569..d874ed170 100644 --- a/src/bt_peer_connection.cpp +++ b/src/bt_peer_connection.cpp @@ -691,7 +691,8 @@ namespace libtorrent } #endif // #ifndef TORRENT_DISABLE_ENCRYPTION - void regular_c_free(char* buf, void* userdata, block_cache_reference ref) + void regular_c_free(char* buf, void* /* userdata */ + , block_cache_reference /* ref */) { ::free(buf); } @@ -2446,7 +2447,7 @@ namespace libtorrent #endif } - void buffer_reclaim_block(char* buffer, void* userdata + void buffer_reclaim_block(char* /* buffer */, void* userdata , block_cache_reference ref) { buffer_allocator_interface* buf = (buffer_allocator_interface*)userdata; @@ -2454,7 +2455,7 @@ namespace libtorrent } void buffer_free_disk_buf(char* buffer, void* userdata - , block_cache_reference ref) + , block_cache_reference /* ref */) { buffer_allocator_interface* buf = (buffer_allocator_interface*)userdata; buf->free_disk_buffer(buffer); diff --git a/src/lsd.cpp b/src/lsd.cpp index f4b2ff8e3..86470d9a7 100644 --- a/src/lsd.cpp +++ b/src/lsd.cpp @@ -65,8 +65,7 @@ namespace libtorrent static error_code ec; -lsd::lsd(io_service& ios, address const& listen_interface - , peer_callback_t const& cb) +lsd::lsd(io_service& ios, peer_callback_t const& cb) : m_callback(cb) , m_socket(udp::endpoint(address_v4::from_string("239.192.152.143", ec), 6771) , boost::bind(&lsd::on_announce, self(), _1, _2, _3)) diff --git a/src/lt_trackers.cpp b/src/lt_trackers.cpp index 67b2edb60..cc4a9284f 100644 --- a/src/lt_trackers.cpp +++ b/src/lt_trackers.cpp @@ -192,7 +192,7 @@ namespace libtorrent { namespace return true; } - virtual bool on_extended(int length + virtual bool on_extended(int /* length */ , int extended_msg, buffer::const_interval body) { if (extended_msg != 19) return false; diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index 3d4a14bdd..4fa824475 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -136,7 +136,7 @@ namespace libtorrent , tcp::endpoint const& endp , torrent_peer* peerinfo , bool outgoing) - : peer_connection_hot_members(tor, ses, sett, s, outgoing) + : peer_connection_hot_members(tor, ses, sett, outgoing) , m_socket(s) , m_peer_info(peerinfo) , m_num_pieces(0) diff --git a/src/policy.cpp b/src/policy.cpp index 3693cb9a6..1765758dc 100644 --- a/src/policy.cpp +++ b/src/policy.cpp @@ -924,7 +924,7 @@ namespace libtorrent } void policy::update_peer(torrent_peer* p, int src, int flags - , tcp::endpoint const& remote, char const* destination) + , tcp::endpoint const& remote, char const* /* destination*/) { TORRENT_ASSERT(is_single_thread()); bool was_conn_cand = is_connect_candidate(*p); diff --git a/src/session_impl.cpp b/src/session_impl.cpp index de30dc38a..849d8fc36 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -7487,7 +7487,6 @@ retry: if (m_lsd) return; m_lsd = new lsd(m_io_service - , m_listen_interface.address() , boost::bind(&session_impl::on_lsd_peer, this, _1, _2)); } diff --git a/src/utp_stream.cpp b/src/utp_stream.cpp index 02a61274f..d8d3cdf8c 100644 --- a/src/utp_stream.cpp +++ b/src/utp_stream.cpp @@ -323,7 +323,7 @@ struct utp_socket_impl , boost::uint32_t& min_rtt, boost::uint16_t seq_nr); void write_sack(boost::uint8_t* buf, int size) const; void incoming(boost::uint8_t const* buf, int size, packet* p, ptime now); - void do_ledbat(int acked_bytes, int delay, int in_flight, ptime const now); + void do_ledbat(int acked_bytes, int delay, int in_flight); int packet_timeout() const; bool test_socket_state(); void maybe_trigger_receive_callback(); @@ -2244,7 +2244,8 @@ void utp_socket_impl::ack_packet(packet* p, ptime const& receive_time free(p); } -void utp_socket_impl::incoming(boost::uint8_t const* buf, int size, packet* p, ptime now) +void utp_socket_impl::incoming(boost::uint8_t const* buf, int size, packet* p + , ptime /* now */) { INVARIANT_CHECK; @@ -2967,7 +2968,7 @@ bool utp_socket_impl::incoming_packet(boost::uint8_t const* buf, int size // only use the minimum from the last 3 delay measurements delay = *std::min_element(m_delay_sample_hist, m_delay_sample_hist + num_delay_hist); - do_ledbat(acked_bytes, delay, prev_bytes_in_flight, receive_time); + do_ledbat(acked_bytes, delay, prev_bytes_in_flight); m_send_delay = delay; } @@ -3197,7 +3198,7 @@ bool utp_socket_impl::incoming_packet(boost::uint8_t const* buf, int size return false; } -void utp_socket_impl::do_ledbat(int acked_bytes, int delay, int in_flight, ptime const now) +void utp_socket_impl::do_ledbat(int acked_bytes, int delay, int in_flight) { INVARIANT_CHECK; diff --git a/test/test_auto_unchoke.cpp b/test/test_auto_unchoke.cpp index 03b172463..8e6461870 100644 --- a/test/test_auto_unchoke.cpp +++ b/test/test_auto_unchoke.cpp @@ -137,7 +137,6 @@ int test_main() test_swarm(); - test_sleep(2000); TEST_CHECK(!exists("./tmp1_unchoke/temporary")); TEST_CHECK(!exists("./tmp2_unchoke/temporary")); TEST_CHECK(!exists("./tmp3_unchoke/temporary"));