diff options
Diffstat (limited to 'xmlschemastypes.c')
-rw-r--r-- | xmlschemastypes.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/xmlschemastypes.c b/xmlschemastypes.c index 91e34b8..9ed7fb0 100644 --- a/xmlschemastypes.c +++ b/xmlschemastypes.c @@ -506,9 +506,9 @@ xmlSchemaGetPredefinedType(const xmlChar *name, const xmlChar *ns) { #define IS_LEAP(y) \ (((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0)) -static const long daysInMonth[12] = +static const unsigned int daysInMonth[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; -static const long daysInMonthLeap[12] = +static const unsigned int daysInMonthLeap[12] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; #define MAX_DAYINMONTH(yr,mon) \ @@ -2651,8 +2651,8 @@ _xmlSchemaDateAdd (xmlSchemaValPtr dt, xmlSchemaValPtr dur) /* month */ carry = d->mon + u->mon; - r->mon = MODULO_RANGE(carry, 1, 13); - carry = FQUOTIENT_RANGE(carry, 1, 13); + r->mon = (unsigned int) MODULO_RANGE(carry, 1, 13); + carry = (long) FQUOTIENT_RANGE(carry, 1, 13); /* year (may be modified later) */ r->year = d->year + carry; @@ -2669,20 +2669,20 @@ _xmlSchemaDateAdd (xmlSchemaValPtr dt, xmlSchemaValPtr dur) /* seconds */ r->sec = d->sec + u->sec; - carry = FQUOTIENT((long)r->sec, 60); + carry = (long) FQUOTIENT((long)r->sec, 60); if (r->sec != 0.0) { r->sec = MODULO(r->sec, 60.0); } /* minute */ carry += d->min; - r->min = MODULO(carry, 60); - carry = FQUOTIENT(carry, 60); + r->min = (unsigned int) MODULO(carry, 60); + carry = (long) FQUOTIENT(carry, 60); /* hours */ carry += d->hour; - r->hour = MODULO(carry, 24); - carry = FQUOTIENT(carry, 24); + r->hour = (unsigned int) MODULO(carry, 24); + carry = (long)FQUOTIENT(carry, 24); /* * days @@ -2701,21 +2701,21 @@ _xmlSchemaDateAdd (xmlSchemaValPtr dt, xmlSchemaValPtr dur) while (1) { if (tempdays < 1) { - long tmon = MODULO_RANGE(r->mon-1, 1, 13); - long tyr = r->year + FQUOTIENT_RANGE(r->mon-1, 1, 13); + long tmon = (long) MODULO_RANGE(r->mon-1, 1, 13); + long tyr = r->year + (long)FQUOTIENT_RANGE(r->mon-1, 1, 13); if (tyr == 0) tyr--; tempdays += MAX_DAYINMONTH(tyr, tmon); carry = -1; - } else if (tempdays > MAX_DAYINMONTH(r->year, r->mon)) { + } else if (tempdays > (long) MAX_DAYINMONTH(r->year, r->mon)) { tempdays = tempdays - MAX_DAYINMONTH(r->year, r->mon); carry = 1; } else break; temp = r->mon + carry; - r->mon = MODULO_RANGE(temp, 1, 13); - r->year = r->year + FQUOTIENT_RANGE(temp, 1, 13); + r->mon = (unsigned int) MODULO_RANGE(temp, 1, 13); + r->year = r->year + (unsigned int) FQUOTIENT_RANGE(temp, 1, 13); if (r->year == 0) { if (temp < 1) r->year--; |