[Git][NTPsec/ntpsec][master] 5 commits: Remove unused defines, move global defines to local.

Gary E. Miller gitlab at mg.gitlab.com
Sun Feb 19 23:32:06 UTC 2017


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


Commits:
4b6bca3b by Gary E. Miller at 2017-02-19T15:05:40-08:00
Remove unused defines, move global defines to local.

- - - - -
4cd88e3a by Gary E. Miller at 2017-02-19T15:13:24-08:00
Move grobal define to local.

- - - - -
ac82e7bf by Gary E. Miller at 2017-02-19T15:14:34-08:00
Remove empty header file.

- - - - -
b0bc840c by Gary E. Miller at 2017-02-19T15:19:41-08:00
Remove unused defines, move some global defines to local.

- - - - -
c7ba97c1 by Gary E. Miller at 2017-02-19T15:31:37-08:00
remove unused defines

- - - - -


9 changed files:

- include/ntp.h
- include/ntp_calendar.h
- − include/ntp_proto.h
- include/parse.h
- libparse/gpstolfp.c
- libparse/parse.c
- ntpd/ntp_loopfilter.c
- ntpd/ntp_proto.c
- ntpd/ntp_util.c


Changes:

=====================================
include/ntp.h
=====================================
--- a/include/ntp.h
+++ b/include/ntp.h
@@ -486,19 +486,6 @@ struct pkt {
 #define VN_MODE(v, m)		((((v) & 7) << 3) | ((m) & 0x7))
 #define	PKT_LI_VN_MODE(l, v, m) ((((l) & 3) << 6) | VN_MODE((v), (m)))
 
-
-/* pythonize-header: start ignoring */
-/*
- * Dealing with stratum.  0 gets mapped to 16 incoming, and back to 0
- * on output.
- */
-#define	PKT_TO_STRATUM(s)	((uint8_t)(((s) == (STRATUM_PKT_UNSPEC)) ?\
-				(STRATUM_UNSPEC) : (s)))
-
-#define	STRATUM_TO_PKT(s)	((uint8_t)(((s) == (STRATUM_UNSPEC)) ?\
-				(STRATUM_PKT_UNSPEC) : (s)))
-
-/* pythonize-header: stop ignoring */
 /*
  * Event codes. Used for reporting errors/events to the control module
  */
@@ -565,12 +552,11 @@ struct pkt {
 #define	NTP_HASH_ADDR(src)	(sock_hash(src) & NTP_HASH_MASK)
 
 /*
- * min, min3 and max.  Makes it easier to transliterate the spec without
+ * min, and max.  Makes it easier to transliterate the spec without
  * thinking about it.
  */
 #define	min(a,b)	(((a) < (b)) ? (a) : (b))
 #define	max(a,b)	(((a) > (b)) ? (a) : (b))
-#define	min3(a,b,c)	min(min((a),(b)), (c))
 
 
 /*
@@ -631,8 +617,6 @@ struct pkt {
 #define	STATS_PID_FILE		3	/* configure ntpd PID file */
 #define	STATS_LEAP_FILE		4	/* configure ntpd leapseconds file */
 
-#define MJD_1900		15020	/* MJD for 1 Jan 1900 */
-
 /*
  * Default parameters.  We use these in the absence of something better.
  * (Historical relic - muliticast mode has been removed for security reasons.)


=====================================
include/ntp_calendar.h
=====================================
--- a/include/ntp_calendar.h
+++ b/include/ntp_calendar.h
@@ -47,35 +47,6 @@ typedef time_t (*systime_func_ptr)(time_t *);
 extern systime_func_ptr ntpcal_set_timefunc(systime_func_ptr);
 
 /*
- * days-of-week
- */
-#define CAL_SUNDAY	0
-#define CAL_MONDAY	1
-#define CAL_TUESDAY	2
-#define CAL_WEDNESDAY	3
-#define CAL_THURSDAY	4
-#define CAL_FRIDAY	5
-#define CAL_SATURDAY	6
-#define CAL_SUNDAY7	7	/* also sunday */
-
-/*
- * Days in each month.	30 days hath September...
- */
-#define	JAN	31
-#define	FEB	28
-#define	FEBLEAP	29
-#define	MAR	31
-#define	APR	30
-#define	MAY	31
-#define	JUN	30
-#define	JUL	31
-#define	AUG	31
-#define	SEP	30
-#define	OCT	31
-#define	NOV	30
-#define	DEC	31
-
-/*
  * We deal in a 4 year cycle starting at March 1, 1900.	 We assume
  * we will only want to deal with dates since then, and not to exceed
  * the rollover day in 2036.


=====================================
include/ntp_proto.h deleted
=====================================
--- a/include/ntp_proto.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef GUARD_NTP_PROTO_H
-#define GUARD_NTP_PROTO_H
-
-#define NTP_MAXFREQ	500e-6
- 
-#endif	/* GUARD_NTP_PROTO_H */


=====================================
include/parse.h
=====================================
--- a/include/parse.h
+++ b/include/parse.h
@@ -24,7 +24,6 @@
 /*
  * some constants useful for GPS time conversion
  */
-#define GPSORIGIN       2524953600u                /* GPS origin - NTP origin in seconds */
 #define GPSWRAP         990                        /* assume week count less than this in the previous epoch */
 #define GPSWEEKS        1024                       /* number of weeks until the GPS epch rolls over */
 
@@ -236,12 +235,6 @@ typedef struct clocktime clocktime_t;
 #define PARSE_INP_DATA  0x04	/* additional data to pass up */
 #define PARSE_INP_SYNTH 0x08	/* just pass up synthesized time */
 
-/*
- * PPS edge info
- */
-#define SYNC_ZERO	0x00
-#define SYNC_ONE	0x01
-
 typedef unsigned long parse_inp_fnc_t(parse_t *, char, timestamp_t *);
 typedef unsigned long parse_cvt_fnc_t(unsigned char *, int, struct format *, clocktime_t *, void *);
 typedef unsigned long parse_pps_fnc_t(parse_t *, int, timestamp_t *);


=====================================
libparse/gpstolfp.c
=====================================
--- a/libparse/gpstolfp.c
+++ b/libparse/gpstolfp.c
@@ -10,6 +10,8 @@
 #include "ntp_calendar.h"
 #include "parse.h"
 
+#define GPSORIGIN       2524953600u  /* GPS origin - NTP origin in seconds */
+
 void
 gpstolfp(
 	 int weeks,


=====================================
libparse/parse.c
=====================================
--- a/libparse/parse.c
+++ b/libparse/parse.c
@@ -19,6 +19,11 @@
 
 # include <stdio.h>
 
+/*
+ * PPS edge info
+ */
+#define SYNC_ONE	0x01
+
 extern clockformat_t *clockformats[];
 extern unsigned short nformats;
 


=====================================
ntpd/ntp_loopfilter.c
=====================================
--- a/ntpd/ntp_loopfilter.c
+++ b/ntpd/ntp_loopfilter.c
@@ -15,11 +15,12 @@
 
 #include "ntpd.h"
 #include "ntp_io.h"
-#include "ntp_proto.h"
 #include "ntp_calendar.h"
 #include "ntp_stdlib.h"
 #include "ntp_syscall.h"
 
+#define NTP_MAXFREQ	500e-6
+
 #ifdef HAVE_KERNEL_PLL
 # define NANOSECONDS	1e9
 # define FREQTOD(x)	((x) / 65536e6)            /* NTP to double */


=====================================
ntpd/ntp_proto.c
=====================================
--- a/ntpd/ntp_proto.c
+++ b/ntpd/ntp_proto.c
@@ -55,6 +55,16 @@
 #define DIFF(x, y) (SQUARE((x) - (y)))
 
 /*
+ * Dealing with stratum.  0 gets mapped to 16 incoming, and back to 0
+ * on output.
+ */
+#define	PKT_TO_STRATUM(s)	((uint8_t)(((s) == (STRATUM_PKT_UNSPEC)) ?\
+				(STRATUM_UNSPEC) : (s)))
+
+#define	STRATUM_TO_PKT(s)	((uint8_t)(((s) == (STRATUM_UNSPEC)) ?\
+				(STRATUM_PKT_UNSPEC) : (s)))
+
+/*
  * peer_select groups statistics for a peer used by clock_select() and
  * clock_cluster().
  */


=====================================
ntpd/ntp_util.c
=====================================
--- a/ntpd/ntp_util.c
+++ b/ntpd/ntp_util.c
@@ -27,12 +27,7 @@
 /*
  * Defines used by the leapseconds stuff
  */
-/* #define	MAX_TAI	100			* max TAI offset (s) UNUSED */
-/* #define	L_DAY	86400UL			* seconds per day UNUSED */
-/* #define	L_YEAR	(L_DAY * 365)		* days per year UNUSED */
-/* #define	L_LYEAR	(L_YEAR + L_DAY)	* days per leap year UNUSED */
-/* #define	L_4YEAR	(L_LYEAR + 3 * L_YEAR)	* days per leap cycle UNUSED */
-/* #define	L_CENT	(L_4YEAR * 25)		* days per century UNUSED */
+#define MJD_1900		15020	/* MJD for 1 Jan 1900 */
 
 /*
  * This contains odds and ends, including the hourly stats, various



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/53e362bddcfa4754944548fa79d4d50e0d315570...c7ba97c176e163af457f320810168cec9b037ee1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170219/0edb02ac/attachment.html>


More information about the vc mailing list