From f963f2c7266ba90a2f24e8a2388888b344ef0aeb Mon Sep 17 00:00:00 2001 From: Alden Torres Date: Tue, 27 Mar 2018 18:24:04 -0400 Subject: [PATCH] minor lint oriented code refactor --- include/libtorrent/aux_/has_block.hpp | 5 ++--- include/libtorrent/request_blocks.hpp | 1 - src/path.cpp | 2 +- src/request_blocks.cpp | 1 - 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/include/libtorrent/aux_/has_block.hpp b/include/libtorrent/aux_/has_block.hpp index 054ef0a6d..f06582a9c 100644 --- a/include/libtorrent/aux_/has_block.hpp +++ b/include/libtorrent/aux_/has_block.hpp @@ -40,17 +40,16 @@ namespace libtorrent { namespace aux { struct has_block { has_block(has_block const&) = default; + // explicitly disallow assignment, to silence msvc warning + has_block& operator=(has_block const&) = delete; explicit has_block(piece_block const& b): block(b) {} bool operator()(pending_block const& pb) const { return pb.block == block; } private: piece_block const& block; - // explicitly disallow assignment, to silence msvc warning - has_block& operator=(has_block const&); }; }} #endif - diff --git a/include/libtorrent/request_blocks.hpp b/include/libtorrent/request_blocks.hpp index 423d54136..7dc90ac44 100644 --- a/include/libtorrent/request_blocks.hpp +++ b/include/libtorrent/request_blocks.hpp @@ -54,4 +54,3 @@ namespace libtorrent { } #endif - diff --git a/src/path.cpp b/src/path.cpp index 5d9126b60..9d17c1acc 100644 --- a/src/path.cpp +++ b/src/path.cpp @@ -227,7 +227,7 @@ namespace libtorrent { // posix version - struct stat ret; + struct stat ret{}; int retval; if (flags & dont_follow_links) retval = ::lstat(f.c_str(), &ret); diff --git a/src/request_blocks.cpp b/src/request_blocks.cpp index 03d3c589b..8b700a917 100644 --- a/src/request_blocks.cpp +++ b/src/request_blocks.cpp @@ -35,7 +35,6 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/torrent.hpp" #include "libtorrent/aux_/socket_type.hpp" #include "libtorrent/peer_info.hpp" // for peer_info flags -#include "libtorrent/performance_counters.hpp" // for counters #include "libtorrent/request_blocks.hpp" #include "libtorrent/alert_manager.hpp" #include "libtorrent/aux_/has_block.hpp"