Re: [HACKERS] taking stdbool.h into use
Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Michael Paquier <michael.paquier@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>,
pgsql-hackers <pgsql-hackers@postgresql.org>,
Thomas Munro <thomas.munro@enterprisedb.com>
Date: 2018-01-16T23:12:29Z
Lists: pgsql-hackers
On 1/11/18 17:01, Peter Eisentraut wrote: > Looking around where else they are used, the uses in numeric.c sure seem > like noops: > > #if SIZEOF_DATUM == 8 > #define NumericAbbrevGetDatum(X) ((Datum) SET_8_BYTES(X)) > #define DatumGetNumericAbbrev(X) ((int64) GET_8_BYTES(X)) > #define NUMERIC_ABBREV_NAN NumericAbbrevGetDatum(PG_INT64_MIN) > #else > #define NumericAbbrevGetDatum(X) ((Datum) SET_4_BYTES(X)) > #define DatumGetNumericAbbrev(X) ((int32) GET_4_BYTES(X)) > #define NUMERIC_ABBREV_NAN NumericAbbrevGetDatum(PG_INT32_MIN) > #endif > > We can just replace these by straight casts, too. I have committed a change for this. I'll work through the other details later. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Use stdbool.h if suitable
- 9a95a77d9d5d 11.0 landed
-
Add configure tests for stdbool.h and sizeof bool
- f20b3285340c 11.0 landed
-
Remove useless use of bit-masking macros
- d91da5ecedc8 11.0 landed
-
Change various Gin*Is* macros to return 0/1.
- af4472bcb88a 9.6.0 cited
-
Fix several possibly non-portable gaffs in record_image_ops.
- 4cbb646334b3 9.4.0 cited