From e1ac846f3d2836dcfa0ad15310e28d0a0b495500 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 30 Oct 2025 14:10:39 +0100 Subject: Mark ItemPointer arguments as const throughout This is a follow up 991295f. I searched over src/ and made all ItemPointer arguments as const as much as possible. Note: We cut out from the original patch the pieces that would have created incompatibilities in the index or table AM APIs. Those could be considered separately. Author: Chao Li Discussion: https://www.postgresql.org/message-id/CAEoWx2nBaypg16Z5ciHuKw66pk850RFWw9ACS2DqqJ_AkKeRsw%40mail.gmail.com --- src/backend/access/spgist/spgdoinsert.c | 2 +- src/backend/access/spgist/spgutils.c | 2 +- src/backend/access/spgist/spgvacuum.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/backend/access/spgist') diff --git a/src/backend/access/spgist/spgdoinsert.c b/src/backend/access/spgist/spgdoinsert.c index e00bd0e2636..5d84141028d 100644 --- a/src/backend/access/spgist/spgdoinsert.c +++ b/src/backend/access/spgist/spgdoinsert.c @@ -1908,7 +1908,7 @@ spgSplitNodeAction(Relation index, SpGistState *state, */ bool spgdoinsert(Relation index, SpGistState *state, - ItemPointer heapPtr, Datum *datums, bool *isnulls) + const ItemPointerData *heapPtr, Datum *datums, bool *isnulls) { bool result = true; TupleDesc leafDescriptor = state->leafTupDesc; diff --git a/src/backend/access/spgist/spgutils.c b/src/backend/access/spgist/spgutils.c index 245ec05e4bb..87c31da71a5 100644 --- a/src/backend/access/spgist/spgutils.c +++ b/src/backend/access/spgist/spgutils.c @@ -868,7 +868,7 @@ SpGistGetLeafTupleSize(TupleDesc tupleDescriptor, * Construct a leaf tuple containing the given heap TID and datum values */ SpGistLeafTuple -spgFormLeafTuple(SpGistState *state, ItemPointer heapPtr, +spgFormLeafTuple(SpGistState *state, const ItemPointerData *heapPtr, const Datum *datums, const bool *isnulls) { SpGistLeafTuple tup; diff --git a/src/backend/access/spgist/spgvacuum.c b/src/backend/access/spgist/spgvacuum.c index 8f8a1ad7796..71ef2e5036f 100644 --- a/src/backend/access/spgist/spgvacuum.c +++ b/src/backend/access/spgist/spgvacuum.c @@ -61,7 +61,7 @@ typedef struct spgBulkDeleteState * ensures that scans of the list don't miss items added during the scan. */ static void -spgAddPendingTID(spgBulkDeleteState *bds, ItemPointer tid) +spgAddPendingTID(spgBulkDeleteState *bds, const ItemPointerData *tid) { spgVacPendingItem *pitem; spgVacPendingItem **listLink; -- cgit v1.2.3