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

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Replace most usages of ntoh[ls] and hton[sl] with pg_bswap.h.
Date: 2017-10-01 23:08:13
Message-ID: E1dynLJ-00033x-2e@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2017-10-02 00:10:56 Re: pgsql: Replace most usages of ntoh[ls] and hton[sl] with pg_bswap.h.
Previous Message Andres Freund 2017-10-01 22:35:56 pgsql: Allow pg_ctl kill to send SIGKILL.