From 9d035f425452279041c52e01cf83b2a27e121b5c Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 13 Jul 2008 20:45:47 +0000 Subject: Clean up the use of some page-header-access macros: principally, use SizeOfPageHeaderData instead of sizeof(PageHeaderData) in places where that makes the code clearer, and avoid casting between Page and PageHeader where possible. Zdenek Kotala, with some additional cleanup by Heikki Linnakangas. I did not apply the parts of the proposed patch that would have resulted in slightly changing the on-disk format of hash indexes; it seems to me that's not a win as long as there's any chance of having in-place upgrade for 8.4. --- src/backend/access/gist/gistutil.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/backend/access/gist/gistutil.c') diff --git a/src/backend/access/gist/gistutil.c b/src/backend/access/gist/gistutil.c index f6ae7747d71..248ec259567 100644 --- a/src/backend/access/gist/gistutil.c +++ b/src/backend/access/gist/gistutil.c @@ -8,7 +8,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/gist/gistutil.c,v 1.29 2008/06/19 00:46:03 alvherre Exp $ + * $PostgreSQL: pgsql/src/backend/access/gist/gistutil.c,v 1.30 2008/07/13 20:45:46 tgl Exp $ *------------------------------------------------------------------------- */ #include "postgres.h" @@ -591,8 +591,7 @@ gistcheckpage(Relation rel, Buffer buf) /* * Additionally check that the special area looks sane. */ - if (((PageHeader) (page))->pd_special != - (BLCKSZ - MAXALIGN(sizeof(GISTPageOpaqueData)))) + if (PageGetSpecialSize(page) != MAXALIGN(sizeof(GISTPageOpaqueData))) ereport(ERROR, (errcode(ERRCODE_INDEX_CORRUPTED), errmsg("index \"%s\" contains corrupted page at block %u", -- cgit v1.2.3