Skip to content

Commit 20f8480

Browse files
committed
Mark TimeScales constants as double to avoid integer overflow in some compilers.
1 parent dbb7503 commit 20f8480

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/backend/utils/adt/date.c

Lines changed: 12 additions & 12 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/date.c,v 1.80 2003/04/04 04:50:44 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.81 2003/04/08 17:02:04 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -645,17 +645,17 @@ AdjustTimeForTypmod(TimeADT *time, int32 typmod)
645645
#else
646646
/* note MAX_TIME_PRECISION differs in this case */
647647
static const double TimeScales[MAX_TIME_PRECISION + 1] = {
648-
1,
649-
10,
650-
100,
651-
1000,
652-
10000,
653-
100000,
654-
1000000,
655-
10000000,
656-
100000000,
657-
1000000000,
658-
10000000000
648+
1.0,
649+
10.0,
650+
100.0,
651+
1000.0,
652+
10000.0,
653+
100000.0,
654+
1000000.0,
655+
10000000.0,
656+
100000000.0,
657+
1000000000.0,
658+
10000000000.0
659659
};
660660
#endif
661661

0 commit comments

Comments
 (0)