Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/ntp back to WARNS=4 (constify and signedness co...



details:   https://anonhg.NetBSD.org/src/rev/a29b56f0d54e
branches:  trunk
changeset: 773416:a29b56f0d54e
user:      kardel <kardel%NetBSD.org@localhost>
date:      Wed Feb 01 20:48:01 2012 +0000

description:
back to WARNS=4 (constify and signedness corrections)

diffstat:

 external/bsd/ntp/Makefile.inc                         |   6 ++--
 external/bsd/ntp/dist/ntpd/ntp_control.c              |  24 ++++++++--------
 external/bsd/ntp/dist/ntpd/ntp_io.c                   |  10 +++---
 external/bsd/ntp/dist/ntpd/ntp_refclock.c             |   4 +-
 external/bsd/ntp/dist/ntpd/ntp_restrict.c             |   6 ++--
 external/bsd/ntp/dist/ntpd/refclock_jjy.c             |  26 +++++++++---------
 external/bsd/ntp/dist/ntpq/ntpq.c                     |  18 ++++++------
 external/bsd/ntp/dist/sntp/crypto.c                   |   4 +-
 external/bsd/ntp/dist/sntp/libopts/autoopts/options.h |   4 +-
 external/bsd/ntp/dist/sntp/libopts/numeric.c          |   4 +-
 external/bsd/ntp/dist/sntp/log.c                      |   4 +-
 external/bsd/ntp/dist/sntp/main.c                     |   4 +-
 external/bsd/ntp/dist/sntp/networking.c               |  10 +++---
 external/bsd/ntp/dist/sntp/networking.h               |   4 +-
 external/bsd/ntp/dist/util/ntp-keygen-opts.c          |   4 +-
 15 files changed, 66 insertions(+), 66 deletions(-)

diffs (truncated from 564 to 300 lines):

diff -r 2bb6a700dc1d -r a29b56f0d54e external/bsd/ntp/Makefile.inc
--- a/external/bsd/ntp/Makefile.inc     Wed Feb 01 18:55:32 2012 +0000
+++ b/external/bsd/ntp/Makefile.inc     Wed Feb 01 20:48:01 2012 +0000
@@ -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 @@
                        -Wno-format-security \
                        -Wno-parentheses -Wno-constant-logical-operand
 
-#WARNS?=       4
-WARNS?=        0
+WARNS?=        4
+
 
 .include <bsd.own.mk>
 
diff -r 2bb6a700dc1d -r a29b56f0d54e external/bsd/ntp/dist/ntpd/ntp_control.c
--- a/external/bsd/ntp/dist/ntpd/ntp_control.c  Wed Feb 01 18:55:32 2012 +0000
+++ b/external/bsd/ntp/dist/ntpd/ntp_control.c  Wed Feb 01 20:48:01 2012 +0000
@@ -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 @@
         * 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 @@
        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 @@
                *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 @@
        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 @@
                *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 @@
                *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 @@
                *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 @@
                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 @@
        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 @@
                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);
diff -r 2bb6a700dc1d -r a29b56f0d54e external/bsd/ntp/dist/ntpd/ntp_io.c
--- a/external/bsd/ntp/dist/ntpd/ntp_io.c       Wed Feb 01 18:55:32 2012 +0000
+++ b/external/bsd/ntp/dist/ntpd/ntp_io.c       Wed Feb 01 20:48:01 2012 +0000
@@ -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 @@
 #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 @@
  * 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 @@
 
        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 @@
                        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])
diff -r 2bb6a700dc1d -r a29b56f0d54e external/bsd/ntp/dist/ntpd/ntp_refclock.c
--- a/external/bsd/ntp/dist/ntpd/ntp_refclock.c Wed Feb 01 18:55:32 2012 +0000
+++ b/external/bsd/ntp/dist/ntpd/ntp_refclock.c Wed Feb 01 20:48:01 2012 +0000
@@ -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 @@
        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;
 }
diff -r 2bb6a700dc1d -r a29b56f0d54e external/bsd/ntp/dist/ntpd/ntp_restrict.c
--- a/external/bsd/ntp/dist/ntpd/ntp_restrict.c Wed Feb 01 18:55:32 2012 +0000
+++ b/external/bsd/ntp/dist/ntpd/ntp_restrict.c Wed Feb 01 20:48:01 2012 +0000
@@ -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 @@
                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;
diff -r 2bb6a700dc1d -r a29b56f0d54e external/bsd/ntp/dist/ntpd/refclock_jjy.c
--- a/external/bsd/ntp/dist/ntpd/refclock_jjy.c Wed Feb 01 18:55:32 2012 +0000
+++ b/external/bsd/ntp/dist/ntpd/refclock_jjy.c Wed Feb 01 20:48:01 2012 +0000
@@ -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 @@
 
 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 @@
 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 @@
 
        char    sLogText [ MAX_LOGTEXT ], sReplyText  [ MAX_LOGTEXT ] ;
 
-       char    *pCmd ;
+       const char *pCmd ;
        int     iCmdLen ;
 
        /*
@@ -841,7 +841,7 @@
 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 @@
 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 @@
 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 @@
 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 @@
 printableString ( char *sOutput, int iOutputLen, char *sInput, int iInputLen )
 {
 



Home | Main Index | Thread Index | Old Index