minor code cleanup (#1933)

This commit is contained in:
Alden Torres 2017-04-22 21:33:38 -04:00 committed by Arvid Norberg
parent 735214a806
commit b863306c8b
8 changed files with 5 additions and 11 deletions

View File

@ -70,7 +70,7 @@ namespace libtorrent {
resize(bits);
if (bits > 0)
{
std::memcpy(buf(), b, size_t((bits + 7) / 8));
std::memcpy(buf(), b, std::size_t((bits + 7) / 8));
clear_trailing_bits();
}
}
@ -229,13 +229,13 @@ namespace libtorrent {
void set_all()
{
if (size() == 0) return;
std::memset(buf(), 0xff, size_t(num_words() * 4));
std::memset(buf(), 0xff, std::size_t(num_words() * 4));
clear_trailing_bits();
}
void clear_all()
{
if (size() == 0) return;
std::memset(buf(), 0x00, size_t(num_words() * 4));
std::memset(buf(), 0x00, std::size_t(num_words() * 4));
}
// make the bitfield empty, of zero size.

View File

@ -57,8 +57,6 @@ POSSIBILITY OF SUCH DAMAGE.
namespace libtorrent {
class torrent;
#ifndef TORRENT_DISABLE_EXTENSIONS
struct TORRENT_EXTRA_EXPORT ut_pex_peer_store
{

View File

@ -157,4 +157,4 @@ private:
}
#endif // BTORRENT_BUFFER_HPP_INCLUDED
#endif // TORRENT_BUFFER_HPP_INCLUDED

View File

@ -67,4 +67,3 @@ namespace libtorrent {
}
#endif // TORRENT_COPY_PTR

View File

@ -97,4 +97,3 @@ namespace libtorrent {
}
#endif // TORRENT_FINGERPRINT_HPP_INCLUDED

View File

@ -105,4 +105,3 @@ namespace libtorrent {
}
#endif // TORRENT_OPERATIONS_HPP_INCLUDED

View File

@ -5675,7 +5675,6 @@ namespace libtorrent {
}
if (size <= 0) return;
int i = 0;
while (size > 0)
{
aux::ses_buffer_holder session_buf = m_ses.allocate_buffer();
@ -5686,7 +5685,6 @@ namespace libtorrent {
buf += buf_size;
size -= buf_size;
m_send_buffer.append_buffer(std::move(session_buf), alloc_buf_size, buf_size);
++i;
}
setup_send();
}

View File

@ -302,6 +302,7 @@ namespace libtorrent {
{
iovec_t const v = {buf.data(), buf.size()};
std::int64_t const ret = f->writev(file_offset, v, ec.ec);
TORRENT_UNUSED(ret);
TORRENT_ASSERT(ec || ret == std::int64_t(v.iov_len));
}, fs.file_offset(i), fs.file_size(i), ec.ec);