From 0b35c96d55a7a44a7438130cbabaf456ba773bb3 Mon Sep 17 00:00:00 2001 From: Wend4r <47463683+Wend4r@users.noreply.github.com> Date: Sun, 2 Feb 2025 13:23:44 +0300 Subject: [PATCH] Fix nontrivial memcall warnings --- public/bitvec.h | 2 +- public/tier1/utlmemory.h | 2 +- public/tier1/utlvector.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/bitvec.h b/public/bitvec.h index 255ed5cd8..8ea08ad75 100644 --- a/public/bitvec.h +++ b/public/bitvec.h @@ -494,7 +494,7 @@ typedef CBitVec<32> CDWordBitVec; template inline CVarBitVecBase::CVarBitVecBase() { - Plat_FastMemset( this, 0, sizeof( *this ) ); + Plat_FastMemset( (void *)this, 0, sizeof( *this ) ); } //----------------------------------------------------------------------------- diff --git a/public/tier1/utlmemory.h b/public/tier1/utlmemory.h index 8204bca15..30330156f 100644 --- a/public/tier1/utlmemory.h +++ b/public/tier1/utlmemory.h @@ -494,7 +494,7 @@ void CUtlMemory::CopyFrom( const CUtlMemory& from ) if( m_pMemory ) { - memcpy( m_pMemory, from.m_pMemory, from.m_nAllocationCount * sizeof(T) ); + memcpy( (void*)m_pMemory, (const void*)from.m_pMemory, from.m_nAllocationCount * sizeof(T) ); } } diff --git a/public/tier1/utlvector.h b/public/tier1/utlvector.h index a0b56f5a9..2d274675b 100644 --- a/public/tier1/utlvector.h +++ b/public/tier1/utlvector.h @@ -1334,7 +1334,7 @@ void CUtlVectorBase::FastRemove( I elem ) if (m_Size > 0) { if ( elem != m_Size -1 ) - memcpy( &Element(elem), &Element(m_Size-1), sizeof(T) ); + memcpy( (void*)&Element(elem), (const void*)&Element(m_Size-1), sizeof(T) ); --m_Size; } }