From ed8209cc35c61fbd8ddff8480962a01c981eef2f Mon Sep 17 00:00:00 2001 From: nillerusr Date: Tue, 25 Nov 2025 06:18:10 +0300 Subject: [PATCH] fix build with clang-20 ref #389 #433 #436 fix #379 --- datamodel/datamodel.cpp | 6 +++--- public/datamodel/dmattributevar.h | 4 +++- public/tier1/utlblockmemory.h | 13 ++++++------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/datamodel/datamodel.cpp b/datamodel/datamodel.cpp index 7e7589dc..e8157a1c 100644 --- a/datamodel/datamodel.cpp +++ b/datamodel/datamodel.cpp @@ -151,7 +151,7 @@ InitReturnVal_t CDataModel::Init( ) //#define _ELEMENT_HISTOGRAM_ #ifdef _ELEMENT_HISTOGRAM_ CUtlMap< UtlSymId_t, int > g_typeHistogram( 0, 100, DefLessFunc( UtlSymId_t ) ); -#endif _ELEMENT_HISTOGRAM_ +#endif //_ELEMENT_HISTOGRAM_ //----------------------------------------------------------------------------- @@ -166,7 +166,7 @@ void CDataModel::Shutdown() Msg( "%d\t%s\n", g_typeHistogram.Element( i ), GetString( g_typeHistogram.Key( i ) ) ); } Msg( "\n" ); -#endif _ELEMENT_HISTOGRAM_ +#endif //_ELEMENT_HISTOGRAM_ int c = GetAllocatedElementCount(); if ( c > 0 ) @@ -1934,7 +1934,7 @@ CDmElement* CDataModel::CreateElement( const DmElementReference_t &ref, const ch { g_typeHistogram.Insert( typeSym, 1 ); } -#endif _ELEMENT_HISTOGRAM_ +#endif //_ELEMENT_HISTOGRAM_ } return pElement; diff --git a/public/datamodel/dmattributevar.h b/public/datamodel/dmattributevar.h index e0ce32f5..fed3f5cd 100644 --- a/public/datamodel/dmattributevar.h +++ b/public/datamodel/dmattributevar.h @@ -92,7 +92,7 @@ public: void Init( CDmElement *pOwner, const char *pAttributeName, int flags = 0 ); // Returns the type of elements allowed into this attribute. UTL_INVAL_SYMBOL allows everything. - UtlSymId_t GetElementType() const; + //UtlSymId_t GetElementType() const; // Get/set void Set( T* pElement ); @@ -1149,11 +1149,13 @@ inline void CDmaElement::Init( CDmElement *pOwner, const char *pAttributeName } } +/* template inline UtlSymId_t CDmaElement::GetElementType() const { return this->Data().m_ElementType; } +*/ template inline T* CDmaElement::GetElement() const diff --git a/public/tier1/utlblockmemory.h b/public/tier1/utlblockmemory.h index 35ef2da2..1dbdc9db 100644 --- a/public/tier1/utlblockmemory.h +++ b/public/tier1/utlblockmemory.h @@ -109,8 +109,8 @@ protected: T** m_pMemory; int m_nBlocks; - int m_nIndexMask : 27; - int m_nIndexShift : 5; + int m_nIndexMask; + int m_nIndexShift; }; //----------------------------------------------------------------------------- @@ -130,17 +130,16 @@ CUtlBlockMemory::~CUtlBlockMemory() Purge(); } - //----------------------------------------------------------------------------- // Fast swap //----------------------------------------------------------------------------- template< class T, class I > void CUtlBlockMemory::Swap( CUtlBlockMemory< T, I > &mem ) { - this->swap( m_pMemory, mem.m_pMemory ); - this->swap( m_nBlocks, mem.m_nBlocks ); - this->swap( m_nIndexMask, mem.m_nIndexMask ); - this->swap( m_nIndexShift, mem.m_nIndexShift ); + V_swap( m_pMemory, mem.m_pMemory ); + V_swap( m_nBlocks, mem.m_nBlocks ); + V_swap( m_nIndexMask, mem.m_nIndexMask ); + V_swap( m_nIndexShift, mem.m_nIndexShift ); }