diff --git a/src/base/bittorrent/infohash.cpp b/src/base/bittorrent/infohash.cpp index 122d4e88f..e050efbb8 100644 --- a/src/base/bittorrent/infohash.cpp +++ b/src/base/bittorrent/infohash.cpp @@ -89,5 +89,9 @@ bool BitTorrent::operator!=(const InfoHash &left, const InfoHash &right) uint BitTorrent::qHash(const InfoHash &key, const uint seed) { +#if (LIBTORRENT_VERSION_NUM < 10200) return ::qHash(static_cast(key), seed); +#else + return ::qHash((std::hash {})(key), seed); +#endif } diff --git a/src/base/bittorrent/torrenthandle.cpp b/src/base/bittorrent/torrenthandle.cpp index 683e1fd64..442821fdf 100644 --- a/src/base/bittorrent/torrenthandle.cpp +++ b/src/base/bittorrent/torrenthandle.cpp @@ -82,7 +82,7 @@ namespace libtorrent template uint qHash(const strong_typedef &key, const uint seed) { - return static_cast((std::hash> {})(key) ^ seed); + return ::qHash((std::hash> {})(key), seed); } } } diff --git a/src/base/bittorrent/trackerentry.cpp b/src/base/bittorrent/trackerentry.cpp index ca13b059a..34ad1bfb0 100644 --- a/src/base/bittorrent/trackerentry.cpp +++ b/src/base/bittorrent/trackerentry.cpp @@ -162,5 +162,5 @@ bool BitTorrent::operator==(const TrackerEntry &left, const TrackerEntry &right) uint BitTorrent::qHash(const TrackerEntry &key, const uint seed) { - return (::qHash(key.url(), seed) ^ key.tier()); + return (::qHash(key.url(), seed) ^ ::qHash(key.tier())); } diff --git a/src/base/net/downloadmanager.cpp b/src/base/net/downloadmanager.cpp index ad6725a94..ffa3c28a7 100644 --- a/src/base/net/downloadmanager.cpp +++ b/src/base/net/downloadmanager.cpp @@ -348,7 +348,7 @@ Net::ServiceID Net::ServiceID::fromURL(const QUrl &url) uint Net::qHash(const ServiceID &serviceID, const uint seed) { - return ::qHash(serviceID.hostName, seed) ^ serviceID.port; + return ::qHash(serviceID.hostName, seed) ^ ::qHash(serviceID.port); } bool Net::operator==(const ServiceID &lhs, const ServiceID &rhs)