mirror of
https://github.com/postgres/postgres.git
synced 2025-08-24 09:27:52 +03:00
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
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user