From ca8e147f44b0ad6b83830811631d9691e820b388 Mon Sep 17 00:00:00 2001 From: frobino Date: Sun, 11 Sep 2022 15:46:04 +0200 Subject: [PATCH] Initialize variables in client Initialize some variables that were non initialized in the tracy client. After this commit, there should be less warnings when Tracy is integrated in applications built with flags connected to uninitialized variables, such as Wmaybe-uninitialized. --- public/client/TracyCallstack.cpp | 2 +- public/client/TracySysTrace.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/client/TracyCallstack.cpp b/public/client/TracyCallstack.cpp index 1e201f26..51c0b455 100644 --- a/public/client/TracyCallstack.cpp +++ b/public/client/TracyCallstack.cpp @@ -661,7 +661,7 @@ static void InitKernelSymbols() while( *ptr != '\t' && *ptr != '\n' ) ptr++; const auto nameend = ptr; const char* modstart = nullptr; - const char* modend; + const char* modend = nullptr; if( *ptr == '\t' ) { ptr += 2; diff --git a/public/client/TracySysTrace.cpp b/public/client/TracySysTrace.cpp index 23b1020a..9f837272 100644 --- a/public/client/TracySysTrace.cpp +++ b/public/client/TracySysTrace.cpp @@ -1241,7 +1241,7 @@ void SysTraceWorker( void* ptr ) #if defined TRACY_HW_TIMER && ( defined __i386 || defined _M_IX86 || defined __x86_64__ || defined _M_X64 ) t0 = ring.ConvertTimeToTsc( t0 ); #endif - QueueType type; + QueueType type{}; switch( id ) { case EventCpuCycles: @@ -1313,7 +1313,7 @@ void SysTraceWorker( void* ptr ) while( activeNum > 0 ) { int sel = -1; - int selPos; + int selPos = -1; int64_t t0 = std::numeric_limits::max(); for( int i=0; i