aboutsummaryrefslogtreecommitdiff
path: root/sbin/fsdb
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2002-03-21 13:10:52 +0000
committerWarner Losh <imp@FreeBSD.org>2002-03-21 13:10:52 +0000
commit0638cc1a3950101932c23ee84e49ec09b9ffc92e (patch)
tree3e13d718c267505bb9b3d399078f639dcce5db19 /sbin/fsdb
parent6da4e60a23f8f4283bcad18322c7a6c2bdf0dfe8 (diff)
downloadsrc-0638cc1a3950101932c23ee84e49ec09b9ffc92e.tar.gz
src-0638cc1a3950101932c23ee84e49ec09b9ffc92e.zip
o __P removal.
o ansi function definitions. o main prototype removal o unifdef __STDC__
Notes
Notes: svn path=/head/; revision=92881
Diffstat (limited to 'sbin/fsdb')
-rw-r--r--sbin/fsdb/fsdb.c45
-rw-r--r--sbin/fsdb/fsdb.h24
-rw-r--r--sbin/fsdb/fsdbutil.c43
3 files changed, 41 insertions, 71 deletions
diff --git a/sbin/fsdb/fsdb.c b/sbin/fsdb/fsdb.c
index ce96e21100a5..8ee5a69c90e1 100644
--- a/sbin/fsdb/fsdb.c
+++ b/sbin/fsdb/fsdb.c
@@ -49,11 +49,11 @@ static const char rcsid[] =
#include "fsdb.h"
#include "fsck.h"
-static void usage __P((void));
-int cmdloop __P((void));
+static void usage(void) __dead2;
+int cmdloop(void);
static void
-usage()
+usage(void)
{
fprintf(stderr, "usage: fsdb [-d] [-f] [-r] fsname\n");
exit(1);
@@ -69,9 +69,7 @@ char nflag;
* the file system.
*/
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int ch, rval;
char *fsys = NULL;
@@ -117,10 +115,8 @@ main(argc, argv)
exit(rval);
}
-#define CMDFUNC(func) int func __P((int argc, char *argv[]))
-#define CMDFUNCSTART(func) int func(argc, argv) \
- int argc; \
- char *argv[];
+#define CMDFUNC(func) int func(int argc, char *argv[])
+#define CMDFUNCSTART(func) int func(int argc, char *argv[])
CMDFUNC(helpfn);
CMDFUNC(focus); /* focus on inode */
@@ -186,9 +182,7 @@ struct cmdtable cmds[] = {
};
int
-helpfn(argc, argv)
- int argc;
- char *argv[];
+helpfn(int argc, char *argv[])
{
struct cmdtable *cmdtp;
@@ -202,8 +196,7 @@ helpfn(argc, argv)
}
char *
-prompt(el)
- EditLine *el;
+prompt(EditLine *el)
{
static char pstring[64];
snprintf(pstring, sizeof(pstring), "fsdb (inum: %d)> ", curinum);
@@ -212,7 +205,7 @@ prompt(el)
int
-cmdloop()
+cmdloop(void)
{
char *line;
const char *elline;
@@ -392,8 +385,7 @@ const char *typename[] = {
int slot;
int
-scannames(idesc)
- struct inodesc *idesc;
+scannames(struct inodesc *idesc)
{
struct direct *dirp = idesc->id_dirp;
@@ -419,12 +411,11 @@ CMDFUNCSTART(ls)
return 0;
}
-int findino __P((struct inodesc *idesc)); /* from fsck */
-static int dolookup __P((char *name));
+int findino(struct inodesc *idesc); /* from fsck */
+static int dolookup(char *name);
static int
-dolookup(name)
- char *name;
+dolookup(char *name)
{
struct inodesc idesc;
@@ -514,8 +505,7 @@ CMDFUNCSTART(rm)
long slotcount, desired;
int
-chinumfunc(idesc)
- struct inodesc *idesc;
+chinumfunc(struct inodesc *idesc)
{
struct direct *dirp = idesc->id_dirp;
@@ -558,8 +548,7 @@ CMDFUNCSTART(chinum)
}
int
-chnamefunc(idesc)
- struct inodesc *idesc;
+chnamefunc(struct inodesc *idesc)
{
struct direct *dirp = idesc->id_dirp;
struct direct testdir;
@@ -822,9 +811,7 @@ CMDFUNCSTART(chgroup)
}
int
-dotime(name, rts)
- char *name;
- struct timespec *rts;
+dotime(char *name, struct timespec *rts)
{
char *p, *val;
struct tm t;
diff --git a/sbin/fsdb/fsdb.h b/sbin/fsdb/fsdb.h
index 7f2bc2e9d14b..90573491b149 100644
--- a/sbin/fsdb/fsdb.h
+++ b/sbin/fsdb/fsdb.h
@@ -30,10 +30,10 @@
* $FreeBSD$
*/
-extern int bread __P((int fd, char *buf, daddr_t blk, long size));
-extern void bwrite __P((int fd, char *buf, daddr_t blk, long size));
-extern void rwerror __P((char *mesg, daddr_t blk));
-extern int reply __P((char *question));
+extern int bread(int fd, char *buf, daddr_t blk, long size);
+extern void bwrite(int fd, char *buf, daddr_t blk, long size);
+extern void rwerror(char *mesg, daddr_t blk);
+extern int reply(char *question);
extern long dev_bsize;
extern long secsize;
@@ -48,15 +48,15 @@ struct cmdtable {
unsigned int flags;
#define FL_RO 0x0000 /* for symmetry */
#define FL_WR 0x0001 /* wants to write */
- int (*handler) __P((int argc, char *argv[]));
+ int (*handler)(int argc, char *argv[]);
};
extern struct dinode *curinode;
extern ino_t curinum;
-int argcount __P((struct cmdtable *cmdp, int argc, char *argv[]));
-char **crack __P((char *line, int *argc));
-char **recrack __P((char *line, int *argc, int argc_max));
-void printstat __P((const char *cp, ino_t inum, struct dinode *dp));
-int printactive __P((int doblocks));
-int checkactive __P((void));
-int checkactivedir __P((void));
+int argcount(struct cmdtable *cmdp, int argc, char *argv[]);
+char **crack(char *line, int *argc);
+char **recrack(char *line, int *argc, int argc_max);
+void printstat(const char *cp, ino_t inum, struct dinode *dp);
+int printactive(int doblocks);
+int checkactive(void);
+int checkactivedir(void);
diff --git a/sbin/fsdb/fsdbutil.c b/sbin/fsdb/fsdbutil.c
index 311be9eecdc9..96c48b0e77c9 100644
--- a/sbin/fsdb/fsdbutil.c
+++ b/sbin/fsdb/fsdbutil.c
@@ -49,14 +49,12 @@ static const char rcsid[] =
#include "fsdb.h"
#include "fsck.h"
-static int charsperline __P((void));
-static int printindir __P((ufs_daddr_t blk, int level, char *bufp));
-static void printblocks __P((ino_t inum, struct dinode *dp));
+static int charsperline(void);
+static int printindir(ufs_daddr_t blk, int level, char *bufp);
+static void printblocks(ino_t inum, struct dinode *dp);
char **
-crack(line, argc)
- char *line;
- int *argc;
+crack(char *line, int *argc)
{
static char *argv[8];
int i;
@@ -74,10 +72,7 @@ crack(line, argc)
}
char **
-recrack(line, argc, argc_max)
- char *line;
- int *argc;
- int argc_max;
+recrack(char *line, int *argc, int argc_max)
{
static char *argv[8];
int i;
@@ -97,10 +92,7 @@ recrack(line, argc, argc_max)
}
int
-argcount(cmdp, argc, argv)
- struct cmdtable *cmdp;
- int argc;
- char *argv[];
+argcount(struct cmdtable *cmdp, int argc, char *argv[])
{
if (cmdp->minargc == cmdp->maxargc)
warnx("command `%s' takes %u arguments, got %u", cmdp->cmd,
@@ -114,10 +106,7 @@ argcount(cmdp, argc, argv)
}
void
-printstat(cp, inum, dp)
- const char *cp;
- ino_t inum;
- struct dinode *dp;
+printstat(const char *cp, ino_t inum, struct dinode *dp)
{
struct group *grp;
struct passwd *pw;
@@ -189,7 +178,7 @@ printstat(cp, inum, dp)
*/
static int
-charsperline()
+charsperline(void)
{
int columns;
char *cp;
@@ -210,10 +199,7 @@ charsperline()
* Recursively print a list of indirect blocks.
*/
static int
-printindir(blk, level, bufp)
- ufs_daddr_t blk;
- int level;
- char *bufp;
+printindir(ufs_daddr_t blk, int level, char *bufp)
{
struct bufarea buf, *bp;
char tempbuf[32]; /* enough to print an ufs_daddr_t */
@@ -267,9 +253,7 @@ printindir(blk, level, bufp)
* Print the block pointers for one inode.
*/
static void
-printblocks(inum, dp)
- ino_t inum;
- struct dinode *dp;
+printblocks(ino_t inum, struct dinode *dp)
{
char *bufp;
int i, j, nfrags;
@@ -307,7 +291,7 @@ printblocks(inum, dp)
int
-checkactive()
+checkactive(void)
{
if (!curinode) {
warnx("no current inode\n");
@@ -317,7 +301,7 @@ checkactive()
}
int
-checkactivedir()
+checkactivedir(void)
{
if (!curinode) {
warnx("no current inode\n");
@@ -331,8 +315,7 @@ checkactivedir()
}
int
-printactive(doblocks)
- int doblocks;
+printactive(int doblocks)
{
if (!checkactive())
return 1;