From 398eecbb94ee93ad35291c5e08c6da81e028f652 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 10 Dec 2017 22:37:56 +0100 Subject: [PATCH] Store LockEvent type as an enum class. --- server/TracyEvent.hpp | 2 +- server/TracyView.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/server/TracyEvent.hpp b/server/TracyEvent.hpp index 7fb5ae04..18ab072a 100644 --- a/server/TracyEvent.hpp +++ b/server/TracyEvent.hpp @@ -107,7 +107,7 @@ struct LockEvent int32_t srcloc; uint8_t thread; uint8_t lockingThread; - uint8_t type; + Type type; uint8_t lockCount; uint64_t waitList; }; diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 28c288d7..60ac1930 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -753,7 +753,7 @@ void View::ProcessLockWait( const QueueLockWait& ev ) { auto lev = m_slab.Alloc(); lev->time = ev.time * m_timerMul; - lev->type = (uint8_t)LockEvent::Type::Wait; + lev->type = LockEvent::Type::Wait; lev->srcloc = 0; auto it = m_lockMap.find( ev.id ); @@ -771,7 +771,7 @@ void View::ProcessLockObtain( const QueueLockObtain& ev ) { auto lev = m_slab.Alloc(); lev->time = ev.time * m_timerMul; - lev->type = (uint8_t)LockEvent::Type::Obtain; + lev->type = LockEvent::Type::Obtain; lev->srcloc = 0; assert( m_lockMap.find( ev.id ) != m_lockMap.end() ); @@ -782,7 +782,7 @@ void View::ProcessLockRelease( const QueueLockRelease& ev ) { auto lev = m_slab.Alloc(); lev->time = ev.time * m_timerMul; - lev->type = (uint8_t)LockEvent::Type::Release; + lev->type = LockEvent::Type::Release; lev->srcloc = 0; assert( m_lockMap.find( ev.id ) != m_lockMap.end() ); @@ -793,7 +793,7 @@ void View::ProcessLockSharedWait( const QueueLockWait& ev ) { auto lev = m_slab.Alloc(); lev->time = ev.time * m_timerMul; - lev->type = (uint8_t)LockEvent::Type::Wait; + lev->type = LockEvent::Type::Wait; lev->srcloc = 0; auto it = m_lockMap.find( ev.id ); @@ -811,7 +811,7 @@ void View::ProcessLockSharedObtain( const QueueLockObtain& ev ) { auto lev = m_slab.Alloc(); lev->time = ev.time * m_timerMul; - lev->type = (uint8_t)LockEvent::Type::Obtain; + lev->type = LockEvent::Type::Obtain; lev->srcloc = 0; assert( m_lockMap.find( ev.id ) != m_lockMap.end() ); @@ -822,7 +822,7 @@ void View::ProcessLockSharedRelease( const QueueLockRelease& ev ) { auto lev = m_slab.Alloc(); lev->time = ev.time * m_timerMul; - lev->type = (uint8_t)LockEvent::Type::Release; + lev->type = LockEvent::Type::Release; lev->srcloc = 0; assert( m_lockMap.find( ev.id ) != m_lockMap.end() ); @@ -844,7 +844,7 @@ void View::ProcessLockMark( const QueueLockMark& ev ) --it; if( (*it)->thread == thread ) { - switch( (LockEvent::Type)(*it)->type ) + switch( (*it)->type ) { case LockEvent::Type::Obtain: case LockEvent::Type::Wait: