Re: Change definitions of bitmap flags to bit-shifting style

2020-12-06 Thread Andrew Dunstan
On 12/6/20 11:44 AM, James Coleman wrote: > On Sun, Dec 6, 2020 at 1:25 AM Michael Paquier > wrote: > > On Sat, Dec 05, 2020 at 10:31:09PM -0300, Alvaro Herrera wrote: > > The hexadecimal representation is more natural to me than > bit-shifting, > > so

Re: Change definitions of bitmap flags to bit-shifting style

2020-12-06 Thread James Coleman
On Sun, Dec 6, 2020 at 1:25 AM Michael Paquier wrote: > On Sat, Dec 05, 2020 at 10:31:09PM -0300, Alvaro Herrera wrote: > > The hexadecimal representation is more natural to me than bit-shifting, > > so I would prefer to use that style too. But maybe I'm trained to it > > because of looking at t

Re: Change definitions of bitmap flags to bit-shifting style

2020-12-05 Thread Michael Paquier
On Sat, Dec 05, 2020 at 10:31:09PM -0300, Alvaro Herrera wrote: > The hexadecimal representation is more natural to me than bit-shifting, > so I would prefer to use that style too. But maybe I'm trained to it > because of looking at t_infomask symbols constantly. If we are going to change all tha

Re: Change definitions of bitmap flags to bit-shifting style

2020-12-05 Thread Laurenz Albe
On Sat, 2020-12-05 at 13:03 -0500, Tom Lane wrote: > Peter Eisentraut writes: > > > 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 u

Re: Change definitions of bitmap flags to bit-shifting style

2020-12-05 Thread Alvaro Herrera
On 2020-Dec-05, Tom Lane wrote: > FWIW, personally I'd vote for doing the exact opposite. When you are > debugging and examining the contents of a bitmask variable, it's easier to > correlate a value like "0x03" with definitions made in the former style. > Or at least I think so; maybe others see

Re: Change definitions of bitmap flags to bit-shifting style

2020-12-05 Thread Tom Lane
Peter Eisentraut writes: > 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. FWIW, p

Change definitions of bitmap flags to bit-shifting style

2020-12-05 Thread Peter Eisentraut
From: Peter Eisentraut Date: Sat, 5 Dec 2020 11:45:04 +0100 Subject: [PATCH] Change definitions of bitmap flags to bit-shifting style Change definitions like #define FOO 0x01 #define BAR 0x02 to #define FOO (1 << 0) #define BAR (1 << 1) etc. Both styles are currently