From 91249324be8a7f3de6989b70da887f659c47b0f0 Mon Sep 17 00:00:00 2001 From: "William M. Brack" Date: Mon, 14 Jul 2003 04:59:57 +0000 Subject: [PATCH] fixed bug 113520 --- ChangeLog | 5 +++++ libexslt/date.c | 6 +++--- tests/exslt/date/seconds.1.out | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6c3b608..eef6bac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Jul 14 13:00:00 HKT 2003 William Brack + + * fixed bug 113520, incorrect result for date:seconds + with change to type casting in libexslt/date.c + Sat Jul 12 20:35:28 HKT 2003 William Brack * fixed bug 114764, trouble with globals and RVT's diff --git a/libexslt/date.c b/libexslt/date.c index 51f1c53..1fe64aa 100644 --- a/libexslt/date.c +++ b/libexslt/date.c @@ -1291,15 +1291,15 @@ exsltDateCastDateToNumber (const exsltDateValPtr dt) return 0.0; if ((dt->type & XS_GYEAR) == XS_GYEAR) { - ret = (double)(_exsltDateCastYMToDays(dt) * SECS_PER_DAY); + ret = (double)_exsltDateCastYMToDays(dt) * SECS_PER_DAY; } /* add in days */ if (dt->type == XS_DURATION) { - ret += (double)(dt->value.dur.day * SECS_PER_DAY); + ret += (double)dt->value.dur.day * SECS_PER_DAY; ret += dt->value.dur.sec; } else { - ret += (double)(dt->value.date.day * SECS_PER_DAY); + ret += (double)dt->value.date.day * SECS_PER_DAY; /* add in time */ ret += TIME_TO_NUMBER(dt); } diff --git a/tests/exslt/date/seconds.1.out b/tests/exslt/date/seconds.1.out index 89c8b72..e6a9948 100644 --- a/tests/exslt/date/seconds.1.out +++ b/tests/exslt/date/seconds.1.out @@ -32,6 +32,6 @@ result : 31536000 seconds : 1971-01-01T00:00:00 result : -31536000 seconds : 0001-01-01T00:00:00 -result : 2006054656 +result : 6.21355968e+10 seconds : -0001-01-01T00:00:00 -result : 2037590656 +result : 6.21671328e+10 -- 2.7.4