fixed warning non-virtual-dtor and minor code refactor (#1324)
fixed warning non-virtual-dtor and minor code refactor
This commit is contained in:
parent
4c7e24ea35
commit
5490f802ec
4
Jamfile
4
Jamfile
|
@ -247,10 +247,6 @@ rule warnings ( properties * )
|
||||||
result += <cflags>-Wno-c++11-long-long ;
|
result += <cflags>-Wno-c++11-long-long ;
|
||||||
result += <cflags>-Wno-variadic-macros ;
|
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
|
# enable these warnings again, once the other ones are dealt with
|
||||||
result += <cflags>-Wno-weak-vtables ;
|
result += <cflags>-Wno-weak-vtables ;
|
||||||
result += <cflags>-Wno-sign-compare ;
|
result += <cflags>-Wno-sign-compare ;
|
||||||
|
|
|
@ -62,10 +62,13 @@ namespace libtorrent { namespace aux
|
||||||
handler_storage(handler_storage const&);
|
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_exception(std::exception const&) = 0;
|
||||||
virtual void on_error(error_code 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
|
// this class is a wrapper for an asio handler object. Its main purpose
|
||||||
|
|
|
@ -44,7 +44,6 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
namespace libtorrent
|
namespace libtorrent
|
||||||
{
|
{
|
||||||
struct storage_interface;
|
struct storage_interface;
|
||||||
using storage_interface = storage_interface;
|
|
||||||
struct cached_piece_entry;
|
struct cached_piece_entry;
|
||||||
class torrent_info;
|
class torrent_info;
|
||||||
struct add_torrent_params;
|
struct add_torrent_params;
|
||||||
|
@ -69,7 +68,6 @@ namespace libtorrent
|
||||||
// a lot of heap allocation churn of using general purpose
|
// a lot of heap allocation churn of using general purpose
|
||||||
// containers.
|
// containers.
|
||||||
struct TORRENT_EXTRA_EXPORT disk_io_job : tailqueue_node<disk_io_job>
|
struct TORRENT_EXTRA_EXPORT disk_io_job : tailqueue_node<disk_io_job>
|
||||||
, boost::noncopyable
|
|
||||||
{
|
{
|
||||||
disk_io_job();
|
disk_io_job();
|
||||||
~disk_io_job();
|
~disk_io_job();
|
||||||
|
|
|
@ -565,6 +565,9 @@ namespace libtorrent
|
||||||
{
|
{
|
||||||
virtual int file_op(int const file_index, std::int64_t const file_offset
|
virtual int file_op(int const file_index, std::int64_t const file_offset
|
||||||
, span<file::iovec_t const> bufs, storage_error& ec) = 0;
|
, span<file::iovec_t const> bufs, storage_error& ec) = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~fileop() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
// this function is responsible for turning read and write operations in the
|
// this function is responsible for turning read and write operations in the
|
||||||
|
|
|
@ -212,7 +212,7 @@ namespace libtorrent
|
||||||
|
|
||||||
} // anonymous namespace
|
} // anonymous namespace
|
||||||
|
|
||||||
struct write_fileop : fileop
|
struct write_fileop final : fileop
|
||||||
{
|
{
|
||||||
write_fileop(default_storage& st, int flags)
|
write_fileop(default_storage& st, int flags)
|
||||||
: m_storage(st)
|
: m_storage(st)
|
||||||
|
@ -300,7 +300,7 @@ namespace libtorrent
|
||||||
int m_flags;
|
int m_flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct read_fileop : fileop
|
struct read_fileop final : fileop
|
||||||
{
|
{
|
||||||
read_fileop(default_storage& st, int const flags)
|
read_fileop(default_storage& st, int const flags)
|
||||||
: m_storage(st)
|
: m_storage(st)
|
||||||
|
|
Loading…
Reference in New Issue