Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sbin/fsck ansi knf
details: https://anonhg.NetBSD.org/src/rev/49e61fcdc8fe
branches: trunk
changeset: 511330:49e61fcdc8fe
user: lukem <lukem%NetBSD.org@localhost>
date: Mon Jun 18 02:31:09 2001 +0000
description:
ansi knf
diffstat:
sbin/fsck/fsck.c | 74 +++++++++++++++-------------------------
sbin/fsck/fsutil.c | 99 ++++++++++-------------------------------------------
sbin/fsck/fsutil.h | 32 ++++++++--------
sbin/fsck/preen.c | 38 ++++++++------------
4 files changed, 79 insertions(+), 164 deletions(-)
diffs (truncated from 561 to 300 lines):
diff -r 5c611095de17 -r 49e61fcdc8fe sbin/fsck/fsck.c
--- a/sbin/fsck/fsck.c Mon Jun 18 02:22:33 2001 +0000
+++ b/sbin/fsck/fsck.c Mon Jun 18 02:31:09 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fsck.c,v 1.24 2001/06/18 02:22:33 lukem Exp $ */
+/* $NetBSD: fsck.c,v 1.25 2001/06/18 02:31:09 lukem Exp $ */
/*
* Copyright (c) 1996 Christos Zoulas. All rights reserved.
@@ -40,7 +40,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: fsck.c,v 1.24 2001/06/18 02:22:33 lukem Exp $");
+__RCSID("$NetBSD: fsck.c,v 1.25 2001/06/18 02:31:09 lukem Exp $");
#endif /* not lint */
#include <sys/param.h>
@@ -80,25 +80,22 @@
static char *options = NULL;
static int flags = 0;
-int main __P((int, char *[]));
+int main(int, char *[]);
-static int checkfs __P((const char *, const char *, const char *, void *,
- pid_t *));
-static int selected __P((const char *));
-static void addoption __P((char *));
-static const char *getoptions __P((const char *));
-static void addentry __P((struct fstypelist *, const char *, const char *));
-static void maketypelist __P((char *));
-static void catopt __P((char **, const char *));
-static void mangle __P((char *, int *, const char ***, int *));
-static const char *getfslab __P((const char *));
-static void usage __P((void));
-static void *isok __P((struct fstab *));
+static int checkfs(const char *, const char *, const char *, void *, pid_t *);
+static int selected(const char *);
+static void addoption(char *);
+static const char *getoptions(const char *);
+static void addentry(struct fstypelist *, const char *, const char *);
+static void maketypelist(char *);
+static void catopt(char **, const char *);
+static void mangle(char *, int *, const char ***, int *);
+static const char *getfslab(const char *);
+static void usage(void);
+static void *isok(struct fstab *);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
struct fstab *fs;
int i, rval = 0;
@@ -198,9 +195,9 @@
static void *
-isok(fs)
- struct fstab *fs;
+isok(struct fstab *fs)
{
+
if (fs->fs_passno == 0)
return NULL;
@@ -215,10 +212,8 @@
static int
-checkfs(vfstype, spec, mntpt, auxarg, pidp)
- const char *vfstype, *spec, *mntpt;
- void *auxarg;
- pid_t *pidp;
+checkfs(const char *vfstype, const char *spec, const char *mntpt, void *auxarg,
+ pid_t *pidp)
{
/* List of directories containing fsck_xxx subcommands. */
static const char *edirs[] = {
@@ -330,8 +325,7 @@
static int
-selected(type)
- const char *type;
+selected(const char *type)
{
struct entry *e;
@@ -345,8 +339,7 @@
static const char *
-getoptions(type)
- const char *type;
+getoptions(const char *type)
{
struct entry *e;
@@ -358,8 +351,7 @@
static void
-addoption(optstr)
- char *optstr;
+addoption(char *optstr)
{
char *newoptions;
struct entry *e;
@@ -379,10 +371,7 @@
static void
-addentry(list, type, opts)
- struct fstypelist *list;
- const char *type;
- const char *opts;
+addentry(struct fstypelist *list, const char *type, const char *opts)
{
struct entry *e;
@@ -394,8 +383,7 @@
static void
-maketypelist(fslist)
- char *fslist;
+maketypelist(char *fslist)
{
char *ptr;
@@ -416,9 +404,7 @@
static void
-catopt(sp, o)
- char **sp;
- const char *o;
+catopt(char **sp, const char *o)
{
char *s;
size_t i, j;
@@ -436,10 +422,7 @@
static void
-mangle(options, argcp, argvp, maxargcp)
- char *options;
- int *argcp, *maxargcp;
- const char ***argvp;
+mangle(char *options, int *argcp, const char ***argvp, int *maxargcp)
{
char *p, *s;
int argc, maxargc;
@@ -477,8 +460,7 @@
const static char *
-getfslab(str)
- const char *str;
+getfslab(const char *str)
{
struct disklabel dl;
int fd;
@@ -513,7 +495,7 @@
static void
-usage()
+usage(void)
{
static const char common[] =
"[-dpvlyn] [-T fstype:fsoptions] [-t fstype]";
diff -r 5c611095de17 -r 49e61fcdc8fe sbin/fsck/fsutil.c
--- a/sbin/fsck/fsutil.c Mon Jun 18 02:22:33 2001 +0000
+++ b/sbin/fsck/fsutil.c Mon Jun 18 02:31:09 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fsutil.c,v 1.9 2001/02/19 22:56:19 cgd Exp $ */
+/* $NetBSD: fsutil.c,v 1.10 2001/06/18 02:31:09 lukem Exp $ */
/*
* Copyright (c) 1990, 1993
@@ -35,17 +35,13 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: fsutil.c,v 1.9 2001/02/19 22:56:19 cgd Exp $");
+__RCSID("$NetBSD: fsutil.c,v 1.10 2001/06/18 02:31:09 lukem Exp $");
#endif /* not lint */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#if __STDC__
#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
#include <errno.h>
#include <fstab.h>
#include <err.h>
@@ -59,60 +55,47 @@
static int hot = 0;
static int preen = 0;
-static void vmsg __P((int, const char *, va_list))
+static void vmsg(int, const char *, va_list)
__attribute((__format__(__printf__,2,0)));
void
-setcdevname(cd, pr)
- const char *cd;
- int pr;
+setcdevname(const char *cd, int pr)
{
+
dev = cd;
preen = pr;
}
const char *
-cdevname()
+cdevname(void)
{
+
return dev;
}
int
-hotroot()
+hotroot(void)
{
+
return hot;
}
/*VARARGS*/
void
-#if __STDC__
errexit(const char *fmt, ...)
-#else
-errexit(va_alist)
- va_dcl
-#endif
{
va_list ap;
-#if __STDC__
va_start(ap, fmt);
-#else
- const char *fmt;
-
- va_start(ap);
- fmt = va_arg(ap, const char *);
-#endif
(void) vfprintf(stderr, fmt, ap);
va_end(ap);
exit(8);
}
static void
-vmsg(fatal, fmt, ap)
- int fatal;
- const char *fmt;
- va_list ap;
+vmsg(int fatal, const char *fmt, va_list ap)
{
+
if (!fatal && preen)
(void) printf("%s: ", dev);
@@ -131,82 +114,46 @@
/*VARARGS*/
void
-#if __STDC__
pfatal(const char *fmt, ...)
-#else
-pfatal(va_alist)
- va_dcl
-#endif
{
va_list ap;
-#if __STDC__
va_start(ap, fmt);
-#else
- const char *fmt;
-
- va_start(ap);
- fmt = va_arg(ap, const char *);
-#endif
vmsg(1, fmt, ap);
va_end(ap);
}
/*VARARGS*/
Home |
Main Index |
Thread Index |
Old Index