From 7b32f32ca0c76fe26ad5950662a40bdfb8269205 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Thu, 13 Feb 2014 09:53:43 -0800 Subject: [PATCH] Fix warnings in opmapcontrol I looked at the latest version of opmapcontrol in OpenPilot. This has not yet been fixed. So added pragma to silence. --- .../src/internals/projections/lks94projection.cpp | 10 ++++++++++ .../projections/mercatorprojectionyandex.cpp | 15 +++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/libs/opmapcontrol/src/internals/projections/lks94projection.cpp b/libs/opmapcontrol/src/internals/projections/lks94projection.cpp index f8a37c0be..4b72d57ce 100644 --- a/libs/opmapcontrol/src/internals/projections/lks94projection.cpp +++ b/libs/opmapcontrol/src/internals/projections/lks94projection.cpp @@ -28,6 +28,11 @@ #include +// These pragmas are local modifications to this third party library to silence warnings +#ifdef Q_OS_LINUX +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#endif namespace projections { LKS94Projection::LKS94Projection():MinLatitude (53.33 ), MaxLatitude (56.55 ), MinLongitude (20.22 ), @@ -787,3 +792,8 @@ Size LKS94Projection::GetTileMatrixMaxXY(int const& zoom) } } + +#ifdef Q_OS_LINUX +#pragma GCC diagnostic pop +#endif + diff --git a/libs/opmapcontrol/src/internals/projections/mercatorprojectionyandex.cpp b/libs/opmapcontrol/src/internals/projections/mercatorprojectionyandex.cpp index a6a2ba306..81b47b6d7 100644 --- a/libs/opmapcontrol/src/internals/projections/mercatorprojectionyandex.cpp +++ b/libs/opmapcontrol/src/internals/projections/mercatorprojectionyandex.cpp @@ -57,6 +57,16 @@ Point MercatorProjectionYandex::FromLatLngToPixel(double lat, double lng, const return ret; } + +// These pragmas are local modifications to this third party library to silence warnings +#ifdef Q_OS_LINUX +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#elif defined(Q_OS_MAC) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#endif + internals::PointLatLng MercatorProjectionYandex::FromPixelToLatLng(const int &x, const int &y, const int &zoom) { Size s = GetTileMatrixSizePixel(zoom); @@ -82,6 +92,11 @@ internals::PointLatLng MercatorProjectionYandex::FromPixelToLatLng(const int &x, return ret; } + +#ifndef Q_OS_WIN +#pragma GCC diagnostic pop +#endif + double MercatorProjectionYandex::Clip(const double &n, const double &minValue, const double &maxValue) const { return qMin(qMax(n, minValue), maxValue); -- 2.22.0