1
0
mirror of https://frontier.innolan.net/rainlance/amiga-tz.git synced 2025-11-21 19:15:49 +00:00

Remove attempt to support floating-point time_t.

It wasn't tested and probably never worked, no platform used it,
and the latest POSIX no longer allows it.
* Makefile (typecheck): Don't check time_t being 'double'.
* Theory: Document the change.
* difftime.c (difftime):
* localtime.c (differ_by_repeat, tzload, timesub, time2sub):
* private.h (time_t_min, time_t_max):
* zdump.c (absolute_min_time, absolute_max_time, tformat):
Don't try to support floating-point time_t.
* localtime.c, private.h, zdump.c: Don't include float.h.
* localtime.c (truncate_time, double_to_time):
* private.h (TYPE_INTEGRAL):
* zdump.c (checkabsolutes):
Remove; no longer needed.  All uses removed.
* zdump.8 (LIMITATIONS): Remove discussion of floating-point time_t.
This commit is contained in:
Paul Eggert
2013-08-12 01:41:34 -07:00
parent 4e5dbe1bbf
commit 3cfb933344
7 changed files with 16 additions and 140 deletions

View File

@ -5,7 +5,7 @@
/*LINTLIBRARY*/
#include "private.h" /* for time_t, TYPE_INTEGRAL, and TYPE_SIGNED */
#include "private.h" /* for time_t and TYPE_SIGNED */
double ATTRIBUTE_CONST
difftime(const time_t time1, const time_t time0)
@ -16,15 +16,8 @@ difftime(const time_t time1, const time_t time0)
*/
if (sizeof (double) > sizeof (time_t))
return (double) time1 - (double) time0;
if (!TYPE_INTEGRAL(time_t)) {
/*
** time_t is floating.
*/
return time1 - time0;
}
if (!TYPE_SIGNED(time_t)) {
/*
** time_t is integral and unsigned.
** The difference of two unsigned values can't overflow
** if the minuend is greater than or equal to the subtrahend.
*/
@ -33,7 +26,6 @@ difftime(const time_t time1, const time_t time0)
else return -(double) (time0 - time1);
}
/*
** time_t is integral and signed.
** Handle cases where both time1 and time0 have the same sign
** (meaning that their difference cannot overflow).
*/