Re: [xslt] Little War(nings)



Igor,

The patches look fine me. I am close to having duration working so I will update 
my copy of the code with these patches.
You may have noticed the date code requires time.h, time, localtime, and gmtime 
in order to get the current date and time. Does windows support these calls? If 
so can you apply patches to the proper configuration file to define:
HAVE_TIME_H, HAVE_LOCALTIME, HAVE_TIME, and HAVE_GMTIME (I will remove the 
requirement for HAVE_MKTIME as we don't use it). If windows does not have these 
routines, is there a way to get the current time and date?

Thanks
Charlie Bozeman

Quoting Igor Zlatkovic <igor@stud.fh-frankfurt.de>:

> 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];
> 
> 
> 
> _______________________________________________
> xslt mailing list, project page http://xmlsoft.org/XSLT/
> xslt@gnome.org
> http://mail.gnome.org/mailman/listinfo/xslt
> 



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