diff options
author | Fujii Masao <fujii@postgresql.org> | 2021-09-16 12:52:30 +0900 |
---|---|---|
committer | Fujii Masao <fujii@postgresql.org> | 2021-09-16 12:52:30 +0900 |
commit | 64a62ebeeb84af2a51b963a1737f804a0fed4246 (patch) | |
tree | 247ad7a335e51eef1f2ca215f3877414b9803280 /src | |
parent | 0c39c292077ef3ba987ced0dc6ea1c8f4f1e1f4b (diff) | |
download | postgresql-64a62ebeeb84af2a51b963a1737f804a0fed4246.tar.gz postgresql-64a62ebeeb84af2a51b963a1737f804a0fed4246.zip |
Use int instead of size_t in procarray.c.
All size_t variables declared in procarray.c are actually int ones.
Let's use int instead of size_t for those variables. Which would
reduce Wsign-compare compiler warnings.
Back-patch to v14 where commit 941697c3c1 added size_t variables
in procarray.c, to make future back-patching easy though
this patch is classified as refactoring only.
Reported-by: Ranier Vilela
Author: Ranier Vilela, Aleksander Alekseev
https://postgr.es/m/CAEudQAqyoTZC670xWi6w-Oe2_Bk1bfu2JzXz6xRfiOUzm7xbyQ@mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/storage/ipc/procarray.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c index c7816fcfb30..3425e7494bc 100644 --- a/src/backend/storage/ipc/procarray.c +++ b/src/backend/storage/ipc/procarray.c @@ -714,7 +714,7 @@ ProcArrayEndTransaction(PGPROC *proc, TransactionId latestXid) static inline void ProcArrayEndTransactionInternal(PGPROC *proc, TransactionId latestXid) { - size_t pgxactoff = proc->pgxactoff; + int pgxactoff = proc->pgxactoff; /* * Note: we need exclusive lock here because we're going to change other @@ -886,7 +886,7 @@ ProcArrayGroupClearXid(PGPROC *proc, TransactionId latestXid) void ProcArrayClearTransaction(PGPROC *proc) { - size_t pgxactoff; + int pgxactoff; /* * Currently we need to lock ProcArrayLock exclusively here, as we @@ -1366,7 +1366,7 @@ TransactionIdIsInProgress(TransactionId xid) TransactionId topxid; TransactionId latestCompletedXid; int mypgxactoff; - size_t numProcs; + int numProcs; int j; /* @@ -1443,7 +1443,7 @@ TransactionIdIsInProgress(TransactionId xid) /* No shortcuts, gotta grovel through the array */ mypgxactoff = MyProc->pgxactoff; numProcs = arrayP->numProcs; - for (size_t pgxactoff = 0; pgxactoff < numProcs; pgxactoff++) + for (int pgxactoff = 0; pgxactoff < numProcs; pgxactoff++) { int pgprocno; PGPROC *proc; @@ -2209,7 +2209,7 @@ GetSnapshotData(Snapshot snapshot) TransactionId *other_xids = ProcGlobal->xids; TransactionId xmin; TransactionId xmax; - size_t count = 0; + int count = 0; int subcount = 0; bool suboverflowed = false; FullTransactionId latest_completed; @@ -2291,7 +2291,7 @@ GetSnapshotData(Snapshot snapshot) if (!snapshot->takenDuringRecovery) { - size_t numProcs = arrayP->numProcs; + int numProcs = arrayP->numProcs; TransactionId *xip = snapshot->xip; int *pgprocnos = arrayP->pgprocnos; XidCacheStatus *subxidStates = ProcGlobal->subxidStates; @@ -2301,7 +2301,7 @@ GetSnapshotData(Snapshot snapshot) * First collect set of pgxactoff/xids that need to be included in the * snapshot. */ - for (size_t pgxactoff = 0; pgxactoff < numProcs; pgxactoff++) + for (int pgxactoff = 0; pgxactoff < numProcs; pgxactoff++) { /* Fetch xid just once - see GetNewTransactionId */ TransactionId xid = UINT32_ACCESS_ONCE(other_xids[pgxactoff]); |