[Git][NTPsec/ntpsec][master] Simplify a grotty test.

Eric S. Raymond gitlab at mg.gitlab.com
Thu Jan 5 20:24:02 UTC 2017


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
57c0e09a by Eric S. Raymond at 2017-01-05T15:23:43-05:00
Simplify a grotty test.

- - - - -


1 changed file:

- ntpd/refclock_generic.c


Changes:

=====================================
ntpd/refclock_generic.c
=====================================
--- a/ntpd/refclock_generic.c
+++ b/ntpd/refclock_generic.c
@@ -3509,16 +3509,12 @@ parse_process(
 #endif
 		if (PARSE_TIMECODE(parsetime->parse_state))
 		{
-#define	M_ISGEQ(a_i, a_f, b_i, b_f)	/* a >= b signed */ \
-	(((uint32_t)((a_i) ^ 0x80000000) > (uint32_t)((b_i) ^ 0x80000000)) || \
-	  ((a_i) == (b_i) && (uint32_t)(a_f) >= (uint32_t)(b_f)))
-			if (M_ISGEQ(lfpsint(off), lfpfrac(off), -1, 0x80000000) &&
-			    M_ISGEQ(0, 0x7fffffff, lfpsint(off), lfpfrac(off)))
+			if (abs(lfptod(off)) <= 0.5)
 			{
 				fudge = ppsphaseadjust; /* pick PPS fudge factor */
 
 				/*
-				 * RS232 offsets within [-0.5..0.5[ - take PPS offsets
+				 * RS232 offsets within [-0.5..0.5] - take PPS offsets
 				 */
 
 				if (parse->parse_type->cl_flags & PARSE_F_PPSONSECOND)



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/57c0e09a027f3f788793f104979ed60e57cd64f6
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170105/61ea968f/attachment.html>


More information about the vc mailing list