fixed warning non-virtual-dtor and minor code refactor (#1324)

fixed warning non-virtual-dtor and minor code refactor
This commit is contained in:
Alden Torres 2016-11-18 08:21:42 -05:00 committed by Arvid Norberg
parent 4c7e24ea35
commit 5490f802ec
5 changed files with 9 additions and 9 deletions

View File

@ -247,10 +247,6 @@ rule warnings ( properties * )
result += <cflags>-Wno-c++11-long-long ;
result += <cflags>-Wno-variadic-macros ;
# in C++98 mode there's no way to silence this warning
# in the code (without final)
result += <cflags>-Wno-non-virtual-dtor ;
# enable these warnings again, once the other ones are dealt with
result += <cflags>-Wno-weak-vtables ;
result += <cflags>-Wno-sign-compare ;

View File

@ -62,10 +62,13 @@ namespace libtorrent { namespace aux
handler_storage(handler_storage const&);
};
struct error_handler_interface
struct TORRENT_EXTRA_EXPORT error_handler_interface
{
virtual void on_exception(std::exception const&) = 0;
virtual void on_error(error_code const&) = 0;
protected:
~error_handler_interface() {}
};
// this class is a wrapper for an asio handler object. Its main purpose

View File

@ -44,7 +44,6 @@ POSSIBILITY OF SUCH DAMAGE.
namespace libtorrent
{
struct storage_interface;
using storage_interface = storage_interface;
struct cached_piece_entry;
class torrent_info;
struct add_torrent_params;
@ -69,7 +68,6 @@ namespace libtorrent
// a lot of heap allocation churn of using general purpose
// containers.
struct TORRENT_EXTRA_EXPORT disk_io_job : tailqueue_node<disk_io_job>
, boost::noncopyable
{
disk_io_job();
~disk_io_job();

View File

@ -565,6 +565,9 @@ namespace libtorrent
{
virtual int file_op(int const file_index, std::int64_t const file_offset
, span<file::iovec_t const> bufs, storage_error& ec) = 0;
protected:
~fileop() {}
};
// this function is responsible for turning read and write operations in the

View File

@ -212,7 +212,7 @@ namespace libtorrent
} // anonymous namespace
struct write_fileop : fileop
struct write_fileop final : fileop
{
write_fileop(default_storage& st, int flags)
: m_storage(st)
@ -300,7 +300,7 @@ namespace libtorrent
int m_flags;
};
struct read_fileop : fileop
struct read_fileop final : fileop
{
read_fileop(default_storage& st, int const flags)
: m_storage(st)