From: Tom Lane Date: Sat, 6 Mar 1999 22:49:03 +0000 (+0000) Subject: Correct compile failures in REL6_4 datetime code. X-Git-Url: http://waps.l3s.uni-hannover.de/gitweb/queryCache.php?a=commitdiff_plain;h=6a231e695c7233d5fa44acad6c3193097f8bd02c;p=users%2Fbernd%2Fpostgres.git Correct compile failures in REL6_4 datetime code. --- diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c index f55caaf0d9..8c4c5db5bc 100644 --- a/src/backend/utils/adt/datetime.c +++ b/src/backend/utils/adt/datetime.c @@ -27,14 +27,6 @@ static int date2tm(DateADT dateVal, int *tzp, struct tm * tm, double *fsec, char **tzn); -#if 0 -static int day_tab[2][12] = { - {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, -{31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}}; - -#define isleap(y) (((y % 4) == 0 && (y % 100) != 0) || (y % 400) == 0) -#endif - #define UTIME_MINYEAR (1901) #define UTIME_MINMONTH (12) #define UTIME_MINDAY (14) diff --git a/src/backend/utils/adt/dt.c b/src/backend/utils/adt/dt.c index 1d98ce4902..553c65b73b 100644 --- a/src/backend/utils/adt/dt.c +++ b/src/backend/utils/adt/dt.c @@ -56,8 +56,6 @@ static int tm2timespan(struct tm * tm, double fsec, TimeSpan *span); #define ROUND_ALL 0 #if 0 -#define isleap(y) (((y % 4) == 0) && (((y % 100) != 0) || ((y % 400) == 0))) - int mdays[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 0}; #endif @@ -2302,8 +2300,7 @@ datetkn *deltacache[MAXDATEFIELDS] = {NULL}; * These routines will be used by other date/time packages - tgl 97/02/25 */ -#if 0 -XXX moved to dt.h - thomas 1999-01-15 +#if 1 /* Set the minimum year to one greater than the year of the first valid day * to avoid having to check year and day both. - tgl 97/05/08 */ diff --git a/src/include/utils/dt.h b/src/include/utils/dt.h index a52bf36dc8..961a573c59 100644 --- a/src/include/utils/dt.h +++ b/src/include/utils/dt.h @@ -269,7 +269,7 @@ extern int datetime_is_epoch(double j); extern int day_tab[2][13]; -#define isleap(y) (((y % 4) == 0 && (y % 100) != 0) || (y % 400) == 0) +#define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0)) /* Julian date support for date2j() and j2date() * Set the minimum year to one greater than the year of the first valid day