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
This commit is contained in:
John Baldwin 2000-08-03 09:08:29 +00:00
parent 92a4949b42
commit 13ba80d4ce
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=64185
4 changed files with 20 additions and 12 deletions

View File

@ -64,8 +64,8 @@ env_getenv(const char *name)
* If (value) is NULL, the variable is set but has no value. * If (value) is NULL, the variable is set but has no value.
*/ */
int int
env_setenv(const char *name, int flags, void *value, ev_sethook_t sethook, env_setenv(const char *name, int flags, const void *value,
ev_unsethook_t unsethook) ev_sethook_t sethook, ev_unsethook_t unsethook)
{ {
struct env_var *ev, *curr, *last; struct env_var *ev, *curr, *last;
@ -150,7 +150,7 @@ getenv(const char *name)
} }
int 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 */ /* No guarantees about state, always assume volatile */
if (overwrite || (env_getenv(name) == NULL)) if (overwrite || (env_getenv(name) == NULL))

View File

@ -36,6 +36,8 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * 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 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
*
* $FreeBSD$
*/ */
#define NETIF_DEBUG 1 #define NETIF_DEBUG 1
@ -111,6 +113,9 @@ ssize_t sendrecv(struct iodesc *,
ssize_t (*)(struct iodesc *, void *, size_t, time_t), ssize_t (*)(struct iodesc *, void *, size_t, time_t),
void *, size_t); void *, size_t);
/* bootp/DHCP */
void bootp(int);
/* Utilities: */ /* Utilities: */
char *ether_sprintf(u_char *); char *ether_sprintf(u_char *);
int in_cksum(void *, int); int in_cksum(void *, int);

View File

@ -1,5 +1,7 @@
/* $NetBSD: netif.h,v 1.4 1995/09/14 23:45:30 pk Exp $ */ /* $NetBSD: netif.h,v 1.4 1995/09/14 23:45:30 pk Exp $ */
/* $FreeBSD$ */
#ifndef __SYS_LIBNETBOOT_NETIF_H #ifndef __SYS_LIBNETBOOT_NETIF_H
#define __SYS_LIBNETBOOT_NETIF_H #define __SYS_LIBNETBOOT_NETIF_H
#include "iodesc.h" #include "iodesc.h"
@ -7,7 +9,7 @@
#define NENTS(x) sizeof(x)/sizeof(x[0]) #define NENTS(x) sizeof(x)/sizeof(x[0])
struct netif_driver { struct netif_driver {
char *netif_bname; const char *netif_bname;
int (*netif_match)(struct netif *, void *); int (*netif_match)(struct netif *, void *);
int (*netif_probe)(struct netif *, void *); int (*netif_probe)(struct netif *, void *);
void (*netif_init)(struct iodesc *, void *); void (*netif_init)(struct iodesc *, void *);

View File

@ -66,6 +66,7 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/dirent.h> #include <sys/dirent.h>
#include <string.h>
#define CHK(fmt, args...) printf("%s(%d): " fmt "\n", __FUNCTION__, __LINE__ , ##args) #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();} #define PCHK(fmt, args...) {printf("%s(%d): " fmt "\n", __FUNCTION__, __LINE__ , ##args); getchar();}
@ -136,12 +137,13 @@ struct devsw {
const char dv_name[8]; const char dv_name[8];
int dv_type; /* opaque type constant, arch-dependant */ int dv_type; /* opaque type constant, arch-dependant */
int (*dv_init)(void); /* early probe call */ 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_open)(struct open_file *f, ...);
int (*dv_close)(struct open_file *f); int (*dv_close)(struct open_file *f);
int (*dv_ioctl)(struct open_file *f, u_long cmd, void *data); int (*dv_ioctl)(struct open_file *f, u_long cmd, void *data);
void (*dv_print)(int verbose); /* print device information */ 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 void closeall(void);
extern ssize_t read(int, void *, size_t); extern ssize_t read(int, void *, size_t);
extern ssize_t write(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 struct dirent *readdirfd(int);
extern void srandom(u_long seed); extern void srandom(u_long seed);
@ -236,7 +236,6 @@ extern u_long random(void);
/* imports from stdlib, locally modified */ /* imports from stdlib, locally modified */
extern long strtol(const char *, char **, int); extern long strtol(const char *, char **, int);
extern char * strerror(int err);
extern char *optarg; /* getopt(3) external variables */ extern char *optarg; /* getopt(3) external variables */
extern int optind, opterr, optopt, optreset; extern int optind, opterr, optopt, optreset;
extern int getopt(int, char * const [], const char *); extern int getopt(int, char * const [], const char *);
@ -273,10 +272,12 @@ struct env_var
extern struct env_var *environ; extern struct env_var *environ;
extern struct env_var *env_getenv(const char *name); extern struct env_var *env_getenv(const char *name);
extern int env_setenv(const char *name, int flags, void *value, extern int env_setenv(const char *name, int flags,
ev_sethook_t sethook, ev_unsethook_t unsethook); const void *value, ev_sethook_t sethook,
ev_unsethook_t unsethook);
extern char *getenv(const char *name); 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 putenv(const char *string);
extern int unsetenv(const char *name); extern int unsetenv(const char *name);