mirror of
https://github.com/postgres/postgres.git
synced 2025-09-05 02:22:28 +03:00
Rename shadowed local variables
In a similar effort to f01592f91
, here we mostly rename shadowed local
variables to remove the warnings produced when compiling with
-Wshadow=compatible-local.
This fixes 63 warnings and leaves just 5.
Author: Justin Pryzby, David Rowley
Reviewed-by: Justin Pryzby
Discussion https://postgr.es/m/20220817145434.GC26426%40telsasoft.com
This commit is contained in:
@@ -107,7 +107,7 @@ parse_publication_options(ParseState *pstate,
|
||||
{
|
||||
char *publish;
|
||||
List *publish_list;
|
||||
ListCell *lc;
|
||||
ListCell *lc2;
|
||||
|
||||
if (*publish_given)
|
||||
errorConflictingDefElem(defel, pstate);
|
||||
@@ -131,9 +131,9 @@ parse_publication_options(ParseState *pstate,
|
||||
"publish")));
|
||||
|
||||
/* Process the option list. */
|
||||
foreach(lc, publish_list)
|
||||
foreach(lc2, publish_list)
|
||||
{
|
||||
char *publish_opt = (char *) lfirst(lc);
|
||||
char *publish_opt = (char *) lfirst(lc2);
|
||||
|
||||
if (strcmp(publish_opt, "insert") == 0)
|
||||
pubactions->pubinsert = true;
|
||||
|
@@ -10223,7 +10223,7 @@ CloneFkReferencing(List **wqueue, Relation parentRel, Relation partRel)
|
||||
Oid constrOid;
|
||||
ObjectAddress address,
|
||||
referenced;
|
||||
ListCell *cell;
|
||||
ListCell *lc;
|
||||
Oid insertTriggerOid,
|
||||
updateTriggerOid;
|
||||
|
||||
@@ -10276,9 +10276,9 @@ CloneFkReferencing(List **wqueue, Relation parentRel, Relation partRel)
|
||||
* don't need to recurse to partitions for this constraint.
|
||||
*/
|
||||
attached = false;
|
||||
foreach(cell, partFKs)
|
||||
foreach(lc, partFKs)
|
||||
{
|
||||
ForeignKeyCacheInfo *fk = lfirst_node(ForeignKeyCacheInfo, cell);
|
||||
ForeignKeyCacheInfo *fk = lfirst_node(ForeignKeyCacheInfo, lc);
|
||||
|
||||
if (tryAttachPartitionForeignKey(fk,
|
||||
RelationGetRelid(partRel),
|
||||
@@ -10877,7 +10877,7 @@ ATExecAlterConstrRecurse(Constraint *cmdcon, Relation conrel, Relation tgrel,
|
||||
{
|
||||
Form_pg_trigger tgform = (Form_pg_trigger) GETSTRUCT(tgtuple);
|
||||
Form_pg_trigger copy_tg;
|
||||
HeapTuple copyTuple;
|
||||
HeapTuple tgCopyTuple;
|
||||
|
||||
/*
|
||||
* Remember OIDs of other relation(s) involved in FK constraint.
|
||||
@@ -10901,16 +10901,16 @@ ATExecAlterConstrRecurse(Constraint *cmdcon, Relation conrel, Relation tgrel,
|
||||
tgform->tgfoid != F_RI_FKEY_CHECK_UPD)
|
||||
continue;
|
||||
|
||||
copyTuple = heap_copytuple(tgtuple);
|
||||
copy_tg = (Form_pg_trigger) GETSTRUCT(copyTuple);
|
||||
tgCopyTuple = heap_copytuple(tgtuple);
|
||||
copy_tg = (Form_pg_trigger) GETSTRUCT(tgCopyTuple);
|
||||
|
||||
copy_tg->tgdeferrable = cmdcon->deferrable;
|
||||
copy_tg->tginitdeferred = cmdcon->initdeferred;
|
||||
CatalogTupleUpdate(tgrel, ©Tuple->t_self, copyTuple);
|
||||
CatalogTupleUpdate(tgrel, &tgCopyTuple->t_self, tgCopyTuple);
|
||||
|
||||
InvokeObjectPostAlterHook(TriggerRelationId, tgform->oid, 0);
|
||||
|
||||
heap_freetuple(copyTuple);
|
||||
heap_freetuple(tgCopyTuple);
|
||||
}
|
||||
|
||||
systable_endscan(tgscan);
|
||||
@@ -18083,14 +18083,14 @@ AttachPartitionEnsureIndexes(Relation rel, Relation attachrel)
|
||||
if (!found)
|
||||
{
|
||||
IndexStmt *stmt;
|
||||
Oid constraintOid;
|
||||
Oid conOid;
|
||||
|
||||
stmt = generateClonedIndexStmt(NULL,
|
||||
idxRel, attmap,
|
||||
&constraintOid);
|
||||
&conOid);
|
||||
DefineIndex(RelationGetRelid(attachrel), stmt, InvalidOid,
|
||||
RelationGetRelid(idxRel),
|
||||
constraintOid,
|
||||
conOid,
|
||||
true, false, false, false, false);
|
||||
}
|
||||
|
||||
|
@@ -1694,9 +1694,9 @@ renametrig_partition(Relation tgrel, Oid partitionId, Oid parentTriggerOid,
|
||||
|
||||
for (int i = 0; i < partdesc->nparts; i++)
|
||||
{
|
||||
Oid partitionId = partdesc->oids[i];
|
||||
Oid partoid = partdesc->oids[i];
|
||||
|
||||
renametrig_partition(tgrel, partitionId, tgform->oid, newname,
|
||||
renametrig_partition(tgrel, partoid, tgform->oid, newname,
|
||||
NameStr(tgform->tgname));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user