Skip to content

Commit

Permalink
kill a position normilization clone caught by codacy. (#1333)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsteven4 authored Aug 30, 2024
1 parent 314d987 commit a81a4b1
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions gdb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1152,26 +1152,7 @@ GdbFormat::write_header()
void
GdbFormat::gdb_check_waypt(Waypoint* wpt)
{
double lat_orig = wpt->latitude;
double lon_orig = wpt->longitude;

if (wpt->latitude < -90) {
wpt->latitude += 180;
} else if (wpt->latitude > +90) {
wpt->latitude -= 180;
}
if (wpt->longitude < -180) {
wpt->longitude += 360;
} else if (wpt->longitude > +180) {
wpt->longitude -= 360;
}

if ((wpt->latitude < -90) || (wpt->latitude > 90.0))
fatal("Invalid latitude %f in waypoint %s.\n",
lat_orig, !wpt->shortname.isEmpty() ? qPrintable(wpt->shortname) : "<no name>");
if ((wpt->longitude < -180) || (wpt->longitude > 180.0))
fatal("Invalid longitude %f in waypoint %s.\n",
lon_orig, !wpt->shortname.isEmpty() ? qPrintable(wpt->shortname) : "<no name>");
wpt->NormalizePosition();
}

/*-----------------------------------------------------------------------------*/
Expand Down

0 comments on commit a81a4b1

Please sign in to comment.