]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Remove bogus const qualifier on PageGetItem() argument
authorPeter Eisentraut <peter@eisentraut.org>
Sun, 4 Jan 2026 15:00:15 +0000 (16:00 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Sun, 4 Jan 2026 15:00:15 +0000 (16:00 +0100)
The function ends up casting away the const qualifier, so it was a
lie.  No callers appear to rely on the const qualifier on the
argument, so the simplest solution is to just remove it.

Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://www.postgresql.org/message-id/beusplf77varvhip6ryuhd2fchsx26qmmhduqz432bnglq634b%402dx4k6yxj4cm

src/include/storage/bufpage.h

index 52989e5e535f0965026a593ff46a4b0b8265b3ad..ae3725b3b81bbb948072077ff9f8b7dbf26a79f9 100644 (file)
@@ -351,12 +351,12 @@ PageValidateSpecialPointer(const PageData *page)
  *             The semantics may change in the future.
  */
 static inline void *
-PageGetItem(const PageData *page, const ItemIdData *itemId)
+PageGetItem(PageData *page, const ItemIdData *itemId)
 {
        Assert(page);
        Assert(ItemIdHasStorage(itemId));
 
-       return (void *) (((const char *) page) + ItemIdGetOffset(itemId));
+       return (char *) page + ItemIdGetOffset(itemId);
 }
 
 /*