Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7ebbf20

Browse files
committed
Remove obsolete PowerPC-specific hack for comparisons to DBL_MIN
(per recent discussion with Tatsuo). Hopefully the compilers withthat old bug are all long gone.
1 parentc6c1fea commit7ebbf20

File tree

2 files changed

+10
-55
lines changed

2 files changed

+10
-55
lines changed

‎src/backend/utils/adt/datetime.c

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.60 2001/01/24 19:43:13 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.61 2001/03/14 20:12:10 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -2397,36 +2397,3 @@ EncodeTimeSpan(struct tm * tm, double fsec, int style, char *str)
23972397

23982398
return0;
23992399
}/* EncodeTimeSpan() */
2400-
2401-
2402-
#if defined(linux)&& defined(__powerpc__)
2403-
2404-
int
2405-
timestamp_is_epoch(doublej)
2406-
{
2407-
staticunion
2408-
{
2409-
doubleepoch;
2410-
unsignedcharc[8];
2411-
}u;
2412-
2413-
u.c[0]=0x80;/* sign bit */
2414-
u.c[1]=0x10;/* DBL_MIN */
2415-
2416-
returnj==u.epoch;
2417-
}
2418-
int
2419-
timestamp_is_current(doublej)
2420-
{
2421-
staticunion
2422-
{
2423-
doublecurrent;
2424-
unsignedcharc[8];
2425-
}u;
2426-
2427-
u.c[1]=0x10;/* DBL_MIN */
2428-
2429-
returnj==u.current;
2430-
}
2431-
2432-
#endif

‎src/include/utils/timestamp.h

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: timestamp.h,v 1.14 2001/01/24 19:43:29 momjian Exp $
9+
* $Id: timestamp.h,v 1.15 2001/03/14 20:12:10 tgl Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -74,36 +74,24 @@ typedef struct
7474
#defineDT_CURRENT(DBL_MIN)
7575
#defineDT_EPOCH(-DBL_MIN)
7676

77-
#defineTIMESTAMP_INVALID(j)do {j = DT_INVALID;} while (0)
77+
#defineTIMESTAMP_INVALID(j)do {j = DT_INVALID;} while (0)
7878
#ifdefNAN
7979
#defineTIMESTAMP_IS_INVALID(j) (isnan(j))
8080
#else
81-
#defineTIMESTAMP_IS_INVALID(j) (j == DT_INVALID)
81+
#defineTIMESTAMP_IS_INVALID(j) ((j) == DT_INVALID)
8282
#endif
8383

84-
#defineTIMESTAMP_NOBEGIN(j)do {j = DT_NOBEGIN;} while (0)
85-
#defineTIMESTAMP_IS_NOBEGIN(j) (j == DT_NOBEGIN)
84+
#defineTIMESTAMP_NOBEGIN(j)do {j = DT_NOBEGIN;} while (0)
85+
#defineTIMESTAMP_IS_NOBEGIN(j) ((j) == DT_NOBEGIN)
8686

8787
#defineTIMESTAMP_NOEND(j)do {j = DT_NOEND;} while (0)
88-
#defineTIMESTAMP_IS_NOEND(j)(j == DT_NOEND)
88+
#defineTIMESTAMP_IS_NOEND(j)((j) == DT_NOEND)
8989

90-
#defineTIMESTAMP_CURRENT(j)do {j = DT_CURRENT;} while (0)
91-
#if defined(linux)&& defined(__powerpc__)
92-
externinttimestamp_is_current(doublej);
93-
94-
#defineTIMESTAMP_IS_CURRENT(j) timestamp_is_current(j)
95-
#else
96-
#defineTIMESTAMP_IS_CURRENT(j) (j == DT_CURRENT)
97-
#endif
90+
#defineTIMESTAMP_CURRENT(j)do {j = DT_CURRENT;} while (0)
91+
#defineTIMESTAMP_IS_CURRENT(j) ((j) == DT_CURRENT)
9892

9993
#defineTIMESTAMP_EPOCH(j)do {j = DT_EPOCH;} while (0)
100-
#if defined(linux)&& defined(__powerpc__)
101-
externinttimestamp_is_epoch(doublej);
102-
103-
#defineTIMESTAMP_IS_EPOCH(j)timestamp_is_epoch(j)
104-
#else
105-
#defineTIMESTAMP_IS_EPOCH(j)(j == DT_EPOCH)
106-
#endif
94+
#defineTIMESTAMP_IS_EPOCH(j)((j) == DT_EPOCH)
10795

10896
#defineTIMESTAMP_IS_RELATIVE(j) (TIMESTAMP_IS_CURRENT(j) || TIMESTAMP_IS_EPOCH(j))
10997
#defineTIMESTAMP_NOT_FINITE(j) (TIMESTAMP_IS_INVALID(j) \

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp