Fix gcc warnings

This commit is contained in:
Jon Beniston 2021-02-27 11:48:43 +00:00
parent 8e2268d9b8
commit 8f1fe0e088
2 changed files with 5 additions and 4 deletions

View File

@ -366,7 +366,7 @@ static bool crossesAntimeridianWest(double prevLon, double lon)
return crosses; return crosses;
} }
static bool crossesEdge(double lon, double prevLon, double bottomLeftLongitude, double bottomRightLongitude, double width, bool antimed) static bool crossesEdge(double lon, double prevLon, double bottomLeftLongitude, double bottomRightLongitude)
{ {
// Determine if antimerdian is between the two points // Determine if antimerdian is between the two points
if (!crossesAntimeridian(prevLon, lon)) if (!crossesAntimeridian(prevLon, lon))
@ -484,7 +484,7 @@ void MapModel::splitTrack(const QList<QGeoCoordinate *>& coords, const QVariantL
// Can be onscreen after having crossed edge from other side // Can be onscreen after having crossed edge from other side
// Or can be onscreen after previously having been off screen // Or can be onscreen after previously having been off screen
onScreen = isOnScreen(lon, bottomLeftLongitude, bottomRightLongitude, width, antimed); onScreen = isOnScreen(lon, bottomLeftLongitude, bottomRightLongitude, width, antimed);
bool crossedEdge = crossesEdge(lon, prevLon, bottomLeftLongitude, bottomRightLongitude, width, antimed); bool crossedEdge = crossesEdge(lon, prevLon, bottomLeftLongitude, bottomRightLongitude);
if ((onScreen && !crossedEdge) || (onScreen && !prevOnScreen)) if ((onScreen && !crossedEdge) || (onScreen && !prevOnScreen))
{ {
if ((i > 0) && (tracks[trackIdx]->size() == 0)) // Could also use (onScreen && !prevOnScreen)? if ((i > 0) && (tracks[trackIdx]->size() == 0)) // Could also use (onScreen && !prevOnScreen)?
@ -554,7 +554,8 @@ void MapModel::splitTrack(const QList<QGeoCoordinate *>& coords, const QVariantL
void MapModel::viewChanged(double bottomLeftLongitude, double bottomRightLongitude) void MapModel::viewChanged(double bottomLeftLongitude, double bottomRightLongitude)
{ {
if (!isnan(bottomLeftLongitude)) (void) bottomRightLongitude;
if (!std::isnan(bottomLeftLongitude))
{ {
for (int row = 0; row < m_items.size(); row++) for (int row = 0; row < m_items.size(); row++)
{ {

View File

@ -26,8 +26,8 @@
#include "maincore.h" #include "maincore.h"
Feature::Feature(const QString& uri, WebAPIAdapterInterface *webAPIAdapterInterface) : Feature::Feature(const QString& uri, WebAPIAdapterInterface *webAPIAdapterInterface) :
m_webAPIAdapterInterface(webAPIAdapterInterface),
m_guiMessageQueue(nullptr), m_guiMessageQueue(nullptr),
m_webAPIAdapterInterface(webAPIAdapterInterface),
m_name(uri), m_name(uri),
m_uri(uri), m_uri(uri),
m_uid(UidCalculator::getNewObjectId()) m_uid(UidCalculator::getNewObjectId())