summaryrefslogtreecommitdiff
path: root/src/backend/access/gin/ginentrypage.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2025-10-27 09:54:16 +0100
committerPeter Eisentraut <peter@eisentraut.org>2025-10-27 09:55:59 +0100
commit76acf4b722faa2a552f62034b793c2797909f91b (patch)
tree43ddf923e05c8cfa56097d5634f5f2d4c1d8015c /src/backend/access/gin/ginentrypage.c
parent64d2b0968ea494cb11900ffb7681b5784e4112b9 (diff)
Remove Item type
This type is just char * underneath, it provides no real value, no type safety, and just makes the code one level more mysterious. It is more idiomatic to refer to blobs of memory by a combination of void * and size_t, so change it to that. Also, since this type hides the pointerness, we can't apply qualifiers to what is pointed to, which requires some unconstify nonsense. This change allows fixing that. Extension code that uses the Item type can change its code to use void * to be backward compatible. Reviewed-by: Nathan Bossart <nathandbossart@gmail.com> Reviewed-by: Peter Geoghegan <pg@bowt.ie> Discussion: https://www.postgresql.org/message-id/flat/c75cccf5-5709-407b-a36a-2ae6570be766@eisentraut.org
Diffstat (limited to 'src/backend/access/gin/ginentrypage.c')
-rw-r--r--src/backend/access/gin/ginentrypage.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/access/gin/ginentrypage.c b/src/backend/access/gin/ginentrypage.c
index ba6bbd562df..c0592367700 100644
--- a/src/backend/access/gin/ginentrypage.c
+++ b/src/backend/access/gin/ginentrypage.c
@@ -563,7 +563,7 @@ entryExecPlaceToPage(GinBtree btree, Buffer buf, GinBtreeStack *stack,
entryPreparePage(btree, page, off, insertData, updateblkno);
placed = PageAddItem(page,
- (Item) insertData->entry,
+ insertData->entry,
IndexTupleSize(insertData->entry),
off, false, false);
if (placed != off)
@@ -684,7 +684,7 @@ entrySplitPage(GinBtree btree, Buffer origbuf,
lsize += MAXALIGN(IndexTupleSize(itup)) + sizeof(ItemIdData);
}
- if (PageAddItem(page, (Item) itup, IndexTupleSize(itup), InvalidOffsetNumber, false, false) == InvalidOffsetNumber)
+ if (PageAddItem(page, itup, IndexTupleSize(itup), InvalidOffsetNumber, false, false) == InvalidOffsetNumber)
elog(ERROR, "failed to add item to index page in \"%s\"",
RelationGetRelationName(btree->index));
ptr += MAXALIGN(IndexTupleSize(itup));
@@ -727,12 +727,12 @@ ginEntryFillRoot(GinBtree btree, Page root,
IndexTuple itup;
itup = GinFormInteriorTuple(getRightMostTuple(lpage), lpage, lblkno);
- if (PageAddItem(root, (Item) itup, IndexTupleSize(itup), InvalidOffsetNumber, false, false) == InvalidOffsetNumber)
+ if (PageAddItem(root, itup, IndexTupleSize(itup), InvalidOffsetNumber, false, false) == InvalidOffsetNumber)
elog(ERROR, "failed to add item to index root page");
pfree(itup);
itup = GinFormInteriorTuple(getRightMostTuple(rpage), rpage, rblkno);
- if (PageAddItem(root, (Item) itup, IndexTupleSize(itup), InvalidOffsetNumber, false, false) == InvalidOffsetNumber)
+ if (PageAddItem(root, itup, IndexTupleSize(itup), InvalidOffsetNumber, false, false) == InvalidOffsetNumber)
elog(ERROR, "failed to add item to index root page");
pfree(itup);
}