fixed build warnings
This commit is contained in:
parent
8bb71da401
commit
5864a883e6
|
@ -179,7 +179,7 @@ namespace libtorrent {
|
|||
std::string tracker_announce_alert::message() const
|
||||
{
|
||||
const static char* event_str[] = {"none", "completed", "started", "stopped", "paused"};
|
||||
TORRENT_ASSERT_VAL(event < sizeof(event_str)/sizeof(event_str[0]), event);
|
||||
TORRENT_ASSERT_VAL(event < int(sizeof(event_str)/sizeof(event_str[0])), event);
|
||||
return tracker_alert::message() + " sending announce (" + event_str[event] + ")";
|
||||
}
|
||||
|
||||
|
|
|
@ -57,9 +57,7 @@ namespace libtorrent
|
|||
for (int j = 0; j < 5 && channel[j]; ++j)
|
||||
{
|
||||
if (channel[j]->throttle() == 0) continue;
|
||||
TORRENT_ASSERT(channel[j]->distribute_quota
|
||||
< (std::numeric_limits<boost::uint64_t>::max)() / priority);
|
||||
quota = (std::min)(int(boost::uint64_t(channel[j]->distribute_quota)
|
||||
quota = (std::min)(int(boost::int64_t(channel[j]->distribute_quota)
|
||||
* priority / channel[j]->tmp), quota);
|
||||
}
|
||||
assigned += quota;
|
||||
|
|
|
@ -347,6 +347,9 @@ namespace libtorrent
|
|||
}
|
||||
break;
|
||||
}
|
||||
case lazy_entry::none_t:
|
||||
destruct();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -254,7 +254,7 @@ namespace libtorrent
|
|||
"bencoded nesting depth exceeded",
|
||||
"bencoded item count limit exceeded",
|
||||
};
|
||||
if (ev < 0 || ev >= sizeof(msgs)/sizeof(msgs[0]))
|
||||
if (ev < 0 || ev >= int(sizeof(msgs)/sizeof(msgs[0])))
|
||||
return "Unknown error";
|
||||
return msgs[ev];
|
||||
}
|
||||
|
|
|
@ -242,7 +242,7 @@ namespace libtorrent
|
|||
TORRENT_ASSERT(str != 0);
|
||||
TORRENT_ASSERT(len >= 0);
|
||||
TORRENT_ASSERT(offset >= 0);
|
||||
TORRENT_ASSERT(offset < sizeof(unreserved_chars)-1);
|
||||
TORRENT_ASSERT(offset < int(sizeof(unreserved_chars))-1);
|
||||
|
||||
std::string ret;
|
||||
for (int i = 0; i < len; ++i)
|
||||
|
|
|
@ -309,7 +309,7 @@ namespace libtorrent
|
|||
ec.assign(errno, boost::system::get_generic_category());
|
||||
break;
|
||||
}
|
||||
if (num_read < sizeof(buffer)) break;
|
||||
if (num_read < int(sizeof(buffer))) break;
|
||||
}
|
||||
close(infd);
|
||||
close(outfd);
|
||||
|
@ -441,7 +441,7 @@ namespace libtorrent
|
|||
#endif
|
||||
if (sep == 0) return f;
|
||||
|
||||
if (sep - first == f.size() - 1)
|
||||
if (sep - first == int(f.size()) - 1)
|
||||
{
|
||||
// if the last character is a / (or \)
|
||||
// ignore it
|
||||
|
|
|
@ -374,7 +374,7 @@ namespace libtorrent
|
|||
sha1_hash file_storage::hash(internal_file_entry const& fe) const
|
||||
{
|
||||
int index = &fe - &m_files[0];
|
||||
if (index >= m_file_hashes.size()) return sha1_hash(0);
|
||||
if (index >= int(m_file_hashes.size())) return sha1_hash(0);
|
||||
return sha1_hash(m_file_hashes[index]);
|
||||
}
|
||||
|
||||
|
@ -387,29 +387,29 @@ namespace libtorrent
|
|||
time_t file_storage::mtime(internal_file_entry const& fe) const
|
||||
{
|
||||
int index = &fe - &m_files[0];
|
||||
if (index >= m_mtime.size()) return 0;
|
||||
if (index >= int(m_mtime.size())) return 0;
|
||||
return m_mtime[index];
|
||||
}
|
||||
|
||||
int file_storage::file_index(internal_file_entry const& fe) const
|
||||
{
|
||||
int index = &fe - &m_files[0];
|
||||
TORRENT_ASSERT(index >= 0 && index < m_files.size());
|
||||
TORRENT_ASSERT(index >= 0 && index < int(m_files.size()));
|
||||
return index;
|
||||
}
|
||||
|
||||
void file_storage::set_file_base(internal_file_entry const& fe, size_type off)
|
||||
{
|
||||
int index = &fe - &m_files[0];
|
||||
TORRENT_ASSERT(index >= 0 && index < m_files.size());
|
||||
if (m_file_base.size() <= index) m_file_base.resize(index);
|
||||
TORRENT_ASSERT(index >= 0 && index < int(m_files.size()));
|
||||
if (int(m_file_base.size()) <= index) m_file_base.resize(index);
|
||||
m_file_base[index] = off;
|
||||
}
|
||||
|
||||
size_type file_storage::file_base(internal_file_entry const& fe) const
|
||||
{
|
||||
int index = &fe - &m_files[0];
|
||||
if (index >= m_file_base.size()) return 0;
|
||||
if (index >= int(m_file_base.size())) return 0;
|
||||
return m_file_base[index];
|
||||
}
|
||||
|
||||
|
@ -424,7 +424,7 @@ namespace libtorrent
|
|||
if (!m_mtime.empty())
|
||||
{
|
||||
time_t mtime = 0;
|
||||
if (m_mtime.size() > index)
|
||||
if (int(m_mtime.size()) > index)
|
||||
{
|
||||
mtime = m_mtime[index];
|
||||
m_mtime.erase(m_mtime.begin() + index);
|
||||
|
@ -434,7 +434,7 @@ namespace libtorrent
|
|||
if (!m_file_hashes.empty())
|
||||
{
|
||||
char const* fh = 0;
|
||||
if (m_file_hashes.size() > index)
|
||||
if (int(m_file_hashes.size()) > index)
|
||||
{
|
||||
fh = m_file_hashes[index];
|
||||
m_file_hashes.erase(m_file_hashes.begin() + index);
|
||||
|
@ -444,7 +444,7 @@ namespace libtorrent
|
|||
if (!m_file_base.empty())
|
||||
{
|
||||
size_type base = 0;
|
||||
if (m_file_base.size() > index)
|
||||
if (int(m_file_base.size()) > index)
|
||||
{
|
||||
base = m_file_base[index];
|
||||
m_file_base.erase(m_file_base.begin() + index);
|
||||
|
|
|
@ -252,7 +252,7 @@ void http_connection::start(std::string const& hostname, std::string const& port
|
|||
#ifdef TORRENT_USE_OPENSSL
|
||||
if (m_ssl) userdata = &m_ssl_ctx;
|
||||
#endif
|
||||
bool ret = instantiate_connection(m_resolver.get_io_service()
|
||||
instantiate_connection(m_resolver.get_io_service()
|
||||
, proxy ? *proxy : null_proxy, m_sock, userdata);
|
||||
|
||||
if (m_bind_addr != address_v4::any())
|
||||
|
|
|
@ -464,6 +464,9 @@ namespace libtorrent
|
|||
line_len += 2;
|
||||
}
|
||||
break;
|
||||
case lazy_entry::none_t:
|
||||
line_len += 4;
|
||||
break;
|
||||
}
|
||||
|
||||
if (line_len > limit) return -1;
|
||||
|
|
|
@ -144,7 +144,7 @@ get_out:
|
|||
if (prime) BN_free(prime);
|
||||
#elif defined TORRENT_USE_TOMMATH
|
||||
// create local key
|
||||
for (int i = 0; i < sizeof(m_dh_local_secret); ++i)
|
||||
for (int i = 0; i < int(sizeof(m_dh_local_secret)); ++i)
|
||||
m_dh_local_secret[i] = rand();
|
||||
|
||||
mp_int prime;
|
||||
|
|
Loading…
Reference in New Issue