From: Evan Hunt Date: Tue, 29 May 2007 18:11:56 +0000 (+0000) Subject: Merge in changes that were needed in 3.1.0 to silence NetBSD compiler X-Git-Tag: v4_0_0a2~48 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=804401cc8e511b17e3cca6bb34df5f26730a4414;p=thirdparty%2Fdhcp.git Merge in changes that were needed in 3.1.0 to silence NetBSD compiler warnings. [rt16907] --- diff --git a/common/conflex.c b/common/conflex.c index 89a4f4651..4df35e248 100644 --- a/common/conflex.c +++ b/common/conflex.c @@ -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])) diff --git a/common/parse.c b/common/parse.c index 6287193f6..258468802 100644 --- a/common/parse.c +++ b/common/parse.c @@ -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; diff --git a/common/print.c b/common/print.c index cbc4a709b..e9a64632d 100644 --- a/common/print.c +++ b/common/print.c @@ -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++) { diff --git a/common/tables.c b/common/tables.c index 5a33f162d..1228812dd 100644 --- a/common/tables.c +++ b/common/tables.c @@ -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); diff --git a/dst/dst_api.c b/dst/dst_api.c index 3af7dc4c5..0be009284 100644 --- a/dst/dst_api.c +++ b/dst/dst_api.c @@ -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; diff --git a/includes/dhcpd.h b/includes/dhcpd.h index 2fade44e5..dd10416ad 100644 --- a/includes/dhcpd.h +++ b/includes/dhcpd.h @@ -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); diff --git a/includes/tree.h b/includes/tree.h index 8f32f1f97..b357b25ce 100644 --- a/includes/tree.h +++ b/includes/tree.h @@ -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; diff --git a/minires/ns_date.c b/minires/ns_date.c index 5f3cb6cb0..88e6b4c9d 100644 --- a/minires/ns_date.c +++ b/minires/ns_date.c @@ -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; diff --git a/minires/res_init.c b/minires/res_init.c index e8170eab2..00b303bd3 100644 --- a/minires/res_init.c +++ b/minires/res_init.c @@ -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 @@ -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 */ diff --git a/minires/res_query.c b/minires/res_query.c index 0c28f75b0..adc435ae4 100644 --- a/minires/res_query.c +++ b/minires/res_query.c @@ -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 @@ -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; diff --git a/omapip/hash.c b/omapip/hash.c index 034a27763..912e66530 100644 --- a/omapip/hash.c +++ b/omapip/hash.c @@ -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++) { diff --git a/server/db.c b/server/db.c index 605c8552a..aa34e24ab 100644 --- a/server/db.c +++ b/server/db.c @@ -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++) diff --git a/server/dhcpd.c b/server/dhcpd.c index e4f83faa5..59c3f9f95 100644 --- a/server/dhcpd.c +++ b/server/dhcpd.c @@ -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