[Git][NTPsec/ntpsec][master] Fix warnings about unused variables/functions when lockclock is enabled

Eric S. Raymond gitlab at mg.gitlab.com
Tue Oct 4 15:23:33 UTC 2016


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


Commits:
875477d1 by Matt Selsky at 2016-10-04T10:36:14-04:00
Fix warnings about unused variables/functions when lockclock is enabled

Warnings seen with Xcode 8.0:
../../ntpd/ntp_loopfilter.c:122:13: warning: unused variable 'loop_started' [-Wunused-variable]
static bool loop_started;       /* true after LOOP_DRIFTINIT */
            ^
../../ntpd/ntp_loopfilter.c:1089:1: warning: unused function 'set_freq' [-Wunused-function]
set_freq(
^
2 warnings generated.

Fixes Gitlab issue #34

- - - - -


1 changed file:

- ntpd/ntp_loopfilter.c


Changes:

=====================================
ntpd/ntp_loopfilter.c
=====================================
--- a/ntpd/ntp_loopfilter.c
+++ b/ntpd/ntp_loopfilter.c
@@ -119,12 +119,12 @@ double	drift_comp;		/* frequency (s/s) */
 static double init_drift_comp; /* initial frequency (PPM) */
 double	clock_stability;	/* frequency stability (wander) (s/s) */
 u_int	sys_tai;		/* TAI offset from UTC */
-static bool loop_started;	/* true after LOOP_DRIFTINIT */
 #ifndef ENABLE_LOCKCLOCK
+static bool loop_started;	/* true after LOOP_DRIFTINIT */
 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 */
+#endif /* ENABLE_LOCKCLOCK */
 
 #ifdef HAVE_KERNEL_PLL
 #ifndef PATH_MAX
@@ -1072,7 +1072,7 @@ direct_freq(
 }
 #endif /* ENABLE_LOCKCLOCK */
 
-
+#ifndef ENABLE_LOCKCLOCK
 /*
  * set_freq - set clock frequency correction
  *
@@ -1111,7 +1111,7 @@ set_freq(
 	mprintf_event(EVNT_FSET, NULL, "%s %.3f PPM", loop_desc,
 	    drift_comp * 1e6);
 }
-
+#endif /* HAVE_LOCKCLOCK */
 
 #ifdef HAVE_KERNEL_PLL
 static void



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


More information about the vc mailing list