Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfe8821c

Browse files
committed
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 wouldreduce Wsign-compare compiler warnings.Back-patch to v14 where commit941697c added size_t variablesin procarray.c, to make future back-patching easy thoughthis patch is classified as refactoring only.Reported-by: Ranier VilelaAuthor: Ranier Vilela, Aleksander Alekseevhttps://postgr.es/m/CAEudQAqyoTZC670xWi6w-Oe2_Bk1bfu2JzXz6xRfiOUzm7xbyQ@mail.gmail.com
1 parentd84d62b commitfe8821c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

‎src/backend/storage/ipc/procarray.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ ProcArrayEndTransaction(PGPROC *proc, TransactionId latestXid)
714714
staticinlinevoid
715715
ProcArrayEndTransactionInternal(PGPROC*proc,TransactionIdlatestXid)
716716
{
717-
size_tpgxactoff=proc->pgxactoff;
717+
intpgxactoff=proc->pgxactoff;
718718

719719
/*
720720
* Note: we need exclusive lock here because we're going to change other
@@ -886,7 +886,7 @@ ProcArrayGroupClearXid(PGPROC *proc, TransactionId latestXid)
886886
void
887887
ProcArrayClearTransaction(PGPROC*proc)
888888
{
889-
size_tpgxactoff;
889+
intpgxactoff;
890890

891891
/*
892892
* Currently we need to lock ProcArrayLock exclusively here, as we
@@ -1366,7 +1366,7 @@ TransactionIdIsInProgress(TransactionId xid)
13661366
TransactionIdtopxid;
13671367
TransactionIdlatestCompletedXid;
13681368
intmypgxactoff;
1369-
size_tnumProcs;
1369+
intnumProcs;
13701370
intj;
13711371

13721372
/*
@@ -1443,7 +1443,7 @@ TransactionIdIsInProgress(TransactionId xid)
14431443
/* No shortcuts, gotta grovel through the array */
14441444
mypgxactoff=MyProc->pgxactoff;
14451445
numProcs=arrayP->numProcs;
1446-
for (size_tpgxactoff=0;pgxactoff<numProcs;pgxactoff++)
1446+
for (intpgxactoff=0;pgxactoff<numProcs;pgxactoff++)
14471447
{
14481448
intpgprocno;
14491449
PGPROC*proc;
@@ -2208,7 +2208,7 @@ GetSnapshotData(Snapshot snapshot)
22082208
TransactionId*other_xids=ProcGlobal->xids;
22092209
TransactionIdxmin;
22102210
TransactionIdxmax;
2211-
size_tcount=0;
2211+
intcount=0;
22122212
intsubcount=0;
22132213
boolsuboverflowed= false;
22142214
FullTransactionIdlatest_completed;
@@ -2290,7 +2290,7 @@ GetSnapshotData(Snapshot snapshot)
22902290

22912291
if (!snapshot->takenDuringRecovery)
22922292
{
2293-
size_tnumProcs=arrayP->numProcs;
2293+
intnumProcs=arrayP->numProcs;
22942294
TransactionId*xip=snapshot->xip;
22952295
int*pgprocnos=arrayP->pgprocnos;
22962296
XidCacheStatus*subxidStates=ProcGlobal->subxidStates;
@@ -2300,7 +2300,7 @@ GetSnapshotData(Snapshot snapshot)
23002300
* First collect set of pgxactoff/xids that need to be included in the
23012301
* snapshot.
23022302
*/
2303-
for (size_tpgxactoff=0;pgxactoff<numProcs;pgxactoff++)
2303+
for (intpgxactoff=0;pgxactoff<numProcs;pgxactoff++)
23042304
{
23052305
/* Fetch xid just once - see GetNewTransactionId */
23062306
TransactionIdxid=UINT32_ACCESS_ONCE(other_xids[pgxactoff]);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp