From f957f64ce12a06848363c8d2ecac4ba6123501cd Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 17 Aug 2019 16:26:59 +0200 Subject: [PATCH] No magic numbers. --- server/TracyEvent.hpp | 2 ++ server/TracyView.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/server/TracyEvent.hpp b/server/TracyEvent.hpp index 9dafde0e..ac2c0f03 100644 --- a/server/TracyEvent.hpp +++ b/server/TracyEvent.hpp @@ -234,6 +234,8 @@ enum { CrashEventSize = sizeof( CrashEvent ) }; struct ContextSwitchData { + enum : int8_t { NoState = 100 }; + int64_t Start() const { return int64_t( _start_cpu ) >> 8; } void SetStart( int64_t start ) { assert( start < ( 1ll << 47 ) ); _start_cpu = ( _start_cpu & 0xFF ) | uint64_t( start << 8 ); } int64_t End() const { return int64_t( _end_reason_state ) >> 16; } diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 23cd91f0..aa72ba4b 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -5046,7 +5046,7 @@ void View::DrawZoneInfoWindow() } ImGui::NextColumn(); const char* desc; - if( reason == 100 ) + if( reason == ContextSwitchData::NoState ) { ImGui::TextUnformatted( DecodeContextSwitchStateCode( state ) ); desc = DecodeContextSwitchState( state );