aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/numutils.c
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2015-03-25 22:39:42 +0100
committerAndres Freund <andres@anarazel.de>2015-03-25 22:39:42 +0100
commit83ff1618bc9d4e530d3ef2a668a71326784a753c (patch)
treed295d560bd4481a61a6f5d036888ed7954b4b86b /src/backend/utils/adt/numutils.c
parentbdc3d7fa2376a7a1e977383cc3221cfe44c4a893 (diff)
downloadpostgresql-83ff1618bc9d4e530d3ef2a668a71326784a753c.tar.gz
postgresql-83ff1618bc9d4e530d3ef2a668a71326784a753c.zip
Centralize definition of integer limits.
Several submitted and even committed patches have run into the problem that C89, our baseline, does not provide minimum/maximum values for various integer datatypes. C99's stdint.h does, but we can't rely on it. Several parts of the code defined limits locally, so instead centralize the definitions to c.h. This patch also changes the more obvious usages of literal limit values; there's more places that could be changed, but it's less clear whether it's beneficial to change those. Author: Andrew Gierth Discussion: 87619tc5wc.fsf@news-spur.riddles.org.uk
Diffstat (limited to 'src/backend/utils/adt/numutils.c')
-rw-r--r--src/backend/utils/adt/numutils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/utils/adt/numutils.c b/src/backend/utils/adt/numutils.c
index d77799acfe3..585da1e7322 100644
--- a/src/backend/utils/adt/numutils.c
+++ b/src/backend/utils/adt/numutils.c
@@ -190,7 +190,7 @@ pg_lltoa(int64 value, char *a)
* Avoid problems with the most negative integer not being representable
* as a positive integer.
*/
- if (value == (-INT64CONST(0x7FFFFFFFFFFFFFFF) - 1))
+ if (value == INT64_MIN)
{
memcpy(a, "-9223372036854775808", 21);
return;