Fri Sep 29 03:43:51 1995 Paul Eggert <eggert@twinsun.com>
authorroland <roland>
Fri, 6 Oct 1995 04:50:31 +0000 (04:50 +0000)
committerroland <roland>
Fri, 6 Oct 1995 04:50:31 +0000 (04:50 +0000)
commit4fd541c4c07889a037176b88a053f78b9aa67e37
tree675034916869aafe0ed7939dc20b010c80e1723f
parent292c956d4f7e748c1d821d3c6ca0b4f663f9e5e7
Fri Sep 29 03:43:51 1995  Paul Eggert  <eggert@twinsun.com>

Rewrite mktime from scratch for performance, and for correctness
in the presence of leap seconds.

* time/mktime.c (ydhms_tm_diff, not_equal_tm, print_tm, check_result):
New functions.
(LEAP_SECONDS_POSSIBLE, CHAR_BIT, INT_MIN, INT_MAX,
TIME_T_MIN, TIME_T_MAX, TM_YEAR_BASE, EPOCH_YEAR): New macros.
<limits.h>, <stdlib.h>: New #includes.
(main): Support tests with given broken-down value; support benchmarks.
(__mon_lengths, debugging_enabled, printtm, dist_tm, doit,
do_normalization, normalize, BAD_STRUCT_TM, SKIP_VALUE,
<ctype.h>): Remove.

* time/time.h, time/mktime.c (__mktime_internal): New offset arg.
* time/mktime.c (mktime), time/timegm.c (timegm): Use it.

* time/mktime.c (__mon_yday): New variable; replaces `__mon_lengths'.
time/offtime.c (__offtime), time/tzset.c (compute_change): Use it.

* time/offtime.c (__offtime): Remove useless assignment
`tp->tm_isdst = -1'.

* manual/maint.texi: Update credits.
manual/maint.texi
time/time.h
time/tzset.c