diff options
| author | Andres Freund | 2015-03-25 21:39:42 +0000 |
|---|---|---|
| committer | Andres Freund | 2015-03-25 21:39:42 +0000 |
| commit | 83ff1618bc9d4e530d3ef2a668a71326784a753c (patch) | |
| tree | d295d560bd4481a61a6f5d036888ed7954b4b86b /src/include/pg_config_manual.h | |
| parent | bdc3d7fa2376a7a1e977383cc3221cfe44c4a893 (diff) | |
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: [email protected]
Diffstat (limited to 'src/include/pg_config_manual.h')
| -rw-r--r-- | src/include/pg_config_manual.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h index 5cfc0ae1e80..d3e9888b7b9 100644 --- a/src/include/pg_config_manual.h +++ b/src/include/pg_config_manual.h @@ -48,7 +48,7 @@ /* * Set the upper and lower bounds of sequence values. */ -#define SEQ_MAXVALUE INT64CONST(0x7FFFFFFFFFFFFFFF) +#define SEQ_MAXVALUE INT64_MAX #define SEQ_MINVALUE (-SEQ_MAXVALUE) /* @@ -185,7 +185,7 @@ * the older rand() function, which is often different from --- and * considerably inferior to --- random(). */ -#define MAX_RANDOM_VALUE (0x7FFFFFFF) +#define MAX_RANDOM_VALUE INT32_MAX /* * On PPC machines, decide whether to use the mutex hint bit in LWARX |
