Change definitions of bitmap flags to bit-shifting style

Поиск
Список
Период
Сортировка
Искать
От
Peter Eisentraut
Тема
Change definitions of bitmap flags to bit-shifting style
Дата
Msg-id
81629061-24f5-2722-83cb-b162d6a1a5fd@enterprisedb.com
Список
Дерево обсуждения
Change definitions of bitmap flags to bit-shifting style Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: Change definitions of bitmap flags to bit-shifting style Tom Lane <tgl@sss.pgh.pa.us>
Re: Change definitions of bitmap flags to bit-shifting style Laurenz Albe <laurenz.albe@cybertec.at>
Re: Change definitions of bitmap flags to bit-shifting style Alvaro Herrera <alvherre@alvh.no-ip.org>
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 James Coleman <jtc331@gmail.com>
Re: Change definitions of bitmap flags to bit-shifting style Andrew Dunstan <andrew@dunslane.net>
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.
В списке pgsql-hackers по дате отправления
От: Andy Fan
Дата:
От: Bruce Momjian
Дата:
FAQ