diff options
author | stefanf <stefanf@FreeBSD.org> | 2004-06-14 10:31:52 +0000 |
---|---|---|
committer | stefanf <stefanf@FreeBSD.org> | 2004-06-14 10:31:52 +0000 |
commit | 819398b145715e5a4304dbc0fda51ccda8870f88 (patch) | |
tree | bc34b687aa5e1e885e5ec8f072d2774e97c05a1c /lib/libc/stdtime/difftime.c | |
parent | c8eeaa3f96986892a586a683b030200986cd5900 (diff) | |
download | FreeBSD-src-819398b145715e5a4304dbc0fda51ccda8870f88.zip FreeBSD-src-819398b145715e5a4304dbc0fda51ccda8870f88.tar.gz |
Merge changes from the tzcode2004a import. Wherever possible I tried to bring
us closer to the vendor branch.
Requested by: wollman
Diffstat (limited to 'lib/libc/stdtime/difftime.c')
-rw-r--r-- | lib/libc/stdtime/difftime.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/libc/stdtime/difftime.c b/lib/libc/stdtime/difftime.c index c79891c..596ea82 100644 --- a/lib/libc/stdtime/difftime.c +++ b/lib/libc/stdtime/difftime.c @@ -6,7 +6,7 @@ #include <sys/cdefs.h> #ifndef lint #ifndef NOID -static char elsieid[] __unused = "@(#)difftime.c 7.7"; +static char elsieid[] __unused = "@(#)difftime.c 7.9"; #endif /* !defined NOID */ #endif /* !defined lint */ __FBSDID("$FreeBSD$"); @@ -36,10 +36,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); /* |