pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Replace most usages of ntoh[ls] and hton[sl] with pg_bswap.h.
2+ messages / 2 participants
[nested] [flat]

* pgsql: Replace most usages of ntoh[ls] and hton[sl] with pg_bswap.h.
@ 2017-10-01 23:08 Andres Freund <andres@anarazel.de>
  2017-10-02 00:10 ` Re: pgsql: Replace most usages of ntoh[ls] and hton[sl] with pg_bswap.h. Michael Paquier <michael.paquier@gmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Andres Freund @ 2017-10-01 23:08 UTC (permalink / raw)
  To: pgsql-committers

Replace most usages of ntoh[ls] and hton[sl] with pg_bswap.h.

All postgres internal usages are replaced, it's just libpq example
usages that haven't been converted. External users of libpq can't
generally rely on including postgres internal headers.

Note that this includes replacing open-coded byte swapping of 64bit
integers (using two 32 bit swaps) with a single 64bit swap.

Where it looked applicable, I have removed netinet/in.h and
arpa/inet.h usage, which previously provided the relevant
functionality. It's perfectly possible that I missed other reasons for
including those, the buildfarm will tell.

Author: Andres Freund
Discussion: https://postgr.es/m/20170927172019.gheidqy6xvlxb325@alap3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0ba99c84e8c7138143059b281063d4cca5a2bfea

Modified Files
--------------
contrib/pgcrypto/crypt-des.c        | 17 +++++++---------
contrib/uuid-ossp/uuid-ossp.c       | 17 +++++++---------
src/backend/commands/copy.c         | 11 +++++-----
src/backend/libpq/auth.c            | 18 ++++++++---------
src/backend/libpq/ifaddr.c          |  6 +++---
src/backend/libpq/pqcomm.c          |  6 +++---
src/backend/libpq/pqformat.c        | 40 ++++++++++---------------------------
src/backend/postmaster/postmaster.c | 13 ++++++------
src/backend/tcop/fastpath.c         |  8 +++-----
src/bin/pg_basebackup/streamutil.c  | 34 +++++++------------------------
src/bin/pg_dump/parallel.c          |  6 ++++--
src/bin/pg_rewind/libpq_fetch.c     | 29 ++-------------------------
src/common/scram-common.c           |  7 ++-----
src/interfaces/libpq/fe-connect.c   | 12 +++++------
src/interfaces/libpq/fe-lobj.c      | 11 +++++-----
src/interfaces/libpq/fe-misc.c      | 14 ++++++-------
src/interfaces/libpq/fe-protocol2.c |  5 ++---
src/interfaces/libpq/fe-protocol3.c |  5 ++---
src/port/getaddrinfo.c              | 11 +++++-----
src/port/inet_aton.c                |  4 +++-
20 files changed, 99 insertions(+), 175 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: pgsql: Replace most usages of ntoh[ls] and hton[sl] with pg_bswap.h.
  2017-10-01 23:08 pgsql: Replace most usages of ntoh[ls] and hton[sl] with pg_bswap.h. Andres Freund <andres@anarazel.de>
@ 2017-10-02 00:10 ` Michael Paquier <michael.paquier@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Paquier @ 2017-10-02 00:10 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; +Cc: pgsql-committers

On Mon, Oct 2, 2017 at 8:08 AM, Andres Freund <andres@anarazel.de> wrote:
> Replace most usages of ntoh[ls] and hton[sl] with pg_bswap.h.
>
> All postgres internal usages are replaced, it's just libpq example
> usages that haven't been converted. External users of libpq can't
> generally rely on including postgres internal headers.
>
> Note that this includes replacing open-coded byte swapping of 64bit
> integers (using two 32 bit swaps) with a single 64bit swap.
>
> Where it looked applicable, I have removed netinet/in.h and
> arpa/inet.h usage, which previously provided the relevant
> functionality. It's perfectly possible that I missed other reasons for
> including those, the buildfarm will tell.

Thanks for taking the time to improve that! I was looking for a 64b
equivalent not long ago for pg_rewind... Those changes look good to me
at quick glance.
-- 
Michael


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2017-10-02 00:10 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-10-01 23:08 pgsql: Replace most usages of ntoh[ls] and hton[sl] with pg_bswap.h. Andres Freund <andres@anarazel.de>
2017-10-02 00:10 ` Michael Paquier <michael.paquier@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox