summaryrefslogtreecommitdiff
path: root/geography/opencpn-plugin-watchdog/patches/patch-src_watchdog_pi.cpp
blob: 8c564968ff762e4ef12ee250206a31ab2a8ec4cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
$NetBSD: patch-src_watchdog_pi.cpp,v 1.2 2018/07/03 15:14:16 bouyer Exp $

--- 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;
-    if(!isnan(m_lastfix.Lat) && !isnan(m_lasttimerfix.Lat) && dt > 0) {
+    if(!std::isnan(m_lastfix.Lat) && !std::isnan(m_lasttimerfix.Lat) && dt > 0) {
         /* this way helps avoid surge speed from gps from surfing waves etc... */
         double cog, sog;
         DistanceBearingMercator_Plugin(m_lastfix.Lat, m_lastfix.Lon,
                                        m_lasttimerfix.Lat, m_lasttimerfix.Lon, &cog, &sog);
         sog *= (3600.0 / dt);
 
-        if(isnan(m_cog))
+        if(std::isnan(m_cog))
             m_cog = cog, m_sog = sog;
         else {
             m_cog = .25*cog + .75*m_cog;