Module Name: src Committed By: kardel Date: Wed Feb 1 20:48:02 UTC 2012
Modified Files: src/external/bsd/ntp: Makefile.inc src/external/bsd/ntp/dist/ntpd: ntp_control.c ntp_io.c ntp_refclock.c ntp_restrict.c refclock_jjy.c src/external/bsd/ntp/dist/ntpq: ntpq.c src/external/bsd/ntp/dist/sntp: crypto.c log.c main.c networking.c networking.h src/external/bsd/ntp/dist/sntp/libopts: numeric.c src/external/bsd/ntp/dist/sntp/libopts/autoopts: options.h src/external/bsd/ntp/dist/util: ntp-keygen-opts.c Log Message: back to WARNS=4 (constify and signedness corrections) To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/external/bsd/ntp/Makefile.inc cvs rdiff -u -r1.5 -r1.6 src/external/bsd/ntp/dist/ntpd/ntp_control.c cvs rdiff -u -r1.7 -r1.8 src/external/bsd/ntp/dist/ntpd/ntp_io.c cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ntp/dist/ntpd/ntp_refclock.c \ src/external/bsd/ntp/dist/ntpd/refclock_jjy.c cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/ntp/dist/ntpd/ntp_restrict.c cvs rdiff -u -r1.4 -r1.5 src/external/bsd/ntp/dist/ntpq/ntpq.c cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ntp/dist/sntp/crypto.c \ src/external/bsd/ntp/dist/sntp/main.c \ src/external/bsd/ntp/dist/sntp/networking.h cvs rdiff -u -r1.4 -r1.5 src/external/bsd/ntp/dist/sntp/log.c cvs rdiff -u -r1.5 -r1.6 src/external/bsd/ntp/dist/sntp/networking.c cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/ntp/dist/sntp/libopts/numeric.c cvs rdiff -u -r1.3 -r1.4 \ src/external/bsd/ntp/dist/sntp/libopts/autoopts/options.h cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ntp/dist/util/ntp-keygen-opts.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/external/bsd/ntp/Makefile.inc diff -u src/external/bsd/ntp/Makefile.inc:1.10 src/external/bsd/ntp/Makefile.inc:1.11 --- src/external/bsd/ntp/Makefile.inc:1.10 Wed Feb 1 07:46:20 2012 +++ src/external/bsd/ntp/Makefile.inc Wed Feb 1 20:48:01 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.10 2012/02/01 07:46:20 kardel Exp $ +# $NetBSD: Makefile.inc,v 1.11 2012/02/01 20:48:01 kardel Exp $ .if !defined(NTP_MAKEFILE_INC) NTP_MAKEFILE_INC=yes @@ -10,8 +10,8 @@ CWARNFLAGS.clang+= -Wno-unneeded-interna -Wno-format-security \ -Wno-parentheses -Wno-constant-logical-operand -#WARNS?= 4 -WARNS?= 0 +WARNS?= 4 + .include <bsd.own.mk> Index: src/external/bsd/ntp/dist/ntpd/ntp_control.c diff -u src/external/bsd/ntp/dist/ntpd/ntp_control.c:1.5 src/external/bsd/ntp/dist/ntpd/ntp_control.c:1.6 --- src/external/bsd/ntp/dist/ntpd/ntp_control.c:1.5 Wed Feb 1 07:46:22 2012 +++ src/external/bsd/ntp/dist/ntpd/ntp_control.c Wed Feb 1 20:48:01 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: ntp_control.c,v 1.5 2012/02/01 07:46:22 kardel Exp $ */ +/* $NetBSD: ntp_control.c,v 1.6 2012/02/01 20:48:01 kardel Exp $ */ /* * ntp_control.c - respond to control messages and send async traps @@ -700,11 +700,11 @@ process_control( * If the length is less than required for the header, or * it is a response or a fragment, ignore this. */ - if (rbufp->recv_length < CTL_HEADER_LEN + if (rbufp->recv_length < (int)CTL_HEADER_LEN || pkt->r_m_e_op & (CTL_RESPONSE|CTL_MORE|CTL_ERROR) || pkt->offset != 0) { DPRINTF(1, ("invalid format in control packet\n")); - if (rbufp->recv_length < CTL_HEADER_LEN) + if (rbufp->recv_length < (int)CTL_HEADER_LEN) numctltooshort++; if (pkt->r_m_e_op & CTL_RESPONSE) numctlinputresp++; @@ -1082,7 +1082,7 @@ ctl_putdbl( while (*cq != '\0') *cp++ = *cq++; *cp++ = '='; - NTP_INSIST((cp - buffer) < sizeof(buffer)); + NTP_INSIST((cp - buffer) < (int)sizeof(buffer)); snprintf(cp, sizeof(buffer) - (cp - buffer), "%.3f", ts); cp += strlen(cp); ctl_putdata(buffer, (unsigned)(cp - buffer), 0); @@ -1107,7 +1107,7 @@ ctl_putuint( *cp++ = *cq++; *cp++ = '='; - NTP_INSIST((cp - buffer) < sizeof(buffer)); + NTP_INSIST((cp - buffer) < (int)sizeof(buffer)); snprintf(cp, sizeof(buffer) - (cp - buffer), "%lu", uval); cp += strlen(cp); ctl_putdata(buffer, (unsigned)( cp - buffer ), 0); @@ -1138,7 +1138,7 @@ ctl_putfs( tm = gmtime(&fstamp); if (NULL == tm) return; - NTP_INSIST((cp - buffer) < sizeof(buffer)); + NTP_INSIST((cp - buffer) < (int)sizeof(buffer)); snprintf(cp, sizeof(buffer) - (cp - buffer), "%04d%02d%02d%02d%02d", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min); @@ -1167,7 +1167,7 @@ ctl_puthex( *cp++ = *cq++; *cp++ = '='; - NTP_INSIST((cp - buffer) < sizeof(buffer)); + NTP_INSIST((cp - buffer) < (int)sizeof(buffer)); snprintf(cp, sizeof(buffer) - (cp - buffer), "0x%lx", uval); cp += strlen(cp); ctl_putdata(buffer,(unsigned)( cp - buffer ), 0); @@ -1193,7 +1193,7 @@ ctl_putint( *cp++ = *cq++; *cp++ = '='; - NTP_INSIST((cp - buffer) < sizeof(buffer)); + NTP_INSIST((cp - buffer) < (int)sizeof(buffer)); snprintf(cp, sizeof(buffer) - (cp - buffer), "%ld", ival); cp += strlen(cp); ctl_putdata(buffer, (unsigned)( cp - buffer ), 0); @@ -1219,7 +1219,7 @@ ctl_putts( *cp++ = *cq++; *cp++ = '='; - NTP_INSIST((cp - buffer) < sizeof(buffer)); + NTP_INSIST((cp - buffer) < (int)sizeof(buffer)); snprintf(cp, sizeof(buffer) - (cp - buffer), "0x%08lx.%08lx", ts->l_ui & 0xffffffffUL, ts->l_uf & 0xffffffffUL); cp += strlen(cp); @@ -1251,7 +1251,7 @@ ctl_putadr( cq = numtoa(addr32); else cq = stoa(addr); - NTP_INSIST((cp - buffer) < sizeof(buffer)); + NTP_INSIST((cp - buffer) < (int)sizeof(buffer)); snprintf(cp, sizeof(buffer) - (cp - buffer), "%s", cq); cp += strlen(cp); ctl_putdata(buffer, (unsigned)(cp - buffer), 0); @@ -1288,7 +1288,7 @@ ctl_putrefid( iplim = iptr + sizeof(refid); for ( ; optr < oplim && iptr < iplim && '\0' != *iptr; iptr++, optr++) - if (isprint(*iptr)) + if (isprint((int)*iptr)) *optr = *iptr; else *optr = '.'; @@ -1321,7 +1321,7 @@ ctl_putarray( if (i == 0) i = NTP_SHIFT; i--; - NTP_INSIST((cp - buffer) < sizeof(buffer)); + NTP_INSIST((cp - buffer) < (int)sizeof(buffer)); snprintf(cp, sizeof(buffer) - (cp - buffer), " %.2f", arr[i] * 1e3); cp += strlen(cp); Index: src/external/bsd/ntp/dist/ntpd/ntp_io.c diff -u src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.7 src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.8 --- src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.7 Wed Feb 1 07:46:22 2012 +++ src/external/bsd/ntp/dist/ntpd/ntp_io.c Wed Feb 1 20:48:01 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: ntp_io.c,v 1.7 2012/02/01 07:46:22 kardel Exp $ */ +/* $NetBSD: ntp_io.c,v 1.8 2012/02/01 20:48:01 kardel Exp $ */ /* * ntp_io.c - input/output routines for ntpd. The socket-opening code @@ -209,7 +209,7 @@ static isc_boolean_t socket_multicast_di #ifdef DEBUG static void interface_dump (const endpt *); static void sockaddr_dump (const sockaddr_u *); -static void print_interface (const endpt *, char *, char *); +static void print_interface (const endpt *, const char *, const char *); #define DPRINT_INTERFACE(level, args) do { if (debug >= (level)) { print_interface args; } } while (0) #else #define DPRINT_INTERFACE(level, args) do {} while (0) @@ -623,7 +623,7 @@ sockaddr_dump(const sockaddr_u *psau) * print_interface - helper to output debug information */ static void -print_interface(const endpt *iface, char *pfx, char *sfx) +print_interface(const endpt *iface, const char *pfx, const char *sfx) { printf("%sinterface #%d: fd=%d, bfd=%d, name=%s, flags=0x%x, ifindex=%u, sin=%s", pfx, @@ -3865,7 +3865,7 @@ calc_addr_distance( found_greater = FALSE; a1_greater = FALSE; /* suppress pot. uninit. warning */ - for (i = 0; i < sizeof(NSRCADR6(a1)); i++) { + for (i = 0; i < (int)sizeof(NSRCADR6(a1)); i++) { if (!found_greater && NSRCADR6(a1)[i] != NSRCADR6(a2)[i]) { found_greater = TRUE; @@ -3908,7 +3908,7 @@ cmp_addr_distance( return 1; } - for (i = 0; i < sizeof(NSRCADR6(d1)); i++) { + for (i = 0; i < (int)sizeof(NSRCADR6(d1)); i++) { if (NSRCADR6(d1)[i] < NSRCADR6(d2)[i]) return -1; else if (NSRCADR6(d1)[i] > NSRCADR6(d2)[i]) Index: src/external/bsd/ntp/dist/ntpd/ntp_refclock.c diff -u src/external/bsd/ntp/dist/ntpd/ntp_refclock.c:1.3 src/external/bsd/ntp/dist/ntpd/ntp_refclock.c:1.4 --- src/external/bsd/ntp/dist/ntpd/ntp_refclock.c:1.3 Wed Feb 1 07:46:22 2012 +++ src/external/bsd/ntp/dist/ntpd/ntp_refclock.c Wed Feb 1 20:48:01 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: ntp_refclock.c,v 1.3 2012/02/01 07:46:22 kardel Exp $ */ +/* $NetBSD: ntp_refclock.c,v 1.4 2012/02/01 20:48:01 kardel Exp $ */ /* * ntp_refclock - processing support for reference clocks @@ -514,7 +514,7 @@ refclock_sample( if (debug) printf( "refclock_sample: n %d offset %.6f disp %.6f jitter %.6f\n", - n, pp->offset, pp->disp, pp->jitter); + (int)n, pp->offset, pp->disp, pp->jitter); #endif return (int)n; } Index: src/external/bsd/ntp/dist/ntpd/refclock_jjy.c diff -u src/external/bsd/ntp/dist/ntpd/refclock_jjy.c:1.3 src/external/bsd/ntp/dist/ntpd/refclock_jjy.c:1.4 --- src/external/bsd/ntp/dist/ntpd/refclock_jjy.c:1.3 Wed Feb 1 07:46:22 2012 +++ src/external/bsd/ntp/dist/ntpd/refclock_jjy.c Wed Feb 1 20:48:01 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: refclock_jjy.c,v 1.3 2012/02/01 07:46:22 kardel Exp $ */ +/* $NetBSD: refclock_jjy.c,v 1.4 2012/02/01 20:48:01 kardel Exp $ */ /* * refclock_jjy - clock driver for JJY receivers @@ -272,9 +272,9 @@ struct refclock refclock_jjy = { static struct { - char commandNumber ; - char *commandLog ; - char *command ; + const char commandNumber ; + const char *commandLog ; + const char *command ; int commandLength ; } tristate_jjy01_command_sequence[] = { @@ -653,7 +653,7 @@ static int jjy_receive_tristate_jjy01 ( struct recvbuf *rbufp ) { - static char *sFunctionName = "jjy_receive_tristate_jjy01" ; + static const char *sFunctionName = "jjy_receive_tristate_jjy01" ; struct jjyunit *up ; struct refclockproc *pp ; @@ -667,7 +667,7 @@ jjy_receive_tristate_jjy01 ( struct recv char sLogText [ MAX_LOGTEXT ], sReplyText [ MAX_LOGTEXT ] ; - char *pCmd ; + const char *pCmd ; int iCmdLen ; /* @@ -841,7 +841,7 @@ jjy_receive_tristate_jjy01 ( struct recv static int jjy_receive_cdex_jst2000 ( struct recvbuf *rbufp ) { - static char *sFunctionName = "jjy_receive_cdex_jst2000" ; + static const char *sFunctionName = "jjy_receive_cdex_jst2000" ; struct jjyunit *up ; struct refclockproc *pp ; @@ -919,7 +919,7 @@ jjy_receive_cdex_jst2000 ( struct recvbu static int jjy_receive_echokeisokuki_lt2000 ( struct recvbuf *rbufp ) { - static char *sFunctionName = "jjy_receive_echokeisokuki_lt2000" ; + static const char *sFunctionName = "jjy_receive_echokeisokuki_lt2000" ; struct jjyunit *up ; struct refclockproc *pp ; @@ -1077,7 +1077,7 @@ static int jjy_receive_citizentic_jjy200 ( struct recvbuf *rbufp ) { - static char *sFunctionName = "jjy_receive_citizentic_jjy200" ; + static const char *sFunctionName = "jjy_receive_citizentic_jjy200" ; struct jjyunit *up ; struct refclockproc *pp ; @@ -1229,12 +1229,12 @@ static void jjy_poll_tristate_jjy01 ( int unit, struct peer *peer ) { - static char *sFunctionName = "jjy_poll_tristate_jjy01" ; + static const char *sFunctionName = "jjy_poll_tristate_jjy01" ; struct jjyunit *up; struct refclockproc *pp; - char *pCmd ; + const char *pCmd ; int iCmdLen ; pp = peer->procptr; @@ -1350,7 +1350,7 @@ static void printableString ( char *sOutput, int iOutputLen, char *sInput, int iInputLen ) { - char *printableControlChar[] = { + const char *printableControlChar[] = { "<NUL>", "<SOH>", "<STX>", "<ETX>", "<EOT>", "<ENQ>", "<ACK>", "<BEL>", "<BS>" , "<HT>" , "<LF>" , "<VT>" , @@ -1364,7 +1364,7 @@ printableString ( char *sOutput, int iOu int i, j, n ; for ( i = j = 0 ; i < iInputLen && j < iOutputLen ; i ++ ) { - if ( isprint( sInput[i] ) ) { + if ( isprint( (int)sInput[i] ) ) { n = 1 ; if ( j + 1 >= iOutputLen ) break ; Index: src/external/bsd/ntp/dist/ntpd/ntp_restrict.c diff -u src/external/bsd/ntp/dist/ntpd/ntp_restrict.c:1.1.1.2 src/external/bsd/ntp/dist/ntpd/ntp_restrict.c:1.2 --- src/external/bsd/ntp/dist/ntpd/ntp_restrict.c:1.1.1.2 Tue Jan 31 21:26:46 2012 +++ src/external/bsd/ntp/dist/ntpd/ntp_restrict.c Wed Feb 1 20:48:01 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: ntp_restrict.c,v 1.1.1.2 2012/01/31 21:26:46 kardel Exp $ */ +/* $NetBSD: ntp_restrict.c,v 1.2 2012/02/01 20:48:01 kardel Exp $ */ /* * ntp_restrict.c - determine host restrictions @@ -48,7 +48,7 @@ #define MASK_IPV6_ADDR(dst, src, msk) \ do { \ int idx; \ - for (idx = 0; idx < COUNTOF((dst)->s6_addr); idx++) { \ + for (idx = 0; idx < (int)COUNTOF((dst)->s6_addr); idx++) { \ (dst)->s6_addr[idx] = (src)->s6_addr[idx] \ & (msk)->s6_addr[idx]; \ } \ @@ -294,7 +294,7 @@ match_restrict6_addr( MASK_IPV6_ADDR(&masked, addr, &res->u.v6.mask); if (ADDR6_EQ(&masked, &res->u.v6.addr) && (!(RESM_NTPONLY & res->mflags) - || NTP_PORT == port)) + || NTP_PORT == (int)port)) break; } return res; Index: src/external/bsd/ntp/dist/ntpq/ntpq.c diff -u src/external/bsd/ntp/dist/ntpq/ntpq.c:1.4 src/external/bsd/ntp/dist/ntpq/ntpq.c:1.5 --- src/external/bsd/ntp/dist/ntpq/ntpq.c:1.4 Wed Feb 1 07:46:23 2012 +++ src/external/bsd/ntp/dist/ntpq/ntpq.c Wed Feb 1 20:48:01 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: ntpq.c,v 1.4 2012/02/01 07:46:23 kardel Exp $ */ +/* $NetBSD: ntpq.c,v 1.5 2012/02/01 20:48:01 kardel Exp $ */ /* * ntpq - query an NTP server using mode 6 commands @@ -384,7 +384,7 @@ struct sock_timeval tvsout = { DEFSTIMEO l_fp delay_time; /* delay time */ char currenthost[LENHOSTNAME]; /* current host name */ int currenthostisnum; /* is prior text from IP? */ -struct sockaddr_in hostaddr = { 0 }; /* host address */ +struct sockaddr_in hostaddr; /* host address */ int showhostnames = 1; /* show host names by default */ int ai_fam_templ; /* address family */ @@ -896,7 +896,7 @@ getresponse( "ERR_INCOMPLETE: Received fragments:\n"); for (f = 0; f < numfrags; f++) fprintf(stderr, - "%2u: %5d %5d\t%3d octets\n", + "%2zu: %5d %5d\t%3d octets\n", f, offsets[f], offsets[f] + counts[f], @@ -935,7 +935,7 @@ getresponse( /* * Check for format errors. Bug proofing. */ - if (n < CTL_HEADER_LEN) { + if (n < (int)CTL_HEADER_LEN) { if (debug) printf("Short (%d byte) packet received\n", n); continue; @@ -1031,7 +1031,7 @@ getresponse( if (n < shouldbesize) { printf("Response packet claims %u octets " - "payload, above %d received\n", + "payload, above %ld received\n", count, n - CTL_HEADER_LEN ); @@ -1083,7 +1083,7 @@ getresponse( if ((int)count > (n - CTL_HEADER_LEN)) { if (debug) printf("Received count of %d octets, " - "data in packet is %d\n", + "data in packet is %lu\n", count, n-CTL_HEADER_LEN); continue; } @@ -1187,7 +1187,7 @@ getresponse( *rsize = offsets[f-1] + counts[f-1]; if (debug) fprintf(stderr, - "%u packets reassembled into response\n", + "%zu packets reassembled into response\n", numfrags); return 0; } @@ -2230,7 +2230,7 @@ help( for (row = 0; row < rows; row++) { for (word = row; word < words; word += rows) - fprintf(fp, "%-*.*s", col, col-1, + fprintf(fp, "%-*.*s", (int)col, (int)col-1, list[word]); fprintf(fp, "\n"); } @@ -3258,7 +3258,7 @@ tstflags( *cp++ = ' '; cb--; } - for (i = 0; i < COUNTOF(tstflagnames); i++) { + for (i = 0; i < (int)COUNTOF(tstflagnames); i++) { if (val & 0x1) { snprintf(cp, cb, "%s%s", sep, tstflagnames[i]); Index: src/external/bsd/ntp/dist/sntp/crypto.c diff -u src/external/bsd/ntp/dist/sntp/crypto.c:1.3 src/external/bsd/ntp/dist/sntp/crypto.c:1.4 --- src/external/bsd/ntp/dist/sntp/crypto.c:1.3 Wed Feb 1 07:46:23 2012 +++ src/external/bsd/ntp/dist/sntp/crypto.c Wed Feb 1 20:48:01 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: crypto.c,v 1.3 2012/02/01 07:46:23 kardel Exp $ */ +/* $NetBSD: crypto.c,v 1.4 2012/02/01 20:48:01 kardel Exp $ */ #include <config.h> #include "crypto.h" @@ -53,7 +53,7 @@ auth_md5( int authentic; char digest[20]; - if (mac_size > sizeof(digest)) + if (mac_size > (int)sizeof(digest)) return 0; hash_len = make_mac(pkt_data, pkt_size, sizeof(digest), cmp_key, digest); Index: src/external/bsd/ntp/dist/sntp/main.c diff -u src/external/bsd/ntp/dist/sntp/main.c:1.3 src/external/bsd/ntp/dist/sntp/main.c:1.4 --- src/external/bsd/ntp/dist/sntp/main.c:1.3 Wed Feb 1 07:46:23 2012 +++ src/external/bsd/ntp/dist/sntp/main.c Wed Feb 1 20:48:01 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.3 2012/02/01 07:46:23 kardel Exp $ */ +/* $NetBSD: main.c,v 1.4 2012/02/01 20:48:01 kardel Exp $ */ #include <config.h> @@ -254,7 +254,7 @@ handle_pkt ( #if SIZEOF_TIME_T == 4 sscanf(p_SNTP_PRETEND_TIME, "%ld", &pretend_time); #elif SIZEOF_TIME_T == 8 - sscanf(p_SNTP_PRETEND_TIME, "%lld", &pretend_time); + sscanf(p_SNTP_PRETEND_TIME, "%zd", &pretend_time); #else # include "GRONK: unexpected value for SIZEOF_TIME_T" #endif Index: src/external/bsd/ntp/dist/sntp/networking.h diff -u src/external/bsd/ntp/dist/sntp/networking.h:1.3 src/external/bsd/ntp/dist/sntp/networking.h:1.4 --- src/external/bsd/ntp/dist/sntp/networking.h:1.3 Wed Feb 1 07:46:23 2012 +++ src/external/bsd/ntp/dist/sntp/networking.h Wed Feb 1 20:48:01 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: networking.h,v 1.3 2012/02/01 07:46:23 kardel Exp $ */ +/* $NetBSD: networking.h,v 1.4 2012/02/01 20:48:01 kardel Exp $ */ #ifndef NETWORKING_H #define NETWORKING_H @@ -60,7 +60,7 @@ int recv_bcst_data (SOCKET rsock, char * int recv_bcst_pkt (SOCKET rsock, struct pkt *rpkt, unsigned int rsize, sockaddr_u *sas); -int process_pkt (struct pkt *rpkt, sockaddr_u *sas, int pkt_len, int mode, struct pkt *spkt, char * func_name); +int process_pkt (struct pkt *rpkt, sockaddr_u *sas, int pkt_len, int mode, struct pkt *spkt, const char * func_name); /* Shortened peer structure. Not absolutely necessary yet */ struct speer { Index: src/external/bsd/ntp/dist/sntp/log.c diff -u src/external/bsd/ntp/dist/sntp/log.c:1.4 src/external/bsd/ntp/dist/sntp/log.c:1.5 --- src/external/bsd/ntp/dist/sntp/log.c:1.4 Wed Feb 1 07:46:23 2012 +++ src/external/bsd/ntp/dist/sntp/log.c Wed Feb 1 20:48:01 2012 @@ -1,10 +1,10 @@ -/* $NetBSD: log.c,v 1.4 2012/02/01 07:46:23 kardel Exp $ */ +/* $NetBSD: log.c,v 1.5 2012/02/01 20:48:01 kardel Exp $ */ #include <config.h> #include "log.h" -char *progname = "sntp"; /* for msyslog use too */ +const char *progname = "sntp"; /* for msyslog use too */ static void cleanup_log(void); Index: src/external/bsd/ntp/dist/sntp/networking.c diff -u src/external/bsd/ntp/dist/sntp/networking.c:1.5 src/external/bsd/ntp/dist/sntp/networking.c:1.6 --- src/external/bsd/ntp/dist/sntp/networking.c:1.5 Wed Feb 1 07:46:23 2012 +++ src/external/bsd/ntp/dist/sntp/networking.c Wed Feb 1 20:48:01 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: networking.c,v 1.5 2012/02/01 07:46:23 kardel Exp $ */ +/* $NetBSD: networking.c,v 1.6 2012/02/01 20:48:01 kardel Exp $ */ #include <config.h> #include "networking.h" @@ -20,7 +20,7 @@ resolve_hosts ( int pref_family ) { - register unsigned int a; + register int a; unsigned int resc; struct addrinfo **tres; @@ -197,7 +197,7 @@ recv_bcst_data ( } mdevadr.imr_multiaddr.s_addr = NSRCADR(sas); mdevadr.imr_interface.s_addr = htonl(INADDR_ANY); - if (mdevadr.imr_multiaddr.s_addr == -1) { + if (mdevadr.imr_multiaddr.s_addr == ~(unsigned)0) { if (ENABLED_OPT(NORMALVERBOSE)) { printf("sntp recv_bcst_data: %s:%d is not a broad-/multicast address, aborting...\n", stoa(sas), SRCPORT(sas)); @@ -293,7 +293,7 @@ process_pkt ( int pkt_len, int mode, struct pkt *spkt, - char * func_name + const char * func_name ) { unsigned int key_id = 0; @@ -313,7 +313,7 @@ process_pkt ( * extension field is present, so we subtract the length of the * field and go around again. */ - if (pkt_len < LEN_PKT_NOMAC || (pkt_len & 3) != 0) { + if (pkt_len < (int)LEN_PKT_NOMAC || (pkt_len & 3) != 0) { unusable: if (ENABLED_OPT(NORMALVERBOSE)) printf("sntp %s: Funny packet length: %i. Discarding package.\n", func_name, pkt_len); Index: src/external/bsd/ntp/dist/sntp/libopts/numeric.c diff -u src/external/bsd/ntp/dist/sntp/libopts/numeric.c:1.1.1.2 src/external/bsd/ntp/dist/sntp/libopts/numeric.c:1.2 --- src/external/bsd/ntp/dist/sntp/libopts/numeric.c:1.1.1.2 Tue Jan 31 21:27:49 2012 +++ src/external/bsd/ntp/dist/sntp/libopts/numeric.c Wed Feb 1 20:48:01 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: numeric.c,v 1.1.1.2 2012/01/31 21:27:49 kardel Exp $ */ +/* $NetBSD: numeric.c,v 1.2 2012/02/01 20:48:01 kardel Exp $ */ /** @@ -40,7 +40,7 @@ * Show information about a numeric option with range constraints. =*/ void -optionShowRange(tOptions* pOpts, tOptDesc* pOD, void * rng_table, int rng_ct) +optionShowRange(tOptions* pOpts, tOptDesc* pOD, const void * rng_table, int rng_ct) { static char const bullet[] = "\t\t\t\t- "; static char const deepin[] = "\t\t\t\t "; Index: src/external/bsd/ntp/dist/sntp/libopts/autoopts/options.h diff -u src/external/bsd/ntp/dist/sntp/libopts/autoopts/options.h:1.3 src/external/bsd/ntp/dist/sntp/libopts/autoopts/options.h:1.4 --- src/external/bsd/ntp/dist/sntp/libopts/autoopts/options.h:1.3 Wed Feb 1 07:46:30 2012 +++ src/external/bsd/ntp/dist/sntp/libopts/autoopts/options.h Wed Feb 1 20:48:01 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: options.h,v 1.3 2012/02/01 07:46:30 kardel Exp $ */ +/* $NetBSD: options.h,v 1.4 2012/02/01 20:48:01 kardel Exp $ */ /* -*- buffer-read-only: t -*- vi: set ro: * @@ -1040,7 +1040,7 @@ extern void optionResetOpt(tOptions*, tO extern void optionSetMembers(tOptions*, tOptDesc*, char const * const *, unsigned int); -extern void optionShowRange(tOptions*, tOptDesc*, void *, int); +extern void optionShowRange(tOptions*, tOptDesc*, const void *, int); extern void optionStackArg(tOptions*, tOptDesc*); Index: src/external/bsd/ntp/dist/util/ntp-keygen-opts.c diff -u src/external/bsd/ntp/dist/util/ntp-keygen-opts.c:1.3 src/external/bsd/ntp/dist/util/ntp-keygen-opts.c:1.4 --- src/external/bsd/ntp/dist/util/ntp-keygen-opts.c:1.3 Wed Feb 1 07:46:30 2012 +++ src/external/bsd/ntp/dist/util/ntp-keygen-opts.c Wed Feb 1 20:48:02 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: ntp-keygen-opts.c,v 1.3 2012/02/01 07:46:30 kardel Exp $ */ +/* $NetBSD: ntp-keygen-opts.c,v 1.4 2012/02/01 20:48:02 kardel Exp $ */ /* * EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.c) @@ -858,7 +858,7 @@ doOptModulus(tOptions* pOptions, tOptDes emit_ranges: - optionShowRange(pOptions, pOptDesc, (void *)rng, 1); + optionShowRange(pOptions, pOptDesc, (const void *)rng, 1); } #endif /* defined OPENSSL */ /* extracted from optmain.tlib near line 128 */