From 2d0bbedda7c4fbf7092c39b0c06b56cb238e15d7 Mon Sep 17 00:00:00 2001 From: David Rowley Date: Wed, 5 Oct 2022 21:01:41 +1300 Subject: 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 --- src/backend/access/transam/clog.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/backend/access/transam/clog.c') diff --git a/src/backend/access/transam/clog.c b/src/backend/access/transam/clog.c index 3d9088a7048..a7dfcfb4da4 100644 --- a/src/backend/access/transam/clog.c +++ b/src/backend/access/transam/clog.c @@ -516,23 +516,23 @@ TransactionGroupUpdateXidStatus(TransactionId xid, XidStatus status, /* Walk the list and update the status of all XIDs. */ while (nextidx != INVALID_PGPROCNO) { - PGPROC *proc = &ProcGlobal->allProcs[nextidx]; + PGPROC *nextproc = &ProcGlobal->allProcs[nextidx]; /* * Transactions with more than THRESHOLD_SUBTRANS_CLOG_OPT sub-XIDs * should not use group XID status update mechanism. */ - Assert(proc->subxidStatus.count <= THRESHOLD_SUBTRANS_CLOG_OPT); + Assert(nextproc->subxidStatus.count <= THRESHOLD_SUBTRANS_CLOG_OPT); - TransactionIdSetPageStatusInternal(proc->clogGroupMemberXid, - proc->subxidStatus.count, - proc->subxids.xids, - proc->clogGroupMemberXidStatus, - proc->clogGroupMemberLsn, - proc->clogGroupMemberPage); + TransactionIdSetPageStatusInternal(nextproc->clogGroupMemberXid, + nextproc->subxidStatus.count, + nextproc->subxids.xids, + nextproc->clogGroupMemberXidStatus, + nextproc->clogGroupMemberLsn, + nextproc->clogGroupMemberPage); /* Move to next proc in list. */ - nextidx = pg_atomic_read_u32(&proc->clogGroupNext); + nextidx = pg_atomic_read_u32(&nextproc->clogGroupNext); } /* We're done with the lock now. */ @@ -545,18 +545,18 @@ TransactionGroupUpdateXidStatus(TransactionId xid, XidStatus status, */ while (wakeidx != INVALID_PGPROCNO) { - PGPROC *proc = &ProcGlobal->allProcs[wakeidx]; + PGPROC *wakeproc = &ProcGlobal->allProcs[wakeidx]; - wakeidx = pg_atomic_read_u32(&proc->clogGroupNext); - pg_atomic_write_u32(&proc->clogGroupNext, INVALID_PGPROCNO); + wakeidx = pg_atomic_read_u32(&wakeproc->clogGroupNext); + pg_atomic_write_u32(&wakeproc->clogGroupNext, INVALID_PGPROCNO); /* ensure all previous writes are visible before follower continues. */ pg_write_barrier(); - proc->clogGroupMember = false; + wakeproc->clogGroupMember = false; - if (proc != MyProc) - PGSemaphoreUnlock(proc->sem); + if (wakeproc != MyProc) + PGSemaphoreUnlock(wakeproc->sem); } return true; -- cgit v1.2.3