added consts and minor code formatting
This commit is contained in:
parent
285daa21a5
commit
10bfe18ebe
|
@ -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)
|
||||||
|
|
|
@ -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);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue