1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

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.
This commit is contained in:
frobino 2022-09-11 15:46:04 +02:00
parent 5bd3f3de5f
commit ca8e147f44
2 changed files with 3 additions and 3 deletions

View File

@ -661,7 +661,7 @@ static void InitKernelSymbols()
while( *ptr != '\t' && *ptr != '\n' ) ptr++; while( *ptr != '\t' && *ptr != '\n' ) ptr++;
const auto nameend = ptr; const auto nameend = ptr;
const char* modstart = nullptr; const char* modstart = nullptr;
const char* modend; const char* modend = nullptr;
if( *ptr == '\t' ) if( *ptr == '\t' )
{ {
ptr += 2; ptr += 2;

View File

@ -1241,7 +1241,7 @@ void SysTraceWorker( void* ptr )
#if defined TRACY_HW_TIMER && ( defined __i386 || defined _M_IX86 || defined __x86_64__ || defined _M_X64 ) #if defined TRACY_HW_TIMER && ( defined __i386 || defined _M_IX86 || defined __x86_64__ || defined _M_X64 )
t0 = ring.ConvertTimeToTsc( t0 ); t0 = ring.ConvertTimeToTsc( t0 );
#endif #endif
QueueType type; QueueType type{};
switch( id ) switch( id )
{ {
case EventCpuCycles: case EventCpuCycles:
@ -1313,7 +1313,7 @@ void SysTraceWorker( void* ptr )
while( activeNum > 0 ) while( activeNum > 0 )
{ {
int sel = -1; int sel = -1;
int selPos; int selPos = -1;
int64_t t0 = std::numeric_limits<int64_t>::max(); int64_t t0 = std::numeric_limits<int64_t>::max();
for( int i=0; i<activeNum; i++ ) for( int i=0; i<activeNum; i++ )
{ {