compile cleanly with -Wall (ntp bug #258)

This commit is contained in:
drochner 2003-12-04 17:17:36 +00:00
parent 35f545891e
commit 507fa5fee7
3 changed files with 24 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: internet.c,v 1.2 2003/12/04 16:23:38 drochner Exp $ */
/* $NetBSD: internet.c,v 1.3 2003/12/04 17:17:36 drochner Exp $ */
/* Copyright (C) 1996 N.M. Maclaren
Copyright (C) 1996 The University of Cambridge
@ -73,8 +73,6 @@ number. */
int family, rval;
struct addrinfo hints;
struct addrinfo *res;
struct sockaddr_in *sin;
struct sockaddr_in6 *sin6;
res = NULL;
memset(address, 0, sizeof(struct sockaddr_storage));

21
dist/ntp/sntp/main.c vendored
View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.2 2003/12/04 16:23:38 drochner Exp $ */
/* $NetBSD: main.c,v 1.3 2003/12/04 17:17:36 drochner Exp $ */
/* Copyright (C) 1996, 1997, 2000 N.M. Maclaren
Copyright (C) 1996, 1997, 2000 The University of Cambridge
@ -243,7 +243,24 @@ typedef struct {
double dispersion, weight, when, offset, error;
} data_record;
void syntax(int);
void display_data(ntp_data *);
void display_packet(unsigned char *, int);
void pack_ntp(unsigned char *, int, ntp_data *);
void unpack_ntp(ntp_data *, unsigned char *, int);
void make_packet(ntp_data *, int);
int read_packet(int, ntp_data *, double *, double *);
void format_time(char *, int, double, double, double, double);
double reset_clock(double, double, int);
void run_server(void);
double estimate_stats(int *, int *, data_record *, double, double *, double *,
double *, double *, double *, double *, int *, int);
double correct_drift(double *, double *, double);
void handle_saving(int, int *, int *, int *, data_record *, double *,
double *, double *);
void query_savefile(void);
void run_daemon(char **, int, int);
void run_client(char **, int);
void fatal (int syserr, const char *message, const char *insert) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: socket.c,v 1.2 2003/12/04 16:23:38 drochner Exp $ */
/* $NetBSD: socket.c,v 1.3 2003/12/04 17:17:36 drochner Exp $ */
/* Copyright (C) 1996, 2000 N.M. Maclaren
Copyright (C) 1996, 2000 The University of Cambridge
@ -32,6 +32,8 @@ static struct sockaddr_storage here[MAX_SOCKETS], there[MAX_SOCKETS];
static struct sockaddr_in here[MAX_SOCKETS], there[MAX_SOCKETS];
#endif
void display_in_hex(const void *, int);
void display_sock_in_hex(struct sockaddr_storage *);
/* There needs to be some disgusting grobble for handling timeouts, that is
identical to the grobble in internet.c. */
@ -65,7 +67,7 @@ void display_in_hex (const void *data, int length) {
#ifdef HAVE_IPV6
void display_sock_in_hex (struct sockaddr_storage *sock) {
int family, len;
int family;
struct sockaddr_in *sin;
struct sockaddr_in6 *sin6;