From 698f18566b1511c55d8a13edcfedd77672b0eb69 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sat, 26 Aug 2017 01:00:15 +1000 Subject: [PATCH] AP_Terrain: cast to int32_t to avoid warning about signedness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ../../libraries/AP_Terrain/TerrainIO.cpp: In member function ‘void AP_Terrain::open_file()’: ../../libraries/AP_Terrain/TerrainIO.cpp:176:46: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 5 has type ‘__gnu_cxx::__enable_if::__type {aka double}’ [-Wformat=] abs((uint32_t)block.lon_degrees)); ^ ../../libraries/AP_Terrain/TerrainIO.cpp:176:46: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 7 has type ‘__gnu_cxx::__enable_if::__type {aka double}’ [-Wformat=] --- libraries/AP_Terrain/TerrainIO.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_Terrain/TerrainIO.cpp b/libraries/AP_Terrain/TerrainIO.cpp index 507b891a51..0ab4245b8b 100644 --- a/libraries/AP_Terrain/TerrainIO.cpp +++ b/libraries/AP_Terrain/TerrainIO.cpp @@ -171,9 +171,9 @@ void AP_Terrain::open_file(void) } snprintf(p, 13, "/%c%02u%c%03u.DAT", block.lat_degrees<0?'S':'N', - abs(block.lat_degrees), + abs((int32_t)block.lat_degrees), block.lon_degrees<0?'W':'E', - abs(block.lon_degrees)); + abs((int32_t)block.lon_degrees)); // create directory if need be if (!directory_created) {