Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] gpsd: Replace the deprecated finite function with the isfinite macro
@ 2012-05-11 10:34 Markos Chandras
  2012-05-11 13:27 ` Simon Dawson
  0 siblings, 1 reply; 3+ messages in thread
From: Markos Chandras @ 2012-05-11 10:34 UTC (permalink / raw)
  To: buildroot

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

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
---
 package/gpsd/gpsd-replace-finite.patch |   48 ++++++++++++++++++++++++++++++++
 1 files changed, 48 insertions(+), 0 deletions(-)
 create mode 100644 package/gpsd/gpsd-replace-finite.patch

diff --git a/package/gpsd/gpsd-replace-finite.patch b/package/gpsd/gpsd-replace-finite.patch
new file mode 100644
index 0000000..027715c
--- /dev/null
+++ b/package/gpsd/gpsd-replace-finite.patch
@@ -0,0 +1,48 @@
+Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
+
+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;
+ 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-11 13:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-11 10:34 [Buildroot] [PATCH] gpsd: Replace the deprecated finite function with the isfinite macro Markos Chandras
2012-05-11 13:27 ` Simon Dawson
2012-05-11 13:37   ` Markos Chandras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox