From: Harlan Stenn Date: Tue, 16 May 2000 04:55:34 +0000 (-0000) Subject: Many files: X-Git-Tag: NTP_4_0_99_J~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4bac30263f67448fef37aa4f3dd32f0417c71a5;p=thirdparty%2Fntp.git Many files: * include/ntp_stdlib.h: * libntp/systime.c (adj_systime): * ntpd/ntp_loopfilter.c (loop_config): * ntpd/ntp_util.c (stats_config): * ports/winnt/ntpd/nt_clockstuff.c (adj_systime): MAXFREQ -> MAX_FREQ * include/ntp_proto.h: Define MAX_FREQ bk: 3920d4c6Uu6DeMufuqYb8UVgJdeWrA --- diff --git a/ChangeLog b/ChangeLog index 9b94d8dbb..a88e215a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2000-05-16 Harlan Stenn + + * include/ntp_stdlib.h: + * libntp/systime.c (adj_systime): + * ntpd/ntp_loopfilter.c (loop_config): + * ntpd/ntp_util.c (stats_config): + * ports/winnt/ntpd/nt_clockstuff.c (adj_systime): + MAXFREQ -> MAX_FREQ + * include/ntp_proto.h: Define MAX_FREQ + 2000-05-15 Harlan Stenn * include/ntp_stdlib.h: diff --git a/include/ntp.h b/include/ntp.h index e8cbde12e..d8341e75d 100644 --- a/include/ntp.h +++ b/include/ntp.h @@ -115,7 +115,7 @@ typedef char s_char; #define CLOCK_SGATE 10. /* popcorn spike gate */ #define BURST_INTERVAL1 4 /* first interburst interval (log2) */ #define BURST_INTERVAL2 1 /* succeeding interburst intervals (log2) */ - + /* * Operations for jitter (variance) calculations (these use doubles). * diff --git a/include/ntp_proto.h b/include/ntp_proto.h index 2a888c2cc..0ea7a9b43 100644 --- a/include/ntp_proto.h +++ b/include/ntp_proto.h @@ -5,4 +5,6 @@ #include #endif +#define MAX_FREQ 500e-6 + #endif /* __ntp_proto_h */ diff --git a/libntp/systime.c b/libntp/systime.c index 05f4460b4..f9f9f8806 100644 --- a/libntp/systime.c +++ b/libntp/systime.c @@ -19,6 +19,7 @@ # include #endif /* HAVE_UTMPX_H */ +#include "ntp_proto.h" /* for MAX_FREQ */ #include "ntp_machine.h" #include "ntp_fp.h" #include "ntp_syslog.h" @@ -27,8 +28,6 @@ int systime_10ms_ticks = 0; /* adj sysclock in 10ms increments */ -#define MAXFREQ 500e-6 - /* * These routines (init_systime, get_systime, step_systime, adj_systime) * implement an interface between the (more or less) system independent @@ -139,8 +138,8 @@ adj_systime( } } else #endif - if (dtemp > MAXFREQ) - dtemp = MAXFREQ; + if (dtemp > MAX_FREQ) + dtemp = MAX_FREQ; dtemp = dtemp * 1e6 + .5; diff --git a/ntpd/ntp_loopfilter.c b/ntpd/ntp_loopfilter.c index 0ad99dbfb..d92158745 100644 --- a/ntpd/ntp_loopfilter.c +++ b/ntpd/ntp_loopfilter.c @@ -537,10 +537,10 @@ local_clock( */ etemp = clock_frequency + flladj + plladj; drift_comp += etemp; - if (drift_comp > MAXFREQ) - drift_comp = MAXFREQ; - else if (drift_comp <= -MAXFREQ) - drift_comp = -MAXFREQ; + if (drift_comp > MAX_FREQ) + drift_comp = MAX_FREQ; + else if (drift_comp <= -MAX_FREQ) + drift_comp = -MAX_FREQ; dtemp = SQUARE(clock_stability); etemp = SQUARE(etemp) - dtemp; clock_stability = SQRT(dtemp + etemp / CLOCK_AVG); @@ -743,10 +743,10 @@ loop_config( */ rstclock(S_FSET); drift_comp = freq; - if (drift_comp > MAXFREQ) - drift_comp = MAXFREQ; - if (drift_comp < -MAXFREQ) - drift_comp = -MAXFREQ; + if (drift_comp > MAX_FREQ) + drift_comp = MAX_FREQ; + if (drift_comp < -MAX_FREQ) + drift_comp = -MAX_FREQ; #ifdef KERNEL_PLL /* * If the phase-lock code is implemented in the kernel, diff --git a/ntpd/ntp_util.c b/ntpd/ntp_util.c index 21604fe9c..e0ed4c60f 100644 --- a/ntpd/ntp_util.c +++ b/ntpd/ntp_util.c @@ -352,7 +352,7 @@ stats_config( } (void) fclose(fp); if ( !finite(old_drift) - || (fabs(old_drift) > (MAXFREQ * 1e6))) { + || (fabs(old_drift) > (MAX_FREQ * 1e6))) { msyslog(LOG_ERR, "invalid frequency (%f) in %s", old_drift, stats_drift_file); exit(1); diff --git a/ports/winnt/ntpd/nt_clockstuff.c b/ports/winnt/ntpd/nt_clockstuff.c index b66da8823..26840b298 100644 --- a/ports/winnt/ntpd/nt_clockstuff.c +++ b/ports/winnt/ntpd/nt_clockstuff.c @@ -52,8 +52,8 @@ adj_systime( dtemp = -dtemp; } - if (dtemp > MAXFREQ) - dtemp = MAXFREQ; + if (dtemp > MAX_FREQ) + dtemp = MAX_FREQ; dtemp = dtemp * 1e6;