]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Merge in changes that were needed in 3.1.0 to silence NetBSD compiler
authorEvan Hunt <each@isc.org>
Tue, 29 May 2007 18:11:56 +0000 (18:11 +0000)
committerEvan Hunt <each@isc.org>
Tue, 29 May 2007 18:11:56 +0000 (18:11 +0000)
warnings. [rt16907]

13 files changed:
common/conflex.c
common/parse.c
common/print.c
common/tables.c
dst/dst_api.c
includes/dhcpd.h
includes/tree.h
minires/ns_date.c
minires/res_init.c
minires/res_query.c
omapip/hash.c
server/db.c
server/dhcpd.c

index 89a4f4651c0941a68b044efa53116f0210e56408..4df35e248bf82cbd96ac7706b421010f7ad0c3a1 100644 (file)
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: conflex.c,v 1.108 2007/05/23 15:29:49 shane Exp $ Copyright (c) 2004-2007 Internet Systems Consortium.  All rights reserved.\n";
+"$Id: conflex.c,v 1.109 2007/05/29 18:11:55 each Exp $ Copyright (c) 2004-2007 Internet Systems Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -46,7 +46,7 @@ static void skip_to_eol PROTO ((struct parse *));
 static enum dhcp_token read_string PROTO ((struct parse *));
 static enum dhcp_token read_number PROTO ((int, struct parse *));
 static enum dhcp_token read_num_or_name PROTO ((int, struct parse *));
-static enum dhcp_token intern PROTO ((char *, enum dhcp_token));
+static enum dhcp_token intern PROTO ((unsigned char *, enum dhcp_token));
 
 isc_result_t new_parse (cfile, file, inbuf, buflen, name, eolp)
        struct parse **cfile;
@@ -520,7 +520,7 @@ static enum dhcp_token read_num_or_name (c, cfile)
 }
 
 static enum dhcp_token intern (atom, dfv)
-       char *atom;
+       unsigned char *atom;
        enum dhcp_token dfv;
 {
        if (!isascii (atom [0]))
index 6287193f69ffdc4ab82d6a32244580756e27183d..258468802478fba56c8264c6c4d896431c95e33a 100644 (file)
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: parse.c,v 1.125 2007/05/23 15:29:49 shane Exp $ Copyright (c) 2004-2007 Internet Systems Consortium.  All rights reserved.\n";
+"$Id: parse.c,v 1.126 2007/05/29 18:11:55 each Exp $ Copyright (c) 2004-2007 Internet Systems Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -721,7 +721,7 @@ void convert_num (cfile, buf, str, base, size)
        int base;
        unsigned size;
 {
-       const char *ptr = str;
+       const unsigned char *ptr = str;
        int negative = 0;
        u_int32_t val = 0;
        int tval;
index cbc4a709bda9a319db80d063346baeaa76456a6c..e9a64632dddf073a220b53f434fd81a846eca8f7 100644 (file)
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: print.c,v 1.65 2007/05/19 19:16:24 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium.  All rights reserved.\n";
+"$Id: print.c,v 1.66 2007/05/29 18:11:55 each Exp $ Copyright (c) 2004-2007 Internet Systems Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -44,7 +44,7 @@ int db_time_format = DEFAULT_TIME_FORMAT;
 char *quotify_string (const char *s, const char *file, int line)
 {
        unsigned len = 0;
-       const char *sp;
+       const unsigned char *sp;
        char *buf, *nsp;
 
        for (sp = s; sp && *sp; sp++) {
index 5a33f162dcdf9a5dba1e5e32ad8ab6e6489d63d7..1228812ddbb1eded51ef7badb50d7f5bc71d6fc0 100644 (file)
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: tables.c,v 1.63 2007/05/19 19:16:24 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium.  All rights reserved.\n";
+"$Id: tables.c,v 1.64 2007/05/29 18:11:55 each Exp $ Copyright (c) 2004-2007 Internet Systems Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -789,7 +789,7 @@ struct universe *config_universe;
  * option structures omapi typed objects, which is a bigger headache.
  */
 
-char *default_option_format = "X";
+char *default_option_format = (char *) "X";
 
 /* Must match hash_reference/dereference types in omapip/hash.h. */
 int
@@ -844,15 +844,15 @@ option_dereference(struct option **dest, const char *file, int line)
                /* The option name may be packed in the same alloc as the
                 * option structure.
                 */
-               if ((*dest)->name != (char *)((*dest) + 1))
-                       dfree((*dest)->name, file, line);
+               if ((char *) (*dest)->name != (char *) ((*dest) + 1))
+                       dfree((char *) (*dest)->name, file, line);
 
                /* It's either a user-configured format (allocated), or the
                 * default static format.
                 */
                if (((*dest)->format != NULL) &&
                    ((*dest)->format != default_option_format)) {
-                       dfree((*dest)->format, file, line);
+                       dfree((char *) (*dest)->format, file, line);
                }
 
                dfree(*dest, file, line);
index 3af7dc4c5542ba50a73595d30a5335bf9aa5d509..0be00928476c6e3bd0a93822a07b21e5c1a56977 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef LINT
-static const char rcsid[] = "$Header: /tmp/cvstest/DHCP/dst/dst_api.c,v 1.1 2001/02/22 07:22:08 mellon Exp $";
+static const char rcsid[] = "$Header: /tmp/cvstest/DHCP/dst/dst_api.c,v 1.2 2007/05/29 18:11:55 each Exp $";
 #endif
 
 /*
@@ -470,7 +470,8 @@ dst_s_read_public_key(const char *in_name, const unsigned in_id, int in_alg)
        unsigned flags, len;
        int proto, alg, dlen;
        int c;
-       char name[PATH_MAX], enckey[RAW_KEY_SIZE], *notspace;
+       char name[PATH_MAX], enckey[RAW_KEY_SIZE];
+        unsigned char *notspace;
        u_char deckey[RAW_KEY_SIZE];
        FILE *fp;
 
index 2fade44e5fd2e46174c53ed7050ccb0d494944dc..dd10416ad7e8dac1a9670b63341df91b561346eb 100644 (file)
@@ -2428,7 +2428,7 @@ int write_server_duid(void);
 #if defined (FAILOVER_PROTOCOL)
 int write_failover_state (dhcp_failover_state_t *);
 #endif
-int db_printable PROTO ((const char *));
+int db_printable PROTO ((const unsigned char *));
 int db_printable_len PROTO ((const unsigned char *, unsigned));
 isc_result_t write_named_billing_class(const void *, unsigned, void *);
 void write_billing_classes (void);
index 8f32f1f9772eb7ed51c31b2035a0fbd64dc1703d..b357b25ce652931a8c7ae5b506a42ae78c30df6b 100644 (file)
@@ -341,8 +341,8 @@ struct universe {
 };
 
 struct option {
-       char *name;
-       char *format;
+       const char *name;
+       const char *format;
        struct universe *universe;
        unsigned code;
        int refcnt;
index 5f3cb6cb0d7f88e3f7475bb30557f2b2dc326ebe..88e6b4c9db010c5228aea146868699eb5b78b078 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: ns_date.c,v 1.3 2005/03/17 20:15:17 dhankins Exp $";
+static const char rcsid[] = "$Id: ns_date.c,v 1.4 2007/05/29 18:11:56 each Exp $";
 #endif
 
 /* Import. */
@@ -48,7 +48,7 @@ static const char rcsid[] = "$Id: ns_date.c,v 1.3 2005/03/17 20:15:17 dhankins E
 
 /* Forward. */
 
-static int     datepart(const char *, int, int, int, int *);
+static int     datepart(const unsigned char *, int, int, int, int *);
 
 /* Public. */
 
@@ -118,7 +118,7 @@ ns_datetosecs(const char *cp, int *errp) {
  * Don't reset the flag if there is no error.
  */
 static int
-datepart(const char *buf, int size, int min, int max, int *errp) {
+datepart(const unsigned char *buf, int size, int min, int max, int *errp) {
        int result = 0;
        int i;
 
index e8170eab206879b699c454a842dcb522a46c1147..00b303bd3668409638b0d179186e837b9545e462 100644 (file)
@@ -76,7 +76,7 @@
 
 #if defined(LIBC_SCCS) && !defined(lint)
 static const char sccsid[] = "@(#)res_init.c   8.1 (Berkeley) 6/7/93";
-static const char rcsid[] = "$Id: res_init.c,v 1.6 2005/03/17 20:15:19 dhankins Exp $";
+static const char rcsid[] = "$Id: res_init.c,v 1.7 2007/05/29 18:11:56 each Exp $";
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
@@ -154,7 +154,8 @@ res_ninit(res_state statp) {
 int
 minires_vinit(res_state statp, int preinit) {
        register FILE *fp;
-       register char *cp, **pp;
+       register unsigned char *cp;
+       register char **pp;
        register int n;
        char buf[BUFSIZ];
        int nserv = 0;    /* number of nameserver records read from file */
index 0c28f75b02def516dc9b042f08ff834ebd0198e7..adc435ae4b40be480024c05d43c63d196d4fa1f1 100644 (file)
@@ -76,7 +76,7 @@
 
 #if defined(LIBC_SCCS) && !defined(lint)
 static const char sccsid[] = "@(#)res_query.c  8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: res_query.c,v 1.5 2005/03/17 20:15:19 dhankins Exp $";
+static const char rcsid[] = "$Id: res_query.c,v 1.6 2007/05/29 18:11:56 each Exp $";
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
@@ -383,7 +383,8 @@ res_nquerydomain(res_state statp,
 
 const char *
 res_hostalias(const res_state statp, const char *name, char *dst, size_t siz) {
-       char *file, *cp1, *cp2;
+       char *file;
+        unsigned char *cp1, *cp2;
        char buf[BUFSIZ];
        FILE *fp;
 
index 034a27763ff7b6b1cf7ec85ac2f01a82d4c2f1cc..912e665308af76469e7d76b89e05cd0f87c4f37c 100644 (file)
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: hash.c,v 1.15 2007/05/19 19:16:26 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium.  All rights reserved.\n";
+"$Id: hash.c,v 1.16 2007/05/29 18:11:56 each Exp $ Copyright (c) 2004-2007 Internet Systems Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -352,7 +352,7 @@ hash_report(struct hash_table *table)
        struct hash_bucket *bp;
 
        if (table->hash_count == 0)
-               return "Invalid hash table.";
+               return (char *) "Invalid hash table.";
 
        for (i = 0 ; i < table->hash_count ; i++) {
                curlen = 0;
@@ -381,7 +381,7 @@ hash_report(struct hash_table *table)
            pct > 2147483647 ||
            minlen > 2147483647 ||
            maxlen > 2147483647)
-               return "Report out of range for display.";
+               return (char *) "Report out of range for display.";
 
        sprintf(retbuf, "Contents/Size (%%): %u/%u (%u%%). Min/max: %u/%u",
                contents, table->hash_count, pct, minlen, maxlen);
@@ -530,8 +530,8 @@ int hash_foreach (struct hash_table *table, hash_foreach_func func)
 int casecmp (const void *v1, const void *v2, size_t len)
 {
        size_t i;
-       const char *s = v1;
-       const char *t = v2;
+       const unsigned char *s = v1;
+       const unsigned char *t = v2;
        
        for (i = 0; i < len; i++)
        {
index 605c8552ad5a6cd8956cc3b718b3b081869f8775..aa34e24ab65a41b6cf912980dae2bf08529793a2 100644 (file)
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: db.c,v 1.78 2007/05/19 19:16:26 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium.  All rights reserved.\n";
+"$Id: db.c,v 1.79 2007/05/29 18:11:56 each Exp $ Copyright (c) 2004-2007 Internet Systems Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -663,7 +663,7 @@ int write_failover_state (dhcp_failover_state_t *state)
 #endif
 
 int db_printable (s)
-       const char *s;
+       const unsigned char *s;
 {
        int i;
        for (i = 0; s [i]; i++)
index e4f83faa55174734430be972cdadf3487f20eef8..59c3f9f95278c7e0b7678fd744a6554de7050b42 100644 (file)
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char ocopyright[] =
-"$Id: dhcpd.c,v 1.125 2007/05/19 19:16:26 dhankins Exp $ Copyright 2004-2007 Internet Systems Consortium.";
+"$Id: dhcpd.c,v 1.126 2007/05/29 18:11:56 each Exp $ Copyright 2004-2007 Internet Systems Consortium.";
 #endif
 
   static char copyright[] =
@@ -199,7 +199,7 @@ main(int argc, char **argv) {
        int fd;
        int i, status;
        struct servent *ent;
-       char *s;
+       unsigned char *s;
        int cftest = 0;
        int lftest = 0;
 #ifndef DEBUG