forked from premiere/premiere-libtorrent
minor code cleanup (#1933)
This commit is contained in:
parent
735214a806
commit
b863306c8b
|
@ -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.
|
||||
|
|
|
@ -57,8 +57,6 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
namespace libtorrent {
|
||||
|
||||
class torrent;
|
||||
|
||||
#ifndef TORRENT_DISABLE_EXTENSIONS
|
||||
struct TORRENT_EXTRA_EXPORT ut_pex_peer_store
|
||||
{
|
||||
|
|
|
@ -157,4 +157,4 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#endif // BTORRENT_BUFFER_HPP_INCLUDED
|
||||
#endif // TORRENT_BUFFER_HPP_INCLUDED
|
||||
|
|
|
@ -67,4 +67,3 @@ namespace libtorrent {
|
|||
}
|
||||
|
||||
#endif // TORRENT_COPY_PTR
|
||||
|
||||
|
|
|
@ -97,4 +97,3 @@ namespace libtorrent {
|
|||
}
|
||||
|
||||
#endif // TORRENT_FINGERPRINT_HPP_INCLUDED
|
||||
|
||||
|
|
|
@ -105,4 +105,3 @@ namespace libtorrent {
|
|||
}
|
||||
|
||||
#endif // TORRENT_OPERATIONS_HPP_INCLUDED
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue