override marking of virtual functions

This commit is contained in:
Arvid Norberg 2015-05-05 05:37:01 +00:00
parent f90537c52d
commit fce3f77744
11 changed files with 123 additions and 92 deletions

View File

@ -52,6 +52,11 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/aux_/disable_warnings_pop.hpp"
#ifdef __GNUC__
// this is to suppress the warnings for using std::auto_ptr
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
// used for emplace_alert() variadic template emulation for c++98
#define TORRENT_ALERT_MANAGER_MAX_ARITY 7
@ -199,5 +204,9 @@ namespace libtorrent {
};
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#endif

View File

@ -49,6 +49,12 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/close_reason.hpp"
#include "libtorrent/aux_/escape_string.hpp" // for convert_from_native
#ifdef __GNUC__
// this is to suppress the warnings for using std::auto_ptr
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
namespace libtorrent
{
@ -2298,5 +2304,10 @@ namespace libtorrent
enum { num_alert_types = 84 };
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#endif

View File

@ -40,6 +40,7 @@ POSSIBILITY OF SUCH DAMAGE.
#pragma GCC diagnostic ignored "-Wundef"
#pragma GCC diagnostic ignored "-Wmissing-noreturn"
#pragma GCC diagnostic ignored "-Wdeprecated"
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#pragma GCC diagnostic ignored "-Wshadow"
#pragma GCC diagnostic ignored "-Wunused-variable"
#endif
@ -57,6 +58,7 @@ POSSIBILITY OF SUCH DAMAGE.
#pragma clang diagnostic ignored "-Wweak-vtables"
#pragma clang diagnostic ignored "-Wmissing-noreturn"
#pragma clang diagnostic ignored "-Wdeprecated"
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#pragma clang diagnostic ignored "-Wcast-align"
#pragma clang diagnostic ignored "-Wweak-vtable"
#pragma clang diagnostic ignored "-Wundef"

View File

@ -590,7 +590,7 @@ namespace libtorrent
// uncork all peers added to the delayed uncork queue
// implements uncork_interface
void do_delayed_uncork();
virtual void do_delayed_uncork() TORRENT_OVERRIDE;
void post_socket_job(socket_job& j);

View File

@ -79,7 +79,7 @@ namespace libtorrent
bt_peer_connection(peer_connection_args const& pack
, peer_id const& pid);
void start();
virtual void start() TORRENT_OVERRIDE;
enum
{
@ -105,7 +105,8 @@ namespace libtorrent
void switch_recv_crypto(boost::shared_ptr<crypto_plugin> crypto);
#endif
virtual int type() const { return peer_connection::bittorrent_connection; }
virtual int type() const TORRENT_OVERRIDE
{ return peer_connection::bittorrent_connection; }
enum message_type
{
@ -152,17 +153,17 @@ namespace libtorrent
// work to do.
void on_sent(error_code const& error
, std::size_t bytes_transferred);
, std::size_t bytes_transferred) TORRENT_OVERRIDE;
void on_receive(error_code const& error
, std::size_t bytes_transferred);
, std::size_t bytes_transferred) TORRENT_OVERRIDE;
void on_receive_impl(std::size_t bytes_transferred);
#if !defined(TORRENT_DISABLE_ENCRYPTION) && !defined(TORRENT_DISABLE_EXTENSIONS)
virtual int hit_send_barrier(std::vector<asio::mutable_buffer>& iovec);
virtual int hit_send_barrier(std::vector<asio::mutable_buffer>& iovec) TORRENT_OVERRIDE;
#endif
virtual void get_specific_peer_info(peer_info& p) const;
virtual bool in_handshake() const;
virtual void get_specific_peer_info(peer_info& p) const TORRENT_OVERRIDE;
virtual bool in_handshake() const TORRENT_OVERRIDE;
bool packet_finished() const { return m_recv_buffer.packet_finished(); }
#ifndef TORRENT_DISABLE_EXTENSIONS
@ -211,16 +212,17 @@ namespace libtorrent
// the following functions appends messages
// to the send buffer
void write_choke();
void write_unchoke();
void write_interested();
void write_not_interested();
void write_request(peer_request const& r);
void write_cancel(peer_request const& r);
void write_bitfield();
void write_have(int index);
void write_dont_have(int index);
void write_piece(peer_request const& r, disk_buffer_holder& buffer);
void write_choke() TORRENT_OVERRIDE;
void write_unchoke() TORRENT_OVERRIDE;
void write_interested() TORRENT_OVERRIDE;
void write_not_interested() TORRENT_OVERRIDE;
void write_request(peer_request const& r) TORRENT_OVERRIDE;
void write_cancel(peer_request const& r) TORRENT_OVERRIDE;
void write_bitfield() TORRENT_OVERRIDE;
void write_have(int index) TORRENT_OVERRIDE;
void write_dont_have(int index) TORRENT_OVERRIDE;
void write_piece(peer_request const& r, disk_buffer_holder& buffer) TORRENT_OVERRIDE;
void write_keepalive() TORRENT_OVERRIDE;
void write_handshake(bool plain_handshake = false);
#ifndef TORRENT_DISABLE_EXTENSIONS
void write_extensions();
@ -230,7 +232,6 @@ namespace libtorrent
#endif
void write_metadata(std::pair<int, int> req);
void write_metadata_request(std::pair<int, int> req);
void write_keepalive();
// DHT extension
void write_dht_port(int listen_port);
@ -238,12 +239,12 @@ namespace libtorrent
// FAST extension
void write_have_all();
void write_have_none();
void write_reject_request(peer_request const&);
void write_allow_fast(int piece);
void write_suggest(int piece);
void write_reject_request(peer_request const&) TORRENT_OVERRIDE;
void write_allow_fast(int piece) TORRENT_OVERRIDE;
void write_suggest(int piece) TORRENT_OVERRIDE;
void on_connected();
void on_metadata();
void on_connected() TORRENT_OVERRIDE;
void on_metadata() TORRENT_OVERRIDE;
#if TORRENT_USE_INVARIANT_CHECKS
void check_invariant() const;
@ -258,7 +259,7 @@ namespace libtorrent
// block. If the peer isn't downloading
// a piece for the moment, the boost::optional
// will be invalid.
boost::optional<piece_block_progress> downloading_piece_progress() const;
boost::optional<piece_block_progress> downloading_piece_progress() const TORRENT_OVERRIDE;
#if !defined(TORRENT_DISABLE_ENCRYPTION) && !defined(TORRENT_DISABLE_EXTENSIONS)
@ -300,7 +301,7 @@ public:
virtual void append_const_send_buffer(char const* buffer, int size
, chained_buffer::free_buffer_fun destructor = &nop
, void* userdata = NULL, block_cache_reference ref
= block_cache_reference());
= block_cache_reference()) TORRENT_OVERRIDE;
private:

View File

@ -421,7 +421,7 @@ int snprintf(char* buf, int len, char const* fmt, ...)
#define TORRENT_FINAL final
#endif
#if __cplusplus <= 199711L
#if __cplusplus <= 199711L || defined BOOST_NO_CXX11_FINAL
#define TORRENT_OVERRIDE
#else
#define TORRENT_OVERRIDE override

View File

@ -80,19 +80,20 @@ namespace libtorrent
http_seed_connection(peer_connection_args const& pack
, web_seed_t& web);
virtual int type() const { return peer_connection::http_seed_connection; }
virtual int type() const TORRENT_OVERRIDE
{ return peer_connection::http_seed_connection; }
// called from the main loop when this connection has any
// work to do.
void on_receive(error_code const& error
, std::size_t bytes_transferred);
virtual void on_receive(error_code const& error
, std::size_t bytes_transferred) TORRENT_OVERRIDE;
std::string const& url() const { return m_url; }
virtual void get_specific_peer_info(peer_info& p) const;
virtual void disconnect(error_code const& ec, operation_t op, int error = 0);
virtual void get_specific_peer_info(peer_info& p) const TORRENT_OVERRIDE;
virtual void disconnect(error_code const& ec, operation_t op, int error = 0) TORRENT_OVERRIDE;
void write_request(peer_request const& r);
virtual void write_request(peer_request const& r) TORRENT_OVERRIDE;
private:

View File

@ -124,14 +124,14 @@ namespace libtorrent
rc4_handler();
// Input keys must be 20 bytes
void set_incoming_key(unsigned char const* key, int len);
void set_outgoing_key(unsigned char const* key, int len);
void set_incoming_key(unsigned char const* key, int len) TORRENT_OVERRIDE;
void set_outgoing_key(unsigned char const* key, int len) TORRENT_OVERRIDE;
int encrypt(std::vector<boost::asio::mutable_buffer>& buf);
int encrypt(std::vector<boost::asio::mutable_buffer>& buf) TORRENT_OVERRIDE;
void decrypt(std::vector<boost::asio::mutable_buffer>& buf
, int& consume
, int& produce
, int& packet_size);
, int& packet_size) TORRENT_OVERRIDE;
private:
rc4 m_rc4_incoming;

View File

@ -55,10 +55,10 @@ struct TORRENT_EXTRA_EXPORT resolver TORRENT_FINAL : resolver_interface
{
resolver(io_service& ios);
void async_resolve(std::string const& host, int flags
, callback_t const& h);
virtual void async_resolve(std::string const& host, int flags
, callback_t const& h) TORRENT_OVERRIDE;
void abort();
virtual void abort() TORRENT_OVERRIDE;
private:

View File

@ -33,6 +33,8 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_STORAGE_HPP_INCLUDE
#define TORRENT_STORAGE_HPP_INCLUDE
#include "libtorrent/config.hpp"
#include "libtorrent/aux_/disable_warnings_push.hpp"
#include <vector>
@ -51,7 +53,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/piece_picker.hpp"
#include "libtorrent/peer_request.hpp"
#include "libtorrent/hasher.hpp"
#include "libtorrent/config.hpp"
#include "libtorrent/file.hpp"
#include "libtorrent/disk_buffer_holder.hpp"
#include "libtorrent/thread.hpp"
@ -414,29 +415,29 @@ namespace libtorrent
// hidden
~default_storage();
// hidden
void set_file_priority(std::vector<boost::uint8_t> const& prio);
#ifndef TORRENT_NO_DEPRECATE
void finalize_file(int file, storage_error& ec);
void finalize_file(int file, storage_error& ec) TORRENT_OVERRIDE;
#endif
bool has_any_file(storage_error& ec);
void set_file_priority(std::vector<boost::uint8_t> const& prio, storage_error& ec);
void rename_file(int index, std::string const& new_filename, storage_error& ec);
void release_files(storage_error& ec);
void delete_files(storage_error& ec);
void initialize(storage_error& ec);
int move_storage(std::string const& save_path, int flags, storage_error& ec);
int sparse_end(int start) const;
bool verify_resume_data(bdecode_node const& rd
virtual bool has_any_file(storage_error& ec) TORRENT_OVERRIDE;
virtual void set_file_priority(std::vector<boost::uint8_t> const& prio
, storage_error& ec) TORRENT_OVERRIDE;
virtual void rename_file(int index, std::string const& new_filename
, storage_error& ec) TORRENT_OVERRIDE;
virtual void release_files(storage_error& ec) TORRENT_OVERRIDE;
virtual void delete_files(storage_error& ec) TORRENT_OVERRIDE;
virtual void initialize(storage_error& ec) TORRENT_OVERRIDE;
virtual int move_storage(std::string const& save_path, int flags
, storage_error& ec) TORRENT_OVERRIDE;
virtual bool verify_resume_data(bdecode_node const& rd
, std::vector<std::string> const* links
, storage_error& error);
void write_resume_data(entry& rd, storage_error& ec) const;
bool tick();
, storage_error& error) TORRENT_OVERRIDE;
virtual void write_resume_data(entry& rd, storage_error& ec) const TORRENT_OVERRIDE;
virtual bool tick() TORRENT_OVERRIDE;
int readv(file::iovec_t const* bufs, int num_bufs
, int piece, int offset, int flags, storage_error& ec);
, int piece, int offset, int flags, storage_error& ec) TORRENT_OVERRIDE;
int writev(file::iovec_t const* bufs, int num_bufs
, int piece, int offset, int flags, storage_error& ec);
, int piece, int offset, int flags, storage_error& ec) TORRENT_OVERRIDE;
// if the files in this storage are mapped, returns the mapped
// file_storage, otherwise returns the original file_storage object.
@ -444,6 +445,8 @@ namespace libtorrent
private:
int sparse_end(int start) const;
// this identifies a read or write operation
// so that default_storage::readwritev() knows what to
// do when it's actually touching the file
@ -510,23 +513,26 @@ namespace libtorrent
{
public:
disabled_storage(int piece_size) : m_piece_size(piece_size) {}
bool has_any_file(storage_error&) { return false; }
void set_file_priority(std::vector<boost::uint8_t> const&, storage_error&) {}
void rename_file(int, std::string const&, storage_error&) {}
void release_files(storage_error&) {}
void delete_files(storage_error&) {}
void initialize(storage_error&) {}
int move_storage(std::string const&, int, storage_error&) { return 0; }
virtual bool has_any_file(storage_error&) TORRENT_OVERRIDE { return false; }
virtual void set_file_priority(std::vector<boost::uint8_t> const&
, storage_error&) TORRENT_OVERRIDE {}
virtual void rename_file(int, std::string const&, storage_error&) TORRENT_OVERRIDE {}
virtual void release_files(storage_error&) TORRENT_OVERRIDE {}
virtual void delete_files(storage_error&) TORRENT_OVERRIDE {}
virtual void initialize(storage_error&) TORRENT_OVERRIDE {}
virtual int move_storage(std::string const&, int, storage_error&) TORRENT_OVERRIDE { 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);
virtual int readv(file::iovec_t const* bufs, int num_bufs, int piece
, int offset, int flags, storage_error& ec) TORRENT_OVERRIDE;
virtual int writev(file::iovec_t const* bufs, int num_bufs, int piece
, int offset, int flags, storage_error& ec) TORRENT_OVERRIDE;
bool verify_resume_data(bdecode_node const&
virtual bool verify_resume_data(bdecode_node const&
, std::vector<std::string> const*
, storage_error&) { return false; }
void write_resume_data(entry&, storage_error&) const {}
, storage_error&) TORRENT_OVERRIDE { return false; }
virtual void write_resume_data(entry&, storage_error&) const TORRENT_OVERRIDE {}
private:
int m_piece_size;
};
@ -535,27 +541,27 @@ namespace libtorrent
// anything written to it
struct zero_storage : storage_interface
{
virtual void initialize(storage_error&) {}
virtual void initialize(storage_error&) TORRENT_OVERRIDE {}
virtual int readv(file::iovec_t const* bufs, int num_bufs
, int piece, int offset, int flags, storage_error& ec);
, int piece, int offset, int flags, storage_error& ec) TORRENT_OVERRIDE;
virtual int writev(file::iovec_t const* bufs, int num_bufs
, int piece, int offset, int flags, storage_error& ec);
, int piece, int offset, int flags, storage_error& ec) TORRENT_OVERRIDE;
virtual bool has_any_file(storage_error&) { return false; }
virtual bool has_any_file(storage_error&) TORRENT_OVERRIDE { return false; }
virtual void set_file_priority(std::vector<boost::uint8_t> const& /* prio */
, storage_error&) {}
, storage_error&) TORRENT_OVERRIDE {}
virtual int move_storage(std::string const& /* save_path */
, int /* flags */, storage_error&) { return 0; }
, int /* flags */, storage_error&) TORRENT_OVERRIDE { return 0; }
virtual bool verify_resume_data(bdecode_node const& /* rd */
, std::vector<std::string> const* /* links */
, storage_error&)
, storage_error&) TORRENT_OVERRIDE
{ return false; }
virtual void write_resume_data(entry&, storage_error&) const {}
virtual void release_files(storage_error&) {}
virtual void write_resume_data(entry&, storage_error&) const TORRENT_OVERRIDE {}
virtual void release_files(storage_error&) TORRENT_OVERRIDE {}
virtual void rename_file(int /* index */
, std::string const& /* new_filenamem */, storage_error&) {}
virtual void delete_files(storage_error&) {}
, std::string const& /* new_filenamem */, storage_error&) TORRENT_OVERRIDE {}
virtual void delete_files(storage_error&) TORRENT_OVERRIDE {}
};
struct disk_io_thread;

View File

@ -74,24 +74,25 @@ namespace libtorrent
web_peer_connection(peer_connection_args const& pack
, web_seed_t& web);
virtual void on_connected();
virtual void on_connected() TORRENT_OVERRIDE;
virtual int type() const { return peer_connection::url_seed_connection; }
virtual int type() const TORRENT_OVERRIDE
{ return peer_connection::url_seed_connection; }
// called from the main loop when this connection has any
// work to do.
void on_receive(error_code const& error
, std::size_t bytes_transferred);
virtual void on_receive(error_code const& error
, std::size_t bytes_transferred) TORRENT_OVERRIDE;
std::string const& url() const { return m_url; }
virtual void get_specific_peer_info(peer_info& p) const;
virtual void get_specific_peer_info(peer_info& p) const TORRENT_OVERRIDE;
virtual void disconnect(error_code const& ec
, operation_t op, int error = 0);
, operation_t op, int error = 0) TORRENT_OVERRIDE;
virtual void write_request(peer_request const& r);
virtual void write_request(peer_request const& r) TORRENT_OVERRIDE;
virtual bool received_invalid_data(int index, bool single_peer);
virtual bool received_invalid_data(int index, bool single_peer) TORRENT_OVERRIDE;
private:
@ -102,7 +103,7 @@ namespace libtorrent
// block. If the peer isn't downloading
// a piece for the moment, the boost::optional
// will be invalid.
boost::optional<piece_block_progress> downloading_piece_progress() const;
boost::optional<piece_block_progress> downloading_piece_progress() const TORRENT_OVERRIDE;
void handle_padfile(buffer::const_interval& recv_buffer);