Change magic value enums to constexprs.

This commit is contained in:
Bartosz Taudul 2022-08-14 18:16:30 +02:00
parent 77e39700b1
commit d12fa11762
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
7 changed files with 9 additions and 9 deletions

View File

@ -219,8 +219,8 @@ static void PrintSourceFragment( const SourceContents& src, uint32_t srcline, in
} }
enum { JumpSeparationBase = 6 }; constexpr float JumpSeparationBase = 6;
enum { JumpArrowBase = 9 }; constexpr float JumpArrowBase = 9;
SourceView::SourceView() SourceView::SourceView()
: m_font( nullptr ) : m_font( nullptr )

View File

@ -8,7 +8,7 @@
namespace tracy namespace tracy
{ {
enum { MinCtxSize = 4 }; constexpr float MinCtxSize = 4;
const char* View::DecodeContextSwitchReasonCode( uint8_t reason ) const char* View::DecodeContextSwitchReasonCode( uint8_t reason )
{ {

View File

@ -9,7 +9,7 @@
namespace tracy namespace tracy
{ {
enum { MinVisSize = 3 }; constexpr float MinVisSize = 3;
int View::DrawCpuData( int offset, double pxns, const ImVec2& wpos, bool hover, float yMin, float yMax ) int View::DrawCpuData( int offset, double pxns, const ImVec2& wpos, bool hover, float yMin, float yMax )
{ {

View File

@ -10,8 +10,8 @@
namespace tracy namespace tracy
{ {
enum { MinVisSize = 3 }; constexpr float MinVisSize = 3;
enum { MinFrameSize = 5 }; constexpr float MinFrameSize = 5;
static tracy_force_inline uint32_t GetColorMuted( uint32_t color, bool active ) static tracy_force_inline uint32_t GetColorMuted( uint32_t color, bool active )
{ {

View File

@ -10,7 +10,7 @@
namespace tracy namespace tracy
{ {
enum { MinVisSize = 3 }; constexpr float MinVisSize = 3;
static tracy_force_inline uint64_t GetThreadBit( uint8_t thread ) static tracy_force_inline uint64_t GetThreadBit( uint8_t thread )
{ {

View File

@ -9,7 +9,7 @@
namespace tracy namespace tracy
{ {
enum { MinVisSize = 3 }; constexpr float MinVisSize = 3;
extern double s_time; extern double s_time;

View File

@ -9,7 +9,7 @@
namespace tracy namespace tracy
{ {
enum { MinVisSize = 3 }; constexpr float MinVisSize = 3;
static tracy_force_inline uint32_t MixGhostColor( uint32_t c0, uint32_t c1 ) static tracy_force_inline uint32_t MixGhostColor( uint32_t c0, uint32_t c1 )
{ {