From d91da5ecedc8f8965bd35de66b09feb79c26e5ca Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 16 Jan 2018 17:12:16 -0500 Subject: [PATCH] Remove useless use of bit-masking macros In this case, the macros SET_8_BYTES(), GET_8_BYTES(), SET_4_BYTES(), GET_4_BYTES() are no-ops, so we can just remove them. The plan is to perhaps remove them from the source code altogether, so we'll start here. Discussion: https://www.postgresql.org/message-id/5d51721a-69ef-2053-9172-599b539f0628@2ndquadrant.com --- src/backend/utils/adt/numeric.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/backend/utils/adt/numeric.c b/src/backend/utils/adt/numeric.c index a1792f0b01..5b34badd5b 100644 --- a/src/backend/utils/adt/numeric.c +++ b/src/backend/utils/adt/numeric.c @@ -354,12 +354,12 @@ typedef struct NumericSumAccum */ #define NUMERIC_ABBREV_BITS (SIZEOF_DATUM * BITS_PER_BYTE) #if SIZEOF_DATUM == 8 -#define NumericAbbrevGetDatum(X) ((Datum) SET_8_BYTES(X)) -#define DatumGetNumericAbbrev(X) ((int64) GET_8_BYTES(X)) +#define NumericAbbrevGetDatum(X) ((Datum) (X)) +#define DatumGetNumericAbbrev(X) ((int64) (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 NumericAbbrevGetDatum(X) ((Datum) (X)) +#define DatumGetNumericAbbrev(X) ((int32) (X)) #define NUMERIC_ABBREV_NAN NumericAbbrevGetDatum(PG_INT32_MIN) #endif -- 2.40.0