Merge pull request #15142 from Chocobo1/warning

Use proper signed number type
This commit is contained in:
Chocobo1
2021-07-01 11:35:04 +08:00
committed by GitHub
97 changed files with 105 additions and 105 deletions

View File

@@ -35,7 +35,7 @@
class BandwidthScheduler : public QObject
{
Q_OBJECT
Q_DISABLE_COPY(BandwidthScheduler)
Q_DISABLE_COPY_MOVE(BandwidthScheduler)
public:
explicit BandwidthScheduler(QObject *parent = nullptr);

View File

@@ -57,7 +57,7 @@ namespace BitTorrent
{
class BencodeResumeDataStorage::Worker final : public QObject
{
Q_DISABLE_COPY(Worker)
Q_DISABLE_COPY_MOVE(Worker)
public:
explicit Worker(const QDir &resumeDataDir);

View File

@@ -43,7 +43,7 @@ namespace BitTorrent
class BencodeResumeDataStorage final : public ResumeDataStorage
{
Q_OBJECT
Q_DISABLE_COPY(BencodeResumeDataStorage)
Q_DISABLE_COPY_MOVE(BencodeResumeDataStorage)
public:
explicit BencodeResumeDataStorage(const QString &path, QObject *parent = nullptr);

View File

@@ -158,7 +158,7 @@ namespace BitTorrent
{
class DBResumeDataStorage::Worker final : public QObject
{
Q_DISABLE_COPY(Worker)
Q_DISABLE_COPY_MOVE(Worker)
public:
Worker(const QString &dbPath, const QString &dbConnectionName);

View File

@@ -37,7 +37,7 @@ namespace BitTorrent
class DBResumeDataStorage final : public ResumeDataStorage
{
Q_OBJECT
Q_DISABLE_COPY(DBResumeDataStorage)
Q_DISABLE_COPY_MOVE(DBResumeDataStorage)
public:
explicit DBResumeDataStorage(const QString &dbPath, QObject *parent = nullptr);

View File

@@ -38,7 +38,7 @@ namespace BitTorrent
class FileSearcher final : public QObject
{
Q_OBJECT
Q_DISABLE_COPY(FileSearcher)
Q_DISABLE_COPY_MOVE(FileSearcher)
public:
FileSearcher() = default;

View File

@@ -40,7 +40,7 @@
class PortForwarderImpl final : public Net::PortForwarder
{
Q_OBJECT
Q_DISABLE_COPY(PortForwarderImpl)
Q_DISABLE_COPY_MOVE(PortForwarderImpl)
public:
explicit PortForwarderImpl(lt::session *provider, QObject *parent = nullptr);

View File

@@ -41,7 +41,7 @@ namespace BitTorrent
class ResumeDataStorage : public QObject
{
Q_OBJECT
Q_DISABLE_COPY(ResumeDataStorage)
Q_DISABLE_COPY_MOVE(ResumeDataStorage)
public:
using QObject::QObject;

View File

@@ -211,7 +211,7 @@ namespace BitTorrent
class Session : public QObject
{
Q_OBJECT
Q_DISABLE_COPY(Session)
Q_DISABLE_COPY_MOVE(Session)
public:
static void initInstance();

View File

@@ -39,7 +39,7 @@ namespace BitTorrent
class Statistics : public QObject
{
Q_OBJECT
Q_DISABLE_COPY(Statistics)
Q_DISABLE_COPY_MOVE(Statistics)
public:
explicit Statistics(BitTorrent::Session *session);

View File

@@ -112,7 +112,7 @@ namespace
QString firstTrackerMessage;
QString firstErrorMessage;
#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));
for (const lt::announce_endpoint &endpoint : nativeEntry.endpoints)
{
@@ -167,8 +167,8 @@ namespace
}
}
#else
const int numEndpoints = nativeEntry.endpoints.size();
trackerEntry.endpoints.reserve(numEndpoints);
const auto numEndpoints = static_cast<qsizetype>(nativeEntry.endpoints.size());
trackerEntry.endpoints.reserve(static_cast<decltype(trackerEntry.endpoints)::size_type>(numEndpoints));
for (const lt::announce_endpoint &endpoint : nativeEntry.endpoints)
{
TrackerEntry::EndpointStats trackerEndpoint;

View File

@@ -76,7 +76,7 @@ namespace BitTorrent
class TorrentImpl final : public QObject, public Torrent
{
Q_DISABLE_COPY(TorrentImpl)
Q_DISABLE_COPY_MOVE(TorrentImpl)
Q_DECLARE_TR_FUNCTIONS(BitTorrent::TorrentImpl)
public:

View File

@@ -72,7 +72,7 @@ namespace BitTorrent
class Tracker final : public QObject, public Http::IRequestHandler, private Http::ResponseBuilder
{
Q_OBJECT
Q_DISABLE_COPY(Tracker)
Q_DISABLE_COPY_MOVE(Tracker)
struct TrackerAnnounceRequest;