From 312eae2bf4f070e39f67f0800430b744b017b80b Mon Sep 17 00:00:00 2001 From: drochner Date: Wed, 14 Apr 1999 11:45:39 +0000 Subject: [PATCH] add prototypes, use ufs_ls() from mi libsa, revert to "void main()", compile with -Wall -Wmissing-prototypes -Wstrict-prototypes -Wno-main --- sys/arch/i386/stand/biosboot/Makefile | 8 ++------ sys/arch/i386/stand/biosboot/devopen.c | 5 ++++- sys/arch/i386/stand/biosboot/devopen.h | 3 +++ sys/arch/i386/stand/biosboot/main.c | 25 ++++++++++++++----------- 4 files changed, 23 insertions(+), 18 deletions(-) create mode 100644 sys/arch/i386/stand/biosboot/devopen.h diff --git a/sys/arch/i386/stand/biosboot/Makefile b/sys/arch/i386/stand/biosboot/Makefile index c94a23bac74c..caf7b6124bcb 100644 --- a/sys/arch/i386/stand/biosboot/Makefile +++ b/sys/arch/i386/stand/biosboot/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.19 1999/03/14 00:04:22 fvdl Exp $ +# $NetBSD: Makefile,v 1.20 1999/04/14 11:45:40 drochner Exp $ S= ${.CURDIR}/../../../../ @@ -30,11 +30,7 @@ CPPFLAGS+= -DPASS_BIOSGEOM #CPPFLAGS+= -DPRIM_LOADSZ=9 #CFLAGS= -O2 -fomit-frame-pointer -fno-defer-pop -CFLAGS+= -Wall - -# XXX should go into library -SRCS+= ls.c -.PATH: ${.CURDIR}/../libsa +CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wno-main SAMISCCPPFLAGS+= -DHEAP_START=0x10000 -DHEAP_LIMIT=0x40000 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_INCLUDE_NET=no diff --git a/sys/arch/i386/stand/biosboot/devopen.c b/sys/arch/i386/stand/biosboot/devopen.c index 7afd7c65c2e6..3a83063232f4 100644 --- a/sys/arch/i386/stand/biosboot/devopen.c +++ b/sys/arch/i386/stand/biosboot/devopen.c @@ -1,4 +1,4 @@ -/* $NetBSD: devopen.c,v 1.7 1998/05/15 16:38:53 drochner Exp $ */ +/* $NetBSD: devopen.c,v 1.8 1999/04/14 11:45:39 drochner Exp $ */ /* * Copyright (c) 1996, 1997 @@ -42,6 +42,7 @@ #include #include +#include "devopen.h" #ifdef _STANDALONE #include #endif @@ -49,6 +50,8 @@ extern int parsebootfile __P((const char *, char**, char**, unsigned int*, unsigned int*, const char**)); +static int dev2bios __P((char *, unsigned int, int *)); + static struct { char *name; int biosdev; diff --git a/sys/arch/i386/stand/biosboot/devopen.h b/sys/arch/i386/stand/biosboot/devopen.h new file mode 100644 index 000000000000..b2df180b0a45 --- /dev/null +++ b/sys/arch/i386/stand/biosboot/devopen.h @@ -0,0 +1,3 @@ +/* $NetBSD: devopen.h,v 1.1 1999/04/14 11:45:39 drochner Exp $ */ + +int bios2dev __P((int, char **, unsigned int *)); diff --git a/sys/arch/i386/stand/biosboot/main.c b/sys/arch/i386/stand/biosboot/main.c index fa4df61d4956..370c3b7544d8 100644 --- a/sys/arch/i386/stand/biosboot/main.c +++ b/sys/arch/i386/stand/biosboot/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.15 1999/02/12 05:14:22 cjs Exp $ */ +/* $NetBSD: main.c,v 1.16 1999/04/14 11:45:39 drochner Exp $ */ /* * Copyright (c) 1996, 1997 @@ -41,12 +41,11 @@ #include #include +#include #include #include - -extern void ls __P((char*)); -extern int bios2dev __P((int, char**, int*)); +#include "devopen.h" int errno; extern int boot_biosdev; @@ -74,6 +73,11 @@ static char *default_devname; static int default_unit, default_partition; static char *default_filename; +char *sprint_bootsel __P((const char *)); +void bootit __P((const char *, int, int)); +void print_banner __P((void)); +void main __P((void)); + void command_help __P((char *)); void command_ls __P((char *)); void command_quit __P((char *)); @@ -161,8 +165,9 @@ parsebootfile(fname, fsname, devname, unit, partition, file) return(0); } -char *sprint_bootsel(filename) -const char *filename; +char * +sprint_bootsel(filename) + const char *filename; { char *fsname, *devname; int unit, partition; @@ -198,7 +203,7 @@ bootit(filename, howto, tell) } void -print_banner(void) +print_banner() { printf("\n"); @@ -217,7 +222,7 @@ print_banner(void) * note: normally, void main() wouldn't be legal, but this isn't a * hosted environment... */ -int +void main() { int currname; @@ -265,8 +270,6 @@ main() /* since it failed, try switching bootfile. */ currname = ++currname % NUMNAMES; } - - return (0); } /* ARGSUSED */ @@ -291,7 +294,7 @@ command_ls(arg) char *save = default_filename; default_filename = "/"; - ls(arg); + ufs_ls(arg); default_filename = save; }