Skip to content

Commit cc1f119

Browse files
committed
refactor: Fix cppcoreguidelines-init-variables warnings
1 parent cc8436f commit cc1f119

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+82
-74
lines changed

.clang-tidy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Checks: >
4848
readability-use-std-min-max,
4949
readability-use-anyofallof,
5050
readability-redundant-member-init,
51+
cppcoreguidelines-init-variables,
5152
5253
CheckOptions:
5354
- key: readability-identifier-naming.ClassCase

src/core/afv/audio/input.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ namespace swift::core::afv::audio
159159
m_maxSampleInput = qMax(qAbs(sampleInput), m_maxSampleInput);
160160
}
161161

162-
int length;
162+
int length {};
163163
const QByteArray encodedBuffer = m_encoder.encode(samples, samples.size(), &length);
164164
m_opusBytesEncoded += length;
165165

src/core/context/contextownaircraftimpl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ namespace swift::core::context
284284
{
285285
CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO << com1 << com2 << transponder;
286286
}
287-
bool changed;
287+
bool changed {};
288288
{
289289
QWriteLocker l(&m_lockAircraft);
290290
changed = m_ownAircraft.hasChangedCockpitData(com1, com2, transponder);
@@ -301,7 +301,7 @@ namespace swift::core::context
301301
{
302302
CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO << transponderMode;
303303
}
304-
bool changed;
304+
bool changed {};
305305
{
306306
QWriteLocker l(&m_lockAircraft);
307307
changed = m_ownAircraft.setTransponderMode(transponderMode);

src/core/db/databaseutils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ namespace swift::core::db
425425
const int contentIndex = content.indexOf(':', cl);
426426
if (contentIndex < cl) break; // should not happen, malformed
427427
const QString ls = content.mid(cl, contentIndex - cl); // content length
428-
bool ok;
428+
bool ok {};
429429
const qint32 size = ls.toInt(&ok);
430430
if (!ok) break; // malformed size
431431
if (size < 1) break;

src/core/db/databasewriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ namespace swift::core::db
172172
CAircraftModelList modelsPublished;
173173
CAircraftModelList modelsSkipped;
174174
CStatusMessageList msgs;
175-
bool directWrite;
175+
bool directWrite {};
176176
const bool sendingSuccessful =
177177
parseSwiftPublishResponse(responseData, modelsPublished, modelsSkipped, msgs, directWrite);
178178
const int c = CDatabaseUtils::fillInMissingAircraftAndLiveryEntities(modelsPublished);

src/core/fsd/interimpilotdataupdate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace swift::core::fsd
1717

1818
QStringList InterimPilotDataUpdate::toTokens() const
1919
{
20-
std::uint32_t pbh;
20+
std::uint32_t pbh {};
2121
packPBH(m_pitch, m_bank, m_heading, m_onGround, pbh);
2222

2323
auto tokens = QStringList {};

src/core/fsd/pilotdataupdate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace swift::core::fsd
2424

2525
QStringList PilotDataUpdate::toTokens() const
2626
{
27-
std::uint32_t pbh;
27+
std::uint32_t pbh {};
2828
packPBH(m_pitch, m_bank, m_heading, m_onGround, pbh);
2929

3030
QStringList tokens;

src/core/fsd/visualpilotdataperiodic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace swift::core::fsd
2727

2828
QStringList VisualPilotDataPeriodic::toTokens() const
2929
{
30-
std::uint32_t pbh;
30+
std::uint32_t pbh {};
3131
packPBH(m_pitch, m_bank, m_heading, false /*! \todo check if needed? */, pbh);
3232

3333
QStringList tokens;

src/core/fsd/visualpilotdatastopped.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace swift::core::fsd
2323

2424
QStringList VisualPilotDataStopped::toTokens() const
2525
{
26-
std::uint32_t pbh;
26+
std::uint32_t pbh {};
2727
packPBH(m_pitch, m_bank, m_heading, false /*! \todo check if needed? */, pbh);
2828

2929
QStringList tokens;

src/core/fsd/visualpilotdataupdate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace swift::core::fsd
2828

2929
QStringList VisualPilotDataUpdate::toTokens() const
3030
{
31-
std::uint32_t pbh;
31+
std::uint32_t pbh {};
3232
packPBH(m_pitch, m_bank, m_heading, false /*! \todo check if needed? */, pbh);
3333

3434
QStringList tokens;

0 commit comments

Comments
 (0)