From: Harlan Stenn Date: Sun, 22 Apr 2001 09:51:03 +0000 (-0000) Subject: Many files: X-Git-Tag: NTP_4_0_99_M~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3a5e0863e7e1cdd66142fa43be63e4e3016175c;p=thirdparty%2Fntp.git Many files: * util/hist.c: * ntptrace/ntptrace.c: * ntpq/ntpq.c: * ntpdc/ntpdc.c: * ntpdate/ntptimeset.c: * ntpdate/ntpdate.c: * ntpd/refclock_parse.c: * ntpd/refclock_msfees.c: * ntpd/refclock_jupiter.c: * ntpd/ntp_refclock.c: * ntpd/ntp_io.c: * libparse/clk_wharton.c: * libparse/clk_varitext.c: * libparse/clk_trimtaip.c: * libparse/clk_schmid.c: * libparse/clk_rcc8000.c: * libparse/clk_rawdcf.c: * libparse/clk_meinberg.c: * libparse/clk_hopf6021.c: * libparse/clk_dcf7000.c: * libparse/clk_computime.c: Lint. From: Simon Burge bk: 3ae2a987_Any0L1_wxk91kE-OkOQ3A --- diff --git a/ChangeLog b/ChangeLog index b666598932..48aa9e567f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,28 @@ +2001-04-22 Harlan Stenn + + * util/hist.c: + * ntptrace/ntptrace.c: + * ntpq/ntpq.c: + * ntpdc/ntpdc.c: + * ntpdate/ntptimeset.c: + * ntpdate/ntpdate.c: + * ntpd/refclock_parse.c: + * ntpd/refclock_msfees.c: + * ntpd/refclock_jupiter.c: + * ntpd/ntp_refclock.c: + * ntpd/ntp_io.c: + * libparse/clk_wharton.c: + * libparse/clk_varitext.c: + * libparse/clk_trimtaip.c: + * libparse/clk_schmid.c: + * libparse/clk_rcc8000.c: + * libparse/clk_rawdcf.c: + * libparse/clk_meinberg.c: + * libparse/clk_hopf6021.c: + * libparse/clk_dcf7000.c: + * libparse/clk_computime.c: + Lint. From: Simon Burge + 2001-04-21 Harlan Stenn * ntpd/refclock_nmea.c (nmea_receive): Fixes. diff --git a/libparse/clk_computime.c b/libparse/clk_computime.c index 5a155cf35f..3312b3f1b0 100644 --- a/libparse/clk_computime.c +++ b/libparse/clk_computime.c @@ -137,7 +137,7 @@ inp_computime( { unsigned int rtc; - parseprintf(DD_PARSE, ("inp_computime(0x%x, 0x%x, ...)\n", (int)parseio, (int)ch)); + parseprintf(DD_PARSE, ("inp_computime(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); switch (ch) { diff --git a/libparse/clk_dcf7000.c b/libparse/clk_dcf7000.c index e815e9d324..30506c5fcd 100644 --- a/libparse/clk_dcf7000.c +++ b/libparse/clk_dcf7000.c @@ -137,7 +137,7 @@ inp_dcf7000( { unsigned int rtc; - parseprintf(DD_PARSE, ("inp_dcf7000(0x%x, 0x%x, ...)\n", (int)parseio, (int)ch)); + parseprintf(DD_PARSE, ("inp_dcf7000(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); switch (ch) { diff --git a/libparse/clk_hopf6021.c b/libparse/clk_hopf6021.c index cd1e821851..b2d53cd364 100644 --- a/libparse/clk_hopf6021.c +++ b/libparse/clk_hopf6021.c @@ -226,7 +226,7 @@ inp_hopf6021( { unsigned int rtc; - parseprintf(DD_PARSE, ("inp_hopf6021(0x%x, 0x%x, ...)\n", (int)parseio, (int)ch)); + parseprintf(DD_PARSE, ("inp_hopf6021(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); switch (ch) { diff --git a/libparse/clk_meinberg.c b/libparse/clk_meinberg.c index 504ddf14ef..87c7fdeb1d 100644 --- a/libparse/clk_meinberg.c +++ b/libparse/clk_meinberg.c @@ -409,7 +409,7 @@ mbg_input( { unsigned int rtc; - parseprintf(DD_PARSE, ("mbg_input(0x%x, 0x%x, ...)\n", (int)parseio, (int)ch)); + parseprintf(DD_PARSE, ("mbg_input(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); switch (ch) { @@ -577,7 +577,7 @@ gps_input( msg_buf = (struct msg_buf *)parseio->parse_pdata; - parseprintf(DD_PARSE, ("gps_input(0x%x, 0x%x, ...)\n", (int)parseio, (int)ch)); + parseprintf(DD_PARSE, ("gps_input(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); if (!msg_buf) return PARSE_INP_SKIP; diff --git a/libparse/clk_rawdcf.c b/libparse/clk_rawdcf.c index 65592ce45a..40ec8ad134 100644 --- a/libparse/clk_rawdcf.c +++ b/libparse/clk_rawdcf.c @@ -546,7 +546,7 @@ inp_rawdcf( { static struct timeval timeout = { 1, 500000 }; /* 1.5 secongs denote second #60 */ - parseprintf(DD_PARSE, ("inp_rawdcf(0x%x, 0x%x, ...)\n", (int)parseio, (int)ch)); + parseprintf(DD_PARSE, ("inp_rawdcf(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); parseio->parse_dtime.parse_stime = *tstamp; /* collect timestamp */ diff --git a/libparse/clk_rcc8000.c b/libparse/clk_rcc8000.c index 863e5d4655..23e676359b 100644 --- a/libparse/clk_rcc8000.c +++ b/libparse/clk_rcc8000.c @@ -140,7 +140,7 @@ inp_rcc8000( { unsigned int rtc; - parseprintf(DD_PARSE, ("inp_rcc8000(0x%x, 0x%x, ...)\n", (int)parseio, (int)ch)); + parseprintf(DD_PARSE, ("inp_rcc8000(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); switch (ch) { diff --git a/libparse/clk_schmid.c b/libparse/clk_schmid.c index 8a0beaf673..52c0ef4d0c 100644 --- a/libparse/clk_schmid.c +++ b/libparse/clk_schmid.c @@ -184,7 +184,7 @@ inp_schmid( { unsigned int rtc; - parseprintf(DD_PARSE, ("inp_schmid(0x%x, 0x%x, ...)\n", (int)parseio, (int)ch)); + parseprintf(DD_PARSE, ("inp_schmid(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); switch (ch) { diff --git a/libparse/clk_trimtaip.c b/libparse/clk_trimtaip.c index 21b8420869..4453e2b506 100644 --- a/libparse/clk_trimtaip.c +++ b/libparse/clk_trimtaip.c @@ -126,7 +126,7 @@ inp_trimtaip( { unsigned int rtc; - parseprintf(DD_PARSE, ("inp_trimtaip(0x%x, 0x%x, ...)\n", (int)parseio, (int)ch)); + parseprintf(DD_PARSE, ("inp_trimtaip(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); switch (ch) { diff --git a/libparse/clk_varitext.c b/libparse/clk_varitext.c index c5c9059b60..8019e0ea38 100644 --- a/libparse/clk_varitext.c +++ b/libparse/clk_varitext.c @@ -169,7 +169,7 @@ inp_varitext( struct varitext *t = (struct varitext *)parseio->parse_pdata; int rtc; - parseprintf(DD_PARSE, ("inp_varitext(0x%x, 0x%x, ...)\n", (int)parseio, (int)ch)); + parseprintf(DD_PARSE, ("inp_varitext(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); if (!t) return PARSE_INP_SKIP; /* local data not allocated - sigh! */ diff --git a/libparse/clk_wharton.c b/libparse/clk_wharton.c index 7296f9aa37..6dfc971d18 100644 --- a/libparse/clk_wharton.c +++ b/libparse/clk_wharton.c @@ -134,7 +134,7 @@ inp_wharton_400a( { unsigned int rtc; - parseprintf(DD_PARSE, ("inp_wharton_400a(0x%x, 0x%x, ...)\n", (int)parseio, (int)ch)); + parseprintf(DD_PARSE, ("inp_wharton_400a(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); switch (ch) { diff --git a/ntpd/ntp_io.c b/ntpd/ntp_io.c index 48514fb02c..23c0cb735e 100644 --- a/ntpd/ntp_io.c +++ b/ntpd/ntp_io.c @@ -1161,7 +1161,7 @@ sendpkt( err = io_completion_port_sendto(inter, pkt, len, dest); if (err != ERROR_SUCCESS) #else - cc = sendto(inter->fd, (char *)pkt, len, 0, (struct sockaddr *)dest, + cc = sendto(inter->fd, (char *)pkt, (size_t)len, 0, (struct sockaddr *)dest, sizeof(struct sockaddr_in)); if (cc == -1) #endif diff --git a/ntpd/ntp_refclock.c b/ntpd/ntp_refclock.c index 7a112e90e8..e8eb5f91ce 100644 --- a/ntpd/ntp_refclock.c +++ b/ntpd/ntp_refclock.c @@ -480,7 +480,7 @@ refclock_sample( while (pp->codeproc != pp->coderecv) off[n++] = pp->filter[pp->codeproc++ % MAXSTAGE]; if (n > 1) - qsort((char *)off, n, sizeof(double), refclock_cmpl_fp); + qsort((char *)off, (size_t)n, sizeof(double), refclock_cmpl_fp); /* * Reject the furthest from the median of the samples until diff --git a/ntpd/refclock_jupiter.c b/ntpd/refclock_jupiter.c index 483984cceb..4d1d4c24db 100644 --- a/ntpd/refclock_jupiter.c +++ b/ntpd/refclock_jupiter.c @@ -680,7 +680,7 @@ jupiter_process(register struct peer *peer) */ for (i = 0; i < NSAMPLES; i++) off[i] = up->filter[i]; - qsort((char *)off, NSAMPLES, sizeof(l_fp), jupiter_cmpl_fp); + qsort((char *)off, (size_t)NSAMPLES, sizeof(l_fp), jupiter_cmpl_fp); /* * Reject the furthest from the median of NSAMPLES samples until diff --git a/ntpd/refclock_msfees.c b/ntpd/refclock_msfees.c index dd1c06db16..b1aaa5658f 100644 --- a/ntpd/refclock_msfees.c +++ b/ntpd/refclock_msfees.c @@ -1284,7 +1284,7 @@ ees_process( if (ees->dump_vals) dump_buf(coffs, 0, samples, "Raw data is:"); /* Sort the offsets, trim off the extremes, then choose one. */ - qsort((char *) coffs, (u_int)samples, sizeof(l_fp), offcompare); + qsort((char *) coffs, (size_t)samples, sizeof(l_fp), offcompare); noff = samples; i = 0; diff --git a/ntpd/refclock_parse.c b/ntpd/refclock_parse.c index ed44683e45..cfb9904e31 100644 --- a/ntpd/refclock_parse.c +++ b/ntpd/refclock_parse.c @@ -5163,9 +5163,9 @@ rawdcf_init_1( } #ifdef TIOCM_DTR - sl232 = sl232 & ~TIOCM_RTS | TIOCM_DTR; /* turn on DTR, clear RTS for power supply */ + sl232 = (sl232 & ~TIOCM_RTS) | TIOCM_DTR; /* turn on DTR, clear RTS for power supply */ #else - sl232 = sl232 & ~CIOCM_RTS | CIOCM_DTR; /* turn on DTR, clear RTS for power supply */ + sl232 = (sl232 & ~CIOCM_RTS) | CIOCM_DTR; /* turn on DTR, clear RTS for power supply */ #endif if (ioctl(parse->generic->io.fd, TIOCMSET, (caddr_t)&sl232) == -1) @@ -5210,9 +5210,9 @@ rawdcf_init_2( } #ifdef TIOCM_RTS - sl232 = sl232 & ~TIOCM_DTR | TIOCM_RTS; /* turn on RTS, clear DTR for power supply */ + sl232 = (sl232 & ~TIOCM_DTR) | TIOCM_RTS; /* turn on RTS, clear DTR for power supply */ #else - sl232 = sl232 & ~CIOCM_DTR | CIOCM_RTS; /* turn on RTS, clear DTR for power supply */ + sl232 = (sl232 & ~CIOCM_DTR) | CIOCM_RTS; /* turn on RTS, clear DTR for power supply */ #endif if (ioctl(parse->generic->io.fd, TIOCMSET, (caddr_t)&sl232) == -1) diff --git a/ntpdate/ntpdate.c b/ntpdate/ntpdate.c index 43813684c7..b01d539806 100644 --- a/ntpdate/ntpdate.c +++ b/ntpdate/ntpdate.c @@ -1654,7 +1654,7 @@ sendpkt( DWORD err; #endif /* SYS_WINNT */ - cc = sendto(fd, (char *)pkt, len, 0, (struct sockaddr *)dest, + cc = sendto(fd, (char *)pkt, (size_t)len, 0, (struct sockaddr *)dest, sizeof(struct sockaddr_in)); #ifndef SYS_WINNT if (cc == -1) { diff --git a/ntpdate/ntptimeset.c b/ntpdate/ntptimeset.c index 0077b009a1..95b70b690c 100644 --- a/ntpdate/ntptimeset.c +++ b/ntpdate/ntptimeset.c @@ -1969,7 +1969,7 @@ sendpkt( } - cc = sendto(fd, (char *)pkt, len, 0, (struct sockaddr *)dest, + cc = sendto(fd, (char *)pkt, (size_t)len, 0, (struct sockaddr *)dest, sizeof(struct sockaddr_in)); #ifndef SYS_WINNT if (cc == -1) { diff --git a/ntpdc/ntpdc.c b/ntpdc/ntpdc.c index 51543ece3b..09ba6333c8 100644 --- a/ntpdc/ntpdc.c +++ b/ntpdc/ntpdc.c @@ -488,7 +488,7 @@ sendpkt( int xdatalen ) { - if (send(sockfd, xdata, xdatalen, 0) == -1) { + if (send(sockfd, xdata, (size_t)xdatalen, 0) == -1) { warning("write to %s failed", currenthost, ""); return -1; } @@ -1298,9 +1298,9 @@ help( cmdsort[n++] = xcp->keyword; #ifdef QSORT_USES_VOID_P - qsort(cmdsort, n, sizeof(char *), helpsort); + qsort(cmdsort, (size_t)n, sizeof(char *), helpsort); #else - qsort((char *)cmdsort, n, sizeof(char *), helpsort); + qsort((char *)cmdsort, (size_t)n, sizeof(char *), helpsort); #endif maxlength = 0; diff --git a/ntpq/ntpq.c b/ntpq/ntpq.c index 52815f5d70..53faab48c1 100644 --- a/ntpq/ntpq.c +++ b/ntpq/ntpq.c @@ -670,7 +670,7 @@ sendpkt( printf("Sending %d octets\n", xdatalen); - if (send(sockfd, xdata, xdatalen, 0) == -1) { + if (send(sockfd, xdata, (size_t)xdatalen, 0) == -1) { warning("write to %s failed", currenthost, ""); return -1; } @@ -1907,9 +1907,9 @@ help( cmdsort[n++] = xcp->keyword; #ifdef QSORT_USES_VOID_P - qsort(cmdsort, (unsigned)n, sizeof(char *), helpsort); + qsort(cmdsort, (size_t)n, sizeof(char *), helpsort); #else - qsort((char *)cmdsort, n, sizeof(char *), helpsort); + qsort((char *)cmdsort, (size_t)n, sizeof(char *), helpsort); #endif maxlength = 0; @@ -3058,7 +3058,7 @@ sortassoc(void) #else (char *) #endif - assoc_cache, (unsigned)numassoc, + assoc_cache, (size_t)numassoc, sizeof(struct association), assoccmp); } diff --git a/ntptrace/ntptrace.c b/ntptrace/ntptrace.c index 6fd9ed7b2d..f7106ba2f1 100644 --- a/ntptrace/ntptrace.c +++ b/ntptrace/ntptrace.c @@ -618,7 +618,7 @@ sendpkt( { int cc; - cc = sendto(fd, (char *)pkt, len, 0, (struct sockaddr *)dest, + cc = sendto(fd, (char *)pkt, (size_t)len, 0, (struct sockaddr *)dest, sizeof(struct sockaddr_in)); if (cc == -1) { #ifndef SYS_WINNT diff --git a/util/hist.c b/util/hist.c index 5b11ff1851..b02d73fdd7 100644 --- a/util/hist.c +++ b/util/hist.c @@ -79,7 +79,7 @@ main( } if (n == 0) return; - qsort((char *)ovfl, (int)n, sizeof(long), col); + qsort((char *)ovfl, (size_t)n, sizeof(long), col); w = 0; j = 0; for (i = 0; i < n; i++) {