From bdf2f6c3e10879c09280e40d24c2e6d822a0ec5f Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Mon, 26 Apr 2021 23:15:45 +0800 Subject: [PATCH] Initialize struct members by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is to suppress the following compilation warnings: base/bittorrent/magneturi.cpp: In constructor ‘BitTorrent::MagnetUri::MagnetUri(const QString&)’: base/bittorrent/magneturi.cpp:87:60: warning: missing initializer for member ‘BitTorrent::TrackerEntry::message’ [-Wmissing-field-initializers] 87 | m_trackers.append({QString::fromStdString(tracker)}); --- src/base/bittorrent/trackerentry.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/base/bittorrent/trackerentry.h b/src/base/bittorrent/trackerentry.h index 63f7434db..ede17cb52 100644 --- a/src/base/bittorrent/trackerentry.h +++ b/src/base/bittorrent/trackerentry.h @@ -53,10 +53,10 @@ namespace BitTorrent int numSeeds = -1; int numLeeches = -1; int numDownloaded = -1; - QString message; + QString message {}; }; - QString url; + QString url {}; int tier = 0; QVector endpoints {}; @@ -67,7 +67,7 @@ namespace BitTorrent int numSeeds = -1; int numLeeches = -1; int numDownloaded = -1; - QString message; + QString message {}; }; bool operator==(const TrackerEntry &left, const TrackerEntry &right);