From 13ba80d4ce2f8256d86e7674c4b0bff90e9a8bf7 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Thu, 3 Aug 2000 09:08:29 +0000 Subject: [PATCH] Cleanup warnings by adding missint prototypes, removing unneeded duplicate prototypes, and adding in several 'const's. Also, add some missing $FreeBSD$'s. Found by: BDECFLAGS --- lib/libstand/environment.c | 6 +++--- lib/libstand/net.h | 5 +++++ lib/libstand/netif.h | 4 +++- lib/libstand/stand.h | 17 +++++++++-------- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/lib/libstand/environment.c b/lib/libstand/environment.c index f2ca120a177d..158e8452f3eb 100644 --- a/lib/libstand/environment.c +++ b/lib/libstand/environment.c @@ -64,8 +64,8 @@ env_getenv(const char *name) * If (value) is NULL, the variable is set but has no value. */ int -env_setenv(const char *name, int flags, void *value, ev_sethook_t sethook, - ev_unsethook_t unsethook) +env_setenv(const char *name, int flags, const void *value, + ev_sethook_t sethook, ev_unsethook_t unsethook) { struct env_var *ev, *curr, *last; @@ -150,7 +150,7 @@ getenv(const char *name) } int -setenv(const char *name, char *value, int overwrite) +setenv(const char *name, const char *value, int overwrite) { /* No guarantees about state, always assume volatile */ if (overwrite || (env_getenv(name) == NULL)) diff --git a/lib/libstand/net.h b/lib/libstand/net.h index 6f6d4435e657..47ff0a0d2e20 100644 --- a/lib/libstand/net.h +++ b/lib/libstand/net.h @@ -36,6 +36,8 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * $FreeBSD$ */ #define NETIF_DEBUG 1 @@ -111,6 +113,9 @@ ssize_t sendrecv(struct iodesc *, ssize_t (*)(struct iodesc *, void *, size_t, time_t), void *, size_t); +/* bootp/DHCP */ +void bootp(int); + /* Utilities: */ char *ether_sprintf(u_char *); int in_cksum(void *, int); diff --git a/lib/libstand/netif.h b/lib/libstand/netif.h index 06093103fa05..dac285107a73 100644 --- a/lib/libstand/netif.h +++ b/lib/libstand/netif.h @@ -1,5 +1,7 @@ /* $NetBSD: netif.h,v 1.4 1995/09/14 23:45:30 pk Exp $ */ +/* $FreeBSD$ */ + #ifndef __SYS_LIBNETBOOT_NETIF_H #define __SYS_LIBNETBOOT_NETIF_H #include "iodesc.h" @@ -7,7 +9,7 @@ #define NENTS(x) sizeof(x)/sizeof(x[0]) struct netif_driver { - char *netif_bname; + const char *netif_bname; int (*netif_match)(struct netif *, void *); int (*netif_probe)(struct netif *, void *); void (*netif_init)(struct iodesc *, void *); diff --git a/lib/libstand/stand.h b/lib/libstand/stand.h index 5fd209d98e40..aa8e65fd0fd1 100644 --- a/lib/libstand/stand.h +++ b/lib/libstand/stand.h @@ -66,6 +66,7 @@ #include #include #include +#include #define CHK(fmt, args...) printf("%s(%d): " fmt "\n", __FUNCTION__, __LINE__ , ##args) #define PCHK(fmt, args...) {printf("%s(%d): " fmt "\n", __FUNCTION__, __LINE__ , ##args); getchar();} @@ -136,12 +137,13 @@ struct devsw { const char dv_name[8]; int dv_type; /* opaque type constant, arch-dependant */ int (*dv_init)(void); /* early probe call */ - int (*dv_strategy)(void *devdata, int rw, daddr_t blk, size_t size, void *buf, size_t *rsize); + int (*dv_strategy)(void *devdata, int rw, daddr_t blk, size_t size, + char *buf, size_t *rsize); int (*dv_open)(struct open_file *f, ...); int (*dv_close)(struct open_file *f); int (*dv_ioctl)(struct open_file *f, u_long cmd, void *data); void (*dv_print)(int verbose); /* print device information */ - void (*dv_cleanup)(); + void (*dv_cleanup)(void); }; /* @@ -227,8 +229,6 @@ extern int close(int); extern void closeall(void); extern ssize_t read(int, void *, size_t); extern ssize_t write(int, void *, size_t); -extern off_t lseek(int, off_t, int); -extern int stat(const char *, struct stat *); extern struct dirent *readdirfd(int); extern void srandom(u_long seed); @@ -236,7 +236,6 @@ extern u_long random(void); /* imports from stdlib, locally modified */ extern long strtol(const char *, char **, int); -extern char * strerror(int err); extern char *optarg; /* getopt(3) external variables */ extern int optind, opterr, optopt, optreset; extern int getopt(int, char * const [], const char *); @@ -273,10 +272,12 @@ struct env_var extern struct env_var *environ; extern struct env_var *env_getenv(const char *name); -extern int env_setenv(const char *name, int flags, void *value, - ev_sethook_t sethook, ev_unsethook_t unsethook); +extern int env_setenv(const char *name, int flags, + const void *value, ev_sethook_t sethook, + ev_unsethook_t unsethook); extern char *getenv(const char *name); -extern int setenv(const char *name, char *value, int overwrite); +extern int setenv(const char *name, const char *value, + int overwrite); extern int putenv(const char *string); extern int unsetenv(const char *name);