diff --git a/public/tier1/utlsymbollarge.h b/public/tier1/utlsymbollarge.h index 1b7110ec..bda1ed92 100644 --- a/public/tier1/utlsymbollarge.h +++ b/public/tier1/utlsymbollarge.h @@ -1,4 +1,4 @@ -//===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======// +//===== Copyright ? 1996-2005, Valve Corporation, All rights reserved. ======// // // Purpose: Defines a large symbol table (intp sized handles, can store more than 64k strings) // @@ -88,39 +88,39 @@ class CUtlSymbolLarge const char* m_pString; }; -inline uint32 CUtlSymbolLarge_Hash( bool CASEINSENSITIVE, const char *pString, int len ) -{ - return ( CASEINSENSITIVE ? MurmurHash2LowerCase( pString, len, 0x31415926 ) : MurmurHash2( pString, len, 0x31415926 ) ); +inline uint32 CUtlSymbolLarge_Hash( bool CASEINSENSITIVE, const char *pString, int len ) +{ + return ( CASEINSENSITIVE ? MurmurHash2LowerCase( pString, len, 0x31415926 ) : MurmurHash2( pString, len, 0x31415926 ) ); } -typedef uint32 LargeSymbolTableHashDecoration_t; - -// The structure consists of the hash immediately followed by the string data -struct CUtlSymbolTableLargeBaseTreeEntry_t -{ - LargeSymbolTableHashDecoration_t m_Hash; - // Variable length string data - char m_String[1]; - - bool IsEmpty() const - { - return ( ( m_Hash == 0 ) && ( 0 == m_String[0] ) ); - } - - char const *String() const - { - return (const char *)&m_String[ 0 ]; - } - - CUtlSymbolLarge ToSymbol() const - { - return CUtlSymbolLarge( String() ); - } - - LargeSymbolTableHashDecoration_t HashValue() const - { - return m_Hash; - } +typedef uint32 LargeSymbolTableHashDecoration_t; + +// The structure consists of the hash immediately followed by the string data +struct CUtlSymbolTableLargeBaseTreeEntry_t +{ + LargeSymbolTableHashDecoration_t m_Hash; + // Variable length string data + char m_String[1]; + + bool IsEmpty() const + { + return ( ( m_Hash == 0 ) && ( 0 == m_String[0] ) ); + } + + char const *String() const + { + return (const char *)&m_String[ 0 ]; + } + + CUtlSymbolLarge ToSymbol() const + { + return CUtlSymbolLarge( String() ); + } + + LargeSymbolTableHashDecoration_t HashValue() const + { + return m_Hash; + } }; // Base Class for threaded and non-threaded types @@ -183,7 +183,7 @@ class CUtlSymbolTableLargeBase { CUtlSymbolTableLargeBase* pTable = (CUtlSymbolTableLargeBase*)((uintptr_t)this + m_tableOffset); - pTable->HashValue( k ); + return pTable->HashValue( k ); } }; @@ -375,13 +375,13 @@ inline void CUtlSymbolTableLargeBase< MutexType, CASEINSENSITIVE >::Purge() m_Mutex.Unlock( __FILE__, __LINE__ ); } -// Case-sensitive -typedef CUtlSymbolTableLargeBase< CThreadEmptyMutex, false > CUtlSymbolTableLarge; -// Case-insensitive -typedef CUtlSymbolTableLargeBase< CThreadEmptyMutex, true > CUtlSymbolTableLarge_CI; -// Multi-threaded case-sensitive -typedef CUtlSymbolTableLargeBase< CThreadMutex, false > CUtlSymbolTableLargeMT; -// Multi-threaded case-insensitive +// Case-sensitive +typedef CUtlSymbolTableLargeBase< CThreadEmptyMutex, false > CUtlSymbolTableLarge; +// Case-insensitive +typedef CUtlSymbolTableLargeBase< CThreadEmptyMutex, true > CUtlSymbolTableLarge_CI; +// Multi-threaded case-sensitive +typedef CUtlSymbolTableLargeBase< CThreadMutex, false > CUtlSymbolTableLargeMT; +// Multi-threaded case-insensitive typedef CUtlSymbolTableLargeBase< CThreadMutex, true > CUtlSymbolTableLargeMT_CI; #endif // UTLSYMBOLLARGE_H