1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-28 11:55:03 +03:00

Convert macros to static inline functions (bufpage.h)

Remove PageIsValid() and PageSizeIsValid(), which weren't used and
seem unnecessary.

Some code using these formerly-macros needs some adjustments because
it was previously playing loose with the Page vs. PageHeader types,
which is no longer possible with the functions instead of macros.

Reviewed-by: Amul Sul <sulamul@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/5b558da8-99fb-0a99-83dd-f72f05388517%40enterprisedb.com
This commit is contained in:
Peter Eisentraut
2022-07-11 07:20:35 +02:00
parent eed959a457
commit 2cd2569c72
5 changed files with 179 additions and 118 deletions

View File

@@ -191,7 +191,7 @@ pg_checksum_page(char *page, BlockNumber blkno)
uint32 checksum;
/* We only calculate the checksum for properly-initialized pages */
Assert(!PageIsNew(&cpage->phdr));
Assert(!PageIsNew((Page) page));
/*
* Save pd_checksum and temporarily set it to zero, so that the checksum