[Git][NTPsec/ntpsec][master] Resolve GitLab Issue #34: osx: build warnings with lockclock

Eric S. Raymond gitlab at mg.gitlab.com
Tue Oct 4 04:03:41 UTC 2016


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
33180b11 by Eric S. Raymond at 2016-10-04T00:01:42-04:00
Resolve  GitLab Issue #34: osx: build warnings with lockclock

These turned out not to be specific to OS X, the code had never
properly been conditionalized for the general case.

- - - - -


1 changed file:

- ntpd/ntp_loopfilter.c


Changes:

=====================================
ntpd/ntp_loopfilter.c
=====================================
--- a/ntpd/ntp_loopfilter.c
+++ b/ntpd/ntp_loopfilter.c
@@ -110,16 +110,20 @@ uint8_t	allan_xpt = CLOCK_ALLAN; /* Allan intercept (log2 s) */
 /*
  * Program variables
  */
+#ifndef ENABLE_LOCKCLOCK
 static double clock_offset;	/* offset */
+static u_long clock_epoch;	/* last update */
+#endif /* ENABLE_LOCKCLOCK */
 double	clock_jitter;		/* offset jitter */
 double	drift_comp;		/* frequency (s/s) */
 static double init_drift_comp; /* initial frequency (PPM) */
 double	clock_stability;	/* frequency stability (wander) (s/s) */
-static u_long clock_epoch;	/* last update */
 u_int	sys_tai;		/* TAI offset from UTC */
 static bool loop_started;	/* true after LOOP_DRIFTINIT */
+#ifndef ENABLE_LOCKCLOCK
 static void rstclock (int, double); /* transition function */
 static double direct_freq(double); /* direct set frequency */
+#endif /* ENABLE_LOCKCLOCK */
 static void set_freq(double);	/* set frequency */
 
 #ifdef HAVE_KERNEL_PLL
@@ -131,9 +135,11 @@ static char *this_file = NULL;
 
 static struct timex ntv;	/* ntp_adjtime() parameters */
 int	pll_status;		/* last kernel status bits */
+#ifndef ENABLE_LOCKCLOCK
 #if defined(STA_NANO) && NTP_API == 4
 static u_int loop_tai;		/* last TAI offset */
 #endif /* STA_NANO */
+#endif /* ENABLE_LOCKCLOCK */
 static	void	start_kern_loop(void);
 static	void	stop_kern_loop(void);
 #endif /* HAVE_KERNEL_PLL */
@@ -183,6 +189,7 @@ static sigjmp_buf env;		/* environment var. for pll_trap() */
 #endif /* HAVE_KERNEL_PLL */
 
 #ifdef HAVE_KERNEL_PLL
+#ifndef ENABLE_LOCKCLOCK
 static void
 sync_status(const char *what, int ostatus, int nstatus)
 {
@@ -192,6 +199,7 @@ sync_status(const char *what, int ostatus, int nstatus)
 	snprintf(tbuf, sizeof(tbuf), "%s status: %s -> %s", what, obuf, nbuf);
 	report_event(EVNT_KERN, NULL, tbuf);
 }
+#endif /* ENABLE_LOCKCLOCK */
 
 /*
  * file_name - return pointer to non-relative portion of this C file pathname
@@ -1018,6 +1026,7 @@ adj_host_clock(
 }
 
 
+#ifndef ENABLE_LOCKCLOCK
 /*
  * Clock state machine. Enter new state and set state variables.
  */
@@ -1061,6 +1070,7 @@ direct_freq(
 
 	return drift_comp;
 }
+#endif /* ENABLE_LOCKCLOCK */
 
 
 /*



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/33180b11236918164618c94bc634cf3d72c683cb
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161004/46e2c370/attachment.html>


More information about the vc mailing list