gpsd: Replace the deprecated finite function with the isfinite macro
PATCH 1/1 gpsd: Replace the deprecated finite function with the isfinite macro
Quote from the finite() man page:
"Note that these functions are obsolete. C99 defines macros isfinite(), isinf(), and isnan() (for all types) replacing them. Further note that the C99 isinf() has weaker guarantees on the return value. See fpclas-sify(3)."
The finite() function is not supported by recent versions of uClibc
--- package/gpsd/gpsd-replace-finite.patch | 48 ++++++++++++++++++++++++++++++++ 1 files changed, 48 insertions(+), 0 deletions(-) create mode 100644 package/gpsd/gpsd-replace-finite.patch
package/gpsd/gpsd-replace-finite.patch new file +48 -0
@@ -0,0 +1,48 @@ +Signed-off-by: Markos Chandras <[email protected]> + +Index: gpsd-2.95/libgpsd_core.c +=================================================================== +--- gpsd-2.95.orig/libgpsd_core.c ++++ gpsd-2.95/libgpsd_core.c +@@ -545,18 +545,18 @@ static void gpsd_error_model(struct gps_ + gpsd_report(LOG_DATA, "modeling errors: mode=%d, masks=%s\n", + fix->mode, gpsd_maskdump(session->gpsdata.set)); + if (fix->mode >= MODE_2D) { +- if (isnan(fix->epx) != 0 && finite(session->gpsdata.dop.hdop) != 0) ++ if (isnan(fix->epx) != 0 && isfinite(session->gpsdata.dop.hdop) != 0) + fix->epx = session->gpsdata.dop.xdop * h_uere; + +- if (isnan(fix->epy) != 0 && finite(session->gpsdata.dop.hdop) != 0) ++ if (isnan(fix->epy) != 0 && isfinite(session->gpsdata.dop.hdop) != 0) + fix->epy = session->gpsdata.dop.ydop * h_uere; + + if ((fix->mode >= MODE_3D) +- && isnan(fix->epv) != 0 && finite(session->gpsdata.dop.vdop) != 0) ++ && isnan(fix->epv) != 0 && isfinite(session->gpsdata.dop.vdop) != 0) + fix->epv = session->gpsdata.dop.vdop * v_uere; + + if (isnan(session->gpsdata.epe) != 0 +- && finite(session->gpsdata.dop.pdop) != 0) ++ && isfinite(session->gpsdata.dop.pdop) != 0) + session->gpsdata.epe = session->gpsdata.dop.pdop * p_uere; + else + session->gpsdata.epe = NAN; +Index: gpsd-2.95/pseudonmea.c +=================================================================== +--- gpsd-2.95.orig/pseudonmea.c ++++ gpsd-2.95/pseudonmea.c +@@ -215,10 +215,10 @@ static void gpsd_binary_quality_dump(str + nmea_add_checksum(bufp2); + bufp += strlen(bufp); + } +- if (finite(session->gpsdata.fix.epx) +- && finite(session->gpsdata.fix.epy) +- && finite(session->gpsdata.fix.epv) +- && finite(session->gpsdata.epe)) { ++ if (isfinite(session->gpsdata.fix.epx) ++ && isfinite(session->gpsdata.fix.epy) ++ && isfinite(session->gpsdata.fix.epv) ++ && isfinite(session->gpsdata.epe)) { + struct tm tm; + time_t intfixtime; +
Signature · 1 line
1.7.1
PATCH 1/1 gpsd: Replace the deprecated finite function with the isfinite macro
I submitted an nearly identical patch back in April:
http://lists.busybox.net/pipermail/buildroot/2012-April/052597.html
At the time, it was noted that the finite calls are not present in newer gpsd releases, and I subsequently submitted a patch to bump the gpsd package from version 2.95 to 3.5:
http://lists.busybox.net/pipermail/buildroot/2012-April/052880.html
Neither of my patches has been committed yet; just wanted to tie the threads together here.
PATCH 1/1 gpsd: Replace the deprecated finite function with the isfinite macro
Quoted 8 lines · Simon Dawson
I submitted an nearly identical patch back in April:
http://lists.busybox.net/pipermail/buildroot/2012-April/052597.html
At the time, it was noted that the finite calls are not present in newer gpsd releases, and I subsequently submitted a patch to bump the gpsd package from version 2.95 to 3.5:
Quoted 9 lines
http://lists.busybox.net/pipermail/buildroot/2012-April/052880.html
Neither of my patches has been committed yet; just wanted to tie the threads together here.
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Hi Simon,
I presume a bump would be preferred as I see no reason to try and keep such an old version alive
Signature · 1 line
markos