[xslt] Little War(nings)



Good evening,

for some reason, I am very mad at compiler warnings these days.

The patch to libexslt/date.c, which follows this text, eliminates their kin.
It removes twelve warnings of the sort 'signed/unsigned mismatch' and
'conversion from double to int, possible loss of data'. All trivial and of
no real importance, but these are the last warnings in the production code.
Does anyone see a reason not to apply this?

Ciao
Igor


*** libexslt/date.c     18 Mar 2002 19:53:53 -0000      1.10
--- libexslt/date.c     17 Apr 2002 19:39:07 -0000
***************
*** 106,114 ****
  #define IS_LEAP(y)                                            \
        (((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0))

! static const int daysInMonth[12] =
        { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
! static const int daysInMonthLeap[12] =
        { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

  #define VALID_MDAY(dt)                                                \
--- 106,114 ----
  #define IS_LEAP(y)                                            \
        (((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0))

! static const unsigned int daysInMonth[12] =
        { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
! static const unsigned int daysInMonthLeap[12] =
        { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

  #define VALID_MDAY(dt)                                                \
***************
*** 1182,1188 ****
        { 'D', 'e', 'c', 'e', 'm', 'b', 'e', 'r', 0 }
      };
      int month;
!     month = exsltDateMonthInYear(dateTime);
      if (!VALID_MONTH(month))
        month = 0;
      return monthNames[month];
--- 1182,1188 ----
        { 'D', 'e', 'c', 'e', 'm', 'b', 'e', 'r', 0 }
      };
      int month;
!     month = (int) exsltDateMonthInYear(dateTime);
      if (!VALID_MONTH(month))
        month = 0;
      return monthNames[month];
***************
*** 1229,1235 ****
        { 'D', 'e', 'c', 0 }
      };
      int month;
!     month = exsltDateMonthInYear(dateTime);
      if(!VALID_MONTH(month))
        month = 0;
      return monthAbbreviations[month];
--- 1229,1235 ----
        { 'D', 'e', 'c', 0 }
      };
      int month;
!     month = (int) exsltDateMonthInYear(dateTime);
      if(!VALID_MONTH(month))
        month = 0;
      return monthAbbreviations[month];
***************
*** 1606,1612 ****
        { 'S', 'a', 't', 'u', 'r', 'd', 'a', 'y', 0 }
      };
      int day;
!     day = exsltDateDayInWeek(dateTime);
      if((day < 1) || (day > 7))
        day = 0;
      return dayNames[day];
--- 1606,1612 ----
        { 'S', 'a', 't', 'u', 'r', 'd', 'a', 'y', 0 }
      };
      int day;
!     day = (int) exsltDateDayInWeek(dateTime);
      if((day < 1) || (day > 7))
        day = 0;
      return dayNames[day];
***************
*** 1645,1651 ****
        { 'S', 'a', 't', 0 }
      };
      int day;
!     day = exsltDateDayInWeek(dateTime);
      if((day < 1) || (day > 7))
        day = 0;
      return dayAbbreviations[day];
--- 1645,1651 ----
        { 'S', 'a', 't', 0 }
      };
      int day;
!     day = (int) exsltDateDayInWeek(dateTime);
      if((day < 1) || (day > 7))
        day = 0;
      return dayAbbreviations[day];






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]