From dba94a92762d09e7e62eefc14bb0138335cfeacc Mon Sep 17 00:00:00 2001 From: Alden Torres Date: Fri, 17 Mar 2017 18:15:11 -0400 Subject: [PATCH] fix IndexType template parameter in typed_span member functions (#1819) fix IndexType template parameter in typed_span member functions --- include/libtorrent/aux_/typed_span.hpp | 16 ++++++++-------- src/storage_utils.cpp | 1 - test/test_remap_files.cpp | 3 +-- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/include/libtorrent/aux_/typed_span.hpp b/include/libtorrent/aux_/typed_span.hpp index 0ea644d4a..7db6421cc 100644 --- a/include/libtorrent/aux_/typed_span.hpp +++ b/include/libtorrent/aux_/typed_span.hpp @@ -64,13 +64,13 @@ namespace libtorrent { namespace aux { template ::value>::type> - typed_span first(underlying_index n) const + typed_span first(underlying_index n) const { TORRENT_ASSERT(n >= 0); return this->base::first(std::size_t(n)); } - typed_span first(std::size_t n) const + typed_span first(std::size_t n) const { TORRENT_ASSERT(n <= std::size_t((std::numeric_limits::max)())); return this->base::first(n); @@ -78,13 +78,13 @@ namespace libtorrent { namespace aux { template ::value>::type> - typed_span last(underlying_index n) const + typed_span last(underlying_index n) const { TORRENT_ASSERT(n >= 0); return this->base::last(std::size_t(n)); } - typed_span last(std::size_t n) const + typed_span last(std::size_t n) const { TORRENT_ASSERT(n <= std::size_t((std::numeric_limits::max)())); return this->base::last(n); @@ -92,7 +92,7 @@ namespace libtorrent { namespace aux { template ::value>::type> - typed_span subspan(underlying_index offset) const + typed_span subspan(underlying_index offset) const { TORRENT_ASSERT(offset >= 0); return this->base::subspan(std::size_t(offset)); @@ -100,20 +100,20 @@ namespace libtorrent { namespace aux { template ::value>::type> - typed_span subspan(underlying_index offset, underlying_index count) const + typed_span subspan(underlying_index offset, underlying_index count) const { TORRENT_ASSERT(offset >= 0); TORRENT_ASSERT(count >= 0); return this->base::subspan(std::size_t(offset), std::size_t(count)); } - typed_span subspan(std::size_t offset) const + typed_span subspan(std::size_t offset) const { TORRENT_ASSERT(offset <= std::size_t((std::numeric_limits::max)())); return this->base::subspan(offset); } - typed_span subspan(std::size_t offset, std::size_t count) const + typed_span subspan(std::size_t offset, std::size_t count) const { TORRENT_ASSERT(offset <= std::size_t((std::numeric_limits::max)())); TORRENT_ASSERT(count <= std::size_t((std::numeric_limits::max)())); diff --git a/src/storage_utils.cpp b/src/storage_utils.cpp index 5f86112b4..1040134d2 100644 --- a/src/storage_utils.cpp +++ b/src/storage_utils.cpp @@ -558,4 +558,3 @@ namespace libtorrent { namespace aux } }} - diff --git a/test/test_remap_files.cpp b/test/test_remap_files.cpp index b3a76ff86..05c9ffa5e 100644 --- a/test/test_remap_files.cpp +++ b/test/test_remap_files.cpp @@ -106,7 +106,7 @@ void test_remap_files(storage_mode_t storage_mode = storage_mode_sparse) } // wait for all alerts to come back and verify the data against the expected - // piece adata + // piece data aux::vector pieces(fs.num_pieces(), false); aux::vector passed(fs.num_pieces(), false); aux::vector files(fs.num_files(), false); @@ -200,4 +200,3 @@ TORRENT_TEST(remap_files) { test_remap_files(); } -