mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 12:59:56 -07:00
Use proper signed number type
This also suppress the compiler warning: src/base/bittorrent/torrentimpl.cpp:228:36: warning: comparison of integer expressions of different signedness: ‘int’ and ‘const size_t’ {aka ‘const long unsigned int’} [-Wsign-compare]
This commit is contained in:
parent
70d1cb86fd
commit
365554d064
1 changed files with 3 additions and 3 deletions
|
@ -112,7 +112,7 @@ namespace
|
||||||
QString firstTrackerMessage;
|
QString firstTrackerMessage;
|
||||||
QString firstErrorMessage;
|
QString firstErrorMessage;
|
||||||
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
||||||
const size_t numEndpoints = nativeEntry.endpoints.size() * ((hashes.has_v1() && hashes.has_v2()) ? 2 : 1);
|
const auto numEndpoints = static_cast<qsizetype>(nativeEntry.endpoints.size() * ((hashes.has_v1() && hashes.has_v2()) ? 2 : 1));
|
||||||
trackerEntry.endpoints.reserve(static_cast<decltype(trackerEntry.endpoints)::size_type>(numEndpoints));
|
trackerEntry.endpoints.reserve(static_cast<decltype(trackerEntry.endpoints)::size_type>(numEndpoints));
|
||||||
for (const lt::announce_endpoint &endpoint : nativeEntry.endpoints)
|
for (const lt::announce_endpoint &endpoint : nativeEntry.endpoints)
|
||||||
{
|
{
|
||||||
|
@ -167,8 +167,8 @@ namespace
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
const int numEndpoints = nativeEntry.endpoints.size();
|
const auto numEndpoints = static_cast<qsizetype>(nativeEntry.endpoints.size());
|
||||||
trackerEntry.endpoints.reserve(numEndpoints);
|
trackerEntry.endpoints.reserve(static_cast<decltype(trackerEntry.endpoints)::size_type>(numEndpoints));
|
||||||
for (const lt::announce_endpoint &endpoint : nativeEntry.endpoints)
|
for (const lt::announce_endpoint &endpoint : nativeEntry.endpoints)
|
||||||
{
|
{
|
||||||
TrackerEntry::EndpointStats trackerEndpoint;
|
TrackerEntry::EndpointStats trackerEndpoint;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue