summaryrefslogtreecommitdiff
path: root/geography/opencpn-plugin-watchdog/patches
diff options
context:
space:
mode:
authorbouyer <bouyer@pkgsrc.org>2018-07-03 15:14:15 +0000
committerbouyer <bouyer@pkgsrc.org>2018-07-03 15:14:15 +0000
commit7072c1dc638345c3f2ff10753a0559ce917d2e3f (patch)
treee14db15ff9734fb73f071cb49451c89f4869fd7a /geography/opencpn-plugin-watchdog/patches
parent3ed19ff25abc40905961094a17d9dccf76104c61 (diff)
downloadpkgsrc-7072c1dc638345c3f2ff10753a0559ce917d2e3f.tar.gz
newer gcc (e.g. 8.0_RC2) requires <cmath> for std::isnan().
This is only a build fix so no revision bump
Diffstat (limited to 'geography/opencpn-plugin-watchdog/patches')
-rw-r--r--geography/opencpn-plugin-watchdog/patches/patch-src_Alarm.cpp89
-rw-r--r--geography/opencpn-plugin-watchdog/patches/patch-src_watchdog_pi.cpp16
2 files changed, 83 insertions, 22 deletions
diff --git a/geography/opencpn-plugin-watchdog/patches/patch-src_Alarm.cpp b/geography/opencpn-plugin-watchdog/patches/patch-src_Alarm.cpp
index 9f437ab1f66..2ddb0b058c4 100644
--- a/geography/opencpn-plugin-watchdog/patches/patch-src_Alarm.cpp
+++ b/geography/opencpn-plugin-watchdog/patches/patch-src_Alarm.cpp
@@ -1,8 +1,16 @@
-$NetBSD: patch-src_Alarm.cpp,v 1.1 2018/04/09 14:18:26 bouyer Exp $
+$NetBSD: patch-src_Alarm.cpp,v 1.2 2018/07/03 15:14:16 bouyer Exp $
---- src/Alarm.cpp.orig 2018-04-09 14:38:56.349739590 +0200
-+++ src/Alarm.cpp 2018-04-09 14:39:24.526834514 +0200
-@@ -81,7 +81,7 @@
+--- src/Alarm.cpp.orig 2018-03-04 15:24:36.000000000 +0100
++++ src/Alarm.cpp 2018-07-02 12:13:29.929855122 +0200
+@@ -27,6 +27,7 @@
+ #include <map>
+
+ #include <wx/wx.h>
++#include <cmath>
+ #include "wx28compat.h"
+ #include "wddc.h"
+
+@@ -81,7 +82,7 @@
bool Test() {
PlugIn_Position_Fix_Ex lastfix = g_watchdog_pi->LastFix();
@@ -11,7 +19,16 @@ $NetBSD: patch-src_Alarm.cpp,v 1.1 2018/04/09 14:18:26 bouyer Exp $
return m_bNoData;
double lat1 = lastfix.Lat, lon1 = lastfix.Lon, lat2, lon2;
-@@ -188,7 +188,7 @@
+@@ -96,7 +97,7 @@
+ while(count < 10 && dist1 > 1e-6) {
+ PositionBearingDistanceMercator_Plugin
+ (lastfix.Lat, lastfix.Lon, lastfix.Cog, dist + dist1, &lat2, &lon2);
+- if(!wxIsNaN(lat2) && PlugIn_GSHHS_CrossesLand(lat1, lon1, lat2, lon2)) {
++ if(!std::isnan(lat2) && PlugIn_GSHHS_CrossesLand(lat1, lon1, lat2, lon2)) {
+ if(dist1 < 1) {
+ m_LandFallTime = wxTimeSpan::Seconds(3600.0 * (dist + dist1) / lastfix.Sog);
+ m_crossinglat1 = lat1, m_crossinglon1 = lon1;
+@@ -188,7 +189,7 @@
void Render(wdDC &dc, PlugIn_ViewPort &vp) {
PlugIn_Position_Fix_Ex lastfix = g_watchdog_pi->LastFix();
@@ -20,7 +37,7 @@ $NetBSD: patch-src_Alarm.cpp,v 1.1 2018/04/09 14:18:26 bouyer Exp $
return;
wxPoint r1, r2, r3, r4;
-@@ -350,7 +350,7 @@
+@@ -350,7 +351,7 @@
bool Test() {
PlugIn_Position_Fix_Ex lastfix = g_watchdog_pi->LastFix();
@@ -29,7 +46,43 @@ $NetBSD: patch-src_Alarm.cpp,v 1.1 2018/04/09 14:18:26 bouyer Exp $
return m_bNoData;
double lat, lon;
-@@ -1701,7 +1701,7 @@
+@@ -389,7 +390,7 @@
+
+ switch(m_Mode) {
+ case TIME: {
+- if(wxIsNaN(lastfix.Lat) || wxIsNaN(lastfix.Lon) ||wxIsNaN(lastfix.Cog) || wxIsNaN(lastfix.Sog)) break;
++ if(std::isnan(lastfix.Lat) || std::isnan(lastfix.Lon) ||std::isnan(lastfix.Cog) || std::isnan(lastfix.Sog)) break;
+ if(ODVersionNewerThan( 1, 1, 1)) {
+ dist = lastfix.Sog * ( m_TimeMinutes / 60 );
+ PositionBearingDistanceMercator_Plugin(lastfix.Lat, lastfix.Lon, lastfix.Cog, dist, &lat, &lon);
+@@ -589,7 +590,7 @@
+ break;
+ }
+ case DISTANCE: {
+- if(wxIsNaN(lastfix.Lat) || wxIsNaN(lastfix.Lon)) break;
++ if(std::isnan(lastfix.Lat) || std::isnan(lastfix.Lon)) break;
+ // check OD version to see which lookup to use
+ if( ODVersionNewerThan( 1, 1, 1)) {
+ BoundaryCrossingList.clear();
+@@ -817,7 +818,7 @@
+ break;
+ }
+ case ANCHOR: {
+- if(wxIsNaN(lastfix.Lat) || wxIsNaN(lastfix.Lon)) break;
++ if(std::isnan(lastfix.Lat) || std::isnan(lastfix.Lon)) break;
+ if(m_BoundaryName == wxEmptyString)
+ m_BoundaryName = g_BoundaryName;
+ if(m_BoundaryDescription == wxEmptyString)
+@@ -850,7 +851,7 @@
+ break;
+ }
+ case GUARD: {
+- if(wxIsNaN(g_AISTarget.m_dLat) || wxIsNaN(g_AISTarget.m_dLat)) break;
++ if(std::isnan(g_AISTarget.m_dLat) || std::isnan(g_AISTarget.m_dLat)) break;
+ wxJSONValue jMsg;
+ wxJSONWriter writer;
+ wxString MsgString;
+@@ -1701,7 +1702,7 @@
}
bool Test() {
@@ -38,7 +91,7 @@ $NetBSD: patch-src_Alarm.cpp,v 1.1 2018/04/09 14:18:26 bouyer Exp $
return m_bNoData;
return Distance() > m_Radius;
}
-@@ -1718,7 +1718,7 @@
+@@ -1718,7 +1719,7 @@
double anchordist = Distance();
wxString s;
@@ -47,7 +100,7 @@ $NetBSD: patch-src_Alarm.cpp,v 1.1 2018/04/09 14:18:26 bouyer Exp $
s = _T("N/A");
else {
wxString fmt(_T("%.0f "));
-@@ -1782,7 +1782,7 @@
+@@ -1782,7 +1783,7 @@
private:
double Distance() {
@@ -56,7 +109,7 @@ $NetBSD: patch-src_Alarm.cpp,v 1.1 2018/04/09 14:18:26 bouyer Exp $
return NAN;
PlugIn_Position_Fix_Ex lastfix = g_watchdog_pi->LastFix();
-@@ -1820,7 +1820,7 @@
+@@ -1820,7 +1821,7 @@
bool Test() {
double error = CourseError();
@@ -65,7 +118,7 @@ $NetBSD: patch-src_Alarm.cpp,v 1.1 2018/04/09 14:18:26 bouyer Exp $
return m_bNoData;
return error > m_Tolerance;
-@@ -1829,7 +1829,7 @@
+@@ -1829,7 +1830,7 @@
wxString GetStatus() {
double courseerror = CourseError();
wxString s;
@@ -74,7 +127,7 @@ $NetBSD: patch-src_Alarm.cpp,v 1.1 2018/04/09 14:18:26 bouyer Exp $
s = _T("N/A");
else {
wxString fmt(_T("%.0f "));
-@@ -1850,7 +1850,7 @@
+@@ -1850,7 +1851,7 @@
double lat1 = lastfix.Lat, lon1 = lastfix.Lon, lat2, lon2, lat3, lon3;
double dist = lastfix.Sog;
@@ -83,7 +136,7 @@ $NetBSD: patch-src_Alarm.cpp,v 1.1 2018/04/09 14:18:26 bouyer Exp $
return;
PositionBearingDistanceMercator_Plugin(lat1, lon1, m_Course+m_Tolerance,
-@@ -1949,7 +1949,7 @@
+@@ -1949,7 +1950,7 @@
wxString GetStatus() {
wxString s;
@@ -92,7 +145,7 @@ $NetBSD: patch-src_Alarm.cpp,v 1.1 2018/04/09 14:18:26 bouyer Exp $
s = _T("N/A");
else {
wxString fmt(_T("%.1f"));
-@@ -1983,7 +1983,7 @@
+@@ -1983,7 +1984,7 @@
bool Test() {
double knots = Knots();
@@ -101,7 +154,7 @@ $NetBSD: patch-src_Alarm.cpp,v 1.1 2018/04/09 14:18:26 bouyer Exp $
return m_bNoData;
if(m_Mode == UNDERSPEED)
-@@ -2038,7 +2038,7 @@
+@@ -2038,7 +2039,7 @@
{
Alarm::OnTimer( tEvent );
double sog = g_watchdog_pi->LastFix().Sog;
@@ -110,7 +163,7 @@ $NetBSD: patch-src_Alarm.cpp,v 1.1 2018/04/09 14:18:26 bouyer Exp $
m_SOGqueue.push_front(sog) ;
return;
}
-@@ -2101,7 +2101,7 @@
+@@ -2101,7 +2102,7 @@
val = 360 - val;
}
@@ -119,7 +172,7 @@ $NetBSD: patch-src_Alarm.cpp,v 1.1 2018/04/09 14:18:26 bouyer Exp $
s = _T("N/A");
else {
wxString fmt(_T("%.1f"));
-@@ -2300,7 +2300,7 @@
+@@ -2300,7 +2301,7 @@
s += _T(" ");
double val = Value();
@@ -128,7 +181,7 @@ $NetBSD: patch-src_Alarm.cpp,v 1.1 2018/04/09 14:18:26 bouyer Exp $
s += _T("N/A");
else {
wxString fmt(_T("%.2f"));
-@@ -2439,7 +2439,7 @@
+@@ -2439,7 +2440,7 @@
value = nmea.Mtw.Temperature;
break;
}
diff --git a/geography/opencpn-plugin-watchdog/patches/patch-src_watchdog_pi.cpp b/geography/opencpn-plugin-watchdog/patches/patch-src_watchdog_pi.cpp
index c9d699cf1bb..8c564968ff7 100644
--- a/geography/opencpn-plugin-watchdog/patches/patch-src_watchdog_pi.cpp
+++ b/geography/opencpn-plugin-watchdog/patches/patch-src_watchdog_pi.cpp
@@ -1,8 +1,16 @@
-$NetBSD: patch-src_watchdog_pi.cpp,v 1.1 2018/04/09 14:18:26 bouyer Exp $
+$NetBSD: patch-src_watchdog_pi.cpp,v 1.2 2018/07/03 15:14:16 bouyer Exp $
---- src/watchdog_pi.cpp.orig 2018-04-09 14:24:25.426153922 +0200
-+++ src/watchdog_pi.cpp 2018-04-09 14:25:01.452945740 +0200
-@@ -345,14 +345,14 @@
+--- src/watchdog_pi.cpp.orig 2018-03-04 15:24:36.000000000 +0100
++++ src/watchdog_pi.cpp 2018-07-02 12:05:36.112240381 +0200
+@@ -26,6 +26,7 @@
+
+ #include <wx/wx.h>
+ #include <wx/stdpaths.h>
++#include <cmath>
+
+ #include "wxJSON/jsonreader.h"
+ #include "wxJSON/jsonwriter.h"
+@@ -345,14 +346,14 @@
{
/* calculate course and speed over ground from gps */
double dt = m_lastfix.FixTime - m_lasttimerfix.FixTime;