From 5eafb1282dfec629acad882528188079b478f8ea Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Sat, 25 Oct 2025 21:40:02 +0200 Subject: [PATCH] refactor: Fix cppcoreguidelines-init-variables warnings --- .clang-tidy | 1 + src/core/afv/audio/input.cpp | 2 +- src/core/context/contextapplicationproxy.h | 2 +- src/core/context/contextownaircraftimpl.cpp | 4 ++-- src/core/db/databaseutils.cpp | 2 +- src/core/db/databasewriter.cpp | 2 +- src/core/fsd/interimpilotdataupdate.cpp | 2 +- src/core/fsd/pilotdataupdate.cpp | 2 +- src/core/fsd/visualpilotdataperiodic.cpp | 2 +- src/core/fsd/visualpilotdatastopped.cpp | 2 +- src/core/fsd/visualpilotdataupdate.cpp | 2 +- src/core/setupreader.h | 2 +- src/core/simulator.cpp | 2 +- src/gui/components/atcstationcomponent.cpp | 3 ++- .../components/cockpittranspondermodeledscomponent.cpp | 2 +- .../components/dbautosimulatorstashingcomponent.cpp | 2 +- src/gui/components/dbmappingcomponent.cpp | 2 +- src/gui/components/hotkeydialog.cpp | 2 +- src/gui/components/rawfsdmessagescomponent.cpp | 2 +- src/gui/components/settingstextmessagestyle.cpp | 2 +- src/gui/components/textmessagecomponent.cpp | 7 +++++-- src/gui/editors/aircrafticaoform.cpp | 2 +- src/gui/editors/airlineicaoform.cpp | 4 ++-- src/gui/editors/coordinateform.cpp | 4 ++-- src/gui/editors/liveryform.cpp | 2 +- src/gui/editors/modelmappingform.cpp | 2 +- src/gui/editors/pbhsform.cpp | 6 +++--- src/gui/editors/situationform.cpp | 8 ++++---- src/gui/models/listmodelbasenontemplate.cpp | 2 +- src/gui/models/listmodelbasenontemplate.h | 4 ++-- src/misc/aviation/aircrafticaocode.cpp | 2 +- src/misc/aviation/altitude.cpp | 2 +- src/misc/aviation/callsign.cpp | 2 +- src/misc/aviation/callsignobjectlist.h | 2 +- src/misc/aviation/comsystem.cpp | 2 +- src/misc/aviation/flightplan.cpp | 4 ++-- src/misc/aviation/selcal.cpp | 5 ++++- src/misc/aviation/transponder.cpp | 4 ++-- src/misc/db/datastore.cpp | 4 ++-- src/misc/dbus.h | 2 +- src/misc/dbusserver.cpp | 4 ++-- src/misc/geo/earthangle.cpp | 4 ++-- src/misc/loghandler.cpp | 2 +- src/misc/logpattern.cpp | 4 ++-- src/misc/math/mathutils.cpp | 10 +++++----- src/misc/math/mathutils.h | 2 +- src/misc/network/networkutils.cpp | 2 +- src/misc/network/urlloglist.cpp | 2 +- src/misc/pq/pqstring.cpp | 2 +- src/misc/pq/time.cpp | 2 +- src/misc/propertyindex.cpp | 2 +- src/misc/simulation/simulationenvironmentprovider.cpp | 6 +++--- src/misc/timestampbased.h | 2 +- src/misc/variant.cpp | 2 +- src/misc/worker.h | 1 + .../simulator/flightgear/fgswiftbusserviceproxy.cpp | 2 +- .../simulator/flightgear/fgswiftbustrafficproxy.cpp | 2 +- src/plugins/simulator/xplane/simulatorxplane.cpp | 2 +- src/plugins/simulator/xplane/xswiftbusserviceproxy.cpp | 2 +- src/plugins/simulator/xplane/xswiftbustrafficproxy.cpp | 2 +- .../xplaneconfig/simulatorxplaneconfigwindow.cpp | 2 +- src/sound/codecs/opusdecoder.cpp | 2 +- src/sound/codecs/opusencoder.cpp | 2 +- src/sound/wav/wavfile.cpp | 4 ++-- src/sound/wav/wavfile.h | 2 +- 65 files changed, 95 insertions(+), 86 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 57efd7d15..e7c970cae 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -45,6 +45,7 @@ Checks: > readability-use-std-min-max, readability-use-anyofallof, readability-redundant-member-init, + cppcoreguidelines-init-variables, CheckOptions: - key: readability-identifier-naming.ClassCase diff --git a/src/core/afv/audio/input.cpp b/src/core/afv/audio/input.cpp index 5a4893f1d..a0c1d67e5 100644 --- a/src/core/afv/audio/input.cpp +++ b/src/core/afv/audio/input.cpp @@ -159,7 +159,7 @@ namespace swift::core::afv::audio m_maxSampleInput = qMax(qAbs(sampleInput), m_maxSampleInput); } - int length; + int length {}; const QByteArray encodedBuffer = m_encoder.encode(samples, samples.size(), &length); m_opusBytesEncoded += length; diff --git a/src/core/context/contextapplicationproxy.h b/src/core/context/contextapplicationproxy.h index 71773e6e6..a7b826748 100644 --- a/src/core/context/contextapplicationproxy.h +++ b/src/core/context/contextapplicationproxy.h @@ -96,7 +96,7 @@ namespace swift::core protected: //! Constructor CContextApplicationProxy(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) - : IContextApplication(mode, runtime), m_dBusInterface(nullptr) + : IContextApplication(mode, runtime) {} //! DBus version constructor diff --git a/src/core/context/contextownaircraftimpl.cpp b/src/core/context/contextownaircraftimpl.cpp index 4b3191ff7..a00a74c4b 100644 --- a/src/core/context/contextownaircraftimpl.cpp +++ b/src/core/context/contextownaircraftimpl.cpp @@ -284,7 +284,7 @@ namespace swift::core::context { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO << com1 << com2 << transponder; } - bool changed; + bool changed {}; { QWriteLocker l(&m_lockAircraft); changed = m_ownAircraft.hasChangedCockpitData(com1, com2, transponder); @@ -301,7 +301,7 @@ namespace swift::core::context { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO << transponderMode; } - bool changed; + bool changed {}; { QWriteLocker l(&m_lockAircraft); changed = m_ownAircraft.setTransponderMode(transponderMode); diff --git a/src/core/db/databaseutils.cpp b/src/core/db/databaseutils.cpp index 505b152e5..a1c06c262 100644 --- a/src/core/db/databaseutils.cpp +++ b/src/core/db/databaseutils.cpp @@ -425,7 +425,7 @@ namespace swift::core::db const int contentIndex = content.indexOf(':', cl); if (contentIndex < cl) break; // should not happen, malformed const QString ls = content.mid(cl, contentIndex - cl); // content length - bool ok; + bool ok {}; const qint32 size = ls.toInt(&ok); if (!ok) break; // malformed size if (size < 1) break; diff --git a/src/core/db/databasewriter.cpp b/src/core/db/databasewriter.cpp index 9ba63d3bb..cd48853c3 100644 --- a/src/core/db/databasewriter.cpp +++ b/src/core/db/databasewriter.cpp @@ -172,7 +172,7 @@ namespace swift::core::db CAircraftModelList modelsPublished; CAircraftModelList modelsSkipped; CStatusMessageList msgs; - bool directWrite; + bool directWrite {}; const bool sendingSuccessful = parseSwiftPublishResponse(responseData, modelsPublished, modelsSkipped, msgs, directWrite); const int c = CDatabaseUtils::fillInMissingAircraftAndLiveryEntities(modelsPublished); diff --git a/src/core/fsd/interimpilotdataupdate.cpp b/src/core/fsd/interimpilotdataupdate.cpp index 2f704ed32..0ae912426 100644 --- a/src/core/fsd/interimpilotdataupdate.cpp +++ b/src/core/fsd/interimpilotdataupdate.cpp @@ -17,7 +17,7 @@ namespace swift::core::fsd QStringList InterimPilotDataUpdate::toTokens() const { - std::uint32_t pbh; + std::uint32_t pbh {}; packPBH(m_pitch, m_bank, m_heading, m_onGround, pbh); auto tokens = QStringList {}; diff --git a/src/core/fsd/pilotdataupdate.cpp b/src/core/fsd/pilotdataupdate.cpp index 905dcf4a8..8c8113c8d 100644 --- a/src/core/fsd/pilotdataupdate.cpp +++ b/src/core/fsd/pilotdataupdate.cpp @@ -24,7 +24,7 @@ namespace swift::core::fsd QStringList PilotDataUpdate::toTokens() const { - std::uint32_t pbh; + std::uint32_t pbh {}; packPBH(m_pitch, m_bank, m_heading, m_onGround, pbh); QStringList tokens; diff --git a/src/core/fsd/visualpilotdataperiodic.cpp b/src/core/fsd/visualpilotdataperiodic.cpp index ad5b686c7..5e209ca7d 100644 --- a/src/core/fsd/visualpilotdataperiodic.cpp +++ b/src/core/fsd/visualpilotdataperiodic.cpp @@ -27,7 +27,7 @@ namespace swift::core::fsd QStringList VisualPilotDataPeriodic::toTokens() const { - std::uint32_t pbh; + std::uint32_t pbh {}; packPBH(m_pitch, m_bank, m_heading, false /*! \todo check if needed? */, pbh); QStringList tokens; diff --git a/src/core/fsd/visualpilotdatastopped.cpp b/src/core/fsd/visualpilotdatastopped.cpp index 5ef5597b5..5af262df7 100644 --- a/src/core/fsd/visualpilotdatastopped.cpp +++ b/src/core/fsd/visualpilotdatastopped.cpp @@ -23,7 +23,7 @@ namespace swift::core::fsd QStringList VisualPilotDataStopped::toTokens() const { - std::uint32_t pbh; + std::uint32_t pbh {}; packPBH(m_pitch, m_bank, m_heading, false /*! \todo check if needed? */, pbh); QStringList tokens; diff --git a/src/core/fsd/visualpilotdataupdate.cpp b/src/core/fsd/visualpilotdataupdate.cpp index ec5e45058..740870c9e 100644 --- a/src/core/fsd/visualpilotdataupdate.cpp +++ b/src/core/fsd/visualpilotdataupdate.cpp @@ -28,7 +28,7 @@ namespace swift::core::fsd QStringList VisualPilotDataUpdate::toTokens() const { - std::uint32_t pbh; + std::uint32_t pbh {}; packPBH(m_pitch, m_bank, m_heading, false /*! \todo check if needed? */, pbh); QStringList tokens; diff --git a/src/core/setupreader.h b/src/core/setupreader.h index c215845f5..e298c1179 100644 --- a/src/core/setupreader.h +++ b/src/core/setupreader.h @@ -58,7 +58,7 @@ namespace swift::core private: std::atomic m_setupAvailable { false }; //!< setup available? - data::CGlobalSetup m_setup {}; //!< data setup + data::CGlobalSetup m_setup; //!< data setup //! Read by local file swift::misc::CStatusMessageList readLocalBootstrapFile(); diff --git a/src/core/simulator.cpp b/src/core/simulator.cpp index a65be0964..202d184b5 100644 --- a/src/core/simulator.cpp +++ b/src/core/simulator.cpp @@ -333,7 +333,7 @@ namespace swift::core if (part2.startsWith("max")) { if (!parser.hasPart(3)) { return false; } - bool ok; + bool ok {}; const int max = parser.part(3).toInt(&ok); if (!ok) { return false; } m_interpolationLogger.setMaxSituations(max); diff --git a/src/gui/components/atcstationcomponent.cpp b/src/gui/components/atcstationcomponent.cpp index 683aac071..d90e54ef7 100644 --- a/src/gui/components/atcstationcomponent.cpp +++ b/src/gui/components/atcstationcomponent.cpp @@ -450,7 +450,8 @@ namespace swift::gui::components m_splitterSizes = ui->sp_AtcSplitter->sizes(); if (m_splitterSizes.size() > 1) { - int min, max; + int min {}; + int max {}; ui->sp_AtcSplitter->getRange(1, &min, &max); QList newSizes; newSizes.push_back(qMax(0, m_splitterSizes.first() + m_splitterSizes.last() - min)); diff --git a/src/gui/components/cockpittranspondermodeledscomponent.cpp b/src/gui/components/cockpittranspondermodeledscomponent.cpp index 45a4d9e7a..726f04a6c 100644 --- a/src/gui/components/cockpittranspondermodeledscomponent.cpp +++ b/src/gui/components/cockpittranspondermodeledscomponent.cpp @@ -48,7 +48,7 @@ namespace swift::gui::components QWidget *w = qobject_cast(QObject::sender()); if (!w) { return; } if (!sGui || sGui->isShuttingDown() || !sGui->getIContextOwnAircraft()) { return; } - CTransponder::TransponderMode mode; + CTransponder::TransponderMode mode {}; if (m_ledStandby.data() == w) { mode = CTransponder::StateStandby; } else if (m_ledIdent.data() == w) { mode = CTransponder::StateIdent; } else if (m_ledModes.data() == w) { mode = CTransponder::ModeC; } diff --git a/src/gui/components/dbautosimulatorstashingcomponent.cpp b/src/gui/components/dbautosimulatorstashingcomponent.cpp index e52f4b67f..7261c3187 100644 --- a/src/gui/components/dbautosimulatorstashingcomponent.cpp +++ b/src/gui/components/dbautosimulatorstashingcomponent.cpp @@ -129,7 +129,7 @@ namespace swift::gui::components int maxObjectsStashed = -1; if (!ui->le_MaxModelsStashed->text().isEmpty()) { - bool ok; + bool ok {}; ui->le_MaxModelsStashed->text().toInt(&ok); if (!ok) { maxObjectsStashed = 100; } } diff --git a/src/gui/components/dbmappingcomponent.cpp b/src/gui/components/dbmappingcomponent.cpp index 8f8732bda..86dda8af1 100644 --- a/src/gui/components/dbmappingcomponent.cpp +++ b/src/gui/components/dbmappingcomponent.cpp @@ -467,7 +467,7 @@ namespace swift::gui::components int currentSize = ui->sp_MappingComponent->sizes().last(); // current size if (h2 <= currentSize) { return; } - int h1; + int h1 {}; if (h * 0.90 > h2) { // enough space to display as whole diff --git a/src/gui/components/hotkeydialog.cpp b/src/gui/components/hotkeydialog.cpp index 54fb0abf0..cc6d85ff0 100644 --- a/src/gui/components/hotkeydialog.cpp +++ b/src/gui/components/hotkeydialog.cpp @@ -328,7 +328,7 @@ namespace swift::gui::components void CHotkeyDialog::clearAdvancedFrame() { QLayout *layout = ui->qf_Advanced->layout(); - QLayoutItem *child; + QLayoutItem *child {}; while ((child = layout->takeAt(0)) != nullptr) { diff --git a/src/gui/components/rawfsdmessagescomponent.cpp b/src/gui/components/rawfsdmessagescomponent.cpp index 81fdbe9d4..c51dd9a8b 100644 --- a/src/gui/components/rawfsdmessagescomponent.cpp +++ b/src/gui/components/rawfsdmessagescomponent.cpp @@ -87,7 +87,7 @@ namespace swift::gui::components void CRawFsdMessagesComponent::enableDisableRawFsdMessages() { //! \fixme KB 2019-03 hardcoded style sheet - bool enable; + bool enable {}; if (ui->pb_EnableDisable->text() == "Enable") { enable = true; diff --git a/src/gui/components/settingstextmessagestyle.cpp b/src/gui/components/settingstextmessagestyle.cpp index 948fa593e..1c34fd119 100644 --- a/src/gui/components/settingstextmessagestyle.cpp +++ b/src/gui/components/settingstextmessagestyle.cpp @@ -117,7 +117,7 @@ namespace swift::gui::components const QStringList matches = match.capturedTexts(); if (matches.size() != 2) { return false; } - bool ok; + bool ok {}; int ptSize = matches.last().toInt(&ok); if (!ok) { return false; } if (increase) diff --git a/src/gui/components/textmessagecomponent.cpp b/src/gui/components/textmessagecomponent.cpp index a30f5f7af..37b2a3fc3 100644 --- a/src/gui/components/textmessagecomponent.cpp +++ b/src/gui/components/textmessagecomponent.cpp @@ -484,7 +484,10 @@ namespace swift::gui::components auto *layout = new QVBoxLayout(newTabWidget); auto *textEdit = new CTextMessageTextEdit(newTabWidget); textEdit->setObjectName("tep_" + tabName); - int marginLeft, marginRight, marginTop, marginBottom; + int marginLeft {}; + int marginRight {}; + int marginTop {}; + int marginBottom {}; ui->tb_TextMessagesAll->layout()->getContentsMargins(&marginLeft, &marginTop, &marginRight, &marginBottom); newTabWidget->layout()->setContentsMargins(marginLeft, marginTop, marginRight, 2); layout->addWidget(textEdit); @@ -773,7 +776,7 @@ namespace swift::gui::components else { // not a standard channel - bool isNumber; + bool isNumber {}; const QString selectedTabText = firstPartOfTabText(ui->tw_TextMessages->tabText(index).trimmed()); const double frequency = selectedTabText.toDouble(&isNumber); if (isNumber) diff --git a/src/gui/editors/aircrafticaoform.cpp b/src/gui/editors/aircrafticaoform.cpp index fbef4b9c8..2d2e57ef3 100644 --- a/src/gui/editors/aircrafticaoform.cpp +++ b/src/gui/editors/aircrafticaoform.cpp @@ -124,7 +124,7 @@ namespace swift::gui::editors const QString family(ui->le_Family->text().trimmed().toUpper()); const QString wtc(ui->cb_Wtc->currentText().left(1)); const QString combined(ui->combined_TypeSelector->getCombinedType()); - bool ok; + bool ok {}; int rank = ui->cb_Rank->currentText().toInt(&ok); if (!ok) { rank = 10; } bool legacy = ui->cb_Legacy->isChecked(); diff --git a/src/gui/editors/airlineicaoform.cpp b/src/gui/editors/airlineicaoform.cpp index e4aa5887d..6119593dc 100644 --- a/src/gui/editors/airlineicaoform.cpp +++ b/src/gui/editors/airlineicaoform.cpp @@ -89,7 +89,7 @@ namespace swift::gui::editors const QString id = ui->le_Id->text(); if (sGui && !sGui->isShuttingDown() && sGui->hasWebDataServices()) { - bool ok; + bool ok {}; const int dbKey = id.toInt(&ok); if (ok) { code = sGui->getWebDataServices()->getAirlineIcaoCodeForDbKey(dbKey); } } @@ -188,7 +188,7 @@ namespace swift::gui::editors { if (!sGui || sGui->isShuttingDown() || !sGui->hasWebDataServices()) { return; } - bool ok; + bool ok {}; const int id = ui->le_Id->text().toInt(&ok); const CAirlineIcaoCode icao = sGui->getWebDataServices()->getAirlineIcaoCodeForDbKey(id); if (ok && !icao.isLoadedFromDb()) diff --git a/src/gui/editors/coordinateform.cpp b/src/gui/editors/coordinateform.cpp index 0780b77f1..dd2951c13 100644 --- a/src/gui/editors/coordinateform.cpp +++ b/src/gui/editors/coordinateform.cpp @@ -214,7 +214,7 @@ namespace swift::gui::editors void CCoordinateForm::latCombinedEntered() { - bool ok; + bool ok {}; int deg = ui->le_LatDeg->text().trimmed().toInt(&ok); if (!ok) return; @@ -246,7 +246,7 @@ namespace swift::gui::editors void CCoordinateForm::lngCombinedEntered() { - bool ok; + bool ok {}; int deg = ui->le_LngDeg->text().trimmed().toInt(&ok); if (!ok) return; diff --git a/src/gui/editors/liveryform.cpp b/src/gui/editors/liveryform.cpp index a26aebada..8c988f54e 100644 --- a/src/gui/editors/liveryform.cpp +++ b/src/gui/editors/liveryform.cpp @@ -68,7 +68,7 @@ namespace swift::gui::editors const QString id = ui->le_Id->text(); if (!id.isEmpty() && sGui && !sGui->isShuttingDown() && sGui->hasWebDataServices()) { - bool ok; + bool ok {}; const int dbKey = id.toInt(&ok); if (ok) { livery = sGui->getWebDataServices()->getLiveryForDbKey(dbKey); } } diff --git a/src/gui/editors/modelmappingform.cpp b/src/gui/editors/modelmappingform.cpp index e519c25c3..bef9cfb04 100644 --- a/src/gui/editors/modelmappingform.cpp +++ b/src/gui/editors/modelmappingform.cpp @@ -112,7 +112,7 @@ namespace swift::gui::editors // without unit we assume ft if (isDigitsOnlyString(v)) { - bool ok; + bool ok {}; const double cgv = v.toDouble(&ok); if (!ok) { return CLength::null(); } return { cgv, CLengthUnit::ft() }; diff --git a/src/gui/editors/pbhsform.cpp b/src/gui/editors/pbhsform.cpp index 1631ae7a8..bb5154c4a 100644 --- a/src/gui/editors/pbhsform.cpp +++ b/src/gui/editors/pbhsform.cpp @@ -49,7 +49,7 @@ namespace swift::gui::editors double CPbhsForm::getBankAngleDegrees() const { const QString v(ui->le_Bank->text().replace(',', '.')); - bool ok; + bool ok {}; double vd = v.toDouble(&ok); if (!ok) { vd = 0.0; } return CAngle::normalizeDegrees180(vd, RoundDigits); @@ -67,7 +67,7 @@ namespace swift::gui::editors double CPbhsForm::getPitchAngleDegrees() const { const QString v(ui->le_Pitch->text().replace(',', '.')); - bool ok; + bool ok {}; double vd = v.toDouble(&ok); if (!ok) { vd = 0.0; } return CAngle::normalizeDegrees180(vd, RoundDigits); @@ -87,7 +87,7 @@ namespace swift::gui::editors double CPbhsForm::getHeadingAngleDegrees() const { const QString v(ui->le_Heading->text().replace(',', '.')); - bool ok; + bool ok {}; double vd = v.toDouble(&ok); if (!ok) { vd = 0.0; } return CAngle::normalizeDegrees180(vd, RoundDigits); diff --git a/src/gui/editors/situationform.cpp b/src/gui/editors/situationform.cpp index faf27c8ac..15b740a28 100644 --- a/src/gui/editors/situationform.cpp +++ b/src/gui/editors/situationform.cpp @@ -83,7 +83,7 @@ namespace swift::gui::editors double CSituationForm::getBankAngleDegrees() const { const QString v(ui->le_Bank->text().replace(',', '.')); - bool ok; + bool ok {}; double vd = v.toDouble(&ok); if (!ok) { vd = 0.0; } return CAngle::normalizeDegrees180(vd, RoundDigits); @@ -94,7 +94,7 @@ namespace swift::gui::editors double CSituationForm::getPitchAngleDegrees() const { const QString v(ui->le_Pitch->text().replace(',', '.')); - bool ok; + bool ok {}; double vd = v.toDouble(&ok); if (!ok) { vd = 0.0; } return CAngle::normalizeDegrees180(vd, RoundDigits); @@ -105,7 +105,7 @@ namespace swift::gui::editors double CSituationForm::getHeadingAngleDegrees() const { const QString v(ui->le_Heading->text().replace(',', '.')); - bool ok; + bool ok {}; double vd = v.toDouble(&ok); if (!ok) { vd = 0.0; } return CAngle::normalizeDegrees180(vd, RoundDigits); @@ -114,7 +114,7 @@ namespace swift::gui::editors double CSituationForm::getBarometricPressureMslMillibar() const { const QString v(ui->le_Pressure->text().replace(',', '.')); - bool ok; + bool ok {}; double vd = v.toDouble(&ok); if (!ok) { vd = CAltitude::standardISASeaLevelPressure().value(CPressureUnit::mbar()); } return vd; diff --git a/src/gui/models/listmodelbasenontemplate.cpp b/src/gui/models/listmodelbasenontemplate.cpp index d216ae8ce..759d1b19e 100644 --- a/src/gui/models/listmodelbasenontemplate.cpp +++ b/src/gui/models/listmodelbasenontemplate.cpp @@ -158,7 +158,7 @@ namespace swift::gui::models } CListModelBaseNonTemplate::CListModelBaseNonTemplate(const QString &translationContext, QObject *parent) - : QStandardItemModel(parent), m_columns(translationContext), m_sortColumn(-1), m_sortOrder(Qt::AscendingOrder) + : QStandardItemModel(parent), m_columns(translationContext) { // non unique default name, set translation context as default this->setObjectName(translationContext); diff --git a/src/gui/models/listmodelbasenontemplate.h b/src/gui/models/listmodelbasenontemplate.h index 157f10047..bad04c70a 100644 --- a/src/gui/models/listmodelbasenontemplate.h +++ b/src/gui/models/listmodelbasenontemplate.h @@ -180,9 +180,9 @@ namespace swift::gui::models CListModelBaseNonTemplate(const QString &translationContext, QObject *parent = nullptr); CColumns m_columns; //!< columns metadata - int m_sortColumn; //!< currently sorted column + int m_sortColumn { -1 }; //!< currently sorted column bool m_modelDestroyed = false; //!< \todo rudimentary workaround for T579, can be removed - Qt::SortOrder m_sortOrder; //!< sort order (asc/desc) + Qt::SortOrder m_sortOrder { Qt::AscendingOrder }; //!< sort order (asc/desc) Qt::DropActions m_dropActions = Qt::IgnoreAction; //!< drop actions swift::misc::CPropertyIndexList m_sortTieBreakers; //!< how column values are sorted if equal, if no value is given this is random diff --git a/src/misc/aviation/aircrafticaocode.cpp b/src/misc/aviation/aircrafticaocode.cpp index 9a7abbaa6..3dab3aa50 100644 --- a/src/misc/aviation/aircrafticaocode.cpp +++ b/src/misc/aviation/aircrafticaocode.cpp @@ -376,7 +376,7 @@ namespace swift::misc::aviation if (m_combinedType.length() < 2) { return -1; } const QString c(m_combinedType.mid(1, 1)); if (c == "-") { return -1; } - bool ok; + bool ok {}; int ec = c.toInt(&ok); if (ok && ec >= 0 && ec < 10) { return ec; } return -1; diff --git a/src/misc/aviation/altitude.cpp b/src/misc/aviation/altitude.cpp index cfde64d8b..b4d3fdc48 100644 --- a/src/misc/aviation/altitude.cpp +++ b/src/misc/aviation/altitude.cpp @@ -234,7 +234,7 @@ namespace swift::misc::aviation return false; } - bool ok; + bool ok {}; if (v.startsWith("F", Qt::CaseInsensitive)) { this->setUnit(CLengthUnit::ft()); diff --git a/src/misc/aviation/callsign.cpp b/src/misc/aviation/callsign.cpp index 55354cf35..7a5f16228 100644 --- a/src/misc/aviation/callsign.cpp +++ b/src/misc/aviation/callsign.cpp @@ -286,7 +286,7 @@ namespace swift::misc::aviation int CCallsign::getFlightNumberInt() const { if (this->isAtcCallsign()) { return -1; } - bool ok; + bool ok {}; const int fn = this->getFlightNumber().toInt(&ok); return ok ? fn : -1; } diff --git a/src/misc/aviation/callsignobjectlist.h b/src/misc/aviation/callsignobjectlist.h index 01cafb1b0..11768a327 100644 --- a/src/misc/aviation/callsignobjectlist.h +++ b/src/misc/aviation/callsignobjectlist.h @@ -204,7 +204,7 @@ namespace swift::misc::aviation //! Incremental update or add object int incrementalUpdateOrAdd(const OBJ &objectBeforeChanges, const CPropertyIndexVariantMap &changedValues) { - int c; + int c {}; const CCallsign cs = objectBeforeChanges.getCallsign(); if (this->containsCallsign(cs)) { diff --git a/src/misc/aviation/comsystem.cpp b/src/misc/aviation/comsystem.cpp index 70a92ec68..7740f4cb4 100644 --- a/src/misc/aviation/comsystem.cpp +++ b/src/misc/aviation/comsystem.cpp @@ -212,7 +212,7 @@ namespace swift::misc::aviation comFreq.parseFromString(input, sep); if (comFreq.isNull()) { - bool ok; + bool ok {}; const double f = CPqString::parseNumber(input, ok, sep); if (ok) { comFreq = CFrequency(f, f > 999 ? CFrequencyUnit::kHz() : CFrequencyUnit::MHz()); } else { comFreq = CFrequency::null(); } diff --git a/src/misc/aviation/flightplan.cpp b/src/misc/aviation/flightplan.cpp index 95673dd37..e1313e191 100644 --- a/src/misc/aviation/flightplan.cpp +++ b/src/misc/aviation/flightplan.cpp @@ -444,7 +444,7 @@ namespace swift::misc::aviation const QDomNodeList generalList = doc.elementsByTagName("general"); if (!generalList.isEmpty()) { - bool ok; + bool ok {}; const QDomNode general = generalList.at(0); QString route = general.firstChildElement("route").text(); fp.setRoute(route.remove("DCT").simplified().trimmed()); @@ -470,7 +470,7 @@ namespace swift::misc::aviation const QDomNodeList timeList = doc.elementsByTagName("times"); if (!timeList.isEmpty()) { - bool ok; + bool ok {}; const QDomNode times = timeList.at(0); const QString enroute = times.firstChildElement("est_time_enroute").text(); const int enrouteSecs = enroute.toInt(&ok); diff --git a/src/misc/aviation/selcal.cpp b/src/misc/aviation/selcal.cpp index 5421069e3..7fc00fff4 100644 --- a/src/misc/aviation/selcal.cpp +++ b/src/misc/aviation/selcal.cpp @@ -54,7 +54,10 @@ namespace swift::misc::aviation bool CSelcal::isValidCode(const QString &code) { if (code.length() != 4) return false; - int p1, p2, p3, p4; + int p1 {}; + int p2 {}; + int p3 {}; + int p4 {}; QString codeUpper = code.toUpper(); if ((p1 = CSelcal::validCharacters().indexOf(codeUpper.at(0))) < 0) return false; if ((p2 = CSelcal::validCharacters().indexOf(codeUpper.at(1))) < 0) return false; diff --git a/src/misc/aviation/transponder.cpp b/src/misc/aviation/transponder.cpp index 326b97bfc..485a03c26 100644 --- a/src/misc/aviation/transponder.cpp +++ b/src/misc/aviation/transponder.cpp @@ -120,7 +120,7 @@ namespace swift::misc::aviation { if (CTransponder::isValidTransponderCode(transponderCode)) { - bool ok; + bool ok {}; this->setTransponderCode(transponderCode.toInt(&ok)); } else { Q_ASSERT_X(false, "CTransponder::setTransponderCode", "illegal transponder value"); } @@ -129,7 +129,7 @@ namespace swift::misc::aviation bool CTransponder::isValidTransponderCode(const QString &transponderCode) { if (transponderCode.isEmpty() || transponderCode.length() > 4) return false; - bool number; + bool number {}; int tc = transponderCode.toInt(&number); if (!number) return false; if (tc < 0 || tc > 7777) return false; diff --git a/src/misc/db/datastore.cpp b/src/misc/db/datastore.cpp index c43359e77..f55816a3b 100644 --- a/src/misc/db/datastore.cpp +++ b/src/misc/db/datastore.cpp @@ -41,7 +41,7 @@ namespace swift::misc::db void IDatastoreObjectWithIntegerKey::setDbKey(const QString &key) { - bool ok; + bool ok {}; const int k = key.toInt(&ok); m_dbKey = ok ? k : -1; } @@ -65,7 +65,7 @@ namespace swift::misc::db int IDatastoreObjectWithIntegerKey::stringToDbKey(const QString &candidate) { if (candidate.isEmpty()) { return invalidDbKey(); } - bool ok; + bool ok {}; int k = candidate.toInt(&ok); return ok ? k : invalidDbKey(); } diff --git a/src/misc/dbus.h b/src/misc/dbus.h index 5282d7198..d08ec1c54 100644 --- a/src/misc/dbus.h +++ b/src/misc/dbus.h @@ -40,7 +40,7 @@ QDBusArgument &operator<<(QDBusArgument &arg, const E &value) template , int> = 0> const QDBusArgument &operator>>(const QDBusArgument &arg, E &value) { - int temp; + int temp {}; arg.beginStructure(); arg >> temp; arg.endStructure(); diff --git a/src/misc/dbusserver.cpp b/src/misc/dbusserver.cpp index 232d0df96..4cc419711 100644 --- a/src/misc/dbusserver.cpp +++ b/src/misc/dbusserver.cpp @@ -139,7 +139,7 @@ namespace swift::misc else if (part.contains("port=", Qt::CaseInsensitive)) { const QString p = part.mid(part.lastIndexOf("=") + 1).trimmed(); - bool ok; + bool ok {}; port = p.toInt(&ok); if (!ok) { port = -1; } } @@ -158,7 +158,7 @@ namespace swift::misc bool CDBusServer::dBusAddressToHostAndPort(const QString &dbusAddress, QString &o_host, QString &o_port) { - int port; + int port {}; const bool s = dBusAddressToHostAndPort(dbusAddress, o_host, port); o_port = QString::number(port); return s; diff --git a/src/misc/geo/earthangle.cpp b/src/misc/geo/earthangle.cpp index 3a2075029..4aae364c9 100644 --- a/src/misc/geo/earthangle.cpp +++ b/src/misc/geo/earthangle.cpp @@ -75,7 +75,7 @@ namespace swift::misc::geo } // number only -> parsed as degrees - bool isDouble; + bool isDouble {}; const double valueDegrees = wgs.toDouble(&isDouble); if (isDouble) { @@ -93,7 +93,7 @@ namespace swift::misc::geo while (i.hasNext() && c < 3) { const QRegularExpressionMatch match = i.next(); - bool ok; + bool ok {}; if (match.hasMatch()) { const QString cap = match.captured(0); diff --git a/src/misc/loghandler.cpp b/src/misc/loghandler.cpp index fc1f33b12..b10ea06be 100644 --- a/src/misc/loghandler.cpp +++ b/src/misc/loghandler.cpp @@ -206,7 +206,7 @@ namespace swift::misc if (isFallThroughEnabled(handlers)) { Q_ASSERT_X(m_oldHandler, Q_FUNC_INFO, "Handler must be installed"); - QtMsgType type; + QtMsgType type {}; QString category; QString message; statusMessage.toQtLogTriple(&type, &category, &message); diff --git a/src/misc/logpattern.cpp b/src/misc/logpattern.cpp index 490244c07..7f1fce766 100644 --- a/src/misc/logpattern.cpp +++ b/src/misc/logpattern.cpp @@ -363,7 +363,7 @@ namespace swift::misc void CLogPattern::unmarshallFromDbus(const QDBusArgument &argument) { - quint8 severities; + quint8 severities {}; QStringList strings; argument >> severities >> m_strategy >> strings; m_strings = QSet(strings.begin(), strings.end()); @@ -385,7 +385,7 @@ namespace swift::misc void CLogPattern::unmarshalFromDataStream(QDataStream &stream) { - quint8 severities; + quint8 severities {}; QStringList strings; stream >> severities >> m_strategy >> strings; m_strings = QSet(strings.begin(), strings.end()); diff --git a/src/misc/math/mathutils.cpp b/src/misc/math/mathutils.cpp index 823ae395e..c2679cde7 100644 --- a/src/misc/math/mathutils.cpp +++ b/src/misc/math/mathutils.cpp @@ -18,8 +18,8 @@ namespace swift::misc::math double CMathUtils::round(double value, int digits) { // gosh, is there no Qt method for this??? It's year 2013 - double fractpart, intpart; - fractpart = modf(value, &intpart); + double intpart {}; + double fractpart = modf(value, &intpart); if (epsilonZeroLimits(fractpart)) { return value; } // do not mess any "integers" to the worse const double m = pow(10.0, digits); const qint64 ri = qRound64(value * m); // do not loose any range here @@ -30,8 +30,8 @@ namespace swift::misc::math double CMathUtils::roundEpsilon(double value, double epsilon) { if (epsilonZeroLimits(epsilon)) { return value; } // avoid division by 0 - double fractpart, intpart; - fractpart = modf(value, &intpart); + double intpart {}; + double fractpart = modf(value, &intpart); if (epsilonZeroLimits(fractpart)) { return value; } // do not mess any "integers" to the worse const double roundValue = value / epsilon; const qint64 ri = qRound64(roundValue); @@ -98,7 +98,7 @@ namespace swift::misc::math QString CMathUtils::fractionalPartAsString(double value, int width) { - double intpart; + double intpart {}; const double fractpart = modf(value, &intpart); const int prec = width >= 0 ? width + 1 : 10; const QString f = QString::number(fractpart, 'f', prec); // avoid scientific notation diff --git a/src/misc/math/mathutils.h b/src/misc/math/mathutils.h index 8659d7b09..eb0317fc0 100644 --- a/src/misc/math/mathutils.h +++ b/src/misc/math/mathutils.h @@ -57,7 +57,7 @@ namespace swift::misc::math //! Fractional part of value static inline double fract(double value) { - double unused; + double unused {}; return modf(value, &unused); } diff --git a/src/misc/network/networkutils.cpp b/src/misc/network/networkutils.cpp index 697652521..7d16bcb90 100644 --- a/src/misc/network/networkutils.cpp +++ b/src/misc/network/networkutils.cpp @@ -135,7 +135,7 @@ namespace swift::misc::network bool CNetworkUtils::isValidPort(const QString &port) { - bool success; + bool success {}; int p = port.toInt(&success); if (!success) return false; return (p >= 1 && p <= 65535); diff --git a/src/misc/network/urlloglist.cpp b/src/misc/network/urlloglist.cpp index 6e543b54d..eaa7fe349 100644 --- a/src/misc/network/urlloglist.cpp +++ b/src/misc/network/urlloglist.cpp @@ -80,7 +80,7 @@ namespace swift::misc::network bool CUrlLogList::markAsReceived(const QNetworkReply *nwReply, bool success) { Q_ASSERT_X(nwReply, Q_FUNC_INFO, "missing reply"); - bool ok; + bool ok {}; const int id = nwReply->property(CUrlLog::propertyNameId()).toInt(&ok); return (ok && id >= 0) ? this->markAsReceived(id, success) : false; } diff --git a/src/misc/pq/pqstring.cpp b/src/misc/pq/pqstring.cpp index 1094ec631..6f4cecff6 100644 --- a/src/misc/pq/pqstring.cpp +++ b/src/misc/pq/pqstring.cpp @@ -43,7 +43,7 @@ namespace swift::misc::physical_quantities unit = unit.trimmed(); // trim after replace, not before if (unit.isEmpty() || number.isEmpty()) { return v; } - bool success; + bool success {}; const double numberD = parseNumber(number, success, mode); if (!success) { return v; } diff --git a/src/misc/pq/time.cpp b/src/misc/pq/time.cpp index bb9b34ed3..3a0d48230 100644 --- a/src/misc/pq/time.cpp +++ b/src/misc/pq/time.cpp @@ -69,7 +69,7 @@ namespace swift::misc::physical_quantities const QString hStr = hhmm.left(2); const QString mStr = hhmm.right(2); - bool ok; + bool ok {}; const int h = hStr.toInt(&ok); if (!ok || h < 0 || h > 23) { return false; } diff --git a/src/misc/propertyindex.cpp b/src/misc/propertyindex.cpp index 27f969dc3..9aec4809e 100644 --- a/src/misc/propertyindex.cpp +++ b/src/misc/propertyindex.cpp @@ -58,7 +58,7 @@ namespace swift::misc for (const auto &index : QStringView { indexes }.split(';')) { if (index.isEmpty()) { continue; } - bool ok; + bool ok {}; int i = index.toInt(&ok); Q_ASSERT(ok); Q_ASSERT(i >= static_cast(CPropertyIndexRef::GlobalIndexCValueObject)); diff --git a/src/misc/simulation/simulationenvironmentprovider.cpp b/src/misc/simulation/simulationenvironmentprovider.cpp index 371260d91..4c9da9f69 100644 --- a/src/misc/simulation/simulationenvironmentprovider.cpp +++ b/src/misc/simulation/simulationenvironmentprovider.cpp @@ -310,7 +310,7 @@ namespace swift::misc::simulation int ISimulationEnvironmentProvider::cleanUpElevations(const ICoordinateGeodetic &referenceCoordinate, int maxNumber) { - int currentMax; + int currentMax {}; CCoordinateGeodeticList coordinates(this->getAllElevationCoordinates(currentMax)); if (maxNumber < 0) { maxNumber = currentMax; } const int size = coordinates.size(); @@ -390,8 +390,8 @@ namespace swift::misc::simulation const int m = foundMissed.second; const double hitRatioPercent = 100.0 * static_cast(f) / static_cast(f + m); - int elvGnd; - int elv; + int elvGnd {}; + int elv {}; { QReadLocker l(&m_lockElvCoordinates); elvGnd = m_elvCoordinatesGnd.sizeInt(); diff --git a/src/misc/timestampbased.h b/src/misc/timestampbased.h index 97ef2b6fb..f261bb16c 100644 --- a/src/misc/timestampbased.h +++ b/src/misc/timestampbased.h @@ -239,7 +239,7 @@ namespace swift::misc static bool canHandleIndex(CPropertyIndexRef index); //! Constructor - ITimestampWithOffsetBased() : ITimestampBased() {} + ITimestampWithOffsetBased() = default; //! Constructor ITimestampWithOffsetBased(qint64 msSincePoch) : ITimestampBased(msSincePoch) {} diff --git a/src/misc/variant.cpp b/src/misc/variant.cpp index 4b32e2964..db9723828 100644 --- a/src/misc/variant.cpp +++ b/src/misc/variant.cpp @@ -543,7 +543,7 @@ namespace swift::misc else if (QMetaType(localUserType).flags() & QMetaType::IsEnumeration) { arg.beginStructure(); - int i; + int i {}; arg >> i; arg.endStructure(); diff --git a/src/misc/worker.h b/src/misc/worker.h index b1dd78477..5a7eec67e 100644 --- a/src/misc/worker.h +++ b/src/misc/worker.h @@ -224,6 +224,7 @@ namespace swift::misc template static CWorker *fromTask(QObject *owner, const QString &name, F &&task) { + // NOLINTNEXTLINE(cppcoreguidelines-init-variables) int typeId = qMetaTypeId(task)())>>(); return fromTaskImpl(owner, name, typeId, [task = std::forward(task)]() mutable { if constexpr (std::is_void_v) diff --git a/src/plugins/simulator/flightgear/fgswiftbusserviceproxy.cpp b/src/plugins/simulator/flightgear/fgswiftbusserviceproxy.cpp index d03049f3c..dd991a105 100644 --- a/src/plugins/simulator/flightgear/fgswiftbusserviceproxy.cpp +++ b/src/plugins/simulator/flightgear/fgswiftbusserviceproxy.cpp @@ -21,7 +21,7 @@ namespace swift::simplugin::flightgear InterfaceName(), connection, this); if (!dummy) { - bool s; + bool s {}; s = connection.connect( QString(), "/fgswiftbus/service", "org.swift_project.fgswiftbus.service", "aircraftModelChanged", this, SIGNAL(aircraftModelChanged(QString, QString, QString, QString, QString, QString, QString))); diff --git a/src/plugins/simulator/flightgear/fgswiftbustrafficproxy.cpp b/src/plugins/simulator/flightgear/fgswiftbustrafficproxy.cpp index d47054f5c..85f07d826 100644 --- a/src/plugins/simulator/flightgear/fgswiftbustrafficproxy.cpp +++ b/src/plugins/simulator/flightgear/fgswiftbustrafficproxy.cpp @@ -21,7 +21,7 @@ namespace swift::simplugin::flightgear connection, this); if (!dummy) { - bool s; + bool s {}; s = connection.connect(QString(), "/fgswiftbus/traffic", "org.swift_project.fgswiftbus.traffic", "simFrame", this, SIGNAL(simFrame())); Q_ASSERT(s); diff --git a/src/plugins/simulator/xplane/simulatorxplane.cpp b/src/plugins/simulator/xplane/simulatorxplane.cpp index b8076c7d7..760391c77 100644 --- a/src/plugins/simulator/xplane/simulatorxplane.cpp +++ b/src/plugins/simulator/xplane/simulatorxplane.cpp @@ -1133,7 +1133,7 @@ namespace swift::simplugin::xplane void CSimulatorXPlane::onXSwiftBusSettingsChanged() { - bool ok; + bool ok {}; const CXSwiftBusSettings xPlaneSide = this->receiveXSwiftBusSettings(ok); if (ok) { diff --git a/src/plugins/simulator/xplane/xswiftbusserviceproxy.cpp b/src/plugins/simulator/xplane/xswiftbusserviceproxy.cpp index d47d4253d..3e17f5bbf 100644 --- a/src/plugins/simulator/xplane/xswiftbusserviceproxy.cpp +++ b/src/plugins/simulator/xplane/xswiftbusserviceproxy.cpp @@ -21,7 +21,7 @@ namespace swift::simplugin::xplane InterfaceName(), connection, this); if (!dummy) { - bool s; + bool s {}; s = connection.connect( QString(), "/xswiftbus/service", "org.swift_project.xswiftbus.service", "aircraftModelChanged", this, SIGNAL(aircraftModelChanged(QString, QString, QString, QString, QString, QString, QString))); diff --git a/src/plugins/simulator/xplane/xswiftbustrafficproxy.cpp b/src/plugins/simulator/xplane/xswiftbustrafficproxy.cpp index fc82aea42..fcf9140a5 100644 --- a/src/plugins/simulator/xplane/xswiftbustrafficproxy.cpp +++ b/src/plugins/simulator/xplane/xswiftbustrafficproxy.cpp @@ -32,7 +32,7 @@ namespace swift::simplugin::xplane connection, this); if (!dummy) { - bool s; + bool s {}; s = connection.connect(QString(), "/xswiftbus/traffic", "org.swift_project.xswiftbus.traffic", "simFrame", this, SIGNAL(simFrame())); Q_ASSERT(s); diff --git a/src/plugins/simulator/xplaneconfig/simulatorxplaneconfigwindow.cpp b/src/plugins/simulator/xplaneconfig/simulatorxplaneconfigwindow.cpp index 91b3dc01d..83a27e0ca 100644 --- a/src/plugins/simulator/xplaneconfig/simulatorxplaneconfigwindow.cpp +++ b/src/plugins/simulator/xplaneconfig/simulatorxplaneconfigwindow.cpp @@ -147,7 +147,7 @@ namespace swift::simplugin::xplane int CSimulatorXPlaneConfigWindow::marginToInt(const QString &text, int defaultValue) { if (text.isEmpty()) { return defaultValue; } - bool ok; + bool ok {}; const int v = text.toInt(&ok); return ok ? v : defaultValue; } diff --git a/src/sound/codecs/opusdecoder.cpp b/src/sound/codecs/opusdecoder.cpp index d72b21acf..749a6822d 100644 --- a/src/sound/codecs/opusdecoder.cpp +++ b/src/sound/codecs/opusdecoder.cpp @@ -7,7 +7,7 @@ namespace swift::sound::codecs { COpusDecoder::COpusDecoder(int sampleRate, int channels) : m_channels(channels) { - int error; + int error {}; m_opusDecoder = opus_decoder_create(sampleRate, channels, &error); } diff --git a/src/sound/codecs/opusencoder.cpp b/src/sound/codecs/opusencoder.cpp index 45c93946e..08308ce25 100644 --- a/src/sound/codecs/opusencoder.cpp +++ b/src/sound/codecs/opusencoder.cpp @@ -7,7 +7,7 @@ namespace swift::sound::codecs { COpusEncoder::COpusEncoder(int sampleRate, int channels, int application) { - int error; + int error {}; opusEncoder = opus_encoder_create(sampleRate, channels, application, &error); } diff --git a/src/sound/wav/wavfile.cpp b/src/sound/wav/wavfile.cpp index 19624d864..aa4297e3e 100644 --- a/src/sound/wav/wavfile.cpp +++ b/src/sound/wav/wavfile.cpp @@ -52,7 +52,7 @@ namespace swift::sound::wav WAVEHeader wave; //!< WAVE header }; - CWavFile::CWavFile(QObject *parent) : QFile(parent), m_headerLength(0) {} + CWavFile::CWavFile(QObject *parent) : QFile(parent) {} bool CWavFile::open(const QString &fileName) { @@ -82,7 +82,7 @@ namespace swift::sound::wav if (qFromLittleEndian(header.wave.descriptor.size) > sizeof(WAVEHeader)) { // Extended data available - quint16 extraFormatBytes; + quint16 extraFormatBytes {}; if (peek((char *)&extraFormatBytes, sizeof(quint16)) != sizeof(quint16)) return false; const qint64 throwAwayBytes = sizeof(quint16) + qFromLittleEndian(extraFormatBytes); if (read(throwAwayBytes).size() != throwAwayBytes) return false; diff --git a/src/sound/wav/wavfile.h b/src/sound/wav/wavfile.h index 024d481d6..db9163270 100644 --- a/src/sound/wav/wavfile.h +++ b/src/sound/wav/wavfile.h @@ -38,7 +38,7 @@ namespace swift::sound::wav bool readHeader(); QAudioFormat m_fileFormat; - qint64 m_headerLength; + qint64 m_headerLength { 0 }; QByteArray m_audioData; }; } // namespace swift::sound::wav