[libxslt] Remove exsltDateCastDateToNumber
- From: Nick Wellnhofer <nwellnhof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxslt] Remove exsltDateCastDateToNumber
- Date: Thu, 18 May 2017 16:25:01 +0000 (UTC)
commit 909ded09388bdd8e5ca7162274953682b1635dad
Author: Nick Wellnhofer <wellnhofer aevum de>
Date: Wed May 17 22:56:48 2017 +0200
Remove exsltDateCastDateToNumber
This function was only used with durations.
libexslt/date.c | 43 ++++++-------------------------------------
1 files changed, 6 insertions(+), 37 deletions(-)
---
diff --git a/libexslt/date.c b/libexslt/date.c
index 81fddf9..85af021 100644
--- a/libexslt/date.c
+++ b/libexslt/date.c
@@ -1388,40 +1388,6 @@ _exsltDateCastYMToDays (const exsltDateValPtr dt)
(dt->value.date.min * SECS_PER_MIN)) + dt->value.date.sec)
/**
- * exsltDateCastDateToNumber:
- * @dt: an #exsltDateValPtr
- *
- * Calculates the number of seconds from year 1 AD.
- *
- * Returns seconds from zero year.
- */
-static double
-exsltDateCastDateToNumber (const exsltDateValPtr dt)
-{
- double ret = 0.0;
-
- if (dt == NULL)
- return 0.0;
-
- if ((dt->type & XS_GYEAR) == XS_GYEAR) {
- 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 += dt->value.dur.sec;
- } else {
- ret += (double)dt->value.date.day * SECS_PER_DAY;
- /* add in time */
- ret += TIME_TO_NUMBER(dt);
- }
-
-
- return ret;
-}
-
-/**
* _exsltDateTruncateDate:
* @dt: an #exsltDateValPtr
* @type: dateTime type to set to
@@ -2950,14 +2916,17 @@ exsltDateSeconds (const xmlChar *dateTime)
dur = _exsltDateDifference(y, dt, 1);
if (dur != NULL) {
- ret = exsltDateCastDateToNumber(dur);
+ ret = (double)dur->value.dur.day * SECS_PER_DAY +
+ dur->value.dur.sec;
exsltDateFreeDate(dur);
}
exsltDateFreeDate(y);
}
- } else if ((dt->type == XS_DURATION) && (dt->value.dur.mon == 0))
- ret = exsltDateCastDateToNumber(dt);
+ } else if ((dt->type == XS_DURATION) && (dt->value.dur.mon == 0)) {
+ ret = (double)dt->value.dur.day * SECS_PER_DAY +
+ dt->value.dur.sec;
+ }
exsltDateFreeDate(dt);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]