1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-30 12:53:51 +00:00

Merge pull request #36 from graydon/warning-fixes

Warning fixes
This commit is contained in:
Bartosz Taudul 2020-06-04 11:35:59 +02:00 committed by GitHub
commit a33caaaaaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -173,6 +173,7 @@ struct ThreadHandleWrapper
#if defined __i386 || defined _M_IX86 || defined __x86_64__ || defined _M_X64 #if defined __i386 || defined _M_IX86 || defined __x86_64__ || defined _M_X64
static inline void CpuId( uint32_t* regs, uint32_t leaf ) static inline void CpuId( uint32_t* regs, uint32_t leaf )
{ {
memset(regs, 0, sizeof(uint32_t) * 4);
#if defined _WIN32 || defined __CYGWIN__ #if defined _WIN32 || defined __CYGWIN__
__cpuidex( (int*)regs, leaf, 0 ); __cpuidex( (int*)regs, leaf, 0 );
#else #else

View File

@ -47,10 +47,13 @@ void SysTime::ReadTimes()
FILE* f = fopen( "/proc/stat", "r" ); FILE* f = fopen( "/proc/stat", "r" );
if( f ) if( f )
{ {
fscanf( f, "cpu %" PRIu64 " %" PRIu64 " %" PRIu64" %" PRIu64, &user, &nice, &system, &idle ); int read = fscanf( f, "cpu %" PRIu64 " %" PRIu64 " %" PRIu64" %" PRIu64, &user, &nice, &system, &idle );
fclose( f ); fclose( f );
if (read == 4)
{
used = user + nice + system; used = user + nice + system;
} }
}
} }
# elif defined __APPLE__ # elif defined __APPLE__