]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Many files:
authorHarlan Stenn <stenn@ntp.org>
Sun, 14 May 2000 01:01:49 +0000 (01:01 -0000)
committerHarlan Stenn <stenn@ntp.org>
Sun, 14 May 2000 01:01:49 +0000 (01:01 -0000)
  * 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 <simonb@netbsd.org>

bk: 391dfafdUCxRhkJFZ9jsFi7SDBh6gA

12 files changed:
ChangeLog
libntp/audio.c
libntp/authparity.c
libntp/lib_strbuf.c
libntp/systime.c
ntpd/ntp_config.c
ntpd/ntp_intres.c
ntpd/ntp_request.c
ntpd/ntp_util.c
ntpd/refclock_oncore.c
ntpdate/ntpdate.h
ntpdate/ntptimeset.c

index af7a32880552f2bb7519cb70ec9f6745a5b2ac28..edde1bb273441a3de85104fd3be190b6d65d5da6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
 2000-05-13  Harlan Stenn  <stenn@whimsy.udel.edu>
 
+       * 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 <simonb@netbsd.org>
+
        * ntpd/ntp_resolver.c (findhostaddr): Compiler noise cleanup
 
        * ntpd/ntp_intres.c: Compiler noise cleanup
index 27e919b61a0d7d4964acbd28aa99748973c0e9ee..f06d22e33b8af114f86dfa8d10ecee91434d2fc9 100644 (file)
@@ -6,8 +6,11 @@
 #endif
 
 #include "audio.h"
-#include <unistd.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
 #include <stdio.h>
+#include "ntp_string.h"
 
 #ifdef HAVE_SYS_AUDIOIO_H
 #include <sys/audioio.h>
index 32fde586c00f53120f90ef4ca1677120b7b1d578..94a487e9421af018ed44cd72da879b5d7b353d2b 100644 (file)
@@ -1,6 +1,12 @@
 /*
  * auth_parity - set parity on a key/check for odd parity
  */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#ifdef DES
 #include "ntp_stdlib.h"
 
 int
@@ -55,3 +61,4 @@ DESauth_parity(
         */
        return (parity_err == 0);
 }
+#endif /* DES */
index 690f1ad28610d0fd62397f12e91978b4784159dd..315070f3a9435b209833b878f3ac4bfd3a7432de 100644 (file)
@@ -2,6 +2,7 @@
  * lib_strbuf - library string storage
  */
 
+#include "ntp_stdlib.h"
 #include "lib_strbuf.h"
 
 /*
index 3664870104704cb28cf256fd2eecf495c1c88ec8..43aaefd0bafd2d9d8949b4c1c5f34b8538b91063 100644 (file)
@@ -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 {
index 5965b91aedc4492fc876f275697519918aefb0f8..263629819c4b38c72e6c55f606da620036433ad9 100644 (file)
@@ -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;
index a69d92a9032f001458ded47fe43b089f0c075850..85676b1a72c31db801c713e7f5848343678b71c2 100644 (file)
@@ -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);
        }
index 51e7fcf3aeec82f4041dfdde4f3c9b3a1a278666..0ce5c6993b9a3b06999e81bbaf465b9a2b3eb09d 100644 (file)
@@ -2,13 +2,15 @@
  * ntp_request.c - respond to information requests
  */
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+# include <config.h>
 #endif
 
 #include <sys/types.h>
 #include <stdio.h>
 #include <signal.h>
 #include <sys/time.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
 
 #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;
index 20861b0a73d735cab28506a619ac9bb7d816860f..df4d5003dc22a3a9f1b6cf2def3d0758bcaade3b 100644 (file)
@@ -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);
                }
index 8c6e4183dd111ef7de8a832f417b94a4d9580dcc..c40776b9e9ae6375e54b048fc6fca9632359158c 100644 (file)
@@ -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");
index 85e438e3307cfd95d703135aceba6cd73f15605d..b0e925daaaa40e9e966bfd351d629ba1e8442f46 100644 (file)
@@ -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
index fb9e7e07acf531b0f4ad2154ed5a877cd2b786cd..4ccdf17c41424c810f79557fc3b803674d2b085c 100644 (file)
@@ -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));