[Git][NTPsec/ntpsec][master] ntp_refclock: simplify a bit.

Gary E. Miller gitlab at mg.gitlab.com
Wed Feb 8 21:48:59 UTC 2017


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


Commits:
fbe6a260 by Gary E. Miller at 2017-02-08T13:43:02-08:00
ntp_refclock: simplify a bit.

remove one unused #define, move a macro to one place it is used.

- - - - -


2 changed files:

- include/ntp_refclock.h
- ntpd/ntp_refclock.c


Changes:

=====================================
include/ntp_refclock.h
=====================================
--- a/include/ntp_refclock.h
+++ b/include/ntp_refclock.h
@@ -13,12 +13,6 @@
 #include "ntp_tty.h"
 #include "recvbuff.h"
 
-
-#define SAMPLE(x)	pp->coderecv = (pp->coderecv + 1) % MAXSTAGE; \
-			pp->filter[pp->coderecv] = (x); \
-			if (pp->coderecv == pp->codeproc) \
-				pp->codeproc = (pp->codeproc + 1) % MAXSTAGE;
-
 /*
  * Configuration flag values
  */
@@ -39,13 +33,6 @@
 #define	CLK_HAVEFLAG4	0x80
 
 /*
- * Constant for disabling event reporting in
- * refclock_receive. ORed in leap
- * parameter
- */
-#define REFCLOCK_OWN_STATES	0x80
-
-/*
  * Structure for returning clock status
  */
 struct refclockstat {


=====================================
ntpd/ntp_refclock.c
=====================================
--- a/ntpd/ntp_refclock.c
+++ b/ntpd/ntp_refclock.c
@@ -25,6 +25,12 @@
 #include "refclock_pps.h"
 #endif /* HAVE_PPSAPI */
 
+
+#define SAMPLE(x)	pp->coderecv = (pp->coderecv + 1) % MAXSTAGE; \
+			pp->filter[pp->coderecv] = (x); \
+			if (pp->coderecv == pp->codeproc) \
+				pp->codeproc = (pp->codeproc + 1) % MAXSTAGE;
+
 /*
  * Reference clock support is provided here by maintaining the fiction
  * that the clock is actually a peer.  As no packets are exchanged with



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/fbe6a260af4a4e43352aa2229fd1f8d4d7db5379
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170208/130e2c3b/attachment.html>


More information about the vc mailing list