Skip to content

Commit cd4e8ca

Browse files
committed
Fix final warnings produced by -Wshadow=compatible-local
I thought I had these in d8df67b, but per report from Andres Freund, I missed some. Reviewed-by: Andres Freund Discussion: https://postgr.es/m/20221005214052.c4tkudawyp5wxt3c@awork3.anarazel.de
1 parent 4289263 commit cd4e8ca

File tree

10 files changed

+32
-43
lines changed

10 files changed

+32
-43
lines changed

contrib/bloom/blinsert.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,6 @@ blinsert(Relation index, Datum *values, bool *isnull,
232232

233233
if (metaData->nEnd > metaData->nStart)
234234
{
235-
Page page;
236-
237235
blkno = metaData->notFullPage[metaData->nStart];
238236
Assert(blkno != InvalidBlockNumber);
239237

contrib/file_fdw/file_fdw.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -450,15 +450,15 @@ get_file_fdw_attribute_options(Oid relid)
450450
for (attnum = 1; attnum <= natts; attnum++)
451451
{
452452
Form_pg_attribute attr = TupleDescAttr(tupleDesc, attnum - 1);
453-
List *options;
453+
List *column_options;
454454
ListCell *lc;
455455

456456
/* Skip dropped attributes. */
457457
if (attr->attisdropped)
458458
continue;
459459

460-
options = GetForeignColumnOptions(relid, attnum);
461-
foreach(lc, options)
460+
column_options = GetForeignColumnOptions(relid, attnum);
461+
foreach(lc, column_options)
462462
{
463463
DefElem *def = (DefElem *) lfirst(lc);
464464

@@ -480,7 +480,7 @@ get_file_fdw_attribute_options(Oid relid)
480480
fncolumns = lappend(fncolumns, makeString(attname));
481481
}
482482
}
483-
/* maybe in future handle other options here */
483+
/* maybe in future handle other column options here */
484484
}
485485
}
486486

contrib/hstore/hstore.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,15 @@ typedef struct
128128
/* finalize a newly-constructed hstore */
129129
#define HS_FINALIZE(hsp_,count_,buf_,ptr_) \
130130
do { \
131-
int buflen = (ptr_) - (buf_); \
131+
int _buflen = (ptr_) - (buf_); \
132132
if ((count_)) \
133133
ARRPTR(hsp_)[0].entry |= HENTRY_ISFIRST; \
134134
if ((count_) != HS_COUNT((hsp_))) \
135135
{ \
136136
HS_SETCOUNT((hsp_),(count_)); \
137-
memmove(STRPTR(hsp_), (buf_), buflen); \
137+
memmove(STRPTR(hsp_), (buf_), _buflen); \
138138
} \
139-
SET_VARSIZE((hsp_), CALCDATASIZE((count_), buflen)); \
139+
SET_VARSIZE((hsp_), CALCDATASIZE((count_), _buflen)); \
140140
} while (0)
141141

142142
/* ensure the varlena size of an existing hstore is correct */

contrib/postgres_fdw/deparse.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -943,8 +943,6 @@ foreign_expr_walker(Node *node,
943943
*/
944944
if (agg->aggorder)
945945
{
946-
ListCell *lc;
947-
948946
foreach(lc, agg->aggorder)
949947
{
950948
SortGroupClause *srt = (SortGroupClause *) lfirst(lc);

contrib/postgres_fdw/postgres_fdw.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,8 +1341,6 @@ postgresGetForeignPlan(PlannerInfo *root,
13411341
*/
13421342
if (outer_plan)
13431343
{
1344-
ListCell *lc;
1345-
13461344
/*
13471345
* Right now, we only consider grouping and aggregation beyond
13481346
* joins. Queries involving aggregates or grouping do not require
@@ -6272,10 +6270,10 @@ foreign_grouping_ok(PlannerInfo *root, RelOptInfo *grouped_rel,
62726270
*/
62736271
foreach(l, aggvars)
62746272
{
6275-
Expr *expr = (Expr *) lfirst(l);
6273+
Expr *aggref = (Expr *) lfirst(l);
62766274

6277-
if (IsA(expr, Aggref))
6278-
tlist = add_to_flat_tlist(tlist, list_make1(expr));
6275+
if (IsA(aggref, Aggref))
6276+
tlist = add_to_flat_tlist(tlist, list_make1(aggref));
62796277
}
62806278
}
62816279
}
@@ -6289,8 +6287,6 @@ foreign_grouping_ok(PlannerInfo *root, RelOptInfo *grouped_rel,
62896287
*/
62906288
if (havingQual)
62916289
{
6292-
ListCell *lc;
6293-
62946290
foreach(lc, (List *) havingQual)
62956291
{
62966292
Expr *expr = (Expr *) lfirst(lc);
@@ -6324,7 +6320,6 @@ foreign_grouping_ok(PlannerInfo *root, RelOptInfo *grouped_rel,
63246320
if (fpinfo->local_conds)
63256321
{
63266322
List *aggvars = NIL;
6327-
ListCell *lc;
63286323

63296324
foreach(lc, fpinfo->local_conds)
63306325
{

src/interfaces/libpq/fe-secure-gssapi.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,11 @@ pg_GSS_write(PGconn *conn, const void *ptr, size_t len)
135135
*/
136136
if (PqGSSSendLength)
137137
{
138-
ssize_t ret;
138+
ssize_t retval;
139139
ssize_t amount = PqGSSSendLength - PqGSSSendNext;
140140

141-
ret = pqsecure_raw_write(conn, PqGSSSendBuffer + PqGSSSendNext, amount);
142-
if (ret <= 0)
141+
retval = pqsecure_raw_write(conn, PqGSSSendBuffer + PqGSSSendNext, amount);
142+
if (retval <= 0)
143143
{
144144
/*
145145
* Report any previously-sent data; if there was none, reflect
@@ -149,16 +149,16 @@ pg_GSS_write(PGconn *conn, const void *ptr, size_t len)
149149
*/
150150
if (bytes_sent)
151151
return bytes_sent;
152-
return ret;
152+
return retval;
153153
}
154154

155155
/*
156156
* Check if this was a partial write, and if so, move forward that
157157
* far in our buffer and try again.
158158
*/
159-
if (ret != amount)
159+
if (retval != amount)
160160
{
161-
PqGSSSendNext += ret;
161+
PqGSSSendNext += retval;
162162
continue;
163163
}
164164

src/pl/plpython/plpy_cursorobject.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,18 +215,18 @@ PLy_cursor_plan(PyObject *ob, PyObject *args)
215215
PyObject *elem;
216216

217217
elem = PySequence_GetItem(args, j);
218-
PG_TRY();
218+
PG_TRY(2);
219219
{
220220
bool isnull;
221221

222222
plan->values[j] = PLy_output_convert(arg, elem, &isnull);
223223
nulls[j] = isnull ? 'n' : ' ';
224224
}
225-
PG_FINALLY();
225+
PG_FINALLY(2);
226226
{
227227
Py_DECREF(elem);
228228
}
229-
PG_END_TRY();
229+
PG_END_TRY(2);
230230
}
231231

232232
portal = SPI_cursor_open(NULL, plan->plan, plan->values, nulls,

src/pl/plpython/plpy_exec.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,6 @@ PLy_exec_trigger(FunctionCallInfo fcinfo, PLyProcedure *proc)
375375
rv = NULL;
376376
else if (pg_strcasecmp(srv, "MODIFY") == 0)
377377
{
378-
TriggerData *tdata = (TriggerData *) fcinfo->context;
379-
380378
if (TRIGGER_FIRED_BY_INSERT(tdata->tg_event) ||
381379
TRIGGER_FIRED_BY_UPDATE(tdata->tg_event))
382380
rv = PLy_modify_tuple(proc, plargs, tdata, rv);

src/pl/plpython/plpy_spi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,18 +236,18 @@ PLy_spi_execute_plan(PyObject *ob, PyObject *list, long limit)
236236
PyObject *elem;
237237

238238
elem = PySequence_GetItem(list, j);
239-
PG_TRY();
239+
PG_TRY(2);
240240
{
241241
bool isnull;
242242

243243
plan->values[j] = PLy_output_convert(arg, elem, &isnull);
244244
nulls[j] = isnull ? 'n' : ' ';
245245
}
246-
PG_FINALLY();
246+
PG_FINALLY(2);
247247
{
248248
Py_DECREF(elem);
249249
}
250-
PG_END_TRY();
250+
PG_END_TRY(2);
251251
}
252252

253253
rv = SPI_execute_plan(plan->plan, plan->values, nulls,

src/test/modules/test_integerset/test_integerset.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -585,26 +585,26 @@ test_huge_distances(void)
585585
*/
586586
for (int i = 0; i < num_values; i++)
587587
{
588-
uint64 x = values[i];
588+
uint64 y = values[i];
589589
bool expected;
590590
bool result;
591591

592-
if (x > 0)
592+
if (y > 0)
593593
{
594-
expected = (values[i - 1] == x - 1);
595-
result = intset_is_member(intset, x - 1);
594+
expected = (values[i - 1] == y - 1);
595+
result = intset_is_member(intset, y - 1);
596596
if (result != expected)
597-
elog(ERROR, "intset_is_member failed for " UINT64_FORMAT, x - 1);
597+
elog(ERROR, "intset_is_member failed for " UINT64_FORMAT, y - 1);
598598
}
599599

600-
result = intset_is_member(intset, x);
600+
result = intset_is_member(intset, y);
601601
if (result != true)
602-
elog(ERROR, "intset_is_member failed for " UINT64_FORMAT, x);
602+
elog(ERROR, "intset_is_member failed for " UINT64_FORMAT, y);
603603

604-
expected = (i != num_values - 1) ? (values[i + 1] == x + 1) : false;
605-
result = intset_is_member(intset, x + 1);
604+
expected = (i != num_values - 1) ? (values[i + 1] == y + 1) : false;
605+
result = intset_is_member(intset, y + 1);
606606
if (result != expected)
607-
elog(ERROR, "intset_is_member failed for " UINT64_FORMAT, x + 1);
607+
elog(ERROR, "intset_is_member failed for " UINT64_FORMAT, y + 1);
608608
}
609609

610610
/*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy