[Git][NTPsec/ntpsec][master] remove a ton of unused macros.
Gary E. Miller
gitlab at mg.gitlab.com
Tue Feb 14 00:31:09 UTC 2017
Gary E. Miller pushed to branch master at NTPsec / ntpsec
Commits:
926f05e0 by Gary E. Miller at 2017-02-13T16:30:18-08:00
remove a ton of unused macros.
Thanks to clang -Weverything, which is too verbose for daily use.
- - - - -
18 changed files:
- libparse/clk_hopf6021.c
- libparse/clk_rawdcf.c
- libparse/clk_rcc8000.c
- ntpd/ntp_config.c
- ntpd/ntp_io.c
- ntpd/ntp_loopfilter.c
- ntpd/ntp_packetstamp.c
- ntpd/ntp_refclock.c
- ntpd/ntp_timer.c
- ntpd/ntp_util.c
- ntpd/refclock_generic.c
- ntpd/refclock_jjy.c
- ntpd/refclock_local.c
- ntpd/refclock_modem.c
- ntpd/refclock_neoclock.c
- ntpd/refclock_nmea.c
- ntpd/refclock_spectracom.c
- ntpd/refclock_trimble.c
Changes:
=====================================
libparse/clk_hopf6021.c
=====================================
--- a/libparse/clk_hopf6021.c
+++ b/libparse/clk_hopf6021.c
@@ -86,7 +86,7 @@
#define HOPF_RADIOHP 0x0C /* high precision radio clock */
#define HOPF_UTC 0x08 /* time code in UTC */
-#define HOPF_WMASK 0x07 /* mask for weekday code */
+/* #define HOPF_WMASK 0x07 * mask for weekday code UNUSED */
static struct format hopf6021_fmt =
{
=====================================
libparse/clk_rawdcf.c
=====================================
--- a/libparse/clk_rawdcf.c
+++ b/libparse/clk_rawdcf.c
@@ -106,7 +106,7 @@ static struct rawdcfcode
{ 33 }, { 35 }, { 36 }, { 40 }, { 42 }, { 45 }, { 49 }, { 50 }, { 54 }, { 58 }, { 59 }
};
-#define DCF_M 0
+/* #define DCF_M 0 UNUSED */
#define DCF_R 1
#define DCF_A1 2
#define DCF_Z 3
@@ -114,18 +114,18 @@ static struct rawdcfcode
#define DCF_S 5
#define DCF_M1 6
#define DCF_M10 7
-#define DCF_P1 8
+/* #define DCF_P1 8 UNUSED */
#define DCF_H1 9
#define DCF_H10 10
-#define DCF_P2 11
+/* #define DCF_P2 11 UNUSED */
#define DCF_D1 12
#define DCF_D10 13
-#define DCF_DW 14
+/* #define DCF_DW 14 UNUSED */
#define DCF_MO 15
#define DCF_MO0 16
#define DCF_Y1 17
#define DCF_Y10 18
-#define DCF_P3 19
+/* #define DCF_P3 19 UNUSED */
static struct partab
{
=====================================
libparse/clk_rcc8000.c
=====================================
--- a/libparse/clk_rcc8000.c
+++ b/libparse/clk_rcc8000.c
@@ -98,9 +98,9 @@ cvt_rcc8000(
* 1 - Leap year
*/
#define RCC8000_VALID 0x8
-#define RCC8000_REJECT 0x4
-#define RCC8000_BST 0x2
-#define RCC8000_LEAPY 0x1
+/* #define RCC8000_REJECT 0x4 UNUSED */
+/* #define RCC8000_BST 0x2 UNUSED */
+/* #define RCC8000_LEAPY 0x1 UNUSED */
clock_time->flags = 0;
=====================================
ntpd/ntp_config.c
=====================================
--- a/ntpd/ntp_config.c
+++ b/ntpd/ntp_config.c
@@ -140,13 +140,15 @@ typedef struct peer_resolved_ctx_tag {
/* Limits */
#define MAXPHONE 10 /* maximum number of phone strings */
-#define MAXPPS 20 /* maximum length of PPS device string */
+/* #define MAXPPS 20 * maximum length of PPS device string UNUSED */
/*
* Miscellaneous macros
*/
-#define ISEOL(c) ((c) == '#' || (c) == '\n' || (c) == '\0')
-#define ISSPACE(c) ((c) == ' ' || (c) == '\t')
+#ifdef HAVE_NETINFO_NI_H
+# define ISEOL(c) ((c) == '#' || (c) == '\n' || (c) == '\0')
+# define ISSPACE(c) ((c) == ' ' || (c) == '\t')
+#endif
#define _UC(str) ((char *)(intptr_t)(str))
=====================================
ntpd/ntp_io.c
=====================================
--- a/ntpd/ntp_io.c
+++ b/ntpd/ntp_io.c
@@ -43,12 +43,13 @@
/*
* setsockopt does not always have the same arg declaration
* across all platforms. If it's not defined we make it empty
+ * UNUSED
+ *
+ * #ifndef SETSOCKOPT_ARG_CAST
+ * #define SETSOCKOPT_ARG_CAST
+ * #endif
*/
-#ifndef SETSOCKOPT_ARG_CAST
-#define SETSOCKOPT_ARG_CAST
-#endif
-
extern int listen_to_virtual_ips;
#ifndef IPTOS_DSCP_EF
=====================================
ntpd/ntp_loopfilter.c
=====================================
--- a/ntpd/ntp_loopfilter.c
+++ b/ntpd/ntp_loopfilter.c
@@ -20,7 +20,11 @@
#include "ntp_stdlib.h"
#include "ntp_syscall.h"
-#define NANOSECONDS 1e9
+#ifdef HAVE_KERNEL_PLL
+# define NANOSECONDS 1e9
+# define FREQTOD(x) ((x) / 65536e6) /* NTP to double */
+# define DTOFREQ(x) ((int32_t)((x) * 65536e6)) /* double to NTP */
+#endif
#define MICROSECONDS 1e6
/*
@@ -41,9 +45,7 @@
#define CLOCK_ALLAN 11 /* Allan intercept (log2 s) */
#define CLOCK_LIMIT 30 /* poll-adjust threshold */
#define CLOCK_PGATE 4. /* poll-adjust gate */
-#define PPS_MAXAGE 120 /* kernel pps signal timeout (s) */
-#define FREQTOD(x) ((x) / 65536e6) /* NTP to double */
-#define DTOFREQ(x) ((int32_t)((x) * 65536e6)) /* double to NTP */
+/* #define PPS_MAXAGE 120 * kernel pps signal timeout (s) UNUSED */
/*
* Clock discipline state machine. This is used to control the
=====================================
ntpd/ntp_packetstamp.c
=====================================
--- a/ntpd/ntp_packetstamp.c
+++ b/ntpd/ntp_packetstamp.c
@@ -20,27 +20,33 @@
#if defined(SO_BINTIME) && defined(SCM_BINTIME) && defined(CMSG_FIRSTHDR)
# define USE_PACKET_TIMESTAMP
# define USE_SCM_BINTIME
-# ifdef OVERRIDE_BINTIME_CTLMSGBUF_SIZE
-# define CMSG_BUFSIZE OVERRIDE_BINTIME_CTLMSGBUF_SIZE
-# else
-# define CMSG_BUFSIZE 1536 /* moderate default */
-# endif
+/* UNUSED
+ * # ifdef OVERRIDE_BINTIME_CTLMSGBUF_SIZE
+ * # define CMSG_BUFSIZE OVERRIDE_BINTIME_CTLMSGBUF_SIZE
+ * # else
+ * # define CMSG_BUFSIZE 1536 * moderate default *
+ * # endif
+ */
#elif defined(SO_TIMESTAMPNS) && defined(SCM_TIMESTAMPNS) && defined(CMSG_FIRSTHDR)
# define USE_PACKET_TIMESTAMP
# define USE_SCM_TIMESTAMPNS
-# ifdef OVERRIDE_TIMESTAMPNS_CTLMSGBUF_SIZE
-# define CMSG_BUFSIZE OVERRIDE_TIMESTAMPNS_CTLMSGBUF_SIZE
-# else
-# define CMSG_BUFSIZE 1536 /* moderate default */
-# endif
+/* UNUSED
+ * # ifdef OVERRIDE_TIMESTAMPNS_CTLMSGBUF_SIZE
+ * # define CMSG_BUFSIZE OVERRIDE_TIMESTAMPNS_CTLMSGBUF_SIZE
+ * # else
+ * # define CMSG_BUFSIZE 1536 * moderate default *
+ * # endif
+ */
#elif defined(SO_TIMESTAMP) && defined(SCM_TIMESTAMP) && defined(CMSG_FIRSTHDR)
# define USE_PACKET_TIMESTAMP
# define USE_SCM_TIMESTAMP
-# ifdef OVERRIDE_TIMESTAMP_CTLMSGBUF_SIZE
-# define CMSG_BUFSIZE OVERRIDE_TIMESTAMP_CTLMSGBUF_SIZE
-# else
-# define CMSG_BUFSIZE 1536 /* moderate default */
-# endif
+/* UNUSED
+ * # ifdef OVERRIDE_TIMESTAMP_CTLMSGBUF_SIZE
+ * # define CMSG_BUFSIZE OVERRIDE_TIMESTAMP_CTLMSGBUF_SIZE
+ * # else
+ * # define CMSG_BUFSIZE 1536 * moderate default *
+ * # endif
+ */
#else
/* fill in for old/other timestamp interfaces */
#endif
=====================================
ntpd/ntp_refclock.c
=====================================
--- a/ntpd/ntp_refclock.c
+++ b/ntpd/ntp_refclock.c
@@ -59,7 +59,7 @@
* identified as a refclock by having a non-NULL procptr member.
*/
#define FUDGEFAC .1 /* fudge correction factor */
-#define LF 0x0a /* ASCII LF */
+/* #define LF 0x0a * ASCII LF UNUSED */
bool cal_enable; /* enable refclock calibrate */
=====================================
ntpd/ntp_timer.c
=====================================
--- a/ntpd/ntp_timer.c
+++ b/ntpd/ntp_timer.c
@@ -17,8 +17,10 @@
#include "ntp_syscall.h"
#endif /* HAVE_KERNEL_PLL */
+#ifdef HAVE_TIMER_CREATE
/* TC_ERR represents the timer_create() error return value. */
-#define TC_ERR (-1)
+# define TC_ERR (-1)
+#endif
static void check_leapsec(uint32_t, const time_t*, bool);
=====================================
ntpd/ntp_util.c
=====================================
--- a/ntpd/ntp_util.c
+++ b/ntpd/ntp_util.c
@@ -26,12 +26,12 @@
/*
* Defines used by the leapseconds stuff
*/
-#define MAX_TAI 100 /* max TAI offset (s) */
-#define L_DAY 86400UL /* seconds per day */
-#define L_YEAR (L_DAY * 365) /* days per year */
-#define L_LYEAR (L_YEAR + L_DAY) /* days per leap year */
-#define L_4YEAR (L_LYEAR + 3 * L_YEAR) /* days per leap cycle */
-#define L_CENT (L_4YEAR * 25) /* days per century */
+/* #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 */
/*
* This contains odds and ends, including the hourly stats, various
=====================================
ntpd/refclock_generic.c
=====================================
--- a/ntpd/refclock_generic.c
+++ b/ntpd/refclock_generic.c
@@ -145,15 +145,17 @@ struct refclock refclock_parse = {
/*
* Definitions
*/
-#define MAXUNITS 4 /* maximum number of "PARSE" units permitted */
+/* #define MAXUNITS 4 * maximum number of "PARSE" units permitted UNUSED */
#define PARSEDEVICE "/dev/refclock-%d" /* device to open %d is unit number */
#define PARSEPPSDEVICE "/dev/refclockpps-%d" /* optional pps device to open %d is unit number */
#undef ABS
#define ABS(_X_) (((_X_) < 0) ? -(_X_) : (_X_))
-#define PARSE_HARDPPS_DISABLE 0
-#define PARSE_HARDPPS_ENABLE 1
+#ifdef HAVE_PPSAPI
+# define PARSE_HARDPPS_DISABLE 0
+# define PARSE_HARDPPS_ENABLE 1
+#endif
/**===========================================================================
** function vector for dynamically binding io handling mechanism
@@ -178,8 +180,8 @@ typedef struct bind
#define PARSE_END(_X_) (*(_X_)->binding->bd_end)(_X_)
#define PARSE_SETCS(_X_, _CS_) (*(_X_)->binding->bd_setcs)(_X_, _CS_)
-#define PARSE_ENABLE(_X_) (*(_X_)->binding->bd_enable)(_X_)
-#define PARSE_DISABLE(_X_) (*(_X_)->binding->bd_disable)(_X_)
+/* #define PARSE_ENABLE(_X_) (*(_X_)->binding->bd_enable)(_X_) UNUSED */
+/* #define PARSE_DISABLE(_X_) (*(_X_)->binding->bd_disable)(_X_) UNUSED */
#define PARSE_GETFMT(_X_, _DCT_) (*(_X_)->binding->bd_getfmt)(_X_, _DCT_)
#define PARSE_SETFMT(_X_, _DCT_) (*(_X_)->binding->bd_setfmt)(_X_, _DCT_)
#define PARSE_GETTIMECODE(_X_, _DCT_) (*(_X_)->binding->bd_timecode)(_X_, _DCT_)
@@ -212,7 +214,7 @@ typedef struct bind
#define ERR_NODATA (unsigned)1 /* no input data */
#define ERR_BADIO (unsigned)2 /* read/write/select errors */
#define ERR_BADSTATUS (unsigned)3 /* unsync states */
-#define ERR_BADEVENT (unsigned)4 /* non nominal events */
+/* #define ERR_BADEVENT (unsigned)4 * non nominal events UNUSED */
#define ERR_INTERNAL (unsigned)5 /* internal error */
#define ERR_CNT (unsigned)(ERR_INTERNAL+1)
@@ -372,7 +374,7 @@ typedef struct poll_info
#define NO_EVENT 0
#define NO_LCLDATA 0
#define NO_MESSAGE 0
-#define NO_PPSDELAY 0
+/* #define NO_PPSDELAY 0 UNUSED */
#define DCF_ID "DCF" /* generic DCF */
#define DCF_A_ID "DCFa" /* AM demodulation */
@@ -380,23 +382,23 @@ typedef struct poll_info
#define GPS_ID "GPS" /* GPS receiver */
#define MSF_ID "MSF" /* MSF receiver */
-#define NOCLOCK_ROOTDELAY 0.0
-#define NOCLOCK_BASEDELAY 0.0
-#define NOCLOCK_DESCRIPTION 0
-#define NOCLOCK_MAXUNSYNC 0
-#define NOCLOCK_CFLAG 0
-#define NOCLOCK_IFLAG 0
-#define NOCLOCK_OFLAG 0
-#define NOCLOCK_LFLAG 0
-#define NOCLOCK_ID "TILT"
-#define NOCLOCK_POLL NO_POLL
-#define NOCLOCK_INIT NO_INIT
-#define NOCLOCK_END NO_END
-#define NOCLOCK_DATA NO_LCLDATA
-#define NOCLOCK_FORMAT ""
-#define NOCLOCK_TYPE CTL_SST_TS_UNSPEC
-#define NOCLOCK_SAMPLES 0
-#define NOCLOCK_KEEP 0
+/* #define NOCLOCK_ROOTDELAY 0.0 UNUSED */
+/* #define NOCLOCK_BASEDELAY 0.0 UNUSED */
+/* #define NOCLOCK_DESCRIPTION 0 UNUSED */
+/* #define NOCLOCK_MAXUNSYNC 0 UNUSED */
+/* #define NOCLOCK_CFLAG 0 UNUSED */
+/* #define NOCLOCK_IFLAG 0 UNUSED */
+/* #define NOCLOCK_OFLAG 0 UNUSED */
+/* #define NOCLOCK_LFLAG 0 UNUSED */
+/* #define NOCLOCK_ID "TILT" UNUSED */
+/* #define NOCLOCK_POLL NO_POLL UNUSED */
+/* #define NOCLOCK_INIT NO_INIT UNUSED */
+/* #define NOCLOCK_END NO_END UNUSED */
+/* #define NOCLOCK_DATA NO_LCLDATA UNUSED */
+/* #define NOCLOCK_FORMAT "" UNUSED */
+/* #define NOCLOCK_TYPE CTL_SST_TS_UNSPEC UNUSED */
+/* #define NOCLOCK_SAMPLES 0 UNUSED */
+/* #define NOCLOCK_KEEP 0 UNUSED */
#define DCF_TYPE CTL_SST_TS_LF
#define GPS_TYPE CTL_SST_TS_UHF
@@ -720,7 +722,7 @@ static void trimbletsip_event (struct parseunit *, int);
#define RCC_CMDSIZE 1
static poll_info_t rcc8000_pollinfo = { RCC_POLLRATE, RCC_POLLCMD, RCC_CMDSIZE };
-#define RCC8000_FLAGS 0
+/* #define RCC8000_FLAGS 0 UNUSED */
#define RCC8000_POLL poll_dpoll
#define RCC8000_INIT poll_init
#define RCC8000_END 0
=====================================
ntpd/refclock_jjy.c
=====================================
--- a/ntpd/refclock_jjy.c
+++ b/ntpd/refclock_jjy.c
@@ -345,7 +345,7 @@ struct refclock refclock_jjy = {
/* Local constants definition for the 2nd parameter of the jjy_write_clockstats */
-#define JJY_CLOCKSTATS_MARK_NONE 0
+/* #define JJY_CLOCKSTATS_MARK_NONE 0 UNUSED */
#define JJY_CLOCKSTATS_MARK_JJY 1
#define JJY_CLOCKSTATS_MARK_SEND 2
#define JJY_CLOCKSTATS_MARK_RECEIVE 3
@@ -359,7 +359,9 @@ struct refclock refclock_jjy = {
#define JJY_CLOCKSTATS_MESSAGE_ECHOBACK "* Echoback"
#define JJY_CLOCKSTATS_MESSAGE_IGNORE_REPLY "* Ignore replay : [%s]"
#define JJY_CLOCKSTATS_MESSAGE_OVER_MIDNIGHT_2 "* Over midnight : timestamp=%d, %d"
-#define JJY_CLOCKSTATS_MESSAGE_OVER_MIDNIGHT_3 "* Over midnight : timestamp=%d, %d, %d"
+/* UNUSED
+ * #define JJY_CLOCKSTATS_MESSAGE_OVER_MIDNIGHT_3 "* Over midnight : timestamp=%d, %d, %d"
+ */
#define JJY_CLOCKSTATS_MESSAGE_TIMESTAMP_UNSURE "* Unsure timestamp : %s"
#define JJY_CLOCKSTATS_MESSAGE_LOOPBACK_DELAY "* Loopback delay : %d.%03d mSec."
#define JJY_CLOCKSTATS_MESSAGE_DELAY_ADJUST "* Delay adjustment : %d mSec. ( valid=%hd/%d )"
@@ -370,12 +372,16 @@ struct refclock refclock_jjy = {
#define JJY_CLOCKSTATS_MESSAGE_TOO_MANY_REPLY "# Too many reply : count=%d"
#define JJY_CLOCKSTATS_MESSAGE_INVALID_REPLY "# Invalid reply : [%s]"
#define JJY_CLOCKSTATS_MESSAGE_SLOW_REPLY_2 "# Slow reply : timestamp=%d, %d"
-#define JJY_CLOCKSTATS_MESSAGE_SLOW_REPLY_3 "# Slow reply : timestamp=%d, %d, %d"
+/* UNUSED
+ * #define JJY_CLOCKSTATS_MESSAGE_SLOW_REPLY_3 "# Slow reply : timestamp=%d, %d, %d"
+ */
#define JJY_CLOCKSTATS_MESSAGE_SSCANF_INVALID_DATE "# Invalid date : rc=%d year=%d month=%d day=%d"
#define JJY_CLOCKSTATS_MESSAGE_SSCANF_INVALID_TIME "# Invalid time : rc=%d hour=%d minute=%d second=%d"
#define JJY_CLOCKSTATS_MESSAGE_SSCANF_INVALID_DATETIME "# Invalid time : rc=%d year=%d month=%d day=%d hour=%d minute=%d second=%d"
#define JJY_CLOCKSTATS_MESSAGE_SSCANF_INVALID_LEAP "# Invalid leap : leapsecond=[%s]"
-#define JJY_CLOCKSTATS_MESSAGE_SSCANF_INVALID_STATUS "# Invalid status : status=[%s]"
+/* UNUSED
+ * #define JJY_CLOCKSTATS_MESSAGE_SSCANF_INVALID_STATUS "# Invalid status : status=[%s]"
+ */
/* Debug print macro */
@@ -1057,8 +1063,8 @@ jjy_synctime ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up )
#define TS_JJY01_COMMAND_NUMBER_STUS 4
#define TS_JJY01_COMMAND_NUMBER_DCST 5
-#define TS_JJY01_REPLY_DATE "yyyy/mm/dd www"
-#define TS_JJY01_REPLY_STIM "hh:mm:ss"
+/* #define TS_JJY01_REPLY_DATE "yyyy/mm/dd www" UNUSED */
+/* #define TS_JJY01_REPLY_STIM "hh:mm:ss" UNUSED */
#define TS_JJY01_REPLY_STUS_ADJUSTED "adjusted"
#define TS_JJY01_REPLY_STUS_UNADJUSTED "unadjusted"
#define TS_JJY01_REPLY_DCST_VALID "valid"
@@ -1550,8 +1556,8 @@ jjy_poll_cdex_jst2000 ( int unit, struct peer *peer )
#define ECHOKEISOKUKI_LT2000_MODE_SWITCHING_CONTINUOUS 3
#define ECHOKEISOKUKI_LT2000_COMMAND_REQUEST_SEND "#"
-#define ECHOKEISOKUKI_LT2000_COMMAND_REQUEST_TIME "T"
-#define ECHOKEISOKUKI_LT2000_COMMAND_CONTINUOUS "C"
+/* #define ECHOKEISOKUKI_LT2000_COMMAND_REQUEST_TIME "T" UNUSED */
+/* #define ECHOKEISOKUKI_LT2000_COMMAND_CONTINUOUS "C" UNUSED */
/**************************************************************************************************/
@@ -1926,8 +1932,8 @@ jjy_poll_citizentic_jjy200 ( int unit, struct peer *peer )
#define TS_GPS01_COMMAND_NUMBER_TIME 2
#define TS_GPS01_COMMAND_NUMBER_STUS 4
-#define TS_GPS01_REPLY_DATE "yyyy/mm/dd"
-#define TS_GPS01_REPLY_TIME "hh:mm:ss"
+/* #define TS_GPS01_REPLY_DATE "yyyy/mm/dd" UNUSED */
+/* #define TS_GPS01_REPLY_TIME "hh:mm:ss" UNUSED */
#define TS_GPS01_REPLY_STUS_RTC "*R"
#define TS_GPS01_REPLY_STUS_GPS "*G"
#define TS_GPS01_REPLY_STUS_UTC "*U"
@@ -2614,7 +2620,7 @@ static short iTeljjyStateTimeout [ 5 ] = { 0, 120, 60, 60, 40 } ;
#define TELJJY_REPLY_TIME 2
#define TELJJY_REPLY_LEAPSEC 3
#define TELJJY_REPLY_LOOP 4
-#define TELJJY_REPLY_PROMPT 5
+/* #define TELJJY_REPLY_PROMPT 5 UNUSED */
#define TELJJY_REPLY_LOOPBACK 6
#define TELJJY_REPLY_COM 7
=====================================
ntpd/refclock_local.c
=====================================
--- a/ntpd/refclock_local.c
+++ b/ntpd/refclock_local.c
@@ -51,7 +51,7 @@
/*
* Local interface definitions
*/
-#define PRECISION (-7) /* about 10 ms precision */
+/* #define PRECISION (-7) * about 10 ms precision UNUSED */
#define NAME "LOCAL" /* shortname */
#define DESCRIPTION "Undisciplined local clock" /* WRU */
#define STRATUM 5 /* default stratum */
=====================================
ntpd/refclock_modem.c
=====================================
--- a/ntpd/refclock_modem.c
+++ b/ntpd/refclock_modem.c
@@ -135,8 +135,8 @@
#define NAME "MODEM" /* shortname */
#define DESCRIPTION "Automated Computer Time Service" /* WRU */
#define REFID "NONE" /* default reference ID */
-#define MSGCNT 20 /* max message count */
-#define MAXPHONE 10 /* max number of phone numbers */
+/* #define MSGCNT 20 * max message count UNUSED */
+/* #define MAXPHONE 10 * max number of phone numbers UNUSED */
/*
* Calling program modes (mode)
=====================================
ntpd/refclock_neoclock.c
=====================================
--- a/ntpd/refclock_neoclock.c
+++ b/ntpd/refclock_neoclock.c
@@ -42,8 +42,10 @@
#define NEOCLOCK4X_FIRMWARE NEOCLOCK4X_FIRMWARE_VERSION_A
#endif
+#if defined(NEOCLOCK4X_FIRMWARE)
/* at this time only firmware version A is known */
-#define NEOCLOCK4X_FIRMWARE_VERSION_A 'A'
+# define NEOCLOCK4X_FIRMWARE_VERSION_A 'A'
+#endif
#define NEOCLOCK4X_TIMECODELEN 37
@@ -56,7 +58,7 @@
#define NEOCLOCK4X_OFFSET_MINUTE 20
#define NEOCLOCK4X_OFFSET_SECOND 22
#define NEOCLOCK4X_OFFSET_HSEC 24
-#define NEOCLOCK4X_OFFSET_DOW 26
+/* #define NEOCLOCK4X_OFFSET_DOW 26 UNUSED */
#define NEOCLOCK4X_OFFSET_TIMESOURCE 28
#define NEOCLOCK4X_OFFSET_DSTSTATUS 29
#define NEOCLOCK4X_OFFSET_QUARZSTATUS 30
=====================================
ntpd/refclock_nmea.c
=====================================
--- a/ntpd/refclock_nmea.c
+++ b/ntpd/refclock_nmea.c
@@ -86,7 +86,7 @@
#define NMEA_DATETRUST_MASK 0x02000000U
#define NMEA_PROTO_IDLEN 5 /* tag name must be at least 5 chars */
-#define NMEA_PROTO_MINLEN 6 /* min chars in sentence, excluding CS */
+/* #define NMEA_PROTO_MINLEN 6 * min chars in sentence, excluding CS UNUSED */
#define NMEA_PROTO_MAXLEN 80 /* max chars in sentence, excluding CS */
#define NMEA_PROTO_FIELDS 32 /* not official; limit on fields per record */
@@ -139,28 +139,30 @@
* Definitions
*/
#define DEVICE "/dev/gps%d" /* GPS serial device */
-#define PPSDEV "/dev/gpspps%d" /* PPSAPI device override */
+#ifdef HAVE_PPSAPI
+# define PPSDEV "/dev/gpspps%d" /* PPSAPI device override */
+# define PPS_PRECISION (-20) /* precision assumed (~ 1 us) */
+# ifndef O_NOCTTY
+# define M_NOCTTY 0
+# else
+# define M_NOCTTY O_NOCTTY
+# endif
+# ifndef O_NONBLOCK
+# define M_NONBLOCK 0
+# else
+# define M_NONBLOCK O_NONBLOCK
+# endif
+# define PPSOPENMODE (O_RDWR | M_NOCTTY | M_NONBLOCK)
+#endif
#ifdef ENABLE_CLASSIC_MODE
#define SPEED232 B4800 /* uart speed (4800 bps) */
#else
#define SPEED232 B9600 /* uart speed (9600 bps) */
#endif
#define PRECISION (-9) /* precision assumed (about 2 ms) */
-#define PPS_PRECISION (-20) /* precision assumed (about 1 us) */
#define REFID "GPS\0" /* reference id */
#define NAME "NMEA" /* shortname */
#define DESCRIPTION "NMEA GPS Clock" /* who we are */
-#ifndef O_NOCTTY
-#define M_NOCTTY 0
-#else
-#define M_NOCTTY O_NOCTTY
-#endif
-#ifndef O_NONBLOCK
-#define M_NONBLOCK 0
-#else
-#define M_NONBLOCK O_NONBLOCK
-#endif
-#define PPSOPENMODE (O_RDWR | M_NOCTTY | M_NONBLOCK)
/* NMEA sentence array indexes for those we use */
#define NMEA_GPRMC 0 /* recommended min. nav. */
=====================================
ntpd/refclock_spectracom.c
=====================================
--- a/ntpd/refclock_spectracom.c
+++ b/ntpd/refclock_spectracom.c
@@ -96,7 +96,9 @@
#define DEVICE "/dev/spectracom%d" /* device name and unit */
#define SPEED232 B9600 /* uart speed (9600 baud) */
#define PRECISION (-13) /* precision assumed (about 100 us) */
-#define PPS_PRECISION (-13) /* precision assumed (about 100 us) */
+#ifdef HAVE_PPSAPI
+# define PPS_PRECISION (-13) /* precision assumed (about 100 us) */
+#endif
#define REFID "GPS\0" /* reference ID */
#define NAME "SPECTRACOM" /* shortname */
#define DESCRIPTION "Spectracom GPS Receiver" /* WRU */
=====================================
ntpd/refclock_trimble.c
=====================================
--- a/ntpd/refclock_trimble.c
+++ b/ntpd/refclock_trimble.c
@@ -118,16 +118,18 @@
* TRIMBLE_UTC_TIME set and TRIMBLE_LEAP_PENDING set: INSERT leap
*/
-#define TRIMBLE_LEAP_INPROGRESS 0x08 /* This is the leap flag */
-#define TRIMBLE_LEAP_WARNING 0x04 /* GPS Leap Warning (see ICD-200) */
+/* #define TRIMBLE_LEAP_INPROGRESS 0x08 * This is the leap flag UNUSED */
+/* #define TRIMBLE_LEAP_WARNING 0x04 * GPS Leap Warning (ICD-200) UNUSED */
#define TRIMBLE_LEAP_PENDING 0x02 /* Leap Pending (24 hours) */
#define TRIMBLE_UTC_TIME 0x01 /* UTC time available */
#define mb(_X_) (up->rpt_buf[(_X_ + 1)]) /* shortcut for buffer access */
/* Conversion Definitions */
-#define GPS_PI (3.1415926535898)
-#define R2D (180.0/GPS_PI)
+#ifdef DEBUG
+# define GPS_PI (3.1415926535898)
+# define R2D (180.0/GPS_PI)
+#endif
/*
* Structure for build data packets for send (thunderbolt uses it only)
@@ -219,7 +221,7 @@ int day_of_year (char *dt);
#define CLK_PRAECIS 1 /* Endrun Technologies Praecis */
#define CLK_THUNDERBOLT 2 /* Trimble Thunderbolt GPS Receiver */
#define CLK_ACUTIME 3 /* Trimble Acutime Gold */
-#define CLK_ACUTIMEB 4 /* Trimble Actutime Gold Port B */
+/* #define CLK_ACUTIMEB 4 * Trimble Actutime Gold Port B UNUSED */
bool praecis_msg;
static void praecis_parse(struct recvbuf *rbufp, struct peer *peer);
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/926f05e0151136d6df681f3aa8f62f80352ef2a2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170214/f4304efb/attachment.html>
More information about the vc
mailing list