From dda0e5cbe44df7bcc04ee2a206e4a3095780e447 Mon Sep 17 00:00:00 2001 From: dwmalone Date: Mon, 7 May 2007 11:18:30 +0000 Subject: ANSIfy function definitions. Move some extern declarations to a header file. Remove an unneeded extern declaration for optarg. --- usr.bin/calendar/calendar.c | 6 ++---- usr.bin/calendar/calendar.h | 3 ++- usr.bin/calendar/day.c | 25 +++++++++---------------- usr.bin/calendar/io.c | 11 ++++------- usr.bin/calendar/ostern.c | 9 +++------ usr.bin/calendar/paskha.c | 9 ++------- 6 files changed, 22 insertions(+), 41 deletions(-) (limited to 'usr.bin/calendar') diff --git a/usr.bin/calendar/calendar.c b/usr.bin/calendar/calendar.c index aae5f2a..5a0eefc 100644 --- a/usr.bin/calendar/calendar.c +++ b/usr.bin/calendar/calendar.c @@ -67,9 +67,7 @@ int f_dayBefore = 0; /* days before current date */ int Friday = 5; /* day before weekend */ int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { int ch; @@ -143,7 +141,7 @@ main(argc, argv) void -usage() +usage(void) { (void)fprintf(stderr, "%s\n%s\n", "usage: calendar [-a] [-A days] [-B days] [-F friday] " diff --git a/usr.bin/calendar/calendar.h b/usr.bin/calendar/calendar.h index fdda4b5..48fb785 100644 --- a/usr.bin/calendar/calendar.h +++ b/usr.bin/calendar/calendar.h @@ -41,7 +41,8 @@ extern int doall; extern struct iovec header[]; extern struct tm *tp; extern const char *calendarFile; -extern char *optarg; +extern int *cumdays; +extern struct fixs neaster, npaskha; void cal(void); void closecal(FILE *); diff --git a/usr.bin/calendar/day.c b/usr.bin/calendar/day.c index 2df00ee..90890d0 100644 --- a/usr.bin/calendar/day.c +++ b/usr.bin/calendar/day.c @@ -75,7 +75,8 @@ static struct fixs fnmonths[13]; /* full national months names */ static struct fixs nmonths[13]; /* short national month names */ -void setnnames(void) +void +setnnames(void) { char buf[80]; int i, l; @@ -137,8 +138,7 @@ void setnnames(void) } void -settime(now) - time_t now; +settime(time_t now) { char *oldl, *lbufp; @@ -170,8 +170,8 @@ settime(now) /* convert Day[/Month][/Year] into unix time (since 1970) * Day: two digits, Month: two digits, Year: digits */ -time_t Mktime (dp) - char *dp; +time_t +Mktime (char *dp) { time_t t; int d, m, y; @@ -216,11 +216,7 @@ time_t Mktime (dp) * along with the matched line. */ int -isnow(endp, monthp, dayp, varp) - char *endp; - int *monthp; - int *dayp; - int *varp; +isnow(char *endp, int *monthp, int *dayp, int *varp) { int day, flags, month = 0, v1, v2; @@ -397,8 +393,7 @@ isnow(endp, monthp, dayp, varp) int -getmonth(s) - char *s; +getmonth(char *s) { const char **p; struct fixs *n; @@ -417,8 +412,7 @@ getmonth(s) int -getday(s) - char *s; +getday(char *s) { const char **p; struct fixs *n; @@ -441,8 +435,7 @@ getday(s) * ... etc ... */ int -getdayvar(s) - char *s; +getdayvar(char *s) { int offs; diff --git a/usr.bin/calendar/io.c b/usr.bin/calendar/io.c index df19e8c..ee5b988 100644 --- a/usr.bin/calendar/io.c +++ b/usr.bin/calendar/io.c @@ -85,7 +85,7 @@ struct iovec header[] = { void -cal() +cal(void) { int printing; char *p; @@ -166,9 +166,7 @@ cal() } int -getfield(p, endp, flags) - char *p, **endp; - int *flags; +getfield(char *p, char **endp, int *flags) { int val, var; char *start, savech; @@ -233,7 +231,7 @@ getfield(p, endp, flags) char path[MAXPATHLEN]; FILE * -opencal() +opencal(void) { uid_t uid; size_t i; @@ -312,8 +310,7 @@ opencal() } void -closecal(fp) - FILE *fp; +closecal(FILE *fp) { uid_t uid; struct stat sbuf; diff --git a/usr.bin/calendar/ostern.c b/usr.bin/calendar/ostern.c index f000f7d..833d623 100644 --- a/usr.bin/calendar/ostern.c +++ b/usr.bin/calendar/ostern.c @@ -43,8 +43,8 @@ __FBSDID("$FreeBSD$"); * Astronomical Almanac". */ -int easter (year) - int year; /* 0 ... abcd, NOT since 1900 */ +int +easter(int year) /* 0 ... abcd, NOT since 1900 */ { int G, /* Golden number - 1 */ C, /* Century */ @@ -73,12 +73,9 @@ int easter (year) */ int -geteaster(s, year) - char *s; - int year; +geteaster(char *s, int year) { int offset = 0; - extern struct fixs neaster; #define EASTER "easter" #define EASTERNAMELEN (sizeof(EASTER) - 1) diff --git a/usr.bin/calendar/paskha.c b/usr.bin/calendar/paskha.c index 3999d31..769d091 100644 --- a/usr.bin/calendar/paskha.c +++ b/usr.bin/calendar/paskha.c @@ -43,13 +43,11 @@ static int paskha (int); /* (old style result) */ static int -paskha (R) -int R; /*year*/ +paskha(int R) /*year*/ { int a, b, c, d, e; static int x = 15; static int y = 6; - extern int *cumdays; a = R % 19; b = R % 4; @@ -62,12 +60,9 @@ int R; /*year*/ /* return year day for Orthodox Easter depending days */ int -getpaskha(s, year) - char *s; - int year; +getpaskha(char *s, int year) { int offset; - extern struct fixs npaskha; if (strncasecmp(s, PASKHA, PASKHALEN) == 0) s += PASKHALEN; -- cgit v1.1