Skip to content

Commit 0b510ad

Browse files
committed
Fix unportable (and incorrect anyway) usage of LL constant suffix that
recently snuck into cash.c. Per report from Edmundo Robles Lopez.
1 parent 242d70d commit 0b510ad

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/backend/utils/adt/cash.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* this version handles 64 bit numbers and so can hold values up to
1414
* $92,233,720,368,547,758.07.
1515
*
16-
* $PostgreSQL: pgsql/src/backend/utils/adt/cash.c,v 1.79 2008/04/21 00:26:45 tgl Exp $
16+
* $PostgreSQL: pgsql/src/backend/utils/adt/cash.c,v 1.80 2008/06/09 19:58:39 tgl Exp $
1717
*/
1818

1919
#include "postgres.h"
@@ -794,13 +794,13 @@ cash_words(PG_FUNCTION_ARGS)
794794
/* Now treat as unsigned, to avoid trouble at INT_MIN */
795795
val = (uint64) value;
796796

797-
m0 = val % 100ll; /* cents */
798-
m1 = (val / 100ll) % 1000; /* hundreds */
799-
m2 = (val / 100000ll) % 1000; /* thousands */
800-
m3 = val / 100000000ll % 1000; /* millions */
801-
m4 = val / 100000000000ll % 1000; /* billions */
802-
m5 = val / 100000000000000ll % 1000; /* trillions */
803-
m6 = val / 100000000000000000ll % 1000; /* quadrillions */
797+
m0 = val % INT64CONST(100); /* cents */
798+
m1 = (val / INT64CONST(100)) % 1000; /* hundreds */
799+
m2 = (val / INT64CONST(100000)) % 1000; /* thousands */
800+
m3 = (val / INT64CONST(100000000)) % 1000; /* millions */
801+
m4 = (val / INT64CONST(100000000000)) % 1000; /* billions */
802+
m5 = (val / INT64CONST(100000000000000)) % 1000; /* trillions */
803+
m6 = (val / INT64CONST(100000000000000000)) % 1000; /* quadrillions */
804804

805805
if (m6)
806806
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy