mirror of
https://github.com/postgres/postgres.git
synced 2025-10-27 00:12:01 +03:00
Remove unnecessary (char *) casts [checksum]
Remove some (char *) casts related to uses of the pg_checksum_page() function. These casts are useless, because everything involved already has the right type. Moreover, these casts actually silently discarded a const qualifier. The declaration of a higher-level function needs to be adjusted to fix that. Reviewed-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> Discussion: https://www.postgresql.org/message-id/flat/fd1fcedb-3492-4fc8-9e3e-74b97f2db6c7%40eisentraut.org
This commit is contained in:
@@ -85,7 +85,7 @@ PageInit(Page page, Size pageSize, Size specialSize)
|
||||
* to pgstat.
|
||||
*/
|
||||
bool
|
||||
PageIsVerifiedExtended(const PageData *page, BlockNumber blkno, int flags)
|
||||
PageIsVerifiedExtended(PageData *page, BlockNumber blkno, int flags)
|
||||
{
|
||||
const PageHeaderData *p = (const PageHeaderData *) page;
|
||||
size_t *pagebytes;
|
||||
@@ -100,7 +100,7 @@ PageIsVerifiedExtended(const PageData *page, BlockNumber blkno, int flags)
|
||||
{
|
||||
if (DataChecksumsEnabled())
|
||||
{
|
||||
checksum = pg_checksum_page((char *) page, blkno);
|
||||
checksum = pg_checksum_page(page, blkno);
|
||||
|
||||
if (checksum != p->pd_checksum)
|
||||
checksum_failure = true;
|
||||
@@ -1534,5 +1534,5 @@ PageSetChecksumInplace(Page page, BlockNumber blkno)
|
||||
if (PageIsNew(page) || !DataChecksumsEnabled())
|
||||
return;
|
||||
|
||||
((PageHeader) page)->pd_checksum = pg_checksum_page((char *) page, blkno);
|
||||
((PageHeader) page)->pd_checksum = pg_checksum_page(page, blkno);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user