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

A few trivial code cleanups motivated by reading warnings generated

by a recent HP C compiler.  Mostly, get rid of useless local variables
that are assigned to but never used.
This commit is contained in:
Tom Lane
2005-10-18 01:06:24 +00:00
parent d330f1554d
commit 23836fb1fb
11 changed files with 15 additions and 44 deletions

View File

@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/gist/gist.c,v 1.126 2005/09/22 20:44:36 momjian Exp $
* $PostgreSQL: pgsql/src/backend/access/gist/gist.c,v 1.127 2005/10/18 01:06:22 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -321,14 +321,12 @@ gistplacetopage(GISTInsertState *state, GISTSTATE *giststate)
/* no space for insertion */
IndexTuple *itvec,
*newitup;
int tlen,
olen;
int tlen;
SplitedPageLayout *dist = NULL,
*ptr;
is_splitted = true;
itvec = gistextractbuffer(state->stack->buffer, &tlen);
olen = tlen;
itvec = gistjoinvector(itvec, &tlen, state->itup, state->ituplen);
newitup = gistSplit(state->r, state->stack->buffer, itvec, &tlen, &dist, giststate);

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/hash/hashinsert.c,v 1.38 2005/10/15 02:49:08 momjian Exp $
* $PostgreSQL: pgsql/src/backend/access/hash/hashinsert.c,v 1.39 2005/10/18 01:06:23 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -37,8 +37,6 @@ _hash_doinsert(Relation rel, HashItem hitem)
Buffer metabuf;
HashMetaPage metap;
IndexTuple itup;
BlockNumber itup_blkno;
OffsetNumber itup_off;
BlockNumber blkno;
Page page;
HashPageOpaque pageopaque;
@@ -159,8 +157,7 @@ _hash_doinsert(Relation rel, HashItem hitem)
}
/* found page with enough space, so add the item here */
itup_off = _hash_pgaddtup(rel, buf, itemsz, hitem);
itup_blkno = BufferGetBlockNumber(buf);
(void) _hash_pgaddtup(rel, buf, itemsz, hitem);
/* write and release the modified page */
_hash_wrtbuf(rel, buf);

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/hash/hashsearch.c,v 1.40 2005/10/15 02:49:08 momjian Exp $
* $PostgreSQL: pgsql/src/backend/access/hash/hashsearch.c,v 1.41 2005/10/18 01:06:23 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -247,7 +247,6 @@ _hash_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir)
HashPageOpaque opaque;
OffsetNumber maxoff;
OffsetNumber offnum;
Bucket bucket;
BlockNumber blkno;
HashItem hitem;
IndexTuple itup;
@@ -258,7 +257,6 @@ _hash_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir)
page = BufferGetPage(buf);
_hash_checkpage(rel, page, LH_BUCKET_PAGE | LH_OVERFLOW_PAGE);
opaque = (HashPageOpaque) PageGetSpecialPointer(page);
bucket = opaque->hasho_bucket;
/*
* If _hash_step is called from _hash_first, current will not be valid, so
@@ -274,8 +272,8 @@ _hash_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir)
/*
* 'offnum' now points to the last tuple we have seen (if any).
*
* continue to step through tuples until: 1) we get to the end of the bucket
* chain or 2) we find a valid tuple.
* continue to step through tuples until: 1) we get to the end of the
* bucket chain or 2) we find a valid tuple.
*/
do
{

View File

@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.95 2005/10/15 02:49:09 momjian Exp $
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.96 2005/10/18 01:06:23 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -225,7 +225,6 @@ _bt_binsrch(Relation rel,
ScanKey scankey,
bool nextkey)
{
TupleDesc itupdesc;
Page page;
BTPageOpaque opaque;
OffsetNumber low,
@@ -233,7 +232,6 @@ _bt_binsrch(Relation rel,
int32 result,
cmpval;
itupdesc = RelationGetDescr(rel);
page = BufferGetPage(buf);
opaque = (BTPageOpaque) PageGetSpecialPointer(page);

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtutils.c,v 1.64 2005/10/15 02:49:09 momjian Exp $
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtutils.c,v 1.65 2005/10/18 01:06:23 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -79,11 +79,9 @@ ScanKey
_bt_mkscankey_nodata(Relation rel)
{
ScanKey skey;
TupleDesc itupdesc;
int natts;
int i;
itupdesc = RelationGetDescr(rel);
natts = RelationGetNumberOfAttributes(rel);
skey = (ScanKey) palloc(natts * sizeof(ScanKeyData));

View File

@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtxlog.c,v 1.23 2005/10/15 02:49:09 momjian Exp $
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtxlog.c,v 1.24 2005/10/18 01:06:23 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -156,7 +156,6 @@ btree_xlog_insert(bool isleaf, bool ismeta,
Relation reln;
Buffer buffer;
Page page;
BTPageOpaque pageop;
char *datapos;
int datalen;
xl_btree_metadata md;
@@ -187,7 +186,6 @@ btree_xlog_insert(bool isleaf, bool ismeta,
page = (Page) BufferGetPage(buffer);
if (PageIsNew((PageHeader) page))
elog(PANIC, "btree_insert_redo: uninitialized page");
pageop = (BTPageOpaque) PageGetSpecialPointer(page);
if (XLByteLE(lsn, PageGetLSN(page)))
{