From 491b876329c1793f5ae458ba5dcaf7e95993c55c Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 19 Dec 2010 09:50:58 +0000 Subject: [PATCH] fixed some msvc warnings --- include/libtorrent/bencode.hpp | 2 +- include/libtorrent/ip_filter.hpp | 4 ++-- include/libtorrent/utp_stream.hpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/libtorrent/bencode.hpp b/include/libtorrent/bencode.hpp index 9e3d14afa..126b7014f 100644 --- a/include/libtorrent/bencode.hpp +++ b/include/libtorrent/bencode.hpp @@ -97,7 +97,7 @@ namespace libtorrent for (std::string::const_iterator i = val.begin() , end(val.end()); i != end; ++i) *out++ = *i; - return val.length(); + return int(val.length()); } TORRENT_EXPORT char const* integer_to_str(char* buf, int size, entry::integer_type val); diff --git a/include/libtorrent/ip_filter.hpp b/include/libtorrent/ip_filter.hpp index dfedee9cd..0d2c43937 100644 --- a/include/libtorrent/ip_filter.hpp +++ b/include/libtorrent/ip_filter.hpp @@ -88,7 +88,7 @@ namespace detail Addr plus_one(Addr const& a) { Addr tmp(a); - for (int i = tmp.size() - 1; i >= 0; --i) + for (int i = int(tmp.size()) - 1; i >= 0; --i) { if (tmp[i] < (std::numeric_limits::max)()) { @@ -106,7 +106,7 @@ namespace detail Addr minus_one(Addr const& a) { Addr tmp(a); - for (int i = tmp.size() - 1; i >= 0; --i) + for (int i = int(tmp.size()) - 1; i >= 0; --i) { if (tmp[i] > 0) { diff --git a/include/libtorrent/utp_stream.hpp b/include/libtorrent/utp_stream.hpp index daf00ba42..3bcfeba82 100644 --- a/include/libtorrent/utp_stream.hpp +++ b/include/libtorrent/utp_stream.hpp @@ -314,7 +314,7 @@ public: return 0; } #ifdef TORRENT_DEBUG - int buf_size = 0; + size_t buf_size = 0; #endif for (typename Mutable_Buffers::const_iterator i = buffers.begin()