On Tue, Apr 10, 2012 at 03:09:52PM +0200, Alexandre Julliard wrote:
Piotr Caban piotr@codeweavers.com writes:
@@ -48,7 +49,7 @@ static const int MonthLengths[2][12] =
static inline int IsLeapYear(int Year) {
- return Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0);
- return (Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0)) ? 1 : 0;
Maybe you should do something like:
return (((Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0)) ? 1 : 0) ? 1 : 0) ? 1 : 0;
to make really sure you get 0 or 1, you never know what might happen ;-)
But see also http://www.hermetic.ch/cal_stud/cal_art.html for some info about which years were/are actually leap years ...
David