Change definitions of bitmap flags to bit-shifting style

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Change definitions of bitmap flags to bit-shifting style
Date: 2020-12-05 15:30:38
Message-ID: 81629061-24f5-2722-83cb-b162d6a1a5fd@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The attached patch changes definitions like

#define FOO 0x01
#define BAR 0x02

to

#define FOO (1 << 0)
#define BAR (1 << 1)

etc.

Both styles are currently in use, but the latter style seems more
readable and easier to update.

This change only addresses bitmaps used in memory (e.g., for parsing or
specific function APIs), where the actual bits don't really matter.
Bits that might go on disk weren't touched. There, defining the bits in
a more concrete way seems better.

Attachment Content-Type Size
0001-Change-definitions-of-bitmap-flags-to-bit-shifting-s.patch text/plain 54.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2020-12-05 15:42:05 Re: Proposed patch for key managment
Previous Message Andy Fan 2020-12-05 15:10:28 Re: [PATCH] Keeps tracking the uniqueness with UniqueKey