added consts and minor code formatting

This commit is contained in:
Alden Torres 2017-07-03 16:18:53 -04:00 committed by Arvid Norberg
parent 285daa21a5
commit 10bfe18ebe
2 changed files with 4 additions and 4 deletions

View File

@ -663,14 +663,14 @@ namespace libtorrent {
DLOG("]\n"); DLOG("]\n");
#endif #endif
open_mode_t const file_flags = m_settings.get_bool(settings_pack::coalesce_writes) open_mode_t const file_flags = m_settings.get_bool(settings_pack::coalesce_writes)
? open_mode_t::coalesce_buffers : open_mode_t::none; ? open_mode_t::coalesce_buffers : open_mode_t::none;
// issue the actual write operation // issue the actual write operation
auto iov_start = iov; auto iov_start = iov;
std::size_t flushing_start = 0; std::size_t flushing_start = 0;
piece_index_t const piece = pe->piece; piece_index_t const piece = pe->piece;
int const blocks_in_piece = pe->blocks_in_piece; int const blocks_in_piece = int(pe->blocks_in_piece);
bool failed = false; bool failed = false;
std::size_t const n_blocks = aux::numeric_cast<std::size_t>(num_blocks); std::size_t const n_blocks = aux::numeric_cast<std::size_t>(num_blocks);
for (std::size_t i = 1; i <= n_blocks; ++i) for (std::size_t i = 1; i <= n_blocks; ++i)

View File

@ -173,7 +173,7 @@ namespace libtorrent {
} }
int part_file::writev(span<iovec_t const> bufs, piece_index_t const piece int part_file::writev(span<iovec_t const> bufs, piece_index_t const piece
, int offset, error_code& ec) , int const offset, error_code& ec)
{ {
TORRENT_ASSERT(offset >= 0); TORRENT_ASSERT(offset >= 0);
std::unique_lock<std::mutex> l(m_mutex); std::unique_lock<std::mutex> l(m_mutex);
@ -236,7 +236,7 @@ namespace libtorrent {
} }
} }
void part_file::free_piece(piece_index_t piece) void part_file::free_piece(piece_index_t const piece)
{ {
std::lock_guard<std::mutex> l(m_mutex); std::lock_guard<std::mutex> l(m_mutex);