From 23e5fd3d8feb8e295b1ea4a1e82892e14b389bc8 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Mon, 6 Apr 2015 04:31:21 +0000 Subject: [PATCH] fix warnings --- bindings/python/src/peer_info.cpp | 6 +++--- include/libtorrent/file_storage.hpp | 3 ++- include/libtorrent/torrent.hpp | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/bindings/python/src/peer_info.cpp b/bindings/python/src/peer_info.cpp index 3894b057c..da983d549 100644 --- a/bindings/python/src/peer_info.cpp +++ b/bindings/python/src/peer_info.cpp @@ -10,17 +10,17 @@ using namespace boost::python; using namespace libtorrent; -int get_last_active(peer_info const& pi) +boost::int64_t get_last_active(peer_info const& pi) { return total_seconds(pi.last_active); } -int get_last_request(peer_info const& pi) +boost::int64_t get_last_request(peer_info const& pi) { return total_seconds(pi.last_request); } -int get_download_queue_time(peer_info const& pi) +boost::int64_t get_download_queue_time(peer_info const& pi) { return total_seconds(pi.download_queue_time); } diff --git a/include/libtorrent/file_storage.hpp b/include/libtorrent/file_storage.hpp index dc6155605..bc0e7f727 100644 --- a/include/libtorrent/file_storage.hpp +++ b/include/libtorrent/file_storage.hpp @@ -138,7 +138,8 @@ namespace libtorrent void set_name(char const* n, bool borrow_string = false, int string_len = 0); std::string filename() const; char const* filename_ptr() const { return name; } - int filename_len() const { return name_len == name_is_owned?strlen(name):name_len; } + int filename_len() const + { return name_len == name_is_owned?int(strlen(name)):int(name_len); } enum { name_is_owned = (1<<12)-1, diff --git a/include/libtorrent/torrent.hpp b/include/libtorrent/torrent.hpp index 31bb82fd6..98bd489f5 100644 --- a/include/libtorrent/torrent.hpp +++ b/include/libtorrent/torrent.hpp @@ -739,7 +739,7 @@ namespace libtorrent int seconds_since_last_scrape() const { return m_last_scrape == (std::numeric_limits::min)() - ? -1 : m_ses.session_time() - m_last_scrape; + ? -1 : int(m_ses.session_time() - m_last_scrape); } #ifndef TORRENT_DISABLE_DHT