Skip to content

Commit 8696192

Browse files
committed
Avoiding
cc1: warnings being treated as errors transsup.c: In function `TransBlockGetLastTransactionIdStatus': transsup.c:122: warning: unsigned value >= 0 is always 1 gmake[3]: *** [transsup.o] Error 1 ...
1 parent bed4db7 commit 8696192

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/backend/access/transam/transsup.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/transsup.c,v 1.6 1996/11/05 11:12:30 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/transsup.c,v 1.6.2.1 1996/12/14 05:19:12 vadim Exp $
1111
*
1212
* NOTES
1313
* This file contains support functions for the high
@@ -119,8 +119,8 @@ TransBlockGetLastTransactionIdStatus(Block tblock,
119119
* ----------------
120120
*/
121121
maxIndex = TP_NumXidStatusPerBlock;
122-
for (index = maxIndex-1; index>=0; index--) {
123-
offset = BitIndexOf(index);
122+
for (index = maxIndex; index > 0; index--) {
123+
offset = BitIndexOf(index-1);
124124
bit1 = ((bits8) BitArrayBitIsSet((BitArray) tblock, offset++)) << 1;
125125
bit2 = (bits8) BitArrayBitIsSet((BitArray) tblock, offset);
126126

@@ -135,7 +135,7 @@ TransBlockGetLastTransactionIdStatus(Block tblock,
135135
if (xstatus != XID_INPROGRESS) {
136136
if (returnXidP != NULL) {
137137
TransactionIdStore(baseXid, returnXidP);
138-
TransactionIdAdd(returnXidP, index);
138+
TransactionIdAdd(returnXidP, index - 1);
139139
}
140140
break;
141141
}

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