fix warnings

This commit is contained in:
Arvid Norberg 2015-04-06 04:31:21 +00:00
parent 6d09050d08
commit 23e5fd3d8f
3 changed files with 6 additions and 5 deletions

View File

@ -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);
}

View File

@ -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,

View File

@ -739,7 +739,7 @@ namespace libtorrent
int seconds_since_last_scrape() const
{
return m_last_scrape == (std::numeric_limits<boost::int16_t>::min)()
? -1 : m_ses.session_time() - m_last_scrape;
? -1 : int(m_ses.session_time() - m_last_scrape);
}
#ifndef TORRENT_DISABLE_DHT