[Git][NTPsec/ntpsec][master] Use NSAMPLES macro in more places in ntpfrob

Gary E. Miller gitlab at mg.gitlab.com
Thu Jul 26 01:23:42 UTC 2018


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


Commits:
2188c910 by Matt Selsky at 2018-07-26T01:01:55Z
Use NSAMPLES macro in more places in ntpfrob

Reduce the number of magic values

- - - - -


1 changed file:

- ntpfrob/jitter.c


Changes:

=====================================
ntpfrob/jitter.c
=====================================
@@ -114,7 +114,7 @@ void jitter(const iomode mode)
 			fputs(", ", stdout);
 		}
 		fputs("], \"Last rank\": [", stdout);
-		for (i = NBUF - 12; i < NBUF - 2; i++) {
+		for (i = NBUF - NSAMPLES - 2; i < NBUF - 2; i++) {
 		    fprintf(stdout, "%.9f", gtod[i]);
 		    if (i < NBUF - 3)
 			fputs(", ", stdout);
@@ -128,7 +128,7 @@ void jitter(const iomode mode)
 		for (i = 0; i < NSAMPLES; i++)
 		    fprintf(stdout, "%2d %13.9f\n", i, gtod[i]);
 		fprintf(stdout, "Last rank\n");
-		for (i = NBUF - 12; i < NBUF - 2; i++)
+		for (i = NBUF - NSAMPLES - 2; i < NBUF - 2; i++)
 		    fprintf(stdout, "%2d %13.9f\n", i, gtod[i]);
 	}
 



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/2188c910f2f069ff2b1d25250e96cc4ff831e043

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/2188c910f2f069ff2b1d25250e96cc4ff831e043
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/20180726/bcd8829a/attachment.html>


More information about the vc mailing list