From f0cd6492bd72512e71c914546ece8be17b90553b Mon Sep 17 00:00:00 2001 From: Alden Torres Date: Thu, 15 Feb 2018 09:22:52 -0500 Subject: [PATCH] minor lint oriented cleanup and refactor in headers --- include/libtorrent/block_cache.hpp | 2 +- include/libtorrent/disk_interface.hpp | 2 +- include/libtorrent/disk_io_thread.hpp | 1 - include/libtorrent/disk_io_thread_pool.hpp | 2 +- include/libtorrent/disk_job_pool.hpp | 1 - include/libtorrent/packet_pool.hpp | 4 ++-- 6 files changed, 5 insertions(+), 7 deletions(-) diff --git a/include/libtorrent/block_cache.hpp b/include/libtorrent/block_cache.hpp index 5720beb7c..dc8fee7e7 100644 --- a/include/libtorrent/block_cache.hpp +++ b/include/libtorrent/block_cache.hpp @@ -188,7 +188,7 @@ namespace aux { return refcount == 0 && piece_refcount == 0 && !hashing - && read_jobs.size() == 0 + && read_jobs.empty() && outstanding_read == 0 && (ignore_hash || !hash || hash->offset == 0); } diff --git a/include/libtorrent/disk_interface.hpp b/include/libtorrent/disk_interface.hpp index 8630743b0..559ce4a45 100644 --- a/include/libtorrent/disk_interface.hpp +++ b/include/libtorrent/disk_interface.hpp @@ -105,7 +105,7 @@ namespace libtorrent { } // this contains information about a file that's currently open by the - // libtorrent disk I/O subsystem. It's associated with a single torent. + // libtorrent disk I/O subsystem. It's associated with a single torrent. struct TORRENT_EXPORT open_file_state { // the index of the file this entry refers to into the ``file_storage`` diff --git a/include/libtorrent/disk_io_thread.hpp b/include/libtorrent/disk_io_thread.hpp index c9711dbb3..84c60a614 100644 --- a/include/libtorrent/disk_io_thread.hpp +++ b/include/libtorrent/disk_io_thread.hpp @@ -376,7 +376,6 @@ namespace aux { status_t do_check_fastresume(disk_io_job* j, jobqueue_t& completed_jobs); status_t do_rename_file(disk_io_job* j, jobqueue_t& completed_jobs); status_t do_stop_torrent(disk_io_job* j, jobqueue_t& completed_jobs); - status_t do_read_and_hash(disk_io_job* j, jobqueue_t& completed_jobs); status_t do_flush_piece(disk_io_job* j, jobqueue_t& completed_jobs); status_t do_flush_hashed(disk_io_job* j, jobqueue_t& completed_jobs); status_t do_flush_storage(disk_io_job* j, jobqueue_t& completed_jobs); diff --git a/include/libtorrent/disk_io_thread_pool.hpp b/include/libtorrent/disk_io_thread_pool.hpp index a35183978..810e819e7 100644 --- a/include/libtorrent/disk_io_thread_pool.hpp +++ b/include/libtorrent/disk_io_thread_pool.hpp @@ -69,7 +69,7 @@ namespace libtorrent { // set the maximum number of I/O threads which may be running // the actual number of threads will be <= this number - void set_max_threads(int const i); + void set_max_threads(int i); void abort(bool wait); int max_threads() const { return m_max_threads; } diff --git a/include/libtorrent/disk_job_pool.hpp b/include/libtorrent/disk_job_pool.hpp index c73bb7ca3..5a4b3967c 100644 --- a/include/libtorrent/disk_job_pool.hpp +++ b/include/libtorrent/disk_job_pool.hpp @@ -73,4 +73,3 @@ namespace libtorrent { } #endif // TORRENT_DISK_JOB_POOL - diff --git a/include/libtorrent/packet_pool.hpp b/include/libtorrent/packet_pool.hpp index 4900db441..7acf9b9a9 100644 --- a/include/libtorrent/packet_pool.hpp +++ b/include/libtorrent/packet_pool.hpp @@ -168,7 +168,7 @@ namespace libtorrent { , m_mtu_floor_slab(mtu_floor_size) , m_mtu_ceiling_slab(mtu_ceiling_size) {} - packet_pool(packet_pool&&) = default; + packet_pool(packet_pool&&) = delete; packet_ptr acquire(int const allocate) { @@ -183,7 +183,7 @@ namespace libtorrent { { TORRENT_ASSERT(is_single_thread()); - if (p.get() == nullptr) return; + if (!p) return; int const allocated = p->allocated;