[Git][NTPsec/ntpsec][master] ntptime: fix dumb macro name: NS_PER_MS_FLOAT -> NS_PER_US_FLOAT

Gary E. Miller gitlab at mg.gitlab.com
Tue May 2 22:40:49 UTC 2017


Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
9f901ddb by Gary E. Miller at 2017-05-02T15:40:36-07:00
ntptime: fix dumb macro name:  NS_PER_MS_FLOAT -> NS_PER_US_FLOAT

- - - - -


1 changed file:

- ntptime/ntptime.c


Changes:

=====================================
ntptime/ntptime.c
=====================================
--- a/ntptime/ntptime.c
+++ b/ntptime/ntptime.c
@@ -32,7 +32,8 @@
 # define TVUTOTSF(tvu)	\
 	(uint32_t)((((uint64_t)(tvu) << 32) + US_PER_S / 2) / US_PER_S)
 
-#define NS_PER_MS_FLOAT	1000.0
+/* nano seconds per micro second */
+#define NS_PER_US_FLOAT	1000.0
 
 /* MUSL port shim */
 #ifndef HAVE_NTP_GETTIME
@@ -366,7 +367,7 @@ main(
 		printf(json ? jfmt7 : ofmt7, status, timex_state(status));
 		printf(json ? jfmt8 : ofmt8,
 		       snprintb(sizeof(binbuf), binbuf, ntx.modes, TIMEX_MOD_BITS));
-		ftemp = (double)ntx.offset/NS_PER_MS_FLOAT;
+		ftemp = (double)ntx.offset/NS_PER_US_FLOAT;
 		printf(json ? jfmt9 : ofmt9, ftemp);
 		ftemp = FP_UNSCALE(ntx.freq);
 		printf(json ? jfmt10 : ofmt10, ftemp, 1 << ntx.shift);
@@ -389,7 +390,7 @@ main(
 		if (ntx.shift != 0) {
 		  ftemp = FP_UNSCALE(ntx.ppsfreq);
 		  gtemp = FP_UNSCALE(ntx.stabil);
-			htemp = (double)ntx.jitter/NS_PER_MS_FLOAT;
+			htemp = (double)ntx.jitter/NS_PER_US_FLOAT;
 			printf(json ? jfmt14 : ofmt14,
 			    ftemp, gtemp, htemp);
 			printf(json ? jfmt15 : ofmt15,



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/9f901ddb42bbf97c87890090a795f6acb17b9a3a

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/9f901ddb42bbf97c87890090a795f6acb17b9a3a
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170502/2c34f7c0/attachment.html>


More information about the vc mailing list