diff options
author | Warner Losh <imp@FreeBSD.org> | 2002-02-02 06:24:13 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2002-02-02 06:24:13 +0000 |
commit | f9bcb0beb529e74510077ff052839d7ad2817950 (patch) | |
tree | bb89216bd31fd20d2f8d292f03ed0842028b958d /bin/date | |
parent | 5dce647c1b3b206238c72385c0b16f62e508ec30 (diff) |
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)
Notes
Notes:
svn path=/head/; revision=90108
Diffstat (limited to 'bin/date')
-rw-r--r-- | bin/date/date.c | 23 | ||||
-rw-r--r-- | bin/date/extern.h | 2 | ||||
-rw-r--r-- | bin/date/netdate.c | 3 |
3 files changed, 11 insertions, 17 deletions
diff --git a/bin/date/date.c b/bin/date/date.c index d879fa6aa5e2..8c42f083ff52 100644 --- a/bin/date/date.c +++ b/bin/date/date.c @@ -67,16 +67,14 @@ static const char rcsid[] = time_t tval; int retval; -static void setthetime __P((const char *, const char *, int, int)); -static void badformat __P((void)); -static void usage __P((void)); +static void setthetime(const char *, const char *, int, int); +static void badformat(void); +static void usage(void); -int logwtmp __P((char *, char *, char *)); +int logwtmp(char *, char *, char *); int -main(argc, argv) - int argc; - char **argv; +main(int argc, char *argv[]) { struct timezone tz; int ch, rflag; @@ -182,12 +180,9 @@ main(argc, argv) #define ATOI2(s) ((s) += 2, ((s)[-2] - '0') * 10 + ((s)[-1] - '0')) void -setthetime(fmt, p, jflag, nflag) - const char *fmt; - register const char *p; - int jflag, nflag; +setthetime(const char *fmt, const char *p, int jflag, int nflag) { - register struct tm *lt; + struct tm *lt; struct timeval tv; const char *dot, *t; int century; @@ -295,14 +290,14 @@ setthetime(fmt, p, jflag, nflag) } static void -badformat() +badformat(void) { warnx("illegal time format"); usage(); } static void -usage() +usage(void) { (void)fprintf(stderr, "%s\n%s\n", "usage: date [-jnu] [-d dst] [-r seconds] [-t west] " diff --git a/bin/date/extern.h b/bin/date/extern.h index 4726eb6a97c3..17b35bbf06a1 100644 --- a/bin/date/extern.h +++ b/bin/date/extern.h @@ -34,4 +34,4 @@ * $FreeBSD$ */ -int netsettime __P((time_t)); +int netsettime(time_t); diff --git a/bin/date/netdate.c b/bin/date/netdate.c index 8c5f6e97937d..c8bb51acd780 100644 --- a/bin/date/netdate.c +++ b/bin/date/netdate.c @@ -68,8 +68,7 @@ extern int retval; * Returns 0 on success. Returns > 0 on failure, setting retval to 2; */ int -netsettime(tval) - time_t tval; +netsettime(time_t tval) { struct timeval tout; struct servent *sp; |