summaryrefslogtreecommitdiff
path: root/timezone/zdump.c
diff options
context:
space:
mode:
Diffstat (limited to 'timezone/zdump.c')
-rw-r--r--timezone/zdump.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/timezone/zdump.c b/timezone/zdump.c
index ae4d286b12..d525da1bae 100644
--- a/timezone/zdump.c
+++ b/timezone/zdump.c
@@ -1,4 +1,4 @@
-static char elsieid[] = "@(#)zdump.c 8.2";
+static char elsieid[] = "@(#)zdump.c 7.74";
/*
** This code has been made independent of the rest of the time
@@ -15,7 +15,7 @@ static char elsieid[] = "@(#)zdump.c 8.2";
#include "ctype.h" /* for isalpha et al. */
#ifndef isascii
#define isascii(x) 1
-#endif /* !defined isascii */
+#endif
#ifndef ZDUMP_LO_YEAR
#define ZDUMP_LO_YEAR (-500)
@@ -130,7 +130,11 @@ static char elsieid[] = "@(#)zdump.c 8.2";
#endif /* !defined TZ_DOMAIN */
#ifndef P
+#ifdef __STDC__
#define P(x) x
+#else /* !defined __STDC__ */
+#define P(x) ()
+#endif /* !defined __STDC__ */
#endif /* !defined P */
extern char ** environ;
@@ -414,21 +418,14 @@ _("%s: use of -v on system with floating time_t other than float or double\n"),
}
} else if (0 > (time_t) -1) {
/*
- ** time_t is signed. Assume overflow wraps around.
+ ** time_t is signed.
*/
- time_t t = 0;
- time_t t1 = 1;
+ register time_t hibit;
- while (t < t1) {
- t = t1;
- t1 = 2 * t1 + 1;
- }
-
- absolute_max_time = t;
- t = -t;
- absolute_min_time = t - 1;
- if (t < absolute_min_time)
- absolute_min_time = t;
+ for (hibit = 1; (hibit * 2) != 0; hibit *= 2)
+ continue;
+ absolute_min_time = hibit;
+ absolute_max_time = -(hibit + 1);
} else {
/*
** time_t is unsigned.
@@ -471,7 +468,10 @@ const long y;
}
static time_t
-hunt(char *name, time_t lot, time_t hit)
+hunt(name, lot, hit)
+char * name;
+time_t lot;
+time_t hit;
{
time_t t;
long diff;
@@ -541,7 +541,10 @@ struct tm * oldp;
}
static void
-show(char *zone, time_t t, int v)
+show(zone, t, v)
+char * zone;
+time_t t;
+int v;
{
register struct tm * tmp;