Commit 9f3b5b78 authored by Gus Grubba's avatar Gus Grubba

Uninitialized variable used in fmin/fmax.

parent 45cb473c
......@@ -1392,26 +1392,28 @@ void MissionController::_addPlannedHomePosition(Vehicle* vehicle, QmlObjectListM
visualItems->insert(0, homeItem);
if (visualItems->count() > 1 && addToCenter) {
double north, south, east, west;
double north = 0.0;
double south = 0.0;
double east = 0.0;
double west = 0.0;
bool firstCoordSet = false;
for (int i=1; i<visualItems->count(); i++) {
VisualMissionItem* item = qobject_cast<VisualMissionItem*>(visualItems->get(i));
if (item->specifiesCoordinate()) {
if (firstCoordSet) {
double lat = _normalizeLat(item->coordinate().latitude());
double lon = _normalizeLon(item->coordinate().longitude());
north = fmax(north, lat);
south = fmin(south, lat);
east = fmax(east, lon);
west = fmin(west, lon);
east = fmax(east, lon);
west = fmin(west, lon);
} else {
firstCoordSet = true;
north = _normalizeLat(item->coordinate().latitude());
south = north;
east = _normalizeLon(item->coordinate().longitude());
west = east;
east = _normalizeLon(item->coordinate().longitude());
west = east;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment