Silence a rather odd compiler warning. In passing, make this file's

error messages look at least a little bit like the message style
guidelines say.
This commit is contained in:
Tom Lane 2007-07-15 23:09:26 +00:00
parent a190eb3d7d
commit cfd6c89b04
2 changed files with 18 additions and 18 deletions

View File

@ -56,14 +56,14 @@ extern Datum bt_page_stats(PG_FUNCTION_ARGS);
#define IS_INDEX(r) ((r)->rd_rel->relkind == 'i') #define IS_INDEX(r) ((r)->rd_rel->relkind == 'i')
#define IS_BTREE(r) ((r)->rd_rel->relam == BTREE_AM_OID) #define IS_BTREE(r) ((r)->rd_rel->relam == BTREE_AM_OID)
#define CHECK_PAGE_OFFSET_RANGE(page, offset) { \ #define CHECK_PAGE_OFFSET_RANGE(pg, offnum) { \
if ( !(FirstOffsetNumber<=(offset) && \ if ( !(FirstOffsetNumber<=(offnum) && \
(offset)<=PageGetMaxOffsetNumber(page)) ) \ (offnum)<=PageGetMaxOffsetNumber(pg)) ) \
elog(ERROR, "Page offset number out of range."); } elog(ERROR, "page offset number out of range"); }
#define CHECK_RELATION_BLOCK_RANGE(rel, blkno) { \ #define CHECK_RELATION_BLOCK_RANGE(rel, blkno) { \
if ( (blkno)<0 && RelationGetNumberOfBlocks((rel))<=(blkno) ) \ if ( (blkno)<0 && RelationGetNumberOfBlocks((rel))<=(blkno) ) \
elog(ERROR, "Block number out of range."); } elog(ERROR, "block number out of range"); }
/* ------------------------------------------------ /* ------------------------------------------------
* structure for single btree page statistics * structure for single btree page statistics
@ -220,10 +220,10 @@ bt_page_stats(PG_FUNCTION_ARGS)
buffer = ReadBuffer(rel, blkno); buffer = ReadBuffer(rel, blkno);
if (!IS_INDEX(rel) || !IS_BTREE(rel)) if (!IS_INDEX(rel) || !IS_BTREE(rel))
elog(ERROR, "bt_page_stats() can be used only on b-tree index."); elog(ERROR, "bt_page_stats() can only be used on b-tree index");
if (blkno == 0) if (blkno == 0)
elog(ERROR, "Block 0 is a meta page."); elog(ERROR, "block 0 is a meta page");
{ {
HeapTuple tuple; HeapTuple tuple;
@ -323,7 +323,7 @@ bt_page_items(PG_FUNCTION_ARGS)
struct user_args *uargs = NULL; struct user_args *uargs = NULL;
if (blkno == 0) if (blkno == 0)
elog(ERROR, "Block 0 is a meta page."); elog(ERROR, "block 0 is a meta page");
if (SRF_IS_FIRSTCALL()) if (SRF_IS_FIRSTCALL())
{ {
@ -343,14 +343,14 @@ bt_page_items(PG_FUNCTION_ARGS)
uargs->buffer = ReadBuffer(uargs->rel, blkno); uargs->buffer = ReadBuffer(uargs->rel, blkno);
if (!IS_INDEX(uargs->rel) || !IS_BTREE(uargs->rel)) if (!IS_INDEX(uargs->rel) || !IS_BTREE(uargs->rel))
elog(ERROR, "bt_page_items() can be used only on b-tree index."); elog(ERROR, "bt_page_items() can only be used on b-tree index");
uargs->page = BufferGetPage(uargs->buffer); uargs->page = BufferGetPage(uargs->buffer);
opaque = (BTPageOpaque) PageGetSpecialPointer(uargs->page); opaque = (BTPageOpaque) PageGetSpecialPointer(uargs->page);
if (P_ISDELETED(opaque)) if (P_ISDELETED(opaque))
elog(NOTICE, "bt_page_items(): this page is deleted."); elog(NOTICE, "page is deleted");
fctx->max_calls = PageGetMaxOffsetNumber(uargs->page); fctx->max_calls = PageGetMaxOffsetNumber(uargs->page);
fctx->user_fctx = uargs; fctx->user_fctx = uargs;
@ -368,7 +368,7 @@ bt_page_items(PG_FUNCTION_ARGS)
id = PageGetItemId(uargs->page, uargs->offset); id = PageGetItemId(uargs->page, uargs->offset);
if (!ItemIdIsValid(id)) if (!ItemIdIsValid(id))
elog(ERROR, "Invalid ItemId."); elog(ERROR, "invalid ItemId");
itup = (IndexTuple) PageGetItem(uargs->page, id); itup = (IndexTuple) PageGetItem(uargs->page, id);
@ -453,7 +453,7 @@ bt_metap(PG_FUNCTION_ARGS)
rel = relation_openrv(relrv, AccessShareLock); rel = relation_openrv(relrv, AccessShareLock);
if (!IS_INDEX(rel) || !IS_BTREE(rel)) if (!IS_INDEX(rel) || !IS_BTREE(rel))
elog(ERROR, "bt_metap() can be used only on b-tree index."); elog(ERROR, "bt_metap() can only be used on b-tree index");
buffer = ReadBuffer(rel, 0); buffer = ReadBuffer(rel, 0);

View File

@ -47,14 +47,14 @@ extern Datum pg_relpages(PG_FUNCTION_ARGS);
#define IS_INDEX(r) ((r)->rd_rel->relkind == 'i') #define IS_INDEX(r) ((r)->rd_rel->relkind == 'i')
#define IS_BTREE(r) ((r)->rd_rel->relam == BTREE_AM_OID) #define IS_BTREE(r) ((r)->rd_rel->relam == BTREE_AM_OID)
#define CHECK_PAGE_OFFSET_RANGE(page, offset) { \ #define CHECK_PAGE_OFFSET_RANGE(pg, offnum) { \
if ( !(FirstOffsetNumber<=(offset) && \ if ( !(FirstOffsetNumber<=(offnum) && \
(offset)<=PageGetMaxOffsetNumber(page)) ) \ (offnum)<=PageGetMaxOffsetNumber(pg)) ) \
elog(ERROR, "Page offset number out of range."); } elog(ERROR, "page offset number out of range"); }
#define CHECK_RELATION_BLOCK_RANGE(rel, blkno) { \ #define CHECK_RELATION_BLOCK_RANGE(rel, blkno) { \
if ( (blkno)<0 && RelationGetNumberOfBlocks((rel))<=(blkno) ) \ if ( (blkno)<0 && RelationGetNumberOfBlocks((rel))<=(blkno) ) \
elog(ERROR, "Block number out of range."); } elog(ERROR, "block number out of range"); }
/* ------------------------------------------------ /* ------------------------------------------------
* A structure for a whole btree index statistics * A structure for a whole btree index statistics
@ -100,7 +100,7 @@ pgstatindex(PG_FUNCTION_ARGS)
rel = relation_openrv(relrv, AccessShareLock); rel = relation_openrv(relrv, AccessShareLock);
if (!IS_INDEX(rel) || !IS_BTREE(rel)) if (!IS_INDEX(rel) || !IS_BTREE(rel))
elog(ERROR, "pgstatindex() can be used only on b-tree index."); elog(ERROR, "pgstatindex() can only be used on b-tree index");
/*------------------- /*-------------------
* Read a metapage * Read a metapage