From 834a171516ef957f77edb4180b5cd7af5eada698 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 22 Sep 2025 14:47:49 +0200 Subject: [PATCH 20/23] C11 anonymous unions [HeapTupleFields] --- src/backend/access/heap/heapam_xlog.c | 2 +- src/include/access/htup_details.h | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/backend/access/heap/heapam_xlog.c b/src/backend/access/heap/heapam_xlog.c index cf843277938..f51af454284 100644 --- a/src/backend/access/heap/heapam_xlog.c +++ b/src/backend/access/heap/heapam_xlog.c @@ -1301,7 +1301,7 @@ heap_mask(char *pagedata, BlockNumber blkno) * During replay, we set Command Id to FirstCommandId. Hence, mask * it. See heap_xlog_insert() for details. */ - page_htup->t_choice.t_heap.t_field3.t_cid = MASK_MARKER; + page_htup->t_choice.t_heap.t_cid = MASK_MARKER; /* * For a speculative tuple, heap_insert() does not set ctid in the diff --git a/src/include/access/htup_details.h b/src/include/access/htup_details.h index fa4525e3f58..4aea2d658c6 100644 --- a/src/include/access/htup_details.h +++ b/src/include/access/htup_details.h @@ -128,7 +128,7 @@ typedef struct HeapTupleFields { CommandId t_cid; /* inserting or deleting command ID, or both */ TransactionId t_xvac; /* old-style VACUUM FULL xact ID */ - } t_field3; + }; } HeapTupleFields; typedef struct DatumTupleFields @@ -419,7 +419,7 @@ HeapTupleHeaderGetUpdateXid(const HeapTupleHeaderData *tup) static inline CommandId HeapTupleHeaderGetRawCommandId(const HeapTupleHeaderData *tup) { - return tup->t_choice.t_heap.t_field3.t_cid; + return tup->t_choice.t_heap.t_cid; } /* SetCmin is reasonably simple since we never need a combo CID */ @@ -427,7 +427,7 @@ static inline void HeapTupleHeaderSetCmin(HeapTupleHeaderData *tup, CommandId cid) { Assert(!(tup->t_infomask & HEAP_MOVED)); - tup->t_choice.t_heap.t_field3.t_cid = cid; + tup->t_choice.t_heap.t_cid = cid; tup->t_infomask &= ~HEAP_COMBOCID; } @@ -436,7 +436,7 @@ static inline void HeapTupleHeaderSetCmax(HeapTupleHeaderData *tup, CommandId cid, bool iscombo) { Assert(!((tup)->t_infomask & HEAP_MOVED)); - tup->t_choice.t_heap.t_field3.t_cid = cid; + tup->t_choice.t_heap.t_cid = cid; if (iscombo) tup->t_infomask |= HEAP_COMBOCID; else @@ -447,7 +447,7 @@ static inline TransactionId HeapTupleHeaderGetXvac(const HeapTupleHeaderData *tup) { if (tup->t_infomask & HEAP_MOVED) - return tup->t_choice.t_heap.t_field3.t_xvac; + return tup->t_choice.t_heap.t_xvac; else return InvalidTransactionId; } @@ -456,7 +456,7 @@ static inline void HeapTupleHeaderSetXvac(HeapTupleHeaderData *tup, TransactionId xid) { Assert(tup->t_infomask & HEAP_MOVED); - tup->t_choice.t_heap.t_field3.t_xvac = xid; + tup->t_choice.t_heap.t_xvac = xid; } StaticAssertDecl(MaxOffsetNumber < SpecTokenOffsetNumber, -- 2.51.0