diff options
| author | Andres Freund | 2016-03-27 15:17:00 +0000 |
|---|---|---|
| committer | Andres Freund | 2016-03-27 16:10:19 +0000 |
| commit | 1a7a43672bf2939dda93a27d498349e7a4aa3c14 (patch) | |
| tree | 7c2b58901af052b421fa1114d4c899c4b870163c /src/backend/storage | |
| parent | af4472bcb88ab36b9abbe7fd5858e570a65a2d1a (diff) | |
Don't use !! but != 0/NULL to force boolean evaluation.
I introduced several uses of !! to force bit arithmetic to be boolean,
but per discussion the project prefers != 0/NULL.
Discussion: CA+TgmoZP5KakLGP6B4vUjgMBUW0woq_dJYi0paOz-My0Hwt_vQ@mail.gmail.com
Diffstat (limited to 'src/backend/storage')
| -rw-r--r-- | src/backend/storage/lmgr/lwlock.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c index 11e4a51adf6..31626cb5b04 100644 --- a/src/backend/storage/lmgr/lwlock.c +++ b/src/backend/storage/lmgr/lwlock.c @@ -209,11 +209,11 @@ PRINT_LWDEBUG(const char *where, LWLock *lock, LWLockMode mode) errmsg_internal("%d: %s(%s): excl %u shared %u haswaiters %u waiters %u rOK %d", MyProcPid, where, MainLWLockNames[id], - !!(state & LW_VAL_EXCLUSIVE), + (state & LW_VAL_EXCLUSIVE) != 0, state & LW_SHARED_MASK, - !!(state & LW_FLAG_HAS_WAITERS), + (state & LW_FLAG_HAS_WAITERS) != 0, pg_atomic_read_u32(&lock->nwaiters), - !!(state & LW_FLAG_RELEASE_OK)))); + (state & LW_FLAG_RELEASE_OK) != 0))); else ereport(LOG, (errhidestmt(true), @@ -221,11 +221,11 @@ PRINT_LWDEBUG(const char *where, LWLock *lock, LWLockMode mode) errmsg_internal("%d: %s(%s %d): excl %u shared %u haswaiters %u waiters %u rOK %d", MyProcPid, where, T_NAME(lock), id, - !!(state & LW_VAL_EXCLUSIVE), + (state & LW_VAL_EXCLUSIVE) != 0, state & LW_SHARED_MASK, - !!(state & LW_FLAG_HAS_WAITERS), + (state & LW_FLAG_HAS_WAITERS) != 0, pg_atomic_read_u32(&lock->nwaiters), - !!(state & LW_FLAG_RELEASE_OK)))); + (state & LW_FLAG_RELEASE_OK) != 0))); } } |
