Kill __P(), ANSIfy, remove main() prototype; WARNS=2

This commit is contained in:
xtraeme 2005-01-20 15:49:24 +00:00
parent 7fb01f0f08
commit e3529b263e
2 changed files with 25 additions and 44 deletions

View File

@ -1,5 +1,6 @@
# $NetBSD: Makefile,v 1.5 2002/06/11 13:33:48 grant Exp $
# $NetBSD: Makefile,v 1.6 2005/01/20 15:49:24 xtraeme Exp $
WARNS= 2
PROG= ccdconfig
MAN= ccdconfig.8 ccd.conf.5

View File

@ -1,4 +1,4 @@
/* $NetBSD: ccdconfig.c,v 1.39 2004/10/28 19:43:29 dsl Exp $ */
/* $NetBSD: ccdconfig.c,v 1.40 2005/01/20 15:49:24 xtraeme Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
__COPYRIGHT(
"@(#) Copyright (c) 1996, 1997\
The NetBSD Foundation, Inc. All rights reserved.");
__RCSID("$NetBSD: ccdconfig.c,v 1.39 2004/10/28 19:43:29 dsl Exp $");
__RCSID("$NetBSD: ccdconfig.c,v 1.40 2005/01/20 15:49:24 xtraeme Exp $");
#endif
#include <sys/param.h>
@ -100,22 +100,19 @@ static struct nlist nl[] = {
#define CCD_UNCONFIGALL 3 /* unconfigure all devices */
#define CCD_DUMP 4 /* dump a ccd's configuration */
int main __P((int, char *[]));
static int checkdev __P((char *));
static int do_io __P((char *, u_long, struct ccd_ioctl *));
static int do_single __P((int, char **, int));
static int do_all __P((int));
static int dump_ccd __P((int, char **, int));
static int flags_to_val __P((char *));
static int pathtounit __P((char *, int *));
static void print_ccd_info __P((struct ccd_softc *, kvm_t *));
static char *resolve_ccdname __P((char *));
static void usage __P((void));
static int checkdev(char *);
static int do_io(char *, u_long, struct ccd_ioctl *);
static int do_single(int, char **, int);
static int do_all(int);
static int dump_ccd(int, char **, int);
static int flags_to_val(char *);
static int pathtounit(char *, int *);
static void print_ccd_info(struct ccd_softc *, kvm_t *);
static char *resolve_ccdname(char *);
static void usage(void);
int
main(argc, argv)
int argc;
char *argv[];
main(int argc, char *argv[])
{
int ch, options = 0, action = CCD_CONFIG;
@ -204,10 +201,7 @@ main(argc, argv)
}
static int
do_single(argc, argv, action)
int argc;
char **argv;
int action;
do_single(int argc, char **argv, int action)
{
struct ccd_ioctl ccio;
char *ccd, *cp, *cp2, **disks;
@ -327,8 +321,7 @@ do_single(argc, argv, action)
}
static int
do_all(action)
int action;
do_all(int action)
{
FILE *f;
char *line, *cp, *vp, **argv, **nargv;
@ -395,8 +388,7 @@ do_all(action)
}
static int
checkdev(path)
char *path;
checkdev(char *path)
{
struct stat st;
@ -410,9 +402,7 @@ checkdev(path)
}
static int
pathtounit(path, unitp)
char *path;
int *unitp;
pathtounit(char *path, int *unitp)
{
struct stat st;
int maxpartitions;
@ -432,8 +422,7 @@ pathtounit(path, unitp)
}
static char *
resolve_ccdname(name)
char *name;
resolve_ccdname(char *name)
{
char c, *path;
size_t len;
@ -460,10 +449,7 @@ resolve_ccdname(name)
}
static int
do_io(path, cmd, cciop)
char *path;
u_long cmd;
struct ccd_ioctl *cciop;
do_io(char *path, u_long cmd, struct ccd_ioctl *cciop)
{
int fd;
const char *cp;
@ -501,10 +487,7 @@ do_io(path, cmd, cciop)
}
static int
dump_ccd(argc, argv, action)
int argc;
char **argv;
int action;
dump_ccd(int argc, char **argv, int action)
{
char errbuf[_POSIX2_LINE_MAX], *ccd, *cp;
struct ccd_softc *cs, *kcs;
@ -603,9 +586,7 @@ dump_ccd(argc, argv, action)
}
static void
print_ccd_info(cs, kd)
struct ccd_softc *cs;
kvm_t *kd;
print_ccd_info(struct ccd_softc *cs, kvm_t *kd)
{
static int header_printed = 0;
struct ccdcinfo *cip;
@ -659,8 +640,7 @@ print_ccd_info(cs, kd)
}
static int
flags_to_val(flags)
char *flags;
flags_to_val(char *flags)
{
char *cp, *tok;
int i, tmp, val = ~CCDF_USERMASK;
@ -718,7 +698,7 @@ flags_to_val(flags)
}
static void
usage()
usage(void)
{
const char *progname = getprogname();