aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/brin/brin_pageops.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2019-01-29 01:16:24 +0100
committerPeter Eisentraut <peter@eisentraut.org>2019-02-13 11:50:16 +0100
commit37d9916020286caec810f4de61fbd0de3568454d (patch)
treed9d80040f72093664d8a20b55de2a670988d281e /src/backend/access/brin/brin_pageops.c
parentcf40dc65b676c8df1ee12f060b40f0e37a183e04 (diff)
downloadpostgresql-37d9916020286caec810f4de61fbd0de3568454d.tar.gz
postgresql-37d9916020286caec810f4de61fbd0de3568454d.zip
More unconstify use
Replace casts whose only purpose is to cast away const with the unconstify() macro. Discussion: https://www.postgresql.org/message-id/flat/53a28052-f9f3-1808-fed9-460fd43035ab%402ndquadrant.com
Diffstat (limited to 'src/backend/access/brin/brin_pageops.c')
-rw-r--r--src/backend/access/brin/brin_pageops.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/access/brin/brin_pageops.c b/src/backend/access/brin/brin_pageops.c
index 2eb354f948f..2e83aa42f78 100644
--- a/src/backend/access/brin/brin_pageops.c
+++ b/src/backend/access/brin/brin_pageops.c
@@ -178,7 +178,7 @@ brin_doupdate(Relation idxrel, BlockNumber pagesPerRange,
brin_can_do_samepage_update(oldbuf, origsz, newsz))
{
START_CRIT_SECTION();
- if (!PageIndexTupleOverwrite(oldpage, oldoff, (Item) newtup, newsz))
+ if (!PageIndexTupleOverwrite(oldpage, oldoff, (Item) unconstify(BrinTuple *, newtup), newsz))
elog(ERROR, "failed to replace BRIN tuple");
MarkBufferDirty(oldbuf);
@@ -195,7 +195,7 @@ brin_doupdate(Relation idxrel, BlockNumber pagesPerRange,
XLogRegisterData((char *) &xlrec, SizeOfBrinSamepageUpdate);
XLogRegisterBuffer(0, oldbuf, REGBUF_STANDARD);
- XLogRegisterBufData(0, (char *) newtup, newsz);
+ XLogRegisterBufData(0, (char *) unconstify(BrinTuple *, newtup), newsz);
recptr = XLogInsert(RM_BRIN_ID, info);
@@ -252,7 +252,7 @@ brin_doupdate(Relation idxrel, BlockNumber pagesPerRange,
brin_page_init(newpage, BRIN_PAGETYPE_REGULAR);
PageIndexTupleDeleteNoCompact(oldpage, oldoff);
- newoff = PageAddItem(newpage, (Item) newtup, newsz,
+ newoff = PageAddItem(newpage, (Item) unconstify(BrinTuple *, newtup), newsz,
InvalidOffsetNumber, false, false);
if (newoff == InvalidOffsetNumber)
elog(ERROR, "failed to add BRIN tuple to new page");
@@ -287,7 +287,7 @@ brin_doupdate(Relation idxrel, BlockNumber pagesPerRange,
XLogRegisterData((char *) &xlrec, SizeOfBrinUpdate);
XLogRegisterBuffer(0, newbuf, REGBUF_STANDARD | (extended ? REGBUF_WILL_INIT : 0));
- XLogRegisterBufData(0, (char *) newtup, newsz);
+ XLogRegisterBufData(0, (char *) unconstify(BrinTuple *, newtup), newsz);
/* revmap page */
XLogRegisterBuffer(1, revmapbuf, 0);