From: Danny Mayer Date: Sun, 20 Apr 2003 05:39:04 +0000 (-0400) Subject: Fix casting issues and other warnings. X-Git-Tag: NTP_4_1_80_RC1~44^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=991358d7e3e4de7584ca7f3e38ef5179afcff0ce;p=thirdparty%2Fntp.git Fix casting issues and other warnings. bk: 3ea23278ldgjtHXO-0Aj-2plhYMZ_Q --- diff --git a/ntpd/ntp_loopfilter.c b/ntpd/ntp_loopfilter.c index bd7e28607..61d271bf3 100644 --- a/ntpd/ntp_loopfilter.c +++ b/ntpd/ntp_loopfilter.c @@ -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; diff --git a/ntpd/ntp_monitor.c b/ntpd/ntp_monitor.c index c10fec12a..5599b757d 100644 --- a/ntpd/ntp_monitor.c +++ b/ntpd/ntp_monitor.c @@ -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 diff --git a/ntpd/refclock_palisade.c b/ntpd/refclock_palisade.c index 2ae9a282b..897221bf3 100644 --- a/ntpd/refclock_palisade.c +++ b/ntpd/refclock_palisade.c @@ -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 */ diff --git a/ports/winnt/include/config.h b/ports/winnt/include/config.h index 951c7352a..209fcaa85 100644 --- a/ports/winnt/include/config.h +++ b/ports/winnt/include/config.h @@ -30,6 +30,11 @@ /* 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_ diff --git a/ports/winnt/ntpd/hopf_PCI_io.c b/ports/winnt/ntpd/hopf_PCI_io.c index 1e93bc45b..09ff47a50 100644 --- a/ports/winnt/ntpd/hopf_PCI_io.c +++ b/ports/winnt/ntpd/hopf_PCI_io.c @@ -8,6 +8,12 @@ * */ +/* + * Ignore nonstandard extension warning. + * This happens when including winioctl.h + */ +#pragma warning( disable : 4201) + #include #include #include