Friends,
There are places in the code that cast away const for no apparent
reason, fixed like such:
diff --git a/src/backend/executor/nodeIndexscan.c b/src/backend/executor/nodeIndexscan.c
index 3143bd9..fe2cfc2 100644
--- a/src/backend/executor/nodeIndexscan.c
+++ b/src/backend/executor/nodeIndexscan.c
@@ -409,8 +409,8 @@ static intreorderqueue_cmp(const pairingheap_node *a, const pairingheap_node *b,
void *arg){
- ReorderTuple *rta = (ReorderTuple *) a;
- ReorderTuple *rtb = (ReorderTuple *) b;
+ const ReorderTuple *rta = (const ReorderTuple *) a;
+ const ReorderTuple *rtb = (const ReorderTuple *) b; IndexScanState *node = (IndexScanState *) arg;
return-cmp_orderbyvals(rta->orderbyvals, rta->orderbynulls,
There are also places which appear to cast away const due to using
typedefs that don't include const, which make for a more messy fix,
like such:
diff --git a/src/backend/storage/page/bufpage.c b/src/backend/storage/page/bufpage.c
index 73aa0c0..9e157a3 100644
--- a/src/backend/storage/page/bufpage.c
+++ b/src/backend/storage/page/bufpage.c
@@ -1037,7 +1037,7 @@ PageIndexTupleDeleteNoCompact(Page page, OffsetNumber offnum) */boolPageIndexTupleOverwrite(Page
page,OffsetNumber offnum,
- Item newtup, Size newsize)
+ const char *newtup, Size newsize){ PageHeader phdr =
(PageHeader)page; ItemId tupid;
diff --git a/src/include/storage/bufpage.h b/src/include/storage/bufpage.h
index ad4ab5f..cd97a1a 100644
--- a/src/include/storage/bufpage.h
+++ b/src/include/storage/bufpage.h
@@ -431,7 +431,7 @@ extern void PageIndexTupleDelete(Page page, OffsetNumber offset);extern void
PageIndexMultiDelete(Pagepage, OffsetNumber *itemnos, int nitems);extern void PageIndexTupleDeleteNoCompact(Page page,
OffsetNumberoffset);extern bool PageIndexTupleOverwrite(Page page, OffsetNumber offnum,
- Item newtup, Size newsize);
+ const char *newtup, Size newsize);extern char *PageSetChecksumCopy(Page
page,BlockNumber blkno);extern void PageSetChecksumInplace(Page page, BlockNumber blkno);
Are these castings away of const consistent with the project's coding standards?
Would patches to not cast away const be considered?
Thanks,
Mark Dilger