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