Source-Changes-HG archive

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

[src/trunk]: src/external/bsd/ntp Pretending that %d can print size_t on __LP...



details:   https://anonhg.NetBSD.org/src/rev/56ab85671bc6
branches:  trunk
changeset: 759265:56ab85671bc6
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Dec 04 23:08:32 2010 +0000

description:
Pretending that %d can print size_t on __LP64__, by turning off warnings
is not really a good idea.  Turn on the warnings and fix them. Unfortunately
there are a bunch of const-castaways... Should be fed upstream.

diffstat:

 external/bsd/ntp/Makefile.inc                         |    5 +-
 external/bsd/ntp/bin/Makefile.inc                     |    4 +-
 external/bsd/ntp/bin/ntpd/Makefile                    |    4 +-
 external/bsd/ntp/bin/sntp/Makefile                    |    4 +-
 external/bsd/ntp/dist/include/audio.h                 |    4 +-
 external/bsd/ntp/dist/include/icom.h                  |    4 +-
 external/bsd/ntp/dist/include/ntp_filegen.h           |    4 +-
 external/bsd/ntp/dist/include/ntp_fp.h                |    8 +-
 external/bsd/ntp/dist/include/ntp_stdlib.h            |    8 +-
 external/bsd/ntp/dist/include/ntpd.h                  |    8 +-
 external/bsd/ntp/dist/lib/isc/event.c                 |    6 +-
 external/bsd/ntp/dist/lib/isc/inet_ntop.c             |    6 +-
 external/bsd/ntp/dist/lib/isc/inet_pton.c             |    4 +-
 external/bsd/ntp/dist/lib/isc/result.c                |   24 +-
 external/bsd/ntp/dist/lib/isc/unix/file.c             |   16 +-
 external/bsd/ntp/dist/libntp/audio.c                  |    6 +-
 external/bsd/ntp/dist/libntp/authkeys.c               |    4 +-
 external/bsd/ntp/dist/libntp/authreadkeys.c           |   10 +-
 external/bsd/ntp/dist/libntp/hextoint.c               |    4 +-
 external/bsd/ntp/dist/libntp/humandate.c              |    4 +-
 external/bsd/ntp/dist/libntp/icom.c                   |    4 +-
 external/bsd/ntp/dist/libntp/modetoa.c                |    8 +-
 external/bsd/ntp/dist/libntp/ssl_init.c               |   10 +-
 external/bsd/ntp/dist/libopts/autoopts.c              |   11 +-
 external/bsd/ntp/dist/libopts/autoopts.h              |    7 +-
 external/bsd/ntp/dist/libopts/autoopts/options.h      |   10 +-
 external/bsd/ntp/dist/libopts/compat/pathfind.c       |    4 +-
 external/bsd/ntp/dist/libopts/configfile.c            |   10 +-
 external/bsd/ntp/dist/libopts/enumeration.c           |   18 +-
 external/bsd/ntp/dist/libopts/file.c                  |    6 +-
 external/bsd/ntp/dist/libopts/load.c                  |   14 +-
 external/bsd/ntp/dist/libopts/nested.c                |   29 +-
 external/bsd/ntp/dist/libopts/parse-duration.c        |   12 +-
 external/bsd/ntp/dist/libopts/putshell.c              |    4 +-
 external/bsd/ntp/dist/libopts/reset.c                 |    4 +-
 external/bsd/ntp/dist/libopts/save.c                  |   32 +-
 external/bsd/ntp/dist/libopts/stack.c                 |    4 +-
 external/bsd/ntp/dist/libopts/streqvcmp.c             |    6 +-
 external/bsd/ntp/dist/libopts/tokenize.c              |    4 +-
 external/bsd/ntp/dist/libopts/usage.c                 |    4 +-
 external/bsd/ntp/dist/libparse/clk_meinberg.c         |    4 +-
 external/bsd/ntp/dist/libparse/clk_rawdcf.c           |   22 +-
 external/bsd/ntp/dist/libparse/data_mbg.c             |    4 +-
 external/bsd/ntp/dist/libparse/info_trimble.c         |    6 +-
 external/bsd/ntp/dist/ntpd/ntp_config.c               |   30 +-
 external/bsd/ntp/dist/ntpd/ntp_control.c              |   36 ++--
 external/bsd/ntp/dist/ntpd/ntp_crypto.c               |   28 +-
 external/bsd/ntp/dist/ntpd/ntp_filegen.c              |    4 +-
 external/bsd/ntp/dist/ntpd/ntp_intres.c               |    8 +-
 external/bsd/ntp/dist/ntpd/ntp_io.c                   |   14 +-
 external/bsd/ntp/dist/ntpd/ntp_parser.c               |    6 +-
 external/bsd/ntp/dist/ntpd/ntp_parser.y               |   10 +-
 external/bsd/ntp/dist/ntpd/ntp_peer.c                 |    4 +-
 external/bsd/ntp/dist/ntpd/ntp_proto.c                |   24 +-
 external/bsd/ntp/dist/ntpd/ntp_request.c              |   16 +-
 external/bsd/ntp/dist/ntpd/ntp_scanner.c              |   23 +-
 external/bsd/ntp/dist/ntpd/refclock_acts.c            |    4 +-
 external/bsd/ntp/dist/ntpd/refclock_datum.c           |    6 +-
 external/bsd/ntp/dist/ntpd/refclock_jjy.c             |   42 ++---
 external/bsd/ntp/dist/ntpd/refclock_jupiter.c         |  117 +++++++-------
 external/bsd/ntp/dist/ntpd/refclock_neoclock4x.c      |    6 +-
 external/bsd/ntp/dist/ntpd/refclock_nmea.c            |    4 +-
 external/bsd/ntp/dist/ntpd/refclock_oncore.c          |  148 +++++++++--------
 external/bsd/ntp/dist/ntpd/refclock_parse.c           |   36 ++-
 external/bsd/ntp/dist/ntpd/refclock_pcf.c             |    4 +-
 external/bsd/ntp/dist/ntpdate/ntpdate.c               |    6 +-
 external/bsd/ntp/dist/ntpdc/ntpdc.c                   |   18 +-
 external/bsd/ntp/dist/ntpdc/ntpdc.h                   |    4 +-
 external/bsd/ntp/dist/ntpdc/ntpdc_ops.c               |   14 +-
 external/bsd/ntp/dist/ntpq/ntpq-subs.c                |   10 +-
 external/bsd/ntp/dist/ntpq/ntpq.c                     |   14 +-
 external/bsd/ntp/dist/ntpq/ntpq.h                     |    4 +-
 external/bsd/ntp/dist/sntp/crypto.c                   |   13 +-
 external/bsd/ntp/dist/sntp/libopts/autoopts.h         |    7 +-
 external/bsd/ntp/dist/sntp/libopts/autoopts/options.h |    4 +-
 external/bsd/ntp/dist/sntp/libopts/nested.c           |    6 +-
 external/bsd/ntp/dist/sntp/libopts/save.c             |   20 +-
 external/bsd/ntp/dist/sntp/libopts/stack.c            |    4 +-
 external/bsd/ntp/dist/sntp/log.c                      |    6 +-
 external/bsd/ntp/dist/sntp/log.h                      |    6 +-
 external/bsd/ntp/dist/sntp/main.c                     |    4 +-
 external/bsd/ntp/dist/sntp/networking.c               |   22 +-
 external/bsd/ntp/dist/sntp/networking.h               |    4 +-
 external/bsd/ntp/dist/util/jitter.h                   |    8 +-
 external/bsd/ntp/dist/util/ntp-keygen-opts.c          |    6 +-
 external/bsd/ntp/dist/util/ntp-keygen.c               |   53 +++---
 external/bsd/ntp/dist/util/ntptime.c                  |   15 +-
 external/bsd/ntp/lib/Makefile.inc                     |    3 +-
 88 files changed, 608 insertions(+), 587 deletions(-)

diffs (truncated from 4347 to 300 lines):

diff -r 6da62877d2c2 -r 56ab85671bc6 external/bsd/ntp/Makefile.inc
--- a/external/bsd/ntp/Makefile.inc     Sat Dec 04 17:41:18 2010 +0000
+++ b/external/bsd/ntp/Makefile.inc     Sat Dec 04 23:08:32 2010 +0000
@@ -1,12 +1,11 @@
-#      $NetBSD: Makefile.inc,v 1.4 2010/09/04 17:06:06 kardel Exp $
+#      $NetBSD: Makefile.inc,v 1.5 2010/12/04 23:08:32 christos Exp $
 
 .if !defined(NTP_MAKEFILE_INC)
 NTP_MAKEFILE_INC=yes
 
 USE_FORT?= yes # network client/server
 
-WARNS?=        0
-COPTS+=-Werror
+WARNS?=        5
 
 .include <bsd.own.mk>
 
diff -r 6da62877d2c2 -r 56ab85671bc6 external/bsd/ntp/bin/Makefile.inc
--- a/external/bsd/ntp/bin/Makefile.inc Sat Dec 04 17:41:18 2010 +0000
+++ b/external/bsd/ntp/bin/Makefile.inc Sat Dec 04 23:08:32 2010 +0000
@@ -1,5 +1,3 @@
-#      $NetBSD: Makefile.inc,v 1.2 2010/08/28 15:42:46 kardel Exp $
+#      $NetBSD: Makefile.inc,v 1.3 2010/12/04 23:08:33 christos Exp $
 
 .include "../Makefile.inc"
-
-WARNS?=                2
diff -r 6da62877d2c2 -r 56ab85671bc6 external/bsd/ntp/bin/ntpd/Makefile
--- a/external/bsd/ntp/bin/ntpd/Makefile        Sat Dec 04 17:41:18 2010 +0000
+++ b/external/bsd/ntp/bin/ntpd/Makefile        Sat Dec 04 23:08:32 2010 +0000
@@ -1,6 +1,6 @@
-#      $NetBSD: Makefile,v 1.6 2010/08/29 18:55:50 kardel Exp $
+#      $NetBSD: Makefile,v 1.7 2010/12/04 23:08:33 christos Exp $
 
-NOGCCERROR=yes
+#NOGCCERROR=yes
 
 .include <bsd.own.mk>
 
diff -r 6da62877d2c2 -r 56ab85671bc6 external/bsd/ntp/bin/sntp/Makefile
--- a/external/bsd/ntp/bin/sntp/Makefile        Sat Dec 04 17:41:18 2010 +0000
+++ b/external/bsd/ntp/bin/sntp/Makefile        Sat Dec 04 23:08:32 2010 +0000
@@ -1,6 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2010/08/28 15:42:45 kardel Exp $
-
-WARNS?=        1       # XXX -Wshadow -Wsign-compare -Wcast-qual
+# $NetBSD: Makefile,v 1.2 2010/12/04 23:08:33 christos Exp $
 
 USE_FORT?= yes # network client/server
 
diff -r 6da62877d2c2 -r 56ab85671bc6 external/bsd/ntp/dist/include/audio.h
--- a/external/bsd/ntp/dist/include/audio.h     Sat Dec 04 17:41:18 2010 +0000
+++ b/external/bsd/ntp/dist/include/audio.h     Sat Dec 04 23:08:32 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audio.h,v 1.1.1.1 2009/12/13 16:54:48 kardel Exp $     */
+/*     $NetBSD: audio.h,v 1.2 2010/12/04 23:08:33 christos Exp $       */
 
 /*
  * Header file for audio drivers
@@ -11,6 +11,6 @@
 /*
  * Function prototypes
  */
-int    audio_init              (char *, int, int);
+int    audio_init              (const char *, int, int);
 int    audio_gain              (int, int, int);
 void   audio_show              (void);
diff -r 6da62877d2c2 -r 56ab85671bc6 external/bsd/ntp/dist/include/icom.h
--- a/external/bsd/ntp/dist/include/icom.h      Sat Dec 04 17:41:18 2010 +0000
+++ b/external/bsd/ntp/dist/include/icom.h      Sat Dec 04 23:08:32 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: icom.h,v 1.1.1.1 2009/12/13 16:54:48 kardel Exp $      */
+/*     $NetBSD: icom.h,v 1.2 2010/12/04 23:08:33 christos Exp $        */
 
 /*
  * Header file for ICOM radios
@@ -85,5 +85,5 @@
 /*
  * Function prototypes
  */
-int    icom_init               (char *, int, int);
+int    icom_init               (const char *, int, int);
 int    icom_freq               (int, int, double);
diff -r 6da62877d2c2 -r 56ab85671bc6 external/bsd/ntp/dist/include/ntp_filegen.h
--- a/external/bsd/ntp/dist/include/ntp_filegen.h       Sat Dec 04 17:41:18 2010 +0000
+++ b/external/bsd/ntp/dist/include/ntp_filegen.h       Sat Dec 04 23:08:32 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ntp_filegen.h,v 1.1.1.1 2009/12/13 16:54:51 kardel Exp $       */
+/*     $NetBSD: ntp_filegen.h,v 1.2 2010/12/04 23:08:33 christos Exp $ */
 
 /*
  * ntp_filegen.h,v 3.9 1996/12/01 16:02:45 kardel Exp
@@ -52,5 +52,5 @@
 extern FILEGEN *filegen_get    (const char *);
 extern void    filegen_register (const char *, const char *, FILEGEN *);
 #ifdef DEBUG
-extern void    filegen_unregister(char *);
+extern void    filegen_unregister(const char *);
 #endif
diff -r 6da62877d2c2 -r 56ab85671bc6 external/bsd/ntp/dist/include/ntp_fp.h
--- a/external/bsd/ntp/dist/include/ntp_fp.h    Sat Dec 04 17:41:18 2010 +0000
+++ b/external/bsd/ntp/dist/include/ntp_fp.h    Sat Dec 04 23:08:32 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ntp_fp.h,v 1.1.1.1 2009/12/13 16:54:51 kardel Exp $    */
+/*     $NetBSD: ntp_fp.h,v 1.2 2010/12/04 23:08:33 christos Exp $      */
 
 /*
  * ntp_fp.h - definitions for NTP fixed/floating-point arithmetic
@@ -103,9 +103,9 @@
 /*
  * Conversions between the two fixed point types
  */
-#define        MFPTOFP(x_i, x_f)       (((x_i) >= 0x00010000) ? 0x7fffffff : \
-                               (((x_i) <= -0x00010000) ? 0x80000000 : \
-                               (((x_i)<<16) | (((x_f)>>16)&0xffff))))
+#define        MFPTOFP(x_i, x_f)       (((int)(x_i) >= 0x00010000) ? 0x7fffffff : \
+                               (((int)(x_i) <= -0x00010000) ? 0x80000000 : \
+                               (u_int)(((x_i)<<16) | (((x_f)>>16)&0xffff))))
 #define        LFPTOFP(v)              MFPTOFP((v)->l_i, (v)->l_f)
 
 #define UFPTOLFP(x, v) ((v)->l_ui = (u_fp)(x)>>16, (v)->l_uf = (x)<<16)
diff -r 6da62877d2c2 -r 56ab85671bc6 external/bsd/ntp/dist/include/ntp_stdlib.h
--- a/external/bsd/ntp/dist/include/ntp_stdlib.h        Sat Dec 04 17:41:18 2010 +0000
+++ b/external/bsd/ntp/dist/include/ntp_stdlib.h        Sat Dec 04 23:08:32 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ntp_stdlib.h,v 1.1.1.1 2009/12/13 16:54:53 kardel Exp $        */
+/*     $NetBSD: ntp_stdlib.h,v 1.2 2010/12/04 23:08:33 christos Exp $  */
 
 /*
  * ntp_stdlib.h - Prototypes for NTP lib.
@@ -82,18 +82,18 @@
 /* a_md5encrypt.c */
 extern int     MD5authdecrypt  (int, u_char *, u_int32 *, int, int);
 extern int     MD5authencrypt  (int, u_char *, u_int32 *, int);
-extern void    MD5auth_setkey  (keyid_t, int, const u_char *, const int);
+extern void    MD5auth_setkey  (keyid_t, int, const u_char *, size_t);
 extern u_int32 addr2refid      (sockaddr_u *);
 
 
 extern int     atoint          (const char *, long *);
 extern int     atouint         (const char *, u_long *);
 extern int     hextoint        (const char *, u_long *);
-extern char *  humanlogtime    (void);
+extern const char *    humanlogtime    (void);
 extern char *  inttoa          (long);
 extern char *  mfptoa          (u_long, u_long, short);
 extern char *  mfptoms         (u_long, u_long, short);
-extern const char * modetoa    (int);
+extern const char * modetoa    (size_t);
 extern  const char * eventstr  (int);
 extern  const char * ceventstr (int);
 extern char *  statustoa       (int, int);
diff -r 6da62877d2c2 -r 56ab85671bc6 external/bsd/ntp/dist/include/ntpd.h
--- a/external/bsd/ntp/dist/include/ntpd.h      Sat Dec 04 17:41:18 2010 +0000
+++ b/external/bsd/ntp/dist/include/ntpd.h      Sat Dec 04 23:08:32 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ntpd.h,v 1.1.1.1 2009/12/13 16:54:50 kardel Exp $      */
+/*     $NetBSD: ntpd.h,v 1.2 2010/12/04 23:08:33 christos Exp $        */
 
 /*
  * ntpd.h - Prototypes for ntpd.
@@ -39,7 +39,7 @@
 struct ctl_var {
        u_short code;
        u_short flags;
-       char *text;
+       const char *text;
 };
 /*
  * Flag values
@@ -136,7 +136,7 @@
 extern struct peer *newpeer    (sockaddr_u *, struct interface *, int, int, int, int, u_int, u_char, int, keyid_t);
 extern void    peer_all_reset  (void);
 extern void    peer_clr_stats  (void);
-extern struct peer *peer_config (sockaddr_u *, struct interface *, int, int, int, int, u_int, int, keyid_t, u_char *);
+extern struct peer *peer_config (sockaddr_u *, struct interface *, int, int, int, int, u_int, int, keyid_t, const u_char *);
 extern void    peer_reset      (struct peer *);
 extern void    refresh_all_peerinterfaces (void);
 extern void    unpeer          (struct peer *);
@@ -173,7 +173,7 @@
 /* ntp_proto.c */
 extern void    transmit        (struct peer *);
 extern void    receive         (struct recvbuf *);
-extern void    peer_clear      (struct peer *, char *);
+extern void    peer_clear      (struct peer *, const char *);
 extern void    process_packet  (struct peer *, struct pkt *, u_int);
 extern void    clock_select    (void);
 
diff -r 6da62877d2c2 -r 56ab85671bc6 external/bsd/ntp/dist/lib/isc/event.c
--- a/external/bsd/ntp/dist/lib/isc/event.c     Sat Dec 04 17:41:18 2010 +0000
+++ b/external/bsd/ntp/dist/lib/isc/event.c     Sat Dec 04 23:08:32 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: event.c,v 1.1.1.1 2009/12/13 16:54:12 kardel Exp $     */
+/*     $NetBSD: event.c,v 1.2 2010/12/04 23:08:33 christos Exp $       */
 
 /*
  * Copyright (C) 2004, 2005, 2007  Internet Systems Consortium, Inc. ("ISC")
@@ -36,9 +36,7 @@
 
 static void
 destroy(isc_event_t *event) {
-       isc_mem_t *mctx = event->ev_destroy_arg;
-
-       isc_mem_put(mctx, event, event->ev_size);
+       isc_mem_put(event->ev_destroy_arg, event, event->ev_size);
 }
 
 isc_event_t *
diff -r 6da62877d2c2 -r 56ab85671bc6 external/bsd/ntp/dist/lib/isc/inet_ntop.c
--- a/external/bsd/ntp/dist/lib/isc/inet_ntop.c Sat Dec 04 17:41:18 2010 +0000
+++ b/external/bsd/ntp/dist/lib/isc/inet_ntop.c Sat Dec 04 23:08:32 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: inet_ntop.c,v 1.1.1.1 2009/12/13 16:54:15 kardel Exp $ */
+/*     $NetBSD: inet_ntop.c,v 1.2 2010/12/04 23:08:33 christos Exp $   */
 
 /*
  * Copyright (C) 2004, 2005, 2007  Internet Systems Consortium, Inc. ("ISC")
@@ -43,6 +43,7 @@
  * sizeof(int) < 4.  sizeof(int) > 4 is fine; all the world's not a VAX.
  */
 
+#ifdef notdef
 static const char *inet_ntop4(const unsigned char *src, char *dst,
                              size_t size);
 
@@ -50,7 +51,9 @@
 static const char *inet_ntop6(const unsigned char *src, char *dst,
                              size_t size);
 #endif
+#endif
 
+#ifdef notdef
 /*! char *
  * isc_net_ntop(af, src, dst, size)
  *     convert a network format address to presentation format.
@@ -202,3 +205,4 @@
        return (dst);
 }
 #endif /* AF_INET6 */
+#endif
diff -r 6da62877d2c2 -r 56ab85671bc6 external/bsd/ntp/dist/lib/isc/inet_pton.c
--- a/external/bsd/ntp/dist/lib/isc/inet_pton.c Sat Dec 04 17:41:18 2010 +0000
+++ b/external/bsd/ntp/dist/lib/isc/inet_pton.c Sat Dec 04 23:08:32 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: inet_pton.c,v 1.1.1.1 2009/12/13 16:54:19 kardel Exp $ */
+/*     $NetBSD: inet_pton.c,v 1.2 2010/12/04 23:08:33 christos Exp $   */
 
 /*
  * Copyright (C) 2004, 2005, 2007  Internet Systems Consortium, Inc. ("ISC")
@@ -43,6 +43,7 @@
  * sizeof(int) < 4.  sizeof(int) > 4 is fine; all the world's not a VAX.
  */
 
+#ifdef notdef
 static int inet_pton4(const char *src, unsigned char *dst);
 static int inet_pton6(const char *src, unsigned char *dst);
 
@@ -214,3 +215,4 @@
        memcpy(dst, tmp, NS_IN6ADDRSZ);
        return (1);
 }
+#endif
diff -r 6da62877d2c2 -r 56ab85671bc6 external/bsd/ntp/dist/lib/isc/result.c
--- a/external/bsd/ntp/dist/lib/isc/result.c    Sat Dec 04 17:41:18 2010 +0000
+++ b/external/bsd/ntp/dist/lib/isc/result.c    Sat Dec 04 23:08:32 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: result.c,v 1.1.1.1 2009/12/13 16:54:19 kardel Exp $    */
+/*     $NetBSD: result.c,v 1.2 2010/12/04 23:08:33 christos Exp $      */
 
 /*
  * Copyright (C) 2004, 2005, 2007, 2008  Internet Systems Consortium, Inc. ("ISC")
@@ -114,14 +114,14 @@
 static isc_mutex_t                             lock;
 
 static isc_result_t
-register_table(unsigned int base, unsigned int nresults, const char **text,
+register_table(unsigned int base, unsigned int nresults, const char **text1,
               isc_msgcat_t *msgcat, int set)
 {
        resulttable *table;
 
        REQUIRE(base % ISC_RESULTCLASS_SIZE == 0);
        REQUIRE(nresults <= ISC_RESULTCLASS_SIZE);
-       REQUIRE(text != NULL);
+       REQUIRE(text1 != NULL);
 
        /*
         * We use malloc() here because we we want to be able to use
@@ -132,7 +132,7 @@
                return (ISC_R_NOMEMORY);
        table->base = base;
        table->last = base + nresults - 1;
-       table->text = text;
+       table->text = text1;
        table->msgcat = msgcat;
        table->set = set;
        ISC_LINK_INIT(table, link);
@@ -172,14 +172,14 @@
 const char *



Home | Main Index | Thread Index | Old Index