Skip to content

Commit 23836fb

Browse files
committed
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.
1 parent d330f15 commit 23836fb

File tree

11 files changed

+15
-44
lines changed

11 files changed

+15
-44
lines changed

src/backend/access/gist/gist.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/gist/gist.c,v 1.126 2005/09/22 20:44:36 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/gist/gist.c,v 1.127 2005/10/18 01:06:22 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -321,14 +321,12 @@ gistplacetopage(GISTInsertState *state, GISTSTATE *giststate)
321321
/* no space for insertion */
322322
IndexTuple *itvec,
323323
*newitup;
324-
int tlen,
325-
olen;
324+
int tlen;
326325
SplitedPageLayout *dist = NULL,
327326
*ptr;
328327

329328
is_splitted = true;
330329
itvec = gistextractbuffer(state->stack->buffer, &tlen);
331-
olen = tlen;
332330
itvec = gistjoinvector(itvec, &tlen, state->itup, state->ituplen);
333331
newitup = gistSplit(state->r, state->stack->buffer, itvec, &tlen, &dist, giststate);
334332

src/backend/access/hash/hashinsert.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/hash/hashinsert.c,v 1.38 2005/10/15 02:49:08 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/hash/hashinsert.c,v 1.39 2005/10/18 01:06:23 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -37,8 +37,6 @@ _hash_doinsert(Relation rel, HashItem hitem)
3737
Buffer metabuf;
3838
HashMetaPage metap;
3939
IndexTuple itup;
40-
BlockNumber itup_blkno;
41-
OffsetNumber itup_off;
4240
BlockNumber blkno;
4341
Page page;
4442
HashPageOpaque pageopaque;
@@ -159,8 +157,7 @@ _hash_doinsert(Relation rel, HashItem hitem)
159157
}
160158

161159
/* found page with enough space, so add the item here */
162-
itup_off = _hash_pgaddtup(rel, buf, itemsz, hitem);
163-
itup_blkno = BufferGetBlockNumber(buf);
160+
(void) _hash_pgaddtup(rel, buf, itemsz, hitem);
164161

165162
/* write and release the modified page */
166163
_hash_wrtbuf(rel, buf);

src/backend/access/hash/hashsearch.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/hash/hashsearch.c,v 1.40 2005/10/15 02:49:08 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/hash/hashsearch.c,v 1.41 2005/10/18 01:06:23 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -247,7 +247,6 @@ _hash_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir)
247247
HashPageOpaque opaque;
248248
OffsetNumber maxoff;
249249
OffsetNumber offnum;
250-
Bucket bucket;
251250
BlockNumber blkno;
252251
HashItem hitem;
253252
IndexTuple itup;
@@ -258,7 +257,6 @@ _hash_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir)
258257
page = BufferGetPage(buf);
259258
_hash_checkpage(rel, page, LH_BUCKET_PAGE | LH_OVERFLOW_PAGE);
260259
opaque = (HashPageOpaque) PageGetSpecialPointer(page);
261-
bucket = opaque->hasho_bucket;
262260

263261
/*
264262
* 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)
274272
/*
275273
* 'offnum' now points to the last tuple we have seen (if any).
276274
*
277-
* continue to step through tuples until: 1) we get to the end of the bucket
278-
* chain or 2) we find a valid tuple.
275+
* continue to step through tuples until: 1) we get to the end of the
276+
* bucket chain or 2) we find a valid tuple.
279277
*/
280278
do
281279
{

src/backend/access/nbtree/nbtsearch.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.95 2005/10/15 02:49:09 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.96 2005/10/18 01:06:23 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -225,15 +225,13 @@ _bt_binsrch(Relation rel,
225225
ScanKey scankey,
226226
bool nextkey)
227227
{
228-
TupleDesc itupdesc;
229228
Page page;
230229
BTPageOpaque opaque;
231230
OffsetNumber low,
232231
high;
233232
int32 result,
234233
cmpval;
235234

236-
itupdesc = RelationGetDescr(rel);
237235
page = BufferGetPage(buf);
238236
opaque = (BTPageOpaque) PageGetSpecialPointer(page);
239237

src/backend/access/nbtree/nbtutils.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtutils.c,v 1.64 2005/10/15 02:49:09 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtutils.c,v 1.65 2005/10/18 01:06:23 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -79,11 +79,9 @@ ScanKey
7979
_bt_mkscankey_nodata(Relation rel)
8080
{
8181
ScanKey skey;
82-
TupleDesc itupdesc;
8382
int natts;
8483
int i;
8584

86-
itupdesc = RelationGetDescr(rel);
8785
natts = RelationGetNumberOfAttributes(rel);
8886

8987
skey = (ScanKey) palloc(natts * sizeof(ScanKeyData));

src/backend/access/nbtree/nbtxlog.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtxlog.c,v 1.23 2005/10/15 02:49:09 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtxlog.c,v 1.24 2005/10/18 01:06:23 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -156,7 +156,6 @@ btree_xlog_insert(bool isleaf, bool ismeta,
156156
Relation reln;
157157
Buffer buffer;
158158
Page page;
159-
BTPageOpaque pageop;
160159
char *datapos;
161160
int datalen;
162161
xl_btree_metadata md;
@@ -187,7 +186,6 @@ btree_xlog_insert(bool isleaf, bool ismeta,
187186
page = (Page) BufferGetPage(buffer);
188187
if (PageIsNew((PageHeader) page))
189188
elog(PANIC, "btree_insert_redo: uninitialized page");
190-
pageop = (BTPageOpaque) PageGetSpecialPointer(page);
191189

192190
if (XLByteLE(lsn, PageGetLSN(page)))
193191
{

src/backend/catalog/heap.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/catalog/heap.c,v 1.291 2005/10/15 02:49:12 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/catalog/heap.c,v 1.292 2005/10/18 01:06:23 tgl Exp $
1212
*
1313
*
1414
* INTERFACE ROUTINES
@@ -1452,7 +1452,6 @@ AddRelationRawConstraints(Relation rel,
14521452
TupleDesc tupleDesc;
14531453
TupleConstr *oldconstr;
14541454
int numoldchecks;
1455-
ConstrCheck *oldchecks;
14561455
ParseState *pstate;
14571456
RangeTblEntry *rte;
14581457
int numchecks;
@@ -1467,15 +1466,9 @@ AddRelationRawConstraints(Relation rel,
14671466
tupleDesc = RelationGetDescr(rel);
14681467
oldconstr = tupleDesc->constr;
14691468
if (oldconstr)
1470-
{
14711469
numoldchecks = oldconstr->num_check;
1472-
oldchecks = oldconstr->check;
1473-
}
14741470
else
1475-
{
14761471
numoldchecks = 0;
1477-
oldchecks = NULL;
1478-
}
14791472

14801473
/*
14811474
* Create a dummy ParseState and insert the target relation as its sole

src/backend/catalog/pg_conversion.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/catalog/pg_conversion.c,v 1.27 2005/10/15 02:49:14 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/catalog/pg_conversion.c,v 1.28 2005/10/18 01:06:23 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -174,7 +174,6 @@ void
174174
RemoveConversionById(Oid conversionOid)
175175
{
176176
Relation rel;
177-
TupleDesc tupDesc;
178177
HeapTuple tuple;
179178
HeapScanDesc scan;
180179
ScanKeyData scanKeyData;
@@ -186,7 +185,6 @@ RemoveConversionById(Oid conversionOid)
186185

187186
/* open pg_conversion */
188187
rel = heap_open(ConversionRelationId, RowExclusiveLock);
189-
tupDesc = rel->rd_att;
190188

191189
scan = heap_beginscan(rel, SnapshotNow,
192190
1, &scanKeyData);

src/backend/commands/typecmds.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/commands/typecmds.c,v 1.81 2005/10/15 02:49:16 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/commands/typecmds.c,v 1.82 2005/10/18 01:06:24 tgl Exp $
1212
*
1313
* DESCRIPTION
1414
* The "DefineFoo" routines take the parse tree and pick out the
@@ -1335,7 +1335,6 @@ AlterDomainDropConstraint(List *names, const char *constrName, DropBehavior beha
13351335
Oid domainoid;
13361336
HeapTuple tup;
13371337
Relation rel;
1338-
Form_pg_type typTup;
13391338
Relation conrel;
13401339
SysScanDesc conscan;
13411340
ScanKeyData key[1];
@@ -1379,8 +1378,6 @@ AlterDomainDropConstraint(List *names, const char *constrName, DropBehavior beha
13791378
conscan = systable_beginscan(conrel, ConstraintTypidIndexId, true,
13801379
SnapshotNow, 1, key);
13811380

1382-
typTup = (Form_pg_type) GETSTRUCT(tup);
1383-
13841381
/*
13851382
* Scan over the result set, removing any matching entries.
13861383
*/

src/backend/executor/nodeHashjoin.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/nodeHashjoin.c,v 1.74 2005/10/15 02:49:17 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/nodeHashjoin.c,v 1.75 2005/10/18 01:06:24 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -50,7 +50,6 @@ ExecHashJoin(HashJoinState *node)
5050
HashState *hashNode;
5151
List *joinqual;
5252
List *otherqual;
53-
ScanDirection dir;
5453
TupleTableSlot *inntuple;
5554
ExprContext *econtext;
5655
ExprDoneCond isDone;
@@ -68,7 +67,6 @@ ExecHashJoin(HashJoinState *node)
6867
otherqual = node->js.ps.qual;
6968
hashNode = (HashState *) innerPlanState(node);
7069
outerNode = outerPlanState(node);
71-
dir = estate->es_direction;
7270

7371
/*
7472
* get information from HashJoin state

src/backend/rewrite/rewriteDefine.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/rewrite/rewriteDefine.c,v 1.106 2005/10/15 02:49:24 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/rewrite/rewriteDefine.c,v 1.107 2005/10/18 01:06:24 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -191,7 +191,6 @@ DefineQueryRewrite(RuleStmt *stmt)
191191
Oid ev_relid;
192192
Oid ruleId;
193193
int event_attno;
194-
Oid event_attype;
195194
ListCell *l;
196195
Query *query;
197196
AclResult aclresult;
@@ -432,7 +431,6 @@ DefineQueryRewrite(RuleStmt *stmt)
432431
* This rule is allowed - prepare to install it.
433432
*/
434433
event_attno = -1;
435-
event_attype = InvalidOid;
436434

437435
/*
438436
* We want the rule's table references to be checked as though by the rule

0 commit comments

Comments
 (0)