Skip to content

Commit d91da5e

Browse files
committed
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
1 parent 649aeb1 commit d91da5e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/backend/utils/adt/numeric.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,12 +354,12 @@ typedef struct NumericSumAccum
354354
*/
355355
#define NUMERIC_ABBREV_BITS (SIZEOF_DATUM * BITS_PER_BYTE)
356356
#if SIZEOF_DATUM == 8
357-
#define NumericAbbrevGetDatum(X) ((Datum) SET_8_BYTES(X))
358-
#define DatumGetNumericAbbrev(X) ((int64) GET_8_BYTES(X))
357+
#define NumericAbbrevGetDatum(X) ((Datum) (X))
358+
#define DatumGetNumericAbbrev(X) ((int64) (X))
359359
#define NUMERIC_ABBREV_NAN NumericAbbrevGetDatum(PG_INT64_MIN)
360360
#else
361-
#define NumericAbbrevGetDatum(X) ((Datum) SET_4_BYTES(X))
362-
#define DatumGetNumericAbbrev(X) ((int32) GET_4_BYTES(X))
361+
#define NumericAbbrevGetDatum(X) ((Datum) (X))
362+
#define DatumGetNumericAbbrev(X) ((int32) (X))
363363
#define NUMERIC_ABBREV_NAN NumericAbbrevGetDatum(PG_INT32_MIN)
364364
#endif
365365

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy