From da38fed01aeae03e4045f63ff1de5c2d722c596e Mon Sep 17 00:00:00 2001 From: Kenzzer <14257866+kenzzer@users.noreply.github.com> Date: Sat, 23 May 2026 08:21:13 +0000 Subject: [PATCH] Fix for tier1 & mathlib compilation --- public/mathlib/mathlib.h | 2 +- public/tier0/vprof.h | 2 +- public/tier1/UtlSortVector.h | 4 ++-- public/tier1/fmtstr.h | 3 +-- tier1/KeyValues.cpp | 2 +- tier1/checksum_md5.cpp | 2 +- tier1/fileio.cpp | 1 - tier1/memstack.cpp | 9 +++++---- 8 files changed, 12 insertions(+), 13 deletions(-) diff --git a/public/mathlib/mathlib.h b/public/mathlib/mathlib.h index 01107d19..baeb4ebc 100644 --- a/public/mathlib/mathlib.h +++ b/public/mathlib/mathlib.h @@ -1591,7 +1591,7 @@ float Hermite_Spline( float t ); -void Hermite_SplineBasis( float t, float basis[] ); +void Hermite_SplineBasis( float t, float basis[4] ); void Hermite_Spline( const Quaternion &q0, diff --git a/public/tier0/vprof.h b/public/tier0/vprof.h index 154a131c..e4cc20a4 100644 --- a/public/tier0/vprof.h +++ b/public/tier0/vprof.h @@ -778,9 +778,9 @@ private: inline CVProfNode::CVProfNode( const tchar * pszName, int detailLevel, CVProfNode *pParent, const tchar *pBudgetGroupName, int budgetFlags ) : m_pszName( pszName ), + m_nRecursions( 0 ), m_nCurFrameCalls( 0 ), m_nPrevFrameCalls( 0 ), - m_nRecursions( 0 ), m_pParent( pParent ), m_pChild( NULL ), m_pSibling( NULL ), diff --git a/public/tier1/UtlSortVector.h b/public/tier1/UtlSortVector.h index 9890c607..887c5817 100644 --- a/public/tier1/UtlSortVector.h +++ b/public/tier1/UtlSortVector.h @@ -150,13 +150,13 @@ private: //----------------------------------------------------------------------------- template CUtlSortVector::CUtlSortVector( int nGrowSize, int initSize ) : - m_pLessContext(NULL), BaseVector( nGrowSize, initSize ), m_bNeedsSort( false ) + BaseVector( nGrowSize, initSize ), m_pLessContext(NULL), m_bNeedsSort( false ) { } template CUtlSortVector::CUtlSortVector( T* pMemory, int numElements ) : - m_pLessContext(NULL), BaseVector( pMemory, numElements ), m_bNeedsSort( false ) + BaseVector( pMemory, numElements ), m_pLessContext(NULL), m_bNeedsSort( false ) { } diff --git a/public/tier1/fmtstr.h b/public/tier1/fmtstr.h index bcac9a26..62fab323 100644 --- a/public/tier1/fmtstr.h +++ b/public/tier1/fmtstr.h @@ -121,12 +121,11 @@ public: // Use this for va_list formatting const char *sprintf_argv(const char *pszFormat, va_list arg_ptr) { - int result; bool bTruncated = false; static int s_nWarned = 0; InitQuietTruncation(); - result = V_vsnprintfRet( m_szBuf, SIZE_BUF - 1, pszFormat, arg_ptr, &bTruncated ); + V_vsnprintfRet( m_szBuf, SIZE_BUF - 1, pszFormat, arg_ptr, &bTruncated ); m_szBuf[SIZE_BUF - 1] = 0; if ( bTruncated && !m_bQuietTruncation && ( s_nWarned < 5 ) ) { diff --git a/tier1/KeyValues.cpp b/tier1/KeyValues.cpp index 648b4522..f394bebe 100644 --- a/tier1/KeyValues.cpp +++ b/tier1/KeyValues.cpp @@ -231,12 +231,12 @@ class CKeyValuesGrowableStringTable public: // Constructor CKeyValuesGrowableStringTable() : + m_hashLookup( 2048, 0, 0, m_Functor, m_Functor ), #ifdef PLATFORM_64BITS m_vecStrings( 0, 4 * 512 * 1024 ) #else m_vecStrings( 0, 512 * 1024 ) #endif - , m_hashLookup( 2048, 0, 0, m_Functor, m_Functor ) { m_vecStrings.AddToTail( '\0' ); } diff --git a/tier1/checksum_md5.cpp b/tier1/checksum_md5.cpp index 4276d0ab..89661ae2 100644 --- a/tier1/checksum_md5.cpp +++ b/tier1/checksum_md5.cpp @@ -36,7 +36,7 @@ //----------------------------------------------------------------------------- static void MD5Transform(unsigned int buf[4], unsigned int const in[16]) { - register unsigned int a, b, c, d; + unsigned int a, b, c, d; a = buf[0]; b = buf[1]; diff --git a/tier1/fileio.cpp b/tier1/fileio.cpp index 1bf326f3..090bea45 100644 --- a/tier1/fileio.cpp +++ b/tier1/fileio.cpp @@ -49,7 +49,6 @@ #include #endif #include -#define int64 int64_t #define _A_SUBDIR S_IFDIR diff --git a/tier1/memstack.cpp b/tier1/memstack.cpp index 79eb1014..a6efcf31 100644 --- a/tier1/memstack.cpp +++ b/tier1/memstack.cpp @@ -31,16 +31,17 @@ MEMALLOC_DEFINE_EXTERNAL_TRACKING(CMemoryStack); //----------------------------------------------------------------------------- CMemoryStack::CMemoryStack() - : m_pBase( NULL ), + : m_pNextAlloc( NULL ), - m_pAllocLimit( NULL ), m_pCommitLimit( NULL ), - m_alignment( 16 ), + m_pAllocLimit( NULL ), + m_pBase( NULL ), #if defined(_WIN32) m_commitSize( 0 ), m_minCommit( 0 ), #endif - m_maxSize( 0 ) + m_maxSize( 0 ), + m_alignment( 16 ) { }