[Git][NTPsec/ntpsec][master] 3 commits: Remove unused SIZEOFs (INT and LONG LONG)

Hal Murray gitlab at mg.gitlab.com
Thu Mar 16 08:24:27 UTC 2017


Hal Murray pushed to branch master at NTPsec / ntpsec


Commits:
8f4933d5 by Hal Murray at 2017-03-15T23:10:52-07:00
Remove unused SIZEOFs (INT and LONG LONG)

- - - - -
d6edf2f5 by Hal Murray at 2017-03-15T23:10:52-07:00
Remove cos option for leap smearing

- - - - -
8624a6df by Hal Murray at 2017-03-15T23:10:52-07:00
Move leap_smear_intv to ntp_timer

- - - - -


3 changed files:

- ntpd/ntp_io.c
- ntpd/ntp_timer.c
- wafhelpers/configure.py


Changes:

=====================================
ntpd/ntp_io.c
=====================================
--- a/ntpd/ntp_io.c
+++ b/ntpd/ntp_io.c
@@ -56,13 +56,6 @@
 #endif
 int qos = IPTOS_DSCP_EF;	/* QoS RFC 3246 */
 
-#ifdef ENABLE_LEAP_SMEAR
-/* TODO burnicki: This should be moved to ntp_timer.c, but if we do so
- * we get a linker error. Since we're running out of time before the leap
- * second occurs, we let it here where it just works.
- */
-int leap_smear_intv;
-#endif
 
 /*
  * NIC rule entry


=====================================
ntpd/ntp_timer.c
=====================================
--- a/ntpd/ntp_timer.c
+++ b/ntpd/ntp_timer.c
@@ -22,6 +22,7 @@
 # define	TC_ERR	(-1)
 #endif
 
+
 static void check_leapsec(time_t, bool);
 
 /*
@@ -46,7 +47,8 @@ static	u_long leapf_timer;	/* Report leapfile problems once/day */
 static	u_long huffpuff_timer;	/* huff-n'-puff timer */
 static	u_long worker_idle_timer;/* next check for idle intres */
 u_long	leapsec;	        /* seconds to next leap (proximity class) */
-int     leapdif;                /* TAI difference step at next leap second*/
+int	leap_smear_intv;	/* Duration of smear.  Enables smear mode. */
+int	leapdif;		/* TAI difference step at next leap second*/
 u_long	orphwait; 		/* orphan wait time */
 
 /*
@@ -442,14 +444,9 @@ check_leapsec(
 				      double leap_smear_time = dtemp - leap_smear.intv_start;
 				      /*
 				       * For now we just do a linear interpolation over the smear interval
+				       * https://developers.google.com/time/smear
 				       */
-#if 0
-				      // linear interpolation
 				      leap_smear.doffset = -(leap_smear_time * lsdata.tai_diff / leap_smear.interval);
-#else
-				      // Google approach: lie(t) = (1.0 - cos(pi * t / w)) / 2.0
-				      leap_smear.doffset = -((double) lsdata.tai_diff - cos( M_PI * leap_smear_time / leap_smear.interval)) / 2.0;
-#endif
 				      /*
 				       * TODO see if we're inside an
 				       * inserted leap second, so we


=====================================
wafhelpers/configure.py
=====================================
--- a/wafhelpers/configure.py
+++ b/wafhelpers/configure.py
@@ -426,10 +426,8 @@ int main(int argc, char **argv) {
 
     # mostly used by timetoa.h and timespecops.h
     sizeofs = [
-        ("time.h",          "time_t"),
-        (None,          "int"),
+        ("time.h",      "time_t"),
         (None,          "long"),
-        (None,          "long long"),
     ]
 
     for header, sizeof in sorted(sizeofs, key=lambda x: x[1:]):



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/d66a8fe29e7025b47a065cc073c510b81b00cf23...8624a6df3a23124d9768ea4362d9f0de0215ea02
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170316/63fb8d9a/attachment.html>


More information about the vc mailing list