Skip to content

Commit 1a0b2a8

Browse files
committed
refactor: clang format line length
1 parent c7779e1 commit 1a0b2a8

File tree

1,352 files changed

+26034
-26643
lines changed

Some content is hidden

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

1,352 files changed

+26034
-26643
lines changed

.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ BreakBeforeBraces: Custom
3434
BreakInheritanceList: AfterColon
3535
BreakBeforeTernaryOperators: false
3636
BreakConstructorInitializers: BeforeColon
37-
ColumnLimit: 0 # Leave line length untouched
37+
ColumnLimit: 120
3838
Cpp11BracedListStyle: false
3939
FixNamespaceComments: true
4040
IncludeBlocks: Regroup

samples/afvclient/afvclientbridge.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55

66
using namespace swift::core::afv::clients;
77

8-
CAfvClientBridge::CAfvClientBridge(CAfvClient *afvClient, QObject *parent) : QObject(parent),
9-
m_afvClient(afvClient)
8+
CAfvClientBridge::CAfvClientBridge(CAfvClient *afvClient, QObject *parent) : QObject(parent), m_afvClient(afvClient)
109
{
1110
connect(afvClient, &CAfvClient::receivingCallsignsChanged, this, &CAfvClientBridge::receivingCallsignsChanged);
1211
connect(afvClient, &CAfvClient::connectionStatusChanged, this, &CAfvClientBridge::connectionStatusChanged);
13-
connect(afvClient, &CAfvClient::updatedFromOwnAircraftCockpit, this, &CAfvClientBridge::updatedFromOwnAircraftCockpit);
12+
connect(afvClient, &CAfvClient::updatedFromOwnAircraftCockpit, this,
13+
&CAfvClientBridge::updatedFromOwnAircraftCockpit);
1414
connect(afvClient, &CAfvClient::ptt, this, &CAfvClientBridge::ptt);
1515
connect(afvClient, &CAfvClient::inputVolumePeakVU, this, &CAfvClientBridge::inputVolumePeakVU);
1616
connect(afvClient, &CAfvClient::outputVolumePeakVU, this, &CAfvClientBridge::outputVolumePeakVU);

samples/afvclient/afvclientbridge.h

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ class CAfvClientBridge : public QObject
1919
//! @{
2020
Q_PROPERTY(double inputVolumePeakVU READ getInputVolumePeakVU NOTIFY inputVolumePeakVU)
2121
Q_PROPERTY(double outputVolumePeakVU READ getOutputVolumePeakVU NOTIFY outputVolumePeakVU)
22-
Q_PROPERTY(swift::core::afv::clients::CAfvClient::ConnectionStatus connectionStatus READ getConnectionStatus NOTIFY connectionStatusChanged)
22+
Q_PROPERTY(swift::core::afv::clients::CAfvClient::ConnectionStatus connectionStatus READ getConnectionStatus NOTIFY
23+
connectionStatusChanged)
2324
Q_PROPERTY(QString receivingCallsignsCom1 READ getReceivingCallsignsCom1 NOTIFY receivingCallsignsChanged)
2425
Q_PROPERTY(QString receivingCallsignsCom2 READ getReceivingCallsignsCom2 NOTIFY receivingCallsignsChanged)
2526
//! @}
@@ -66,13 +67,19 @@ class CAfvClientBridge : public QObject
6667
Q_INVOKABLE void setBypassEffects(bool value) { m_afvClient->setBypassEffects(value); }
6768

6869
//! \copydoc swift::core::afv::clients::CAfvClient::startAudio
69-
Q_INVOKABLE void startAudio(const QString &inputDeviceName, const QString &outputDeviceName) { m_afvClient->startAudio(inputDeviceName, outputDeviceName); }
70+
Q_INVOKABLE void startAudio(const QString &inputDeviceName, const QString &outputDeviceName)
71+
{
72+
m_afvClient->startAudio(inputDeviceName, outputDeviceName);
73+
}
7074

7175
//! \copydoc swift::core::afv::clients::CAfvClient::enableTransceiver
7276
Q_INVOKABLE void enableTransceiver(quint16 id, bool enable) { m_afvClient->enableTransceiver(id, enable); }
7377

7478
//! \copydoc swift::core::afv::clients::CAfvClient::updateComFrequency
75-
Q_INVOKABLE void updateComFrequency(quint16 id, quint32 frequencyHz) { m_afvClient->updateComFrequency(id, frequencyHz); }
79+
Q_INVOKABLE void updateComFrequency(quint16 id, quint32 frequencyHz)
80+
{
81+
m_afvClient->updateComFrequency(id, frequencyHz);
82+
}
7683

7784
//! \copydoc swift::core::afv::clients::CAfvClient::updatePosition
7885
Q_INVOKABLE void updatePosition(double latitudeDeg, double longitudeDeg, double heightMeters)
@@ -93,7 +100,10 @@ class CAfvClientBridge : public QObject
93100
Q_INVOKABLE void setInputVolumeDb(double valueDb) { m_afvClient->setInputVolumeDb(valueDb); }
94101

95102
//! \copydoc swift::core::afv::clients::CAfvClient::setNormalizedMasterOutputVolume
96-
Q_INVOKABLE void setNormalizedMasterOutputVolume(double valueDb) { m_afvClient->setNormalizedMasterOutputVolume(valueDb); }
103+
Q_INVOKABLE void setNormalizedMasterOutputVolume(double valueDb)
104+
{
105+
m_afvClient->setNormalizedMasterOutputVolume(valueDb);
106+
}
97107

98108
signals:
99109
//! Receiving callsigns have been changed

samples/afvclient/main.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ int main(int argc, char *argv[])
4141
voiceClient->start(QThread::TimeCriticalPriority); // background thread
4242
CAfvClientBridge *voiceClientBridge = new CAfvClientBridge(voiceClient, &qa);
4343

44-
QObject::connect(&qa, &QCoreApplication::aboutToQuit, [voiceClient]() {
45-
voiceClient->quitAndWait();
46-
});
44+
QObject::connect(&qa, &QCoreApplication::aboutToQuit, [voiceClient]() { voiceClient->quitAndWait(); });
4745

4846
// default user name
4947
QString defaultUserName("1234567");

samples/fsd/main.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ int main(int argc, char *argv[])
2222
QCoreApplication qa(argc, argv);
2323
COwnAircraftProviderDummy::instance()->updateOwnCallsign("BER368");
2424

25-
CFSDClient client(CClientProviderDummy::instance(), COwnAircraftProviderDummy::instance(), CRemoteAircraftProviderDummy::instance(), &qa);
25+
CFSDClient client(CClientProviderDummy::instance(), COwnAircraftProviderDummy::instance(),
26+
CRemoteAircraftProviderDummy::instance(), &qa);
2627
client.setClientName("Test Client");
2728
client.setHostApplication("None");
2829
client.setVersion(0, 8);
@@ -48,8 +49,8 @@ int main(int argc, char *argv[])
4849
client.sendFsdMessage("$CRLOWW_F_APP:LHA449:ATIS:E:6\r\n");
4950
client.sendFsdMessage("$CRN1234:BAW345:CAPS:INTERIMPOS=1:MODELDESC=1:ATCINFO=1:STEALTH=1:ACCONFIG=1\r\n");
5051
client.sendFsdMessage("#SBBAW106:LHA449:PI:GEN:EQUIPMENT=B744:AIRLINE=BAW:LIVERY=UNION\r\n");
51-
client.sendFsdMessage("#SBGEC55F:DESWL:FSIPIR:1::MD11:12.93209:-0.01354:3648.00000:4.CB8FB1E0.984745A0::PMDG MD-11F Lufthansa Cargo WOW\r\n");
52-
client.sendFsdMessage("#TMAFR529:@20500&@26000:taxi to entry N1 via M A4\r\n");
52+
client.sendFsdMessage("#SBGEC55F:DESWL:FSIPIR:1::MD11:12.93209:-0.01354:3648.00000:4.CB8FB1E0.984745A0::PMDG MD-11F
53+
Lufthansa Cargo WOW\r\n"); client.sendFsdMessage("#TMAFR529:@20500&@26000:taxi to entry N1 via M A4\r\n");
5354
client.sendFsdMessage("$CQDLH123:BER368:ACC:json config\r\n");
5455
client.sendFsdMessage("$CQDLH123:@94836:ACC:{\"request\":\"full\"}\r\n");
5556
client.sendFsdMessage("#SBAUA417C:LHA449:PI:X:0:1:~B737");

samples/misc/main.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ int main(int argc, char *argv[])
3737
QTextStream qtout(stdout);
3838
QTextStream qtin(stdin);
3939

40-
do
41-
{
40+
do {
4241
qtout << Qt::endl;
4342
qtout << "1 .. JSON" << Qt::endl;
4443
qtout << "2 .. Change object" << Qt::endl;

samples/misc/samplesalgorithm.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ namespace swift::sample
2929
int CSamplesAlgorithm::samples()
3030
{
3131
swift::misc::CSequence<int> seq;
32-
for (int i = 1; i <= 100; ++i)
33-
{
34-
seq.push_back(i);
35-
}
32+
for (int i = 1; i <= 100; ++i) { seq.push_back(i); }
3633
const int samples = 200;
3734
swift::misc::CSequence<int> means;
3835
{
@@ -42,7 +39,9 @@ namespace swift::sample
4239
means.push_back(std::accumulate(randoms.cbegin(), randoms.cend(), 0) / 10);
4340
}
4441
int mean = std::accumulate(means.cbegin(), means.cend(), 0) / samples;
45-
int stdDev = std::sqrt(std::accumulate(means.cbegin(), means.cend(), 0, [&](int a, int n) { return a + (n - mean) * (n - mean); }) / samples);
42+
int stdDev = std::sqrt(std::accumulate(means.cbegin(), means.cend(), 0,
43+
[&](int a, int n) { return a + (n - mean) * (n - mean); }) /
44+
samples);
4645
qDebug() << "randomElements";
4746
qDebug() << "means:" << means;
4847
qDebug() << "mean of the means:" << mean;
@@ -56,7 +55,9 @@ namespace swift::sample
5655
means.push_back(std::accumulate(randoms.cbegin(), randoms.cend(), 0) / 10);
5756
}
5857
int mean = std::accumulate(means.cbegin(), means.cend(), 0) / samples;
59-
int stdDev = std::sqrt(std::accumulate(means.cbegin(), means.cend(), 0, [&](int a, int n) { return a + (n - mean) * (n - mean); }) / samples);
58+
int stdDev = std::sqrt(std::accumulate(means.cbegin(), means.cend(), 0,
59+
[&](int a, int n) { return a + (n - mean) * (n - mean); }) /
60+
samples);
6061
qDebug() << "sampleElements";
6162
qDebug() << "means:" << means;
6263
qDebug() << "mean of the means:" << mean;
@@ -69,7 +70,10 @@ namespace swift::sample
6970
qDebug() << "topologicallySortedInsert";
7071
QStringList dst;
7172
int count = 0;
72-
auto cmp = [&](const QString &a, const QString &b) { count++; return a[0] == b[0] && a[1] < b[1]; };
73+
auto cmp = [&](const QString &a, const QString &b) {
74+
count++;
75+
return a[0] == b[0] && a[1] < b[1];
76+
};
7377
for (const auto &s : src) { swift::misc::topologicallySortedInsert(dst, s, cmp); }
7478
qDebug() << count << "comparisons";
7579
qDebug() << dst;

samples/misc/sampleschangeobject.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,15 @@ namespace swift::sample
3232
int CSamplesChangeObject::samples()
3333
{
3434
// ATC station
35-
const CCoordinateGeodetic geoPos = CCoordinateGeodetic::fromWgs84("48° 21′ 13″ N", "11° 47′ 09″ E", { 1487, CLengthUnit::ft() });
35+
const CCoordinateGeodetic geoPos =
36+
CCoordinateGeodetic::fromWgs84("48° 21′ 13″ N", "11° 47′ 09″ E", { 1487, CLengthUnit::ft() });
3637
const CAtcStation station1(CCallsign("eddm_twr"), CUser("123456", "Joe Doe"),
37-
CFrequency(118.7, CFrequencyUnit::MHz()),
38-
geoPos, CLength(50, CLengthUnit::km()), false);
38+
CFrequency(118.7, CFrequencyUnit::MHz()), geoPos, CLength(50, CLengthUnit::km()),
39+
false);
3940
const CAtcStation station2(station1);
4041
const CAtcStation station3(CCallsign("eddm_app"), CUser("654321", "Jen Doe"),
41-
CFrequency(120.7, CFrequencyUnit::MHz()),
42-
geoPos, CLength(100, CLengthUnit::km()), false);
42+
CFrequency(120.7, CFrequencyUnit::MHz()), geoPos, CLength(100, CLengthUnit::km()),
43+
false);
4344

4445
Q_ASSERT_X(station1 == station2, Q_FUNC_INFO, "Unequal stations");
4546

@@ -57,9 +58,8 @@ namespace swift::sample
5758
// put Jane in the tower
5859
CPropertyIndexVariantMap newController;
5960
newController.addValue(CAtcStation::IndexController, CVariant::fromValue(CUser("112233", "Jane Doe")));
60-
atcList.applyIf(
61-
swift::misc::predicates::MemberEqual(&CAtcStation::getCallsign, CCallsign("eddm_twr")),
62-
newController);
61+
atcList.applyIf(swift::misc::predicates::MemberEqual(&CAtcStation::getCallsign, CCallsign("eddm_twr")),
62+
newController);
6363
qDebug() << "-- after update via predicates";
6464
qDebug() << atcList.toQString();
6565

samples/misc/samplescontainer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ namespace swift::sample
5353
qDebug() << "-- list:";
5454
qDebug() << atcList.toQString();
5555

56-
CAtcStationList atcListFind = atcList.findBy(&CAtcStation::getCallsign, "eddm_twr", &CAtcStation::getFrequency, CFrequency(118.7, CFrequencyUnit::MHz()));
56+
CAtcStationList atcListFind = atcList.findBy(&CAtcStation::getCallsign, "eddm_twr", &CAtcStation::getFrequency,
57+
CFrequency(118.7, CFrequencyUnit::MHz()));
5758
qDebug() << "-- find by:";
5859
qDebug() << atcListFind.toQString();
5960

samples/misc/samplesjson.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ namespace swift::sample
6767
qDebug() << "------- Enter -----";
6868
cin.readLine();
6969

70-
CSimulatedAircraft aircraft(CCallsign("DAMBZ"), CUser("123456", "Joe Pilot"), CTestData::getAircraftSituationAboveMunichTower());
70+
CSimulatedAircraft aircraft(CCallsign("DAMBZ"), CUser("123456", "Joe Pilot"),
71+
CTestData::getAircraftSituationAboveMunichTower());
7172
aircraft.setCom1System(CComSystem::getCom1System(122.8, 118.75));
7273
aircraft.setCom2System(CComSystem::getCom2System(123.8, 124.00));
7374
aircraft.setTransponder(CTransponder::getStandardTransponder(7000, CTransponder::ModeC));

0 commit comments

Comments
 (0)