Fix cppcheck warnings

This commit is contained in:
Lars Toenning
2023-04-16 21:02:55 +02:00
parent ac04aa3a63
commit 7ef0e6e1eb
28 changed files with 45 additions and 53 deletions

View File

@@ -52,18 +52,18 @@ namespace BlackMisc::Aviation
lights.setBeaconOn(true);
lights.setNavOn(true);
if (gsKts > 5)
{
// mode taxi
lights.setTaxiOn(true);
lights.setLandingOn(false);
}
else if (gsKts > 30)
if (gsKts > 30)
{
// mode accelaration for takeoff
lights.setTaxiOn(false);
lights.setLandingOn(true);
}
else if (gsKts > 5)
{
// mode taxi
lights.setTaxiOn(true);
lights.setLandingOn(false);
}
else
{
// slow movements or parking

View File

@@ -748,7 +748,7 @@ namespace BlackMisc::Aviation
if (firstSplit.size() >= 2)
{
// format like B789/H-SDE1E2E3FGHIJ2J3J4J5M1RWXY/LB1D1
QString equipment = firstSplit.size() >= 2 ? firstSplit[1] : "";
QString equipment = firstSplit[1];
QStringList split = firstSplit[0].split('/');
if (split.size() >= 3)
{

View File

@@ -74,7 +74,7 @@ namespace BlackMisc::Aviation
if ((p3 = CSelcal::validCharacters().indexOf(codeUpper.at(2))) < 0) return false;
if ((p4 = CSelcal::validCharacters().indexOf(codeUpper.at(3))) < 0) return false;
if (p1 >= p2 || p3 >= p4) return false; // pair in alphabetical order
if (p1 == p3 || p2 == p3 || p2 == p4 || p3 == p4) return false; // given letter can be used only once in a SELCAL code
if (p1 == p3 || p2 == p3 || p2 == p4 || p3 == p4) return false; // cppcheck-suppress knownConditionTrueFalse // given letter can be used only once in a SELCAL code
return true;
}