From b4339b74aded4c38ebcfe3a2a9b37b900abb8874 Mon Sep 17 00:00:00 2001 From: dwmalone Date: Wed, 4 Sep 2002 23:29:10 +0000 Subject: ANSIify function definitions. Add some constness to avoid some warnings. Remove use register keyword. Deal with missing/unneeded extern/prototypes. Some minor type changes/casts to avoid warnings. Reviewed by: md5 --- usr.bin/last/last.c | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) (limited to 'usr.bin/last/last.c') diff --git a/usr.bin/last/last.c b/usr.bin/last/last.c index b3325cc..221f6db 100644 --- a/usr.bin/last/last.c +++ b/usr.bin/last/last.c @@ -119,9 +119,7 @@ usage(void) } int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { int ch; char *p; @@ -198,7 +196,7 @@ main(argc, argv) * read through the wtmp file */ void -wtmp() +wtmp(void) { struct utmp *bp; /* current structure */ struct stat stb; /* stat of file for size */ @@ -237,8 +235,7 @@ wtmp() * process a single wtmp entry */ void -doentry(bp) - struct utmp *bp; +doentry(struct utmp *bp) { struct ttytab *tt, *ttx; /* ttylist entry */ @@ -325,9 +322,7 @@ doentry(bp) * logout type (crash/shutdown) as appropriate. */ void -printentry(bp, tt) - struct utmp *bp; - struct ttytab *tt; +printentry(struct utmp *bp, struct ttytab *tt) { char ct[80]; struct tm *tm; @@ -378,8 +373,7 @@ printentry(bp, tt) * see if want this entry */ int -want(bp) - struct utmp *bp; +want(struct utmp *bp) { ARG *step; @@ -412,9 +406,7 @@ want(bp) * add an entry to a linked list of arguments */ void -addarg(type, arg) - int type; - char *arg; +addarg(int type, char *arg) { ARG *cur; @@ -433,8 +425,7 @@ addarg(type, arg) * off the domain suffix since that's what login(1) does. */ void -hostconv(arg) - char *arg; +hostconv(char *arg) { static int first = 1; static char *hostdot, name[MAXHOSTNAMELEN]; @@ -457,8 +448,7 @@ hostconv(arg) * convert tty to correct name. */ char * -ttyconv(arg) - char *arg; +ttyconv(char *arg) { char *mval; @@ -490,8 +480,7 @@ ttyconv(arg) * Derived from atime_arg1() in usr.bin/touch/touch.c */ time_t -dateconv(arg) - char *arg; +dateconv(char *arg) { time_t timet; struct tm *t; @@ -562,8 +551,7 @@ terr: errx(1, * on interrupt, we inform the user how far we've gotten */ void -onintr(signo) - int signo; +onintr(int signo) { char ct[80]; struct tm *tm; -- cgit v1.1