Commit 0b510ad9 authored by Tom Lane's avatar Tom Lane

Fix unportable (and incorrect anyway) usage of LL constant suffix that

recently snuck into cash.c.  Per report from Edmundo Robles Lopez.
parent 242d70d5
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* this version handles 64 bit numbers and so can hold values up to * this version handles 64 bit numbers and so can hold values up to
* $92,233,720,368,547,758.07. * $92,233,720,368,547,758.07.
* *
* $PostgreSQL: pgsql/src/backend/utils/adt/cash.c,v 1.79 2008/04/21 00:26:45 tgl Exp $ * $PostgreSQL: pgsql/src/backend/utils/adt/cash.c,v 1.80 2008/06/09 19:58:39 tgl Exp $
*/ */
#include "postgres.h" #include "postgres.h"
...@@ -794,13 +794,13 @@ cash_words(PG_FUNCTION_ARGS) ...@@ -794,13 +794,13 @@ cash_words(PG_FUNCTION_ARGS)
/* Now treat as unsigned, to avoid trouble at INT_MIN */ /* Now treat as unsigned, to avoid trouble at INT_MIN */
val = (uint64) value; val = (uint64) value;
m0 = val % 100ll; /* cents */ m0 = val % INT64CONST(100); /* cents */
m1 = (val / 100ll) % 1000; /* hundreds */ m1 = (val / INT64CONST(100)) % 1000; /* hundreds */
m2 = (val / 100000ll) % 1000; /* thousands */ m2 = (val / INT64CONST(100000)) % 1000; /* thousands */
m3 = val / 100000000ll % 1000; /* millions */ m3 = (val / INT64CONST(100000000)) % 1000; /* millions */
m4 = val / 100000000000ll % 1000; /* billions */ m4 = (val / INT64CONST(100000000000)) % 1000; /* billions */
m5 = val / 100000000000000ll % 1000; /* trillions */ m5 = (val / INT64CONST(100000000000000)) % 1000; /* trillions */
m6 = val / 100000000000000000ll % 1000; /* quadrillions */ m6 = (val / INT64CONST(100000000000000000)) % 1000; /* quadrillions */
if (m6) if (m6)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment