aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/lmgr/lock.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/storage/lmgr/lock.c')
-rw-r--r--src/backend/storage/lmgr/lock.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c
index 613b0d49944..bbd444745fd 100644
--- a/src/backend/storage/lmgr/lock.c
+++ b/src/backend/storage/lmgr/lock.c
@@ -218,8 +218,8 @@ int FastPathLockGroupsPerBackend = 0;
* of fast-path lock slots.
*/
#define FAST_PATH_SLOT(group, index) \
- (AssertMacro(((group) >= 0) && ((group) < FastPathLockGroupsPerBackend)), \
- AssertMacro(((index) >= 0) && ((index) < FP_LOCK_SLOTS_PER_GROUP)), \
+ (AssertMacro((uint32) (group) < FastPathLockGroupsPerBackend), \
+ AssertMacro((uint32) (index) < FP_LOCK_SLOTS_PER_GROUP), \
((group) * FP_LOCK_SLOTS_PER_GROUP + (index)))
/*
@@ -227,10 +227,10 @@ int FastPathLockGroupsPerBackend = 0;
* the FAST_PATH_SLOT macro, split it into group and index (in the group).
*/
#define FAST_PATH_GROUP(index) \
- (AssertMacro(((index) >= 0) && ((index) < FP_LOCK_SLOTS_PER_BACKEND)), \
+ (AssertMacro((uint32) (index) < FP_LOCK_SLOTS_PER_BACKEND), \
((index) / FP_LOCK_SLOTS_PER_GROUP))
#define FAST_PATH_INDEX(index) \
- (AssertMacro(((index) >= 0) && ((index) < FP_LOCK_SLOTS_PER_BACKEND)), \
+ (AssertMacro((uint32) (index) < FP_LOCK_SLOTS_PER_BACKEND), \
((index) % FP_LOCK_SLOTS_PER_GROUP))
/* Macros for manipulating proc->fpLockBits */