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

Поиск
Список
Период
Сортировка
От James Coleman
Тема Re: Change definitions of bitmap flags to bit-shifting style
Дата
Msg-id CAAaqYe-BSz+XvcvUUxwZSv9FUw5ZHZ3dGXcUpd0Db=tMUm1NsQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Change definitions of bitmap flags to bit-shifting style  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: Change definitions of bitmap flags to bit-shifting style  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
On Sun, Dec 6, 2020 at 1:25 AM Michael Paquier <michael@paquier.xyz> 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_infomask symbols constantly.

If we are going to change all that, hexa style sounds good to me too.
Would it be worth an addition to the docs, say in [1] to tell that
this is a preferred style?

[1]: https://www.postgresql.org/docs/devel/source-conventions.html?
--
Michael


In my view the bit shifting approach makes it more obvious a single bit is being set, but on the other hand the hex approach makes it easier to compare in debugging. 

I’m not really sure which to prefer, though I think I would have leaned slightly towards the former. 

James

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: A few new options for CHECKPOINT
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: Change definitions of bitmap flags to bit-shifting style