diff options
author | imp <imp@FreeBSD.org> | 2002-02-02 06:50:57 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2002-02-02 06:50:57 +0000 |
commit | 5ef5088ac4e038d0a147a08377ef087fd6edf527 (patch) | |
tree | 01a827446e9ba4f34cf1e754fcac691f6c9eb1cf /bin/stty | |
parent | 50014e35418ca00d25ea852fc4f94acf80be4df3 (diff) | |
download | FreeBSD-src-5ef5088ac4e038d0a147a08377ef087fd6edf527.zip FreeBSD-src-5ef5088ac4e038d0a147a08377ef087fd6edf527.tar.gz |
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.
o Change
int
foo() {
...
to
int
foo(void)
{
...
Diffstat (limited to 'bin/stty')
-rw-r--r-- | bin/stty/cchar.c | 9 | ||||
-rw-r--r-- | bin/stty/extern.h | 22 | ||||
-rw-r--r-- | bin/stty/gfmt.c | 14 | ||||
-rw-r--r-- | bin/stty/key.c | 91 | ||||
-rw-r--r-- | bin/stty/modes.c | 6 | ||||
-rw-r--r-- | bin/stty/print.c | 22 | ||||
-rw-r--r-- | bin/stty/stty.c | 8 | ||||
-rw-r--r-- | bin/stty/util.c | 2 |
8 files changed, 66 insertions, 108 deletions
diff --git a/bin/stty/cchar.c b/bin/stty/cchar.c index 8552160..297ba6b 100644 --- a/bin/stty/cchar.c +++ b/bin/stty/cchar.c @@ -50,7 +50,7 @@ static const char rcsid[] = #include "stty.h" #include "extern.h" -static int c_cchar __P((const void *, const void *)); +static int c_cchar(const void *, const void *); /* * Special control characters. @@ -90,17 +90,14 @@ struct cchar cchars2[] = { }; static int -c_cchar(a, b) - const void *a, *b; +c_cchar(const void *a, const void *b) { return (strcmp(((const struct cchar *)a)->name, ((const struct cchar *)b)->name)); } int -csearch(argvp, ip) - char ***argvp; - struct info *ip; +csearch(char ***argvp, struct info *ip) { struct cchar *cp, tmp; long val; diff --git a/bin/stty/extern.h b/bin/stty/extern.h index 27869f8..35d5f9afe 100644 --- a/bin/stty/extern.h +++ b/bin/stty/extern.h @@ -34,16 +34,16 @@ * $FreeBSD$ */ -int c_cchars __P((const void *, const void *)); -int c_modes __P((const void *, const void *)); -int csearch __P((char ***, struct info *)); -void checkredirect __P((void)); -void gprint __P((struct termios *, struct winsize *, int)); -void gread __P((struct termios *, char *)); -int ksearch __P((char ***, struct info *)); -int msearch __P((char ***, struct info *)); -void optlist __P((void)); -void print __P((struct termios *, struct winsize *, int, enum FMT)); -void usage __P((void)); +int c_cchars(const void *, const void *); +int c_modes(const void *, const void *); +int csearch(char ***, struct info *); +void checkredirect(void); +void gprint(struct termios *, struct winsize *, int); +void gread(struct termios *, char *); +int ksearch(char ***, struct info *); +int msearch(char ***, struct info *); +void optlist(void); +void print(struct termios *, struct winsize *, int, enum FMT); +void usage(void); extern struct cchar cchars1[], cchars2[]; diff --git a/bin/stty/gfmt.c b/bin/stty/gfmt.c index 8a9a03a..be0218a 100644 --- a/bin/stty/gfmt.c +++ b/bin/stty/gfmt.c @@ -48,11 +48,10 @@ static const char rcsid[] = #include "stty.h" #include "extern.h" -static void gerr __P((const char *s)); +static void gerr(const char *s); static void -gerr(s) - const char *s; +gerr(const char *s) { if (s) errx(1, "illegal gfmt1 option -- %s", s); @@ -61,10 +60,7 @@ gerr(s) } void -gprint(tp, wp, ldisc) - struct termios *tp; - struct winsize *wp __unused; - int ldisc __unused; +gprint(struct termios *tp, struct winsize *wp __unused, int ldisc __unused) { struct cchar *cp; @@ -78,9 +74,7 @@ gprint(tp, wp, ldisc) } void -gread(tp, s) - struct termios *tp; - char *s; +gread(struct termios *tp, char *s) { struct cchar *cp; char *ep, *p; diff --git a/bin/stty/key.c b/bin/stty/key.c index 9a48f41..1b9ce2b 100644 --- a/bin/stty/key.c +++ b/bin/stty/key.c @@ -52,28 +52,28 @@ static const char rcsid[] = #include "extern.h" __BEGIN_DECLS -static int c_key __P((const void *, const void *)); -void f_all __P((struct info *)); -void f_cbreak __P((struct info *)); -void f_columns __P((struct info *)); -void f_dec __P((struct info *)); -void f_ek __P((struct info *)); -void f_everything __P((struct info *)); -void f_extproc __P((struct info *)); -void f_ispeed __P((struct info *)); -void f_nl __P((struct info *)); -void f_ospeed __P((struct info *)); -void f_raw __P((struct info *)); -void f_rows __P((struct info *)); -void f_sane __P((struct info *)); -void f_size __P((struct info *)); -void f_speed __P((struct info *)); -void f_tty __P((struct info *)); +static int c_key(const void *, const void *); +void f_all(struct info *); +void f_cbreak(struct info *); +void f_columns(struct info *); +void f_dec(struct info *); +void f_ek(struct info *); +void f_everything(struct info *); +void f_extproc(struct info *); +void f_ispeed(struct info *); +void f_nl(struct info *); +void f_ospeed(struct info *); +void f_raw(struct info *); +void f_rows(struct info *); +void f_sane(struct info *); +void f_size(struct info *); +void f_speed(struct info *); +void f_tty(struct info *); __END_DECLS static struct key { const char *name; /* name */ - void (*f) __P((struct info *)); /* function */ + void (*f)(struct info *); /* function */ #define F_NEEDARG 0x01 /* needs an argument */ #define F_OFFOK 0x02 /* can turn off */ int flags; @@ -101,17 +101,14 @@ static struct key { }; static int -c_key(a, b) - const void *a, *b; +c_key(const void *a, const void *b) { return (strcmp(((const struct key *)a)->name, ((const struct key *)b)->name)); } int -ksearch(argvp, ip) - char ***argvp; - struct info *ip; +ksearch(char ***argvp, struct info *ip) { char *name; struct key *kp, tmp; @@ -140,15 +137,13 @@ ksearch(argvp, ip) } void -f_all(ip) - struct info *ip; +f_all(struct info *ip) { print(&ip->t, &ip->win, ip->ldisc, BSD); } void -f_cbreak(ip) - struct info *ip; +f_cbreak(struct info *ip) { if (ip->off) @@ -163,8 +158,7 @@ f_cbreak(ip) } void -f_columns(ip) - struct info *ip; +f_columns(struct info *ip) { ip->win.ws_col = atoi(ip->arg); @@ -172,8 +166,7 @@ f_columns(ip) } void -f_dec(ip) - struct info *ip; +f_dec(struct info *ip) { ip->t.c_cc[VERASE] = (u_char)0177; @@ -186,8 +179,7 @@ f_dec(ip) } void -f_ek(ip) - struct info *ip; +f_ek(struct info *ip) { ip->t.c_cc[VERASE] = CERASE; @@ -196,16 +188,14 @@ f_ek(ip) } void -f_everything(ip) - struct info *ip; +f_everything(struct info *ip) { print(&ip->t, &ip->win, ip->ldisc, BSD); } void -f_extproc(ip) - struct info *ip; +f_extproc(struct info *ip) { if (ip->off) { @@ -218,8 +208,7 @@ f_extproc(ip) } void -f_ispeed(ip) - struct info *ip; +f_ispeed(struct info *ip) { cfsetispeed(&ip->t, (speed_t)atoi(ip->arg)); @@ -227,8 +216,7 @@ f_ispeed(ip) } void -f_nl(ip) - struct info *ip; +f_nl(struct info *ip) { if (ip->off) { @@ -242,8 +230,7 @@ f_nl(ip) } void -f_ospeed(ip) - struct info *ip; +f_ospeed(struct info *ip) { cfsetospeed(&ip->t, (speed_t)atoi(ip->arg)); @@ -251,8 +238,7 @@ f_ospeed(ip) } void -f_raw(ip) - struct info *ip; +f_raw(struct info *ip) { if (ip->off) @@ -266,8 +252,7 @@ f_raw(ip) } void -f_rows(ip) - struct info *ip; +f_rows(struct info *ip) { ip->win.ws_row = atoi(ip->arg); @@ -275,8 +260,7 @@ f_rows(ip) } void -f_sane(ip) - struct info *ip; +f_sane(struct info *ip) { ip->t.c_cflag = TTYDEF_CFLAG | (ip->t.c_cflag & CLOCAL); @@ -290,24 +274,21 @@ f_sane(ip) } void -f_size(ip) - struct info *ip; +f_size(struct info *ip) { (void)printf("%d %d\n", ip->win.ws_row, ip->win.ws_col); } void -f_speed(ip) - struct info *ip; +f_speed(struct info *ip) { (void)printf("%lu\n", (u_long)cfgetospeed(&ip->t)); } void -f_tty(ip) - struct info *ip; +f_tty(struct info *ip) { int tmp; diff --git a/bin/stty/modes.c b/bin/stty/modes.c index 926dc7d..9cfcfea 100644 --- a/bin/stty/modes.c +++ b/bin/stty/modes.c @@ -44,7 +44,7 @@ static const char rcsid[] = #include <string.h> #include "stty.h" -int msearch __P((char ***, struct info *)); +int msearch(char ***, struct info *); struct modes { const char *name; @@ -209,9 +209,7 @@ struct modes omodes[] = { #define CHK(s) (*name == s[0] && !strcmp(name, s)) int -msearch(argvp, ip) - char ***argvp; - struct info *ip; +msearch(char ***argvp, struct info *ip) { struct modes *mp; char *name; diff --git a/bin/stty/print.c b/bin/stty/print.c index 6aff06a..63fe8d6 100644 --- a/bin/stty/print.c +++ b/bin/stty/print.c @@ -50,16 +50,12 @@ static const char rcsid[] = #include <sys/ioctl_compat.h> /* XXX NTTYDISC is too well hidden */ -static void binit __P((const char *)); -static void bput __P((const char *)); -static const char *ccval __P((struct cchar *, int)); +static void binit(const char *); +static void bput(const char *); +static const char *ccval(struct cchar *, int); void -print(tp, wp, ldisc, fmt) - struct termios *tp; - struct winsize *wp; - int ldisc; - enum FMT fmt; +print(struct termios *tp, struct winsize *wp, int ldisc, enum FMT fmt) { struct cchar *p; long tmp; @@ -228,8 +224,7 @@ static int col; static const char *label; static void -binit(lb) - const char *lb; +binit(const char *lb) { if (col) { @@ -240,8 +235,7 @@ binit(lb) } static void -bput(s) - const char *s; +bput(const char *s) { if (col == 0) { @@ -257,9 +251,7 @@ bput(s) } static const char * -ccval(p, c) - struct cchar *p; - int c; +ccval(struct cchar *p, int c) { static char buf[5]; char *bp; diff --git a/bin/stty/stty.c b/bin/stty/stty.c index d794544..049667a 100644 --- a/bin/stty/stty.c +++ b/bin/stty/stty.c @@ -59,12 +59,8 @@ static const char rcsid[] = #include "stty.h" #include "extern.h" -int main __P((int, char *[])); - int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { struct info i; enum FMT fmt; @@ -160,7 +156,7 @@ args: argc -= optind; } void -usage() +usage(void) { (void)fprintf(stderr, "usage: stty [-a|-e|-g] [-f file] [options]\n"); diff --git a/bin/stty/util.c b/bin/stty/util.c index b99e83f..a5b6790 100644 --- a/bin/stty/util.c +++ b/bin/stty/util.c @@ -57,7 +57,7 @@ static const char rcsid[] = * redirected. */ void -checkredirect() +checkredirect(void) { struct stat sb1, sb2; |