mirror of
https://github.com/postgres/postgres.git
synced 2025-06-13 07:41:39 +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:
@ -8,7 +8,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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 */
|
/* no space for insertion */
|
||||||
IndexTuple *itvec,
|
IndexTuple *itvec,
|
||||||
*newitup;
|
*newitup;
|
||||||
int tlen,
|
int tlen;
|
||||||
olen;
|
|
||||||
SplitedPageLayout *dist = NULL,
|
SplitedPageLayout *dist = NULL,
|
||||||
*ptr;
|
*ptr;
|
||||||
|
|
||||||
is_splitted = true;
|
is_splitted = true;
|
||||||
itvec = gistextractbuffer(state->stack->buffer, &tlen);
|
itvec = gistextractbuffer(state->stack->buffer, &tlen);
|
||||||
olen = tlen;
|
|
||||||
itvec = gistjoinvector(itvec, &tlen, state->itup, state->ituplen);
|
itvec = gistjoinvector(itvec, &tlen, state->itup, state->ituplen);
|
||||||
newitup = gistSplit(state->r, state->stack->buffer, itvec, &tlen, &dist, giststate);
|
newitup = gistSplit(state->r, state->stack->buffer, itvec, &tlen, &dist, giststate);
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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;
|
Buffer metabuf;
|
||||||
HashMetaPage metap;
|
HashMetaPage metap;
|
||||||
IndexTuple itup;
|
IndexTuple itup;
|
||||||
BlockNumber itup_blkno;
|
|
||||||
OffsetNumber itup_off;
|
|
||||||
BlockNumber blkno;
|
BlockNumber blkno;
|
||||||
Page page;
|
Page page;
|
||||||
HashPageOpaque pageopaque;
|
HashPageOpaque pageopaque;
|
||||||
@ -159,8 +157,7 @@ _hash_doinsert(Relation rel, HashItem hitem)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* found page with enough space, so add the item here */
|
/* found page with enough space, so add the item here */
|
||||||
itup_off = _hash_pgaddtup(rel, buf, itemsz, hitem);
|
(void) _hash_pgaddtup(rel, buf, itemsz, hitem);
|
||||||
itup_blkno = BufferGetBlockNumber(buf);
|
|
||||||
|
|
||||||
/* write and release the modified page */
|
/* write and release the modified page */
|
||||||
_hash_wrtbuf(rel, buf);
|
_hash_wrtbuf(rel, buf);
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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;
|
HashPageOpaque opaque;
|
||||||
OffsetNumber maxoff;
|
OffsetNumber maxoff;
|
||||||
OffsetNumber offnum;
|
OffsetNumber offnum;
|
||||||
Bucket bucket;
|
|
||||||
BlockNumber blkno;
|
BlockNumber blkno;
|
||||||
HashItem hitem;
|
HashItem hitem;
|
||||||
IndexTuple itup;
|
IndexTuple itup;
|
||||||
@ -258,7 +257,6 @@ _hash_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir)
|
|||||||
page = BufferGetPage(buf);
|
page = BufferGetPage(buf);
|
||||||
_hash_checkpage(rel, page, LH_BUCKET_PAGE | LH_OVERFLOW_PAGE);
|
_hash_checkpage(rel, page, LH_BUCKET_PAGE | LH_OVERFLOW_PAGE);
|
||||||
opaque = (HashPageOpaque) PageGetSpecialPointer(page);
|
opaque = (HashPageOpaque) PageGetSpecialPointer(page);
|
||||||
bucket = opaque->hasho_bucket;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If _hash_step is called from _hash_first, current will not be valid, so
|
* 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).
|
* '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
|
* continue to step through tuples until: 1) we get to the end of the
|
||||||
* chain or 2) we find a valid tuple.
|
* bucket chain or 2) we find a valid tuple.
|
||||||
*/
|
*/
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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,
|
ScanKey scankey,
|
||||||
bool nextkey)
|
bool nextkey)
|
||||||
{
|
{
|
||||||
TupleDesc itupdesc;
|
|
||||||
Page page;
|
Page page;
|
||||||
BTPageOpaque opaque;
|
BTPageOpaque opaque;
|
||||||
OffsetNumber low,
|
OffsetNumber low,
|
||||||
@ -233,7 +232,6 @@ _bt_binsrch(Relation rel,
|
|||||||
int32 result,
|
int32 result,
|
||||||
cmpval;
|
cmpval;
|
||||||
|
|
||||||
itupdesc = RelationGetDescr(rel);
|
|
||||||
page = BufferGetPage(buf);
|
page = BufferGetPage(buf);
|
||||||
opaque = (BTPageOpaque) PageGetSpecialPointer(page);
|
opaque = (BTPageOpaque) PageGetSpecialPointer(page);
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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)
|
_bt_mkscankey_nodata(Relation rel)
|
||||||
{
|
{
|
||||||
ScanKey skey;
|
ScanKey skey;
|
||||||
TupleDesc itupdesc;
|
|
||||||
int natts;
|
int natts;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
itupdesc = RelationGetDescr(rel);
|
|
||||||
natts = RelationGetNumberOfAttributes(rel);
|
natts = RelationGetNumberOfAttributes(rel);
|
||||||
|
|
||||||
skey = (ScanKey) palloc(natts * sizeof(ScanKeyData));
|
skey = (ScanKey) palloc(natts * sizeof(ScanKeyData));
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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;
|
Relation reln;
|
||||||
Buffer buffer;
|
Buffer buffer;
|
||||||
Page page;
|
Page page;
|
||||||
BTPageOpaque pageop;
|
|
||||||
char *datapos;
|
char *datapos;
|
||||||
int datalen;
|
int datalen;
|
||||||
xl_btree_metadata md;
|
xl_btree_metadata md;
|
||||||
@ -187,7 +186,6 @@ btree_xlog_insert(bool isleaf, bool ismeta,
|
|||||||
page = (Page) BufferGetPage(buffer);
|
page = (Page) BufferGetPage(buffer);
|
||||||
if (PageIsNew((PageHeader) page))
|
if (PageIsNew((PageHeader) page))
|
||||||
elog(PANIC, "btree_insert_redo: uninitialized page");
|
elog(PANIC, "btree_insert_redo: uninitialized page");
|
||||||
pageop = (BTPageOpaque) PageGetSpecialPointer(page);
|
|
||||||
|
|
||||||
if (XLByteLE(lsn, PageGetLSN(page)))
|
if (XLByteLE(lsn, PageGetLSN(page)))
|
||||||
{
|
{
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/catalog/heap.c,v 1.291 2005/10/15 02:49:12 momjian Exp $
|
* $PostgreSQL: pgsql/src/backend/catalog/heap.c,v 1.292 2005/10/18 01:06:23 tgl Exp $
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* INTERFACE ROUTINES
|
* INTERFACE ROUTINES
|
||||||
@ -1452,7 +1452,6 @@ AddRelationRawConstraints(Relation rel,
|
|||||||
TupleDesc tupleDesc;
|
TupleDesc tupleDesc;
|
||||||
TupleConstr *oldconstr;
|
TupleConstr *oldconstr;
|
||||||
int numoldchecks;
|
int numoldchecks;
|
||||||
ConstrCheck *oldchecks;
|
|
||||||
ParseState *pstate;
|
ParseState *pstate;
|
||||||
RangeTblEntry *rte;
|
RangeTblEntry *rte;
|
||||||
int numchecks;
|
int numchecks;
|
||||||
@ -1467,15 +1466,9 @@ AddRelationRawConstraints(Relation rel,
|
|||||||
tupleDesc = RelationGetDescr(rel);
|
tupleDesc = RelationGetDescr(rel);
|
||||||
oldconstr = tupleDesc->constr;
|
oldconstr = tupleDesc->constr;
|
||||||
if (oldconstr)
|
if (oldconstr)
|
||||||
{
|
|
||||||
numoldchecks = oldconstr->num_check;
|
numoldchecks = oldconstr->num_check;
|
||||||
oldchecks = oldconstr->check;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
numoldchecks = 0;
|
numoldchecks = 0;
|
||||||
oldchecks = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create a dummy ParseState and insert the target relation as its sole
|
* Create a dummy ParseState and insert the target relation as its sole
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/catalog/pg_conversion.c,v 1.27 2005/10/15 02:49:14 momjian Exp $
|
* $PostgreSQL: pgsql/src/backend/catalog/pg_conversion.c,v 1.28 2005/10/18 01:06:23 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -174,7 +174,6 @@ void
|
|||||||
RemoveConversionById(Oid conversionOid)
|
RemoveConversionById(Oid conversionOid)
|
||||||
{
|
{
|
||||||
Relation rel;
|
Relation rel;
|
||||||
TupleDesc tupDesc;
|
|
||||||
HeapTuple tuple;
|
HeapTuple tuple;
|
||||||
HeapScanDesc scan;
|
HeapScanDesc scan;
|
||||||
ScanKeyData scanKeyData;
|
ScanKeyData scanKeyData;
|
||||||
@ -186,7 +185,6 @@ RemoveConversionById(Oid conversionOid)
|
|||||||
|
|
||||||
/* open pg_conversion */
|
/* open pg_conversion */
|
||||||
rel = heap_open(ConversionRelationId, RowExclusiveLock);
|
rel = heap_open(ConversionRelationId, RowExclusiveLock);
|
||||||
tupDesc = rel->rd_att;
|
|
||||||
|
|
||||||
scan = heap_beginscan(rel, SnapshotNow,
|
scan = heap_beginscan(rel, SnapshotNow,
|
||||||
1, &scanKeyData);
|
1, &scanKeyData);
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/commands/typecmds.c,v 1.81 2005/10/15 02:49:16 momjian Exp $
|
* $PostgreSQL: pgsql/src/backend/commands/typecmds.c,v 1.82 2005/10/18 01:06:24 tgl Exp $
|
||||||
*
|
*
|
||||||
* DESCRIPTION
|
* DESCRIPTION
|
||||||
* The "DefineFoo" routines take the parse tree and pick out the
|
* The "DefineFoo" routines take the parse tree and pick out the
|
||||||
@ -1335,7 +1335,6 @@ AlterDomainDropConstraint(List *names, const char *constrName, DropBehavior beha
|
|||||||
Oid domainoid;
|
Oid domainoid;
|
||||||
HeapTuple tup;
|
HeapTuple tup;
|
||||||
Relation rel;
|
Relation rel;
|
||||||
Form_pg_type typTup;
|
|
||||||
Relation conrel;
|
Relation conrel;
|
||||||
SysScanDesc conscan;
|
SysScanDesc conscan;
|
||||||
ScanKeyData key[1];
|
ScanKeyData key[1];
|
||||||
@ -1379,8 +1378,6 @@ AlterDomainDropConstraint(List *names, const char *constrName, DropBehavior beha
|
|||||||
conscan = systable_beginscan(conrel, ConstraintTypidIndexId, true,
|
conscan = systable_beginscan(conrel, ConstraintTypidIndexId, true,
|
||||||
SnapshotNow, 1, key);
|
SnapshotNow, 1, key);
|
||||||
|
|
||||||
typTup = (Form_pg_type) GETSTRUCT(tup);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Scan over the result set, removing any matching entries.
|
* Scan over the result set, removing any matching entries.
|
||||||
*/
|
*/
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/executor/nodeHashjoin.c,v 1.74 2005/10/15 02:49:17 momjian Exp $
|
* $PostgreSQL: pgsql/src/backend/executor/nodeHashjoin.c,v 1.75 2005/10/18 01:06:24 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -50,7 +50,6 @@ ExecHashJoin(HashJoinState *node)
|
|||||||
HashState *hashNode;
|
HashState *hashNode;
|
||||||
List *joinqual;
|
List *joinqual;
|
||||||
List *otherqual;
|
List *otherqual;
|
||||||
ScanDirection dir;
|
|
||||||
TupleTableSlot *inntuple;
|
TupleTableSlot *inntuple;
|
||||||
ExprContext *econtext;
|
ExprContext *econtext;
|
||||||
ExprDoneCond isDone;
|
ExprDoneCond isDone;
|
||||||
@ -68,7 +67,6 @@ ExecHashJoin(HashJoinState *node)
|
|||||||
otherqual = node->js.ps.qual;
|
otherqual = node->js.ps.qual;
|
||||||
hashNode = (HashState *) innerPlanState(node);
|
hashNode = (HashState *) innerPlanState(node);
|
||||||
outerNode = outerPlanState(node);
|
outerNode = outerPlanState(node);
|
||||||
dir = estate->es_direction;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* get information from HashJoin state
|
* get information from HashJoin state
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/rewrite/rewriteDefine.c,v 1.106 2005/10/15 02:49:24 momjian Exp $
|
* $PostgreSQL: pgsql/src/backend/rewrite/rewriteDefine.c,v 1.107 2005/10/18 01:06:24 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -191,7 +191,6 @@ DefineQueryRewrite(RuleStmt *stmt)
|
|||||||
Oid ev_relid;
|
Oid ev_relid;
|
||||||
Oid ruleId;
|
Oid ruleId;
|
||||||
int event_attno;
|
int event_attno;
|
||||||
Oid event_attype;
|
|
||||||
ListCell *l;
|
ListCell *l;
|
||||||
Query *query;
|
Query *query;
|
||||||
AclResult aclresult;
|
AclResult aclresult;
|
||||||
@ -432,7 +431,6 @@ DefineQueryRewrite(RuleStmt *stmt)
|
|||||||
* This rule is allowed - prepare to install it.
|
* This rule is allowed - prepare to install it.
|
||||||
*/
|
*/
|
||||||
event_attno = -1;
|
event_attno = -1;
|
||||||
event_attype = InvalidOid;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We want the rule's table references to be checked as though by the rule
|
* We want the rule's table references to be checked as though by the rule
|
||||||
|
Reference in New Issue
Block a user