diff options
author | ed <ed@FreeBSD.org> | 2012-10-19 14:49:42 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2012-10-19 14:49:42 +0000 |
commit | af31e8843c2cc0ba388a33f341de8da1b50de433 (patch) | |
tree | ddffe542a2e921ec48c73d322a2046f559a9d74f /usr.bin/calendar | |
parent | b1462253851ab8c1f6dde48bb7796b15d3f38253 (diff) | |
download | FreeBSD-src-af31e8843c2cc0ba388a33f341de8da1b50de433.zip FreeBSD-src-af31e8843c2cc0ba388a33f341de8da1b50de433.tar.gz |
More -Wmissing-variable-declarations fixes.
In addition to adding `static' where possible:
- bin/date: Move `retval' into extern.h to make it visible to date.c.
- bin/ed: Move globally used variables into ed.h.
- sbin/camcontrol: Move `verbose' into camcontrol.h and fix shadow warnings.
- usr.bin/calendar: Remove unneeded variables.
- usr.bin/chat: Make `line' local instead of global.
- usr.bin/elfdump: Comment out unneeded function.
- usr.bin/rlogin: Use _Noreturn instead of __dead2.
- usr.bin/tset: Pull `Ospeed' into extern.h.
- usr.sbin/mfiutil: Put global variables in mfiutil.h.
- usr.sbin/pkg: Remove unused `os_corres'.
- usr.sbin/quotaon, usr.sbin/repquota: Remove unused `qfname'.
Diffstat (limited to 'usr.bin/calendar')
-rw-r--r-- | usr.bin/calendar/calendar.c | 4 | ||||
-rw-r--r-- | usr.bin/calendar/dates.c | 11 | ||||
-rw-r--r-- | usr.bin/calendar/day.c | 2 | ||||
-rw-r--r-- | usr.bin/calendar/io.c | 6 |
4 files changed, 11 insertions, 12 deletions
diff --git a/usr.bin/calendar/calendar.c b/usr.bin/calendar/calendar.c index bd03e02..2a107c2 100644 --- a/usr.bin/calendar/calendar.c +++ b/usr.bin/calendar/calendar.c @@ -60,8 +60,8 @@ __FBSDID("$FreeBSD$"); struct passwd *pw; int doall = 0; int debug = 0; -char *DEBUG = NULL; -time_t f_time = 0; +static char *DEBUG = NULL; +static time_t f_time = 0; double UTCOffset = UTCOFFSET_NOTSET; int EastLongitude = LONGITUDE_NOTSET; diff --git a/usr.bin/calendar/dates.c b/usr.bin/calendar/dates.c index 3f8b89f..989f29c 100644 --- a/usr.bin/calendar/dates.c +++ b/usr.bin/calendar/dates.c @@ -43,7 +43,7 @@ struct cal_year { int firstdayofweek; /* 0 .. 6 */ struct cal_month *months; struct cal_year *nextyear; -} cal_year; +}; struct cal_month { int month; /* 01 .. 12 */ @@ -52,7 +52,7 @@ struct cal_month { struct cal_year *year; /* points back */ struct cal_day *days; struct cal_month *nextmonth; -} cal_month; +}; struct cal_day { int dayofmonth; /* 01 .. 31 */ @@ -62,19 +62,18 @@ struct cal_day { struct cal_month *month; /* points back */ struct cal_year *year; /* points back */ struct event *events; -} cal_day; +}; int debug_remember = 0; -struct cal_year *hyear = NULL; +static struct cal_year *hyear = NULL; /* 1-based month, 0-based days, cumulative */ -int *cumdays; int cumdaytab[][14] = { {0, -1, 30, 58, 89, 119, 150, 180, 211, 242, 272, 303, 333, 364}, {0, -1, 30, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365}, }; /* 1-based month, individual */ -int *mondays; +static int *mondays; int mondaytab[][14] = { {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 30}, {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 30}, diff --git a/usr.bin/calendar/day.c b/usr.bin/calendar/day.c index 237b6b5..dac6115 100644 --- a/usr.bin/calendar/day.c +++ b/usr.bin/calendar/day.c @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); #include "calendar.h" -time_t time1, time2; +static time_t time1, time2; const struct tm tm0; char dayname[100]; int year1, year2; diff --git a/usr.bin/calendar/io.c b/usr.bin/calendar/io.c index e1ed21d..1625717 100644 --- a/usr.bin/calendar/io.c +++ b/usr.bin/calendar/io.c @@ -60,10 +60,10 @@ __FBSDID("$FreeBSD$"); #include "calendar.h" const char *calendarFile = "calendar"; /* default calendar file */ -const char *calendarHomes[] = {".calendar", _PATH_INCLUDE}; /* HOME */ -const char *calendarNoMail = "nomail"; /* don't sent mail if this file exist */ +static const char *calendarHomes[] = {".calendar", _PATH_INCLUDE}; /* HOME */ +static const char *calendarNoMail = "nomail";/* don't sent mail if file exist */ -char path[MAXPATHLEN]; +static char path[MAXPATHLEN]; struct fixs neaster, npaskha, ncny, nfullmoon, nnewmoon; struct fixs nmarequinox, nsepequinox, njunsolstice, ndecsolstice; |