fix some compile warnings

This commit is contained in:
Arvid Norberg 2015-01-16 20:51:39 +00:00
parent 1ab8d2fa5c
commit f914943e58
3 changed files with 6 additions and 4 deletions

View File

@ -453,7 +453,7 @@ namespace libtorrent
bool preemptive_unchoke() const;
int num_uploads() const
{ return m_stats_counters[counters::num_peers_up_unchoked]; }
{ return int(m_stats_counters[counters::num_peers_up_unchoked]); }
int num_connections() const
{ return m_connections.size(); }
@ -594,7 +594,7 @@ namespace libtorrent
virtual bool verify_bound_address(address const& addr, bool utp
, error_code& ec);
bool has_lsd() const { return m_lsd.get(); }
bool has_lsd() const { return m_lsd.get() != NULL; }
std::vector<block_info>& block_info_storage() { return m_block_info_storage; }

View File

@ -323,7 +323,7 @@ namespace libtorrent
inline std::size_t hash_value(cached_piece_entry const& p)
{
return std::size_t(p.storage.get()) + p.piece;
return std::size_t(p.storage.get()) + std::size_t(p.piece);
}
struct TORRENT_EXTRA_EXPORT block_cache : disk_buffer_pool

View File

@ -188,7 +188,9 @@ public:
return;
}
std::memmove(b, e, m_begin + m_size - e);
TORRENT_ASSERT(e - b <= m_size);
TORRENT_ASSERT(e >= b);
TORRENT_ASSERT(e - b <= std::numeric_limits<boost::uint32_t>::max());
TORRENT_ASSERT(boost::uint32_t(e - b) <= m_size);
m_size -= e - b;
}