summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane1999-03-06 22:49:03 +0000
committerTom Lane1999-03-06 22:49:03 +0000
commit93c7e5026a36e5d56c843e5efa3f6b6b74859c5c (patch)
tree18720acd74f88ed3f48a61df301a76af8233611c
parent35336849e73d92a555cae23c568c1760d31a94c5 (diff)
Correct compile failures in REL6_4 datetime code.
-rw-r--r--src/backend/utils/adt/datetime.c10
-rw-r--r--src/backend/utils/adt/dt.c7
-rw-r--r--src/include/utils/dt.h4
3 files changed, 5 insertions, 16 deletions
diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c
index a8cbdadf539..b47488310fe 100644
--- a/src/backend/utils/adt/datetime.c
+++ b/src/backend/utils/adt/datetime.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.25.2.2 1999/02/13 05:59:34 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.25.2.3 1999/03/06 22:49:03 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -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 3eb3463089d..588e8ebf200 100644
--- a/src/backend/utils/adt/dt.c
+++ b/src/backend/utils/adt/dt.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.59.2.2 1999/02/13 05:59:34 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.59.2.3 1999/03/06 22:49:01 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -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 5ef4f32206d..93d66e254e4 100644
--- a/src/include/utils/dt.h
+++ b/src/include/utils/dt.h
@@ -8,7 +8,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: dt.h,v 1.33.2.1 1999/03/03 05:11:39 thomas Exp $
+ * $Id: dt.h,v 1.33.2.2 1999/03/06 22:49:01 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -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