diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 4bfd9f03..b0da573b 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -2746,10 +2746,10 @@ static inline bool AreOtherWaiting( uint64_t bitlist, uint8_t thread ) enum class LockState { - Nothing = 1 << 0, - HasLock = 1 << 1, // green - HasBlockingLock = 1 << 2, // yellow - WaitLock = 1 << 3, // red + Nothing, + HasLock, // green + HasBlockingLock, // yellow + WaitLock // red }; static Vector::iterator GetNextLockEvent( const Vector::iterator& it, const Vector::iterator& end, LockState state, LockState& nextState, uint8_t thread ) @@ -2849,22 +2849,7 @@ static Vector::iterator GetNextLockEvent( const Vector:: static LockState CombineLockState( LockState state, LockState next ) { - unsigned val = (unsigned)state | (unsigned)next; - -#ifdef _MSC_VER - DWORD ret; - _BitScanReverse( &ret, val ); - return (LockState)( 1 << ret ); -#else - unsigned ret = 1; - val >>= 1; - while( val ) - { - ret <<= 1; - val >>= 1; - } - return (LockState)ret; -#endif + return (LockState)std::max( (int)state, (int)next ); } int View::DrawLocks( uint64_t tid, bool hover, double pxns, const ImVec2& wpos, int _offset, LockHighlight& highlight )