pgsql: Convert confusing macros in multixact.c to static inline functio

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Convert confusing macros in multixact.c to static inline functio
Date: 2024-06-16 17:53:59
Message-ID: E1sIu4k-001moc-7N@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Convert confusing macros in multixact.c to static inline functions

The macros were confused about the argument data types. All the
arguments were called 'xid', and some of the macros included casts to
TransactionId, even though the arguments were actually either
MultiXactIds or MultiXactOffsets. It compiles to the same thing,
because TransactionId, MultiXactId and MultiXactOffset are all
typedefs of uint32, but it was highly misleading.

Author: Maxim Orlov <orlovmg(at)gmail(dot)com>
Discussion: https://www.postgresql.org/message-id/CACG%3DezbLUG-OD1osAW3OchOMxZtdxHh2itYR9Zhh-a13wEBEQw%40mail.gmail.com
Discussion: https://www.postgresql.org/message-id/ff143b24-a093-40da-9833-d36b83726bdf%40iki.fi

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0099b9408e8c74158976c888854e0caafd6c052a

Modified Files
--------------
src/backend/access/transam/multixact.c | 79 ++++++++++++++++++++++++++--------
1 file changed, 60 insertions(+), 19 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Noah Misch 2024-06-16 19:32:09 pgsql: Remove use of %z in sscanf.
Previous Message Tatsuo Ishii 2024-06-16 07:30:59 pgsql: doc: fix typo in create role manual.