diff options
| author | Peter Eisentraut <peter@eisentraut.org> | 2025-10-27 09:54:16 +0100 |
|---|---|---|
| committer | Peter Eisentraut <peter@eisentraut.org> | 2025-10-27 09:55:59 +0100 |
| commit | 76acf4b722faa2a552f62034b793c2797909f91b (patch) | |
| tree | 43ddf923e05c8cfa56097d5634f5f2d4c1d8015c /src/backend/access/nbtree/nbtpage.c | |
| parent | 64d2b0968ea494cb11900ffb7681b5784e4112b9 (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/nbtree/nbtpage.c')
| -rw-r--r-- | src/backend/access/nbtree/nbtpage.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/backend/access/nbtree/nbtpage.c b/src/backend/access/nbtree/nbtpage.c index c79dd38ee18..30b43a4dd18 100644 --- a/src/backend/access/nbtree/nbtpage.c +++ b/src/backend/access/nbtree/nbtpage.c @@ -1194,8 +1194,7 @@ _bt_delitems_vacuum(Relation rel, Buffer buf, itup = updatable[i]->itup; itemsz = MAXALIGN(IndexTupleSize(itup)); - if (!PageIndexTupleOverwrite(page, updatedoffset, (Item) itup, - itemsz)) + if (!PageIndexTupleOverwrite(page, updatedoffset, itup, itemsz)) elog(PANIC, "failed to update partially dead item in block %u of index \"%s\"", BufferGetBlockNumber(buf), RelationGetRelationName(rel)); } @@ -1314,8 +1313,7 @@ _bt_delitems_delete(Relation rel, Buffer buf, itup = updatable[i]->itup; itemsz = MAXALIGN(IndexTupleSize(itup)); - if (!PageIndexTupleOverwrite(page, updatedoffset, (Item) itup, - itemsz)) + if (!PageIndexTupleOverwrite(page, updatedoffset, itup, itemsz)) elog(PANIC, "failed to update partially dead item in block %u of index \"%s\"", BufferGetBlockNumber(buf), RelationGetRelationName(rel)); } @@ -2239,8 +2237,7 @@ _bt_mark_page_halfdead(Relation rel, Relation heaprel, Buffer leafbuf, else BTreeTupleSetTopParent(&trunctuple, InvalidBlockNumber); - if (!PageIndexTupleOverwrite(page, P_HIKEY, (Item) &trunctuple, - IndexTupleSize(&trunctuple))) + if (!PageIndexTupleOverwrite(page, P_HIKEY, &trunctuple, IndexTupleSize(&trunctuple))) elog(ERROR, "could not overwrite high key in half-dead page"); /* Must mark buffers dirty before XLogInsert */ |
