From: Harlan Stenn Date: Sun, 14 May 2000 01:01:49 +0000 (-0000) Subject: Many files: X-Git-Tag: NTP_4_0_99_J~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=197f5a32f638cd0360975337994f5620a02a3709;p=thirdparty%2Fntp.git Many files: * ntpdate/ntptimeset.c: * ntpdate/ntpdate.h: * ntpd/refclock_oncore.c (oncore_msg_En): * ntpd/ntp_util.c (stats_config): * ntpd/ntp_request.c: * ntpd/ntp_intres.c (findhostaddr): * ntpd/ntp_config.c (getconfig): * libntp/systime.c (adj_systime): * libntp/lib_strbuf.c: * libntp/authparity.c: * libntp/audio.c: Header/lint cleanup From/reported by: Simon Burge bk: 391dfafdUCxRhkJFZ9jsFi7SDBh6gA --- diff --git a/ChangeLog b/ChangeLog index af7a32880..edde1bb27 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,19 @@ 2000-05-13 Harlan Stenn + * ntpdate/ntptimeset.c: + * ntpdate/ntpdate.h: + * ntpd/refclock_oncore.c (oncore_msg_En): + * ntpd/ntp_util.c (stats_config): + * ntpd/ntp_request.c: + * ntpd/ntp_intres.c (findhostaddr): + * ntpd/ntp_config.c (getconfig): + * libntp/systime.c (adj_systime): + * libntp/lib_strbuf.c: + * libntp/authparity.c: + * libntp/audio.c: + Header/lint cleanup + From/reported by: Simon Burge + * ntpd/ntp_resolver.c (findhostaddr): Compiler noise cleanup * ntpd/ntp_intres.c: Compiler noise cleanup diff --git a/libntp/audio.c b/libntp/audio.c index 27e919b61..f06d22e33 100644 --- a/libntp/audio.c +++ b/libntp/audio.c @@ -6,8 +6,11 @@ #endif #include "audio.h" -#include +#ifdef HAVE_UNISTD_H +# include +#endif #include +#include "ntp_string.h" #ifdef HAVE_SYS_AUDIOIO_H #include diff --git a/libntp/authparity.c b/libntp/authparity.c index 32fde586c..94a487e94 100644 --- a/libntp/authparity.c +++ b/libntp/authparity.c @@ -1,6 +1,12 @@ /* * auth_parity - set parity on a key/check for odd parity */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#ifdef DES #include "ntp_stdlib.h" int @@ -55,3 +61,4 @@ DESauth_parity( */ return (parity_err == 0); } +#endif /* DES */ diff --git a/libntp/lib_strbuf.c b/libntp/lib_strbuf.c index 690f1ad28..315070f3a 100644 --- a/libntp/lib_strbuf.c +++ b/libntp/lib_strbuf.c @@ -2,6 +2,7 @@ * lib_strbuf - library string storage */ +#include "ntp_stdlib.h" #include "lib_strbuf.h" /* diff --git a/libntp/systime.c b/libntp/systime.c index 366487010..43aaefd0b 100644 --- a/libntp/systime.c +++ b/libntp/systime.c @@ -159,8 +159,8 @@ adj_systime( /* casey - we need a posix type thang here */ if (adjtime(&adjtv, &oadjtv) < 0) { - msyslog(LOG_ERR, "Can't adjust time (%d sec, %d usec): %m", - adjtv.tv_sec, adjtv.tv_usec); + msyslog(LOG_ERR, "Can't adjust time (%ld sec, %ld usec): %m", + (long)adjtv.tv_sec, (long)adjtv.tv_usec); return 0; } else { diff --git a/ntpd/ntp_config.c b/ntpd/ntp_config.c index 5965b91ae..263629819 100644 --- a/ntpd/ntp_config.c +++ b/ntpd/ntp_config.c @@ -706,6 +706,7 @@ getconfig( int minpoll; int maxpoll; int ttl; + unsigned long ul; keyid_t peerkey; char *peerkeystr; keyid_t lpeerkey; @@ -1462,13 +1463,11 @@ getconfig( case CONFIG_REQUESTKEY: if (ntokens >= 2) { - keyid_t rkey; - - if (!atouint(tokens[1], &rkey)) { + if (!atouint(tokens[1], &ul)) { msyslog(LOG_ERR, "%s is undecodable as request key", tokens[1]); - } else if (rkey == 0) { + } else if (ul == 0) { msyslog(LOG_ERR, "%s makes a poor request keyid", tokens[1]); @@ -1476,9 +1475,9 @@ getconfig( #ifdef DEBUG if (debug > 3) printf( - "set info_auth_key to %08x\n", rkey); + "set info_auth_key to %08lx\n", ul); #endif - info_auth_keyid = rkey; + info_auth_keyid = (keyid_t)ul; } } break; @@ -1647,11 +1646,12 @@ getconfig( case CONF_FDG_FLAG2: case CONF_FDG_FLAG3: case CONF_FDG_FLAG4: - if (!atouint(tokens[++i], &lpeerkey) - || lpeerkey > 1) { + if (!atouint(tokens[++i], &ul) + || ul > 1) { msyslog(LOG_ERR, "fudge %s flag value in error", ntoa(&peeraddr)); + lpeerkey = (keyid_t)ul; peerkey = lpeerkey; errflg = i; break; diff --git a/ntpd/ntp_intres.c b/ntpd/ntp_intres.c index a69d92a90..85676b1a7 100644 --- a/ntpd/ntp_intres.c +++ b/ntpd/ntp_intres.c @@ -448,6 +448,7 @@ findhostaddr( ) { struct hostent *hp; + struct in_addr in; checkparent(); /* make sure our guy is still running */ @@ -475,7 +476,8 @@ findhostaddr( msyslog(LOG_INFO, "findhostaddr: Resolving %x>", entry->ce_peeraddr); #endif - hp = gethostbyaddr((const char *)entry->ce_peeraddr, + in.s_addr = entry->ce_peeraddr; + hp = gethostbyaddr((const char *)&in, sizeof entry->ce_peeraddr, AF_INET); } diff --git a/ntpd/ntp_request.c b/ntpd/ntp_request.c index 51e7fcf3a..0ce5c6993 100644 --- a/ntpd/ntp_request.c +++ b/ntpd/ntp_request.c @@ -2,13 +2,15 @@ * ntp_request.c - respond to information requests */ #ifdef HAVE_CONFIG_H -#include +# include #endif #include #include #include #include +#include +#include #include "ntpd.h" #include "ntp_io.h" @@ -535,10 +537,10 @@ process_private( if (proc->sizeofitem != 0) if (proc->sizeofitem*INFO_NITEMS(inpkt->err_nitems) > sizeof(inpkt->data)) { - msyslog(LOG_ERR, "sizeofitem(%d)*NITEMS(%d) > data: %d > %d", + msyslog(LOG_ERR, "sizeofitem(%d)*NITEMS(%d) > data: %d > %ld", proc->sizeofitem, INFO_NITEMS(inpkt->err_nitems), proc->sizeofitem*INFO_NITEMS(inpkt->err_nitems), - sizeof(inpkt->data)); + (long)sizeof(inpkt->data)); req_ack(srcadr, inter, inpkt, INFO_ERR_FMT); return; } @@ -1132,10 +1134,10 @@ do_conf( struct req_pkt *inpkt ) { + int fl; register struct conf_peer *cp; register int items; struct sockaddr_in peeraddr; - int fl; /* * Do a check of everything to see that it looks @@ -1271,7 +1273,6 @@ dns_a( while (items-- > 0) { u_short associd; size_t hnl; - char *cp; struct peer *peer; int bogon = 0; @@ -1287,8 +1288,8 @@ dns_a( peeraddr.sin_addr.s_addr = dp->peeraddr; for (hnl = 0; dp->hostname[hnl] && hnl < sizeof dp->hostname; ++hnl) ; if (hnl >= sizeof dp->hostname) { - msyslog(LOG_ERR, "dns_a: hnl (%d) >= %d", - hnl, sizeof dp->hostname); + msyslog(LOG_ERR, "dns_a: hnl (%ld) >= %ld", + (long)hnl, (long)sizeof dp->hostname); ++bogon; } @@ -1431,7 +1432,7 @@ setclr_flags( if (flags & ~(SYS_FLAG_BCLIENT | SYS_FLAG_AUTHENTICATE | SYS_FLAG_NTP | SYS_FLAG_KERNEL | SYS_FLAG_MONITOR | SYS_FLAG_FILEGEN)) { - msyslog(LOG_ERR, "setclr_flags: extra flags: %#x", + msyslog(LOG_ERR, "setclr_flags: extra flags: %#lx", flags & ~(SYS_FLAG_BCLIENT | SYS_FLAG_AUTHENTICATE | SYS_FLAG_NTP | SYS_FLAG_KERNEL | SYS_FLAG_MONITOR | SYS_FLAG_FILEGEN)); @@ -1738,7 +1739,7 @@ reset_stats( flags = ((struct reset_flags *)inpkt->data)->flags; if (flags & ~RESET_ALLFLAGS) { - msyslog(LOG_ERR, "reset_stats: reset leaves %#x", + msyslog(LOG_ERR, "reset_stats: reset leaves %#lx", flags & ~RESET_ALLFLAGS); req_ack(srcadr, inter, inpkt, INFO_ERR_FMT); return; diff --git a/ntpd/ntp_util.c b/ntpd/ntp_util.c index 20861b0a7..df4d5003d 100644 --- a/ntpd/ntp_util.c +++ b/ntpd/ntp_util.c @@ -353,7 +353,7 @@ stats_config( (void) fclose(fp); if ( !finite(old_drift) || (fabs(old_drift) > (sys_maxfreq * 1e6))) { - msyslog(LOG_ERR, "invalid frequency (%lf) in %s", + msyslog(LOG_ERR, "invalid frequency (%f) in %s", old_drift, stats_drift_file); exit(1); } diff --git a/ntpd/refclock_oncore.c b/ntpd/refclock_oncore.c index 8c6e4183d..c40776b9e 100644 --- a/ntpd/refclock_oncore.c +++ b/ntpd/refclock_oncore.c @@ -1587,7 +1587,8 @@ oncore_msg_En( if (debug > 2) printf("ONCORE: serial/j (%lu, %d) %ld.%09ld\n", - pps_i.assert_sequence, j, tsp->tv_sec, tsp->tv_nsec); + (long)pps_i.assert_sequence, j, + (long)tsp->tv_sec, (long)tsp->tv_nsec); if (pps_i.assert_sequence == j) { printf("ONCORE: oncore_msg_En, error serial pps\n"); diff --git a/ntpdate/ntpdate.h b/ntpdate/ntpdate.h index 85e438e33..b0e925daa 100644 --- a/ntpdate/ntpdate.h +++ b/ntpdate/ntpdate.h @@ -4,6 +4,8 @@ #include "ntp_malloc.h" +extern void loadservers P((char *cfgpath)); + /* * The server structure is a much simplified version of the * peer structure, for ntpdate's use. Since we always send diff --git a/ntpdate/ntptimeset.c b/ntpdate/ntptimeset.c index fb9e7e07a..4ccdf17c4 100644 --- a/ntpdate/ntptimeset.c +++ b/ntpdate/ntptimeset.c @@ -308,7 +308,6 @@ u_long finish_time = 0; int ntptimesetmain P((int argc, char *argv[])); -extern void loadservers P((char *cfgpath)); static void analysis P((int final)); static int have_enough P((void)); static void transmit P((register struct server *server));