ardupilot/libraries/AP_Terrain
Peter Barker a4b3c7eb46 AP_Terrain: cast result of labs to unsigned
Fixes:

../../libraries/AP_Terrain/TerrainGCS.cpp: In member function ‘void AP_Terrain::
handle_terrain_data(const mavlink_message_t&)’:
../../libraries/AP_Terrain/AP_Terrain.h:65:55: error: comparison between signed
and unsigned integer expressions [-Werror=sign-compare]
 #define TERRAIN_LATLON_EQUAL(v1, v2) (labs((v1)-(v2)) <= unsigned(margin.get()*
100))
                                       ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
../../libraries/AP_Terrain/AP_Terrain.h:65:55: note: in definition of macro ‘TER
RAIN_LATLON_EQUAL’
 #define TERRAIN_LATLON_EQUAL(v1, v2) (labs((v1)-(v2)) <= unsigned(margin.get()*
100))
                                                       ^~
compilation terminated due to -Wfatal-errors.
cc1plus: some warnings being treated as errors

In file included from ../../libraries/AP_Terrain/TerrainUtil.cpp:24:0:
../../libraries/AP_Terrain/TerrainUtil.cpp: In member function ‘AP_Terrain::grid
_cache& AP_Terrain::find_grid_cache(const AP_Terrain::grid_info&)’:
../../libraries/AP_Terrain/AP_Terrain.h:65:55: error: comparison between signed
and unsigned integer expressions [-Werror=sign-compare]
 #define TERRAIN_LATLON_EQUAL(v1, v2) (labs((v1)-(v2)) <= unsigned(margin.get()*
100))
                                       ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
~~~~

The return value of labs is signed
2021-11-30 10:16:01 +11:00
..
tools AP_Terrain: added a TERRAIN_MARGIN parameter 2021-08-22 20:32:46 +10:00
AP_Terrain.cpp AP_Terrain: make TERRAIN_MARGIN a float 2021-08-31 09:25:36 +10:00
AP_Terrain.h AP_Terrain: cast result of labs to unsigned 2021-11-30 10:16:01 +11:00
TerrainGCS.cpp AP_Terrain: allow download of terrain data when no GPS lock 2020-07-28 12:15:43 +10:00
TerrainIO.cpp AP_Terrain: compile fix for gcc 9 2021-01-03 08:57:13 +11:00
TerrainMission.cpp AP_Terrain: Fix AP_GPS.h include 2019-06-18 10:02:05 +10:00
TerrainUtil.cpp AP_Terrain: fixed bug in disk offset calculation 2020-05-05 11:21:33 +10:00