diff --git a/server/TracyVector.hpp b/server/TracyVector.hpp index 16192d02..5eaa54f9 100644 --- a/server/TracyVector.hpp +++ b/server/TracyVector.hpp @@ -31,14 +31,14 @@ public: tracy_force_inline Vector() { - memset( this, 0, sizeof( Vector ) ); + memset( (char*)this, 0, sizeof( Vector ) ); } Vector( const Vector& ) = delete; tracy_force_inline Vector( Vector&& src ) noexcept { - memcpy( this, &src, sizeof( Vector ) ); - memset( &src, 0, sizeof( Vector ) ); + memcpy( (char*)this, &src, sizeof( Vector ) ); + memset( (char*)&src, 0, sizeof( Vector ) ); } tracy_force_inline Vector( const T& value ) @@ -68,17 +68,17 @@ public: memUsage -= Capacity() * sizeof( T ); free( m_ptr ); } - memcpy( this, &src, sizeof( Vector ) ); - memset( &src, 0, sizeof( Vector ) ); + memcpy( (char*)this, &src, sizeof( Vector ) ); + memset( (char*)&src, 0, sizeof( Vector ) ); return *this; } tracy_force_inline void swap( Vector& other ) { uint8_t tmp[sizeof( Vector )]; - memcpy( tmp, &other, sizeof( Vector ) ); - memcpy( &other, this, sizeof( Vector ) ); - memcpy( this, tmp, sizeof( Vector ) ); + memcpy( (char*)tmp, &other, sizeof( Vector ) ); + memcpy( (char*)&other, this, sizeof( Vector ) ); + memcpy( (char*)this, tmp, sizeof( Vector ) ); } tracy_force_inline bool empty() const { return m_size == 0; } @@ -310,7 +310,7 @@ private: { if( std::is_trivially_copyable() ) { - memcpy( ptr, m_ptr, m_size * sizeof( T ) ); + memcpy( (char*)ptr, m_ptr, m_size * sizeof( T ) ); } else { diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 6924daad..d70db894 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -257,7 +257,7 @@ Worker::Worker( const char* addr, int port ) m_data.callstackPayload.push_back( nullptr ); m_data.zoneExtra.push_back( ZoneExtra {} ); - memset( m_gpuCtxMap, 0, sizeof( m_gpuCtxMap ) ); + memset( (char*)m_gpuCtxMap, 0, sizeof( m_gpuCtxMap ) ); #ifndef TRACY_NO_STATISTICS m_data.sourceLocationZonesReady = true; @@ -833,7 +833,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks ) s_loadProgress.subProgress.store( 0, std::memory_order_relaxed ); f.Read( sz ); m_data.zoneChildren.reserve_exact( sz, m_slab ); - memset( m_data.zoneChildren.data(), 0, sizeof( Vector> ) * sz ); + memset( (char*)m_data.zoneChildren.data(), 0, sizeof( Vector> ) * sz ); int32_t childIdx = 0; f.Read( sz ); m_data.threads.reserve_exact( sz, m_slab ); @@ -917,7 +917,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks ) s_loadProgress.subProgress.store( 0, std::memory_order_relaxed ); f.Read( sz ); m_data.gpuChildren.reserve_exact( sz, m_slab ); - memset( m_data.gpuChildren.data(), 0, sizeof( Vector> ) * sz ); + memset( (char*)m_data.gpuChildren.data(), 0, sizeof( Vector> ) * sz ); childIdx = 0; f.Read( sz ); m_data.gpuData.reserve_exact( sz, m_slab ); @@ -4940,7 +4940,7 @@ void Worker::ProcessGpuNewContext( const QueueGpuNewContext& ev ) const auto cpuTime = TscTime( ev.cpuTime - m_data.baseTime ); auto gpu = m_slab.AllocInit(); - memset( gpu->query, 0, sizeof( gpu->query ) ); + memset( (char*)gpu->query, 0, sizeof( gpu->query ) ); gpu->timeDiff = cpuTime - gpuTime; gpu->thread = ev.thread; gpu->period = ev.period; @@ -7050,7 +7050,7 @@ ZoneExtra& Worker::AllocZoneExtra( ZoneEvent& ev ) assert( ev.extra == 0 ); ev.extra = uint32_t( m_data.zoneExtra.size() ); auto& extra = m_data.zoneExtra.push_next(); - memset( &extra, 0, sizeof( extra ) ); + memset( (char*)&extra, 0, sizeof( extra ) ); return extra; }