mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-11 06:25:33 +08:00
Fix cppcheck and compiler warnings
This commit is contained in:
@@ -581,7 +581,6 @@ namespace BlackSimPlugin
|
||||
{
|
||||
if (!m_isWeatherActivated) { return false; }
|
||||
|
||||
const CWeatherScenario s = m_weatherScenarioSettings.get();
|
||||
this->getOwnAircraftPosition();
|
||||
const CCoordinateGeodetic currentPosition = this->getOwnAircraftPosition();
|
||||
this->requestWeatherGrid(currentPosition, this->identifier());
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace BlackSimPlugin
|
||||
struct Serializer<MsgTuple, 0>
|
||||
{
|
||||
static const QByteArray &read(const QByteArray &data, MsgTuple &) { return data; }
|
||||
static QByteArray write(QByteArray &data, const MsgTuple &) { return data; }
|
||||
static QByteArray write(const QByteArray &data, const MsgTuple &) { return data; }
|
||||
};
|
||||
|
||||
template< typename MessageTuple, quint32 Size >
|
||||
|
||||
@@ -78,6 +78,7 @@ namespace BlackSimPlugin
|
||||
return QStringLiteral("N/A");
|
||||
}
|
||||
|
||||
// cppcheck-suppress constParameter
|
||||
bool CFsuipc::read(CSimulatedAircraft &aircraft, bool cockpit, bool situation, bool aircraftParts)
|
||||
{
|
||||
Q_UNUSED(aircraft);
|
||||
|
||||
@@ -453,9 +453,6 @@ namespace BlackSimPlugin
|
||||
{
|
||||
read = true;
|
||||
|
||||
// time, basically as a heartbeat
|
||||
QString fsTime = QString::asprintf("%02d:%02d:%02d", localFsTimeRaw[0], localFsTimeRaw[1], localFsTimeRaw[2]);
|
||||
|
||||
if (cockpit)
|
||||
{
|
||||
// COMs
|
||||
@@ -491,6 +488,7 @@ namespace BlackSimPlugin
|
||||
// position
|
||||
const double latCorrectionFactor = 90.0 / (10001750.0 * 65536.0 * 65536.0);
|
||||
const double lonCorrectionFactor = 360.0 / (65536.0 * 65536.0 * 65536.0 * 65536.0);
|
||||
// cppcheck-suppress shadowArgument
|
||||
CAircraftSituation situation = aircraft.getSituation();
|
||||
CCoordinateGeodetic position = situation.getPosition();
|
||||
CLatitude lat(latitudeRaw * latCorrectionFactor, CAngleUnit::deg());
|
||||
|
||||
@@ -1106,7 +1106,6 @@ namespace BlackSimPlugin
|
||||
CAircraftModel model = simObject.getAircraftModel();
|
||||
|
||||
const CSpecializedSimulatorSettings settings = this->getSimulatorSettings();
|
||||
const QStringList modelDirectories = settings.getModelDirectoriesFromSimulatorDirectoryOrDefault();
|
||||
const bool fileExists = CFsCommonUtil::adjustFileDirectory(model, settings.getModelDirectoriesOrDefault());
|
||||
bool canBeUsed = true;
|
||||
|
||||
@@ -1586,7 +1585,6 @@ namespace BlackSimPlugin
|
||||
if (situations.isEmpty())
|
||||
{
|
||||
CLogMessage(this).warning(u"No valid situations for '%1', will be added as pending") << callsign.asString();
|
||||
canAdd = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1596,11 +1594,10 @@ namespace BlackSimPlugin
|
||||
}
|
||||
|
||||
// still invalid?
|
||||
const bool invalidSituation = situation.isPositionOrAltitudeNull();
|
||||
canAdd = invalidSituation;
|
||||
canAdd = situation.isPositionOrAltitudeNull();
|
||||
if (CBuildConfig::isLocalDeveloperDebugBuild())
|
||||
{
|
||||
BLACK_VERIFY_X(invalidSituation, Q_FUNC_INFO, "Expect valid situation");
|
||||
BLACK_VERIFY_X(canAdd, Q_FUNC_INFO, "Expect valid situation");
|
||||
CLogMessage(this).warning(u"Invalid situation for '%1'") << callsign;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user