diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2011-07-08 17:28:27 +0300 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2011-07-08 17:29:53 +0300 |
commit | 9598afa3b0f7a7fdcf3740173346950b2bd5942c (patch) | |
tree | b4a8fd679fb65e0f5124c611835d94a2bce67f03 /src | |
parent | 7544064b15d290047e13078f4e99a8b677e79c54 (diff) | |
download | postgresql-9598afa3b0f7a7fdcf3740173346950b2bd5942c.tar.gz postgresql-9598afa3b0f7a7fdcf3740173346950b2bd5942c.zip |
Fix one overflow and one signedness error, caused by the patch to calculate
OLDSERXID_MAX_PAGE based on BLCKSZ. MSVC compiler warned about these.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/storage/lmgr/predicate.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/storage/lmgr/predicate.c b/src/backend/storage/lmgr/predicate.c index 3c3a6a9d963..35fbc8f5a2d 100644 --- a/src/backend/storage/lmgr/predicate.c +++ b/src/backend/storage/lmgr/predicate.c @@ -311,7 +311,7 @@ static SlruCtlData OldSerXidSlruCtlData; * transactions and the maximum that SLRU supports. */ #define OLDSERXID_MAX_PAGE Min(SLRU_PAGES_PER_SEGMENT * 0x10000 - 1, \ - (MaxTransactionId + 1) / OLDSERXID_ENTRIESPERPAGE - 1) + (MaxTransactionId) / OLDSERXID_ENTRIESPERPAGE) #define OldSerXidNextPage(page) (((page) >= OLDSERXID_MAX_PAGE) ? 0 : (page) + 1) @@ -767,7 +767,7 @@ OldSerXidPagePrecedesLogically(int p, int q) diff = p - q; if (diff >= ((OLDSERXID_MAX_PAGE + 1) / 2)) diff -= OLDSERXID_MAX_PAGE + 1; - else if (diff < -((OLDSERXID_MAX_PAGE + 1) / 2)) + else if (diff < -((int) (OLDSERXID_MAX_PAGE + 1) / 2)) diff += OLDSERXID_MAX_PAGE + 1; return diff < 0; } |