Skip to content

Commit 02ba3cf

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 b555822 commit 02ba3cf

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.7 1996/12/14 05:20:39 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)