Re: [COMMITTERS] pgsql: Extend & revamp pg_bswap.h infrastructure.
| От | Peter Geoghegan |
|---|---|
| Тема | Re: [COMMITTERS] pgsql: Extend & revamp pg_bswap.h infrastructure. |
| Дата | |
| Msg-id | CAH2-Wz=at5AOzb=P=Z5g4OHQ4o5EjyDWdwsr+Y4Sqt2siQ1v2g@mail.gmail.com обсуждение исходный текст |
| Ответ на | [COMMITTERS] pgsql: Extend & revamp pg_bswap.h infrastructure. (Andres Freund <andres@anarazel.de>) |
| Ответы |
Re: [COMMITTERS] pgsql: Extend & revamp pg_bswap.h infrastructure.
|
| Список | pgsql-committers |
On Fri, Sep 29, 2017 at 5:29 PM, Andres Freund <andres@anarazel.de> wrote:
> Extend & revamp pg_bswap.h infrastructure.
This looks wrong:
+static inline uint16
+pg_bswap64(uint16 x)
+{
+ return
+ ((x << 56) & UINT64CONST(0xff00000000000000)) |
+ ((x << 40) & UINT64CONST(0x00ff000000000000)) |
+ ((x << 24) & UINT64CONST(0x0000ff0000000000)) |
+ ((x << 8) & UINT64CONST(0x000000ff00000000)) |
+ ((x >> 8) & UINT64CONST(0x00000000ff000000)) |
+ ((x >> 24) & UINT64CONST(0x0000000000ff0000)) |
+ ((x >> 40) & UINT64CONST(0x000000000000ff00)) |
+ ((x >> 56) & UINT64CONST(0x00000000000000ff));
+}
--
Peter Geoghegan
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
В списке pgsql-committers по дате отправления: