2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-09-02 07:15:44 +00:00

Merge in changes that were needed in 3.1.0 to silence NetBSD compiler

warnings. [rt16907]
This commit is contained in:
Evan Hunt
2007-05-29 18:11:56 +00:00
parent 6ecda39c26
commit 804401cc8e
13 changed files with 36 additions and 33 deletions

View File

@@ -34,7 +34,7 @@
#ifndef lint #ifndef lint
static char copyright[] = 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 */ #endif /* not lint */
#include "dhcpd.h" #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_string PROTO ((struct parse *));
static enum dhcp_token read_number PROTO ((int, 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 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) isc_result_t new_parse (cfile, file, inbuf, buflen, name, eolp)
struct parse **cfile; struct parse **cfile;
@@ -520,7 +520,7 @@ static enum dhcp_token read_num_or_name (c, cfile)
} }
static enum dhcp_token intern (atom, dfv) static enum dhcp_token intern (atom, dfv)
char *atom; unsigned char *atom;
enum dhcp_token dfv; enum dhcp_token dfv;
{ {
if (!isascii (atom [0])) if (!isascii (atom [0]))

View File

@@ -34,7 +34,7 @@
#ifndef lint #ifndef lint
static char copyright[] = 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 */ #endif /* not lint */
#include "dhcpd.h" #include "dhcpd.h"
@@ -721,7 +721,7 @@ void convert_num (cfile, buf, str, base, size)
int base; int base;
unsigned size; unsigned size;
{ {
const char *ptr = str; const unsigned char *ptr = str;
int negative = 0; int negative = 0;
u_int32_t val = 0; u_int32_t val = 0;
int tval; int tval;

View File

@@ -34,7 +34,7 @@
#ifndef lint #ifndef lint
static char copyright[] = 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 */ #endif /* not lint */
#include "dhcpd.h" #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) char *quotify_string (const char *s, const char *file, int line)
{ {
unsigned len = 0; unsigned len = 0;
const char *sp; const unsigned char *sp;
char *buf, *nsp; char *buf, *nsp;
for (sp = s; sp && *sp; sp++) { for (sp = s; sp && *sp; sp++) {

View File

@@ -34,7 +34,7 @@
#ifndef lint #ifndef lint
static char copyright[] = 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 */ #endif /* not lint */
#include "dhcpd.h" #include "dhcpd.h"
@@ -789,7 +789,7 @@ struct universe *config_universe;
* option structures omapi typed objects, which is a bigger headache. * 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. */ /* Must match hash_reference/dereference types in omapip/hash.h. */
int 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 /* The option name may be packed in the same alloc as the
* option structure. * option structure.
*/ */
if ((*dest)->name != (char *)((*dest) + 1)) if ((char *) (*dest)->name != (char *) ((*dest) + 1))
dfree((*dest)->name, file, line); dfree((char *) (*dest)->name, file, line);
/* It's either a user-configured format (allocated), or the /* It's either a user-configured format (allocated), or the
* default static format. * default static format.
*/ */
if (((*dest)->format != NULL) && if (((*dest)->format != NULL) &&
((*dest)->format != default_option_format)) { ((*dest)->format != default_option_format)) {
dfree((*dest)->format, file, line); dfree((char *) (*dest)->format, file, line);
} }
dfree(*dest, file, line); dfree(*dest, file, line);

View File

@@ -1,5 +1,5 @@
#ifndef LINT #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 #endif
/* /*
@@ -470,7 +470,8 @@ dst_s_read_public_key(const char *in_name, const unsigned in_id, int in_alg)
unsigned flags, len; unsigned flags, len;
int proto, alg, dlen; int proto, alg, dlen;
int c; 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]; u_char deckey[RAW_KEY_SIZE];
FILE *fp; FILE *fp;

View File

@@ -2428,7 +2428,7 @@ int write_server_duid(void);
#if defined (FAILOVER_PROTOCOL) #if defined (FAILOVER_PROTOCOL)
int write_failover_state (dhcp_failover_state_t *); int write_failover_state (dhcp_failover_state_t *);
#endif #endif
int db_printable PROTO ((const char *)); int db_printable PROTO ((const unsigned char *));
int db_printable_len PROTO ((const unsigned char *, unsigned)); int db_printable_len PROTO ((const unsigned char *, unsigned));
isc_result_t write_named_billing_class(const void *, unsigned, void *); isc_result_t write_named_billing_class(const void *, unsigned, void *);
void write_billing_classes (void); void write_billing_classes (void);

View File

@@ -341,8 +341,8 @@ struct universe {
}; };
struct option { struct option {
char *name; const char *name;
char *format; const char *format;
struct universe *universe; struct universe *universe;
unsigned code; unsigned code;
int refcnt; int refcnt;

View File

@@ -22,7 +22,7 @@
*/ */
#ifndef lint #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 #endif
/* Import. */ /* 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. */ /* Forward. */
static int datepart(const char *, int, int, int, int *); static int datepart(const unsigned char *, int, int, int, int *);
/* Public. */ /* Public. */
@@ -118,7 +118,7 @@ ns_datetosecs(const char *cp, int *errp) {
* Don't reset the flag if there is no error. * Don't reset the flag if there is no error.
*/ */
static int 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 result = 0;
int i; int i;

View File

@@ -76,7 +76,7 @@
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93"; 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 */ #endif /* LIBC_SCCS and not lint */
#include <sys/types.h> #include <sys/types.h>
@@ -154,7 +154,8 @@ res_ninit(res_state statp) {
int int
minires_vinit(res_state statp, int preinit) { minires_vinit(res_state statp, int preinit) {
register FILE *fp; register FILE *fp;
register char *cp, **pp; register unsigned char *cp;
register char **pp;
register int n; register int n;
char buf[BUFSIZ]; char buf[BUFSIZ];
int nserv = 0; /* number of nameserver records read from file */ int nserv = 0; /* number of nameserver records read from file */

View File

@@ -76,7 +76,7 @@
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93"; 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 */ #endif /* LIBC_SCCS and not lint */
#include <sys/types.h> #include <sys/types.h>
@@ -383,7 +383,8 @@ res_nquerydomain(res_state statp,
const char * const char *
res_hostalias(const res_state statp, const char *name, char *dst, size_t siz) { 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]; char buf[BUFSIZ];
FILE *fp; FILE *fp;

View File

@@ -34,7 +34,7 @@
#ifndef lint #ifndef lint
static char copyright[] = 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 */ #endif /* not lint */
#include "dhcpd.h" #include "dhcpd.h"
@@ -352,7 +352,7 @@ hash_report(struct hash_table *table)
struct hash_bucket *bp; struct hash_bucket *bp;
if (table->hash_count == 0) if (table->hash_count == 0)
return "Invalid hash table."; return (char *) "Invalid hash table.";
for (i = 0 ; i < table->hash_count ; i++) { for (i = 0 ; i < table->hash_count ; i++) {
curlen = 0; curlen = 0;
@@ -381,7 +381,7 @@ hash_report(struct hash_table *table)
pct > 2147483647 || pct > 2147483647 ||
minlen > 2147483647 || minlen > 2147483647 ||
maxlen > 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", sprintf(retbuf, "Contents/Size (%%): %u/%u (%u%%). Min/max: %u/%u",
contents, table->hash_count, pct, minlen, maxlen); 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) int casecmp (const void *v1, const void *v2, size_t len)
{ {
size_t i; size_t i;
const char *s = v1; const unsigned char *s = v1;
const char *t = v2; const unsigned char *t = v2;
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
{ {

View File

@@ -34,7 +34,7 @@
#ifndef lint #ifndef lint
static char copyright[] = 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 */ #endif /* not lint */
#include "dhcpd.h" #include "dhcpd.h"
@@ -663,7 +663,7 @@ int write_failover_state (dhcp_failover_state_t *state)
#endif #endif
int db_printable (s) int db_printable (s)
const char *s; const unsigned char *s;
{ {
int i; int i;
for (i = 0; s [i]; i++) for (i = 0; s [i]; i++)

View File

@@ -34,7 +34,7 @@
#ifndef lint #ifndef lint
static char ocopyright[] = 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 #endif
static char copyright[] = static char copyright[] =
@@ -199,7 +199,7 @@ main(int argc, char **argv) {
int fd; int fd;
int i, status; int i, status;
struct servent *ent; struct servent *ent;
char *s; unsigned char *s;
int cftest = 0; int cftest = 0;
int lftest = 0; int lftest = 0;
#ifndef DEBUG #ifndef DEBUG