From 422181163bfe1a292ee51941a007d54bc127ccec Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Fri, 27 Dec 2024 11:07:35 +0100 Subject: [PATCH 1/3] Add some const decorations (htup.h) --- src/backend/access/heap/heapam.c | 6 +++--- src/backend/utils/time/combocid.c | 6 +++--- src/include/access/htup.h | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c index 329e727f80d..75171e8f2c0 100644 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@ -7419,10 +7419,10 @@ MultiXactIdGetUpdateXid(TransactionId xmax, uint16 t_infomask) * checking the hint bits. */ TransactionId -HeapTupleGetUpdateXid(HeapTupleHeader tuple) +HeapTupleGetUpdateXid(const HeapTupleHeaderData *tup) { - return MultiXactIdGetUpdateXid(HeapTupleHeaderGetRawXmax(tuple), - tuple->t_infomask); + return MultiXactIdGetUpdateXid(HeapTupleHeaderGetRawXmax(tup), + tup->t_infomask); } /* diff --git a/src/backend/utils/time/combocid.c b/src/backend/utils/time/combocid.c index f85510b74ff..1ecdc93b7e2 100644 --- a/src/backend/utils/time/combocid.c +++ b/src/backend/utils/time/combocid.c @@ -101,7 +101,7 @@ static CommandId GetRealCmax(CommandId combocid); */ CommandId -HeapTupleHeaderGetCmin(HeapTupleHeader tup) +HeapTupleHeaderGetCmin(const HeapTupleHeaderData *tup) { CommandId cid = HeapTupleHeaderGetRawCommandId(tup); @@ -115,7 +115,7 @@ HeapTupleHeaderGetCmin(HeapTupleHeader tup) } CommandId -HeapTupleHeaderGetCmax(HeapTupleHeader tup) +HeapTupleHeaderGetCmax(const HeapTupleHeaderData *tup) { CommandId cid = HeapTupleHeaderGetRawCommandId(tup); @@ -150,7 +150,7 @@ HeapTupleHeaderGetCmax(HeapTupleHeader tup) * changes the tuple in shared buffers. */ void -HeapTupleHeaderAdjustCmax(HeapTupleHeader tup, +HeapTupleHeaderAdjustCmax(const HeapTupleHeaderData *tup, CommandId *cmax, bool *iscombo) { diff --git a/src/include/access/htup.h b/src/include/access/htup.h index 116cb1bb273..a5f1ef2441d 100644 --- a/src/include/access/htup.h +++ b/src/include/access/htup.h @@ -78,12 +78,12 @@ typedef HeapTupleData *HeapTuple; #define HeapTupleIsValid(tuple) PointerIsValid(tuple) /* HeapTupleHeader functions implemented in utils/time/combocid.c */ -extern CommandId HeapTupleHeaderGetCmin(HeapTupleHeader tup); -extern CommandId HeapTupleHeaderGetCmax(HeapTupleHeader tup); -extern void HeapTupleHeaderAdjustCmax(HeapTupleHeader tup, +extern CommandId HeapTupleHeaderGetCmin(const HeapTupleHeaderData *tup); +extern CommandId HeapTupleHeaderGetCmax(const HeapTupleHeaderData *tup); +extern void HeapTupleHeaderAdjustCmax(const HeapTupleHeaderData *tup, CommandId *cmax, bool *iscombo); /* Prototype for HeapTupleHeader accessors in heapam.c */ -extern TransactionId HeapTupleGetUpdateXid(HeapTupleHeader tuple); +extern TransactionId HeapTupleGetUpdateXid(const HeapTupleHeaderData *tup); #endif /* HTUP_H */ base-commit: d85ce012f99f63249bb45a78fcecb7a2383920b1 -- 2.47.1