]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Fix casting issues and other warnings.
authorDanny Mayer <mayer@ntp.org>
Sun, 20 Apr 2003 05:39:04 +0000 (01:39 -0400)
committerDanny Mayer <mayer@ntp.org>
Sun, 20 Apr 2003 05:39:04 +0000 (01:39 -0400)
bk: 3ea23278ldgjtHXO-0Aj-2plhYMZ_Q

ntpd/ntp_loopfilter.c
ntpd/ntp_monitor.c
ntpd/refclock_palisade.c
ports/winnt/include/config.h
ports/winnt/ntpd/hopf_PCI_io.c

index bd7e286073653f78ca77d2cfe33d84da1f4a473f..61d271bf345a8fbf06dd01680d359f971d3343b4 100644 (file)
@@ -444,7 +444,7 @@ local_clock(
                        allow_panic = FALSE;
                        dtemp = fabs(fp_offset - last_offset);
                        if (dtemp > CLOCK_SGATE * oerror && mu <
-                           ULOGTOD(sys_poll + 1)) {
+                           (u_long) ULOGTOD(sys_poll + 1)) {
 #ifdef DEBUG
                                if (debug)
                                        printf(
@@ -473,7 +473,7 @@ local_clock(
                        dtemp = max(mu, allan_xpt);
                        flladj = (fp_offset - clock_offset) * etemp /
                            (CLOCK_FLL * dtemp);
-                       etemp = min(mu, ULOGTOD(sys_poll));
+                       etemp = min(mu, (u_long) ULOGTOD(sys_poll));
                        dtemp = 4 * CLOCK_PLL * ULOGTOD(sys_poll);
                        plladj = fp_offset * etemp / (dtemp * dtemp);
                        last_time = peer->epoch;
index c10fec12af13dad7f0a6d6d2eb651495211ef98d..5599b757d3477d34a9f566c2f0b499c3d31d09d7 100644 (file)
@@ -261,9 +261,9 @@ ntp_monitor(
        md->mode = (u_char) mode;
        md->version = PKT_VERSION(pkt->li_vn_mode);
        md->interface = rbufp->dstadr;
-       md->cast_flags = ((rbufp->dstadr->flags & INT_MULTICAST) &&
+       md->cast_flags = (u_char)(((rbufp->dstadr->flags & INT_MULTICAST) &&
            rbufp->fd == md->interface->fd) ? MDF_MCAST: rbufp->fd ==
-               md->interface->bfd ? MDF_BCAST : MDF_UCAST;
+               md->interface->bfd ? MDF_BCAST : MDF_UCAST);
 
        /*
         * Drop him into front of the hash table. Also put him on top of
index 2ae9a282bc21fac9909f277f8fbf9c0a1dfd1369..897221bf30205c9d4c1eb8f8b95dcab8712af3ba 100644 (file)
@@ -363,7 +363,10 @@ TSIP_decode (
                return 0;       
        }
 
-       if (up->rpt_buf[0] == (char) 0x8f) {
+       /*
+        * We cast both to u_char to as 0x8f uses the sign bit on a char
+        */
+       if ((u_char) up->rpt_buf[0] == (u_char) 0x8f) {
        /* 
         * Superpackets
         */
index 951c7352a2c3ce6004d0a87029a7271050b882d8..209fcaa854e064c2fec7e23f52d065bb372702d6 100644 (file)
 /* Define if you have the ANSI C header files.  */
 #define STDC_HEADERS 1
 
+/* Skip asynch rpc inclusion */
+#ifndef __RPCASYNC_H__
+#define __RPCASYNC_H__
+#endif
+
 /* Prevent inclusion of winsock.h in windows.h */
 #ifndef _WINSOCKAPI_
 #define _WINSOCKAPI_  
index 1e93bc45b1e20d3a70c7d3f856c5077d24ff8b87..09ff47a504773aa9c7020430988851847cd5cdfa 100644 (file)
@@ -8,6 +8,12 @@
  * 
  */
 
+/*
+ * Ignore nonstandard extension warning.
+ * This happens when including winioctl.h
+ */
+#pragma warning( disable : 4201)
+
 #include <config.h>
 #include <windows.h>
 #include <stdio.h>