OSDN Git Service

Remove obsolete PowerPC-specific hack for comparisons to DBL_MIN
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 14 Mar 2001 20:12:10 +0000 (20:12 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 14 Mar 2001 20:12:10 +0000 (20:12 +0000)
(per recent discussion with Tatsuo).  Hopefully the compilers with
that old bug are all long gone.

src/backend/utils/adt/datetime.c
src/include/utils/timestamp.h

index 3a9178d..8e92996 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.60 2001/01/24 19:43:13 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.61 2001/03/14 20:12:10 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -2397,36 +2397,3 @@ EncodeTimeSpan(struct tm * tm, double fsec, int style, char *str)
 
        return 0;
 }      /* EncodeTimeSpan() */
-
-
-#if defined(linux) && defined(__powerpc__)
-
-int
-timestamp_is_epoch(double j)
-{
-       static union
-       {
-               double          epoch;
-               unsigned char c[8];
-       }                       u;
-
-       u.c[0] = 0x80;                          /* sign bit */
-       u.c[1] = 0x10;                          /* DBL_MIN */
-
-       return j == u.epoch;
-}
-int
-timestamp_is_current(double j)
-{
-       static union
-       {
-               double          current;
-               unsigned char c[8];
-       }                       u;
-
-       u.c[1] = 0x10;                          /* DBL_MIN */
-
-       return j == u.current;
-}
-
-#endif
index 7a54223..5f74d55 100644 (file)
@@ -6,7 +6,7 @@
  * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $Id: timestamp.h,v 1.14 2001/01/24 19:43:29 momjian Exp $
+ * $Id: timestamp.h,v 1.15 2001/03/14 20:12:10 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -74,36 +74,24 @@ typedef struct
 #define DT_CURRENT             (DBL_MIN)
 #define DT_EPOCH               (-DBL_MIN)
 
-#define TIMESTAMP_INVALID(j)           do {j = DT_INVALID;} while (0)
+#define TIMESTAMP_INVALID(j)   do {j = DT_INVALID;} while (0)
 #ifdef NAN
 #define TIMESTAMP_IS_INVALID(j) (isnan(j))
 #else
-#define TIMESTAMP_IS_INVALID(j) (j == DT_INVALID)
+#define TIMESTAMP_IS_INVALID(j) ((j) == DT_INVALID)
 #endif
 
-#define TIMESTAMP_NOBEGIN(j)           do {j = DT_NOBEGIN;} while (0)
-#define TIMESTAMP_IS_NOBEGIN(j) (j == DT_NOBEGIN)
+#define TIMESTAMP_NOBEGIN(j)   do {j = DT_NOBEGIN;} while (0)
+#define TIMESTAMP_IS_NOBEGIN(j) ((j) == DT_NOBEGIN)
 
 #define TIMESTAMP_NOEND(j)             do {j = DT_NOEND;} while (0)
-#define TIMESTAMP_IS_NOEND(j)  (j == DT_NOEND)
+#define TIMESTAMP_IS_NOEND(j)  ((j) == DT_NOEND)
 
-#define TIMESTAMP_CURRENT(j)           do {j = DT_CURRENT;} while (0)
-#if defined(linux) && defined(__powerpc__)
-extern int     timestamp_is_current(double j);
-
-#define TIMESTAMP_IS_CURRENT(j) timestamp_is_current(j)
-#else
-#define TIMESTAMP_IS_CURRENT(j) (j == DT_CURRENT)
-#endif
+#define TIMESTAMP_CURRENT(j)   do {j = DT_CURRENT;} while (0)
+#define TIMESTAMP_IS_CURRENT(j) ((j) == DT_CURRENT)
 
 #define TIMESTAMP_EPOCH(j)             do {j = DT_EPOCH;} while (0)
-#if defined(linux) && defined(__powerpc__)
-extern int     timestamp_is_epoch(double j);
-
-#define TIMESTAMP_IS_EPOCH(j)  timestamp_is_epoch(j)
-#else
-#define TIMESTAMP_IS_EPOCH(j)  (j == DT_EPOCH)
-#endif
+#define TIMESTAMP_IS_EPOCH(j)  ((j) == DT_EPOCH)
 
 #define TIMESTAMP_IS_RELATIVE(j) (TIMESTAMP_IS_CURRENT(j) || TIMESTAMP_IS_EPOCH(j))
 #define TIMESTAMP_NOT_FINITE(j) (TIMESTAMP_IS_INVALID(j) \