From 31fc2335ddd671e7f6dffd97430144242689afa6 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 16 Oct 2017 20:42:53 +0200 Subject: [PATCH] Silence some type mismatch warnings. --- client/TracyProfiler.cpp | 14 +++++++------- common/TracySocket.cpp | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index 118d01a0..2e088302 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -174,7 +174,7 @@ void Profiler::Worker() ptr += dsz; } if( !SendData( buf, ptr - buf ) ) break; - m_bufferOffset += ptr - buf; + m_bufferOffset += int( ptr - buf ); if( m_bufferOffset > TargetFrameSize * 2 ) m_bufferOffset = 0; } else @@ -193,7 +193,7 @@ void Profiler::Worker() bool Profiler::SendData( const char* data, size_t len ) { #ifdef DISABLE_LZ4 - if( m_sock->Send( data, len ) == -1 ) return false; + if( m_sock->Send( data, (int)len ) == -1 ) return false; #else char lz4[LZ4Size + sizeof( lz4sz_t )]; const lz4sz_t lz4sz = LZ4_compress_fast_continue( m_stream, data, lz4 + sizeof( lz4sz_t ), len, LZ4Size, 1 ); @@ -219,11 +219,11 @@ bool Profiler::SendString( uint64_t str, const char* ptr, QueueType type ) auto len = strlen( ptr ); assert( len < TargetFrameSize - isz - sizeof( uint16_t ) ); assert( len <= std::numeric_limits::max() ); - uint16_t l16 = len; + auto l16 = uint16_t( len ); memcpy( buf + isz, &l16, sizeof( l16 ) ); memcpy( buf + isz + sizeof( l16 ), ptr, l16 ); - m_bufferOffset += isz + sizeof( l16 ) + l16; + m_bufferOffset += int( isz + sizeof( l16 ) + l16 ); if( m_bufferOffset > TargetFrameSize * 2 ) m_bufferOffset = 0; return SendData( buf, isz + sizeof( l16 ) + l16 ); @@ -364,7 +364,7 @@ void Profiler::CalibrateDelay() const auto f0 = GetTime( cpu ); for( int i=0; i::max(); + auto mindiff = std::numeric_limits::max(); for( int i=0; i 0 ); - left -= sz; + left -= (int)sz; } } diff --git a/common/TracySocket.cpp b/common/TracySocket.cpp index 3b2ba233..3ded5bdc 100644 --- a/common/TracySocket.cpp +++ b/common/TracySocket.cpp @@ -119,7 +119,7 @@ int Socket::Send( const void* _buf, int len ) len -= ret; buf += ret; } - return buf - start; + return int( buf - start ); } int Socket::Recv( void* _buf, int len, const timeval* tv )