summaryrefslogtreecommitdiff
path: root/lib/libc/stdtime/difftime.c
diff options
context:
space:
mode:
authorStefan Farfeleder <stefanf@FreeBSD.org>2004-06-14 09:31:29 +0000
committerStefan Farfeleder <stefanf@FreeBSD.org>2004-06-14 09:31:29 +0000
commitdcd1bc204fd36ed3fc26c4077f8d4d4e97020da0 (patch)
tree269ac698a908cc0d64dee4f8a19b576ba3e4195b /lib/libc/stdtime/difftime.c
parent7765d84cdec3fcd768518c96fd849673c90a01d4 (diff)
Import tzcode2004a.
Obtained from: ftp://elsie.nci.nih.gov/pub/tzcode2004a.tar.gz
Notes
svn path=/vendor/tzcode/dist/; revision=130459
Diffstat (limited to 'lib/libc/stdtime/difftime.c')
-rw-r--r--lib/libc/stdtime/difftime.c16
1 files changed, 11 insertions, 5 deletions
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);
/*