[Git][NTPsec/ntpsec][master] Use fabs() instead of abs() for floating point values.

Matt Selsky gitlab at mg.gitlab.com
Fri Jan 6 06:37:10 UTC 2017


Matt Selsky pushed to branch master at NTPsec / ntpsec


Commits:
366ed59c by Matt Selsky at 2017-01-06T01:34:07-05:00
Use fabs() instead of abs() for floating point values.

../../ntpd/refclock_generic.c:3512:8: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
                        if (abs(lfptod(off)) <= 0.5)
                            ^
../../ntpd/refclock_generic.c:3512:8: note: use function 'fabs' instead
                        if (abs(lfptod(off)) <= 0.5)
                            ^~~
                            fabs
1 warning generated.

Fixes GitLab issue #229

- - - - -


1 changed file:

- ntpd/refclock_generic.c


Changes:

=====================================
ntpd/refclock_generic.c
=====================================
--- a/ntpd/refclock_generic.c
+++ b/ntpd/refclock_generic.c
@@ -3509,7 +3509,7 @@ parse_process(
 #endif
 		if (PARSE_TIMECODE(parsetime->parse_state))
 		{
-			if (abs(lfptod(off)) <= 0.5)
+			if (fabs(lfptod(off)) <= 0.5)
 			{
 				fudge = ppsphaseadjust; /* pick PPS fudge factor */
 



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/366ed59c2256418ac052314834d90b9b1fab5044
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170106/40389d6a/attachment.html>


More information about the vc mailing list