diff options
author | markm <markm@FreeBSD.org> | 2002-02-22 20:51:00 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2002-02-22 20:51:00 +0000 |
commit | 7b7558d88436331476243b0b668d2e257d7687fe (patch) | |
tree | ba3cea9a04974b56b589e2a934d2f4ae56780dce /bin/date/vary.c | |
parent | f24931e332589b25b779130a37d5f3491e609025 (diff) | |
download | FreeBSD-src-7b7558d88436331476243b0b668d2e257d7687fe.zip FreeBSD-src-7b7558d88436331476243b0b668d2e257d7687fe.tar.gz |
Fix warnings inspired by lint, a commercial lint and WARNS=4.
Diffstat (limited to 'bin/date/vary.c')
-rw-r--r-- | bin/date/vary.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/bin/date/vary.c b/bin/date/vary.c index 7ee8a4f..2e0bb88 100644 --- a/bin/date/vary.c +++ b/bin/date/vary.c @@ -29,6 +29,7 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ +#include <sys/cdefs.h> #include <err.h> #include <time.h> #include <string.h> @@ -37,7 +38,7 @@ static const char rcsid[] = struct trans { int val; - char *str; + const char *str; }; static struct trans trans_mon[] = { @@ -203,14 +204,14 @@ adjmon(struct tm *t, char type, int val, int istext, int mk) static int adjday(struct tm *t, char type, int val, int mk) { - int mdays; + int lmdays; switch (type) { case '+': while (val) { - mdays = daysinmonth(t); - if (val > mdays - t->tm_mday) { - val -= mdays - t->tm_mday + 1; + lmdays = daysinmonth(t); + if (val > lmdays - t->tm_mday) { + val -= lmdays - t->tm_mday + 1; t->tm_mday = 1; if (!adjmon(t, '+', 1, 0, 0)) return 0; @@ -413,7 +414,7 @@ vary_apply(const struct vary *v, struct tm *t) char type; char which; char *arg; - int len; + size_t len; int val; for (; v; v = v->next) { |