diff options
author | imp <imp@FreeBSD.org> | 2002-02-02 06:10:01 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2002-02-02 06:10:01 +0000 |
commit | ef44ec93a71d6f956cf008bf3f58ad2fc4623a4f (patch) | |
tree | 9de3818cf5f9e9244931cb3dace16141b110d5dd /bin | |
parent | 36a131477e61d6337711fbae88d2a6e9e93f82c9 (diff) | |
download | FreeBSD-src-ef44ec93a71d6f956cf008bf3f58ad2fc4623a4f.zip FreeBSD-src-ef44ec93a71d6f956cf008bf3f58ad2fc4623a4f.tar.gz |
Drag cat(1) kicking and screaming into the late 1980's:
o __P has been reoved
o Old-style K&R declarations have been converted to new C89 style
o register has been removed
o prototype for main() has been removed (gcc3 makes it an error)
o int main(int argc, char *argv[]) is the preferred main definition.
o Attempt to not break style(9) conformance for declarations more than
they already are.
Approved by: arch@, new style(9)
Diffstat (limited to 'bin')
-rw-r--r-- | bin/cat/cat.c | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/bin/cat/cat.c b/bin/cat/cat.c index ad47516..b167fa2 100644 --- a/bin/cat/cat.c +++ b/bin/cat/cat.c @@ -70,20 +70,16 @@ int bflag, eflag, nflag, sflag, tflag, vflag; int rval; const char *filename; -int main __P((int argc, char *argv[])); - -static void scanfiles __P((char **argv, int cooked)); -static void cook_cat __P((FILE *)); -static void raw_cat __P((int)); +static void scanfiles(char **argv, int cooked); +static void cook_cat(FILE *); +static void raw_cat(int); #ifndef NO_UDOM_SUPPORT -static int udom_open __P((const char *path, int flags)); +static int udom_open(const char *path, int flags); #endif int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { int ch; @@ -129,9 +125,7 @@ main(argc, argv) } void -scanfiles(argv, cooked) - char **argv; - int cooked; +scanfiles(char **argv, int cooked) { int i = 0; char *path; @@ -174,10 +168,9 @@ scanfiles(argv, cooked) } static void -cook_cat(fp) - register FILE *fp; +cook_cat(FILE *fp) { - register int ch, gobble, line, prev; + int ch, gobble, line, prev; /* Reset EOF condition on stdin. */ if (fp == stdin && feof(stdin)) @@ -242,10 +235,9 @@ cook_cat(fp) } static void -raw_cat(rfd) - register int rfd; +raw_cat(int rfd) { - register int off, wfd; + int off, wfd; ssize_t nr, nw; static size_t bsize; static char *buf; @@ -272,9 +264,7 @@ raw_cat(rfd) #ifndef NO_UDOM_SUPPORT static int -udom_open(path, flags) - const char *path; - int flags; +udom_open(const char *path, int flags) { struct sockaddr_un sou; int fd; |