From dcd1bc204fd36ed3fc26c4077f8d4d4e97020da0 Mon Sep 17 00:00:00 2001 From: Stefan Farfeleder Date: Mon, 14 Jun 2004 09:31:29 +0000 Subject: Import tzcode2004a. Obtained from: ftp://elsie.nci.nih.gov/pub/tzcode2004a.tar.gz --- lib/libc/stdtime/difftime.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'lib/libc/stdtime/difftime.c') diff --git a/lib/libc/stdtime/difftime.c b/lib/libc/stdtime/difftime.c index f178524f5152..1d1519e15939 100644 --- a/lib/libc/stdtime/difftime.c +++ b/lib/libc/stdtime/difftime.c @@ -5,7 +5,7 @@ #ifndef lint #ifndef NOID -static char elsieid[] = "@(#)difftime.c 7.7"; +static char elsieid[] = "@(#)difftime.c 7.9"; #endif /* !defined NOID */ #endif /* !defined lint */ @@ -32,10 +32,16 @@ const time_t time0; time_t delta; time_t hibit; - if (sizeof(time_t) < sizeof(double)) - return (double) time1 - (double) time0; - if (sizeof(time_t) < sizeof(long_double)) - return (long_double) time1 - (long_double) time0; + { + time_t tt; + double d; + long_double ld; + + if (sizeof tt < sizeof d) + return (double) time1 - (double) time0; + if (sizeof tt < sizeof ld) + return (long_double) time1 - (long_double) time0; + } if (time1 < time0) return -difftime(time0, time1); /* -- cgit v1.3