arm64 : fix intptr_t size

This commit is contained in:
hymei
2022-06-05 01:12:32 +03:00
committed by nillerusr
parent 2690e6c85a
commit 4e4039d756
143 changed files with 1015 additions and 674 deletions
+27
View File
@@ -189,6 +189,7 @@ public:
unsigned int GetUnsignedInt( );
float GetFloat( );
double GetDouble( );
void * GetPtr();
template <size_t maxLenInChars> void GetString( char( &pString )[maxLenInChars] )
{
GetStringInternal( pString, maxLenInChars );
@@ -278,6 +279,7 @@ public:
void PutUnsignedInt( unsigned int u );
void PutFloat( float f );
void PutDouble( double d );
void PutPtr( void * ); // Writes the pointer, not the pointed to
void PutString( const char* pString );
void Put( const void* pMem, int size );
@@ -757,6 +759,18 @@ inline float CUtlBuffer::GetFloat( )
return f;
}
inline void *CUtlBuffer::GetPtr( )
{
void *p;
// LEGACY WARNING: in text mode, PutPtr writes 32 bit pointers in hex, while GetPtr reads 32 or 64 bit pointers in decimal
#ifndef PLATFORM_64BITS
p = ( void* )GetUnsignedInt();
#else
p = ( void* )GetInt64();
#endif
return p;
}
inline double CUtlBuffer::GetDouble( )
{
double d;
@@ -986,6 +1000,19 @@ inline void CUtlBuffer::PutDouble( double d )
PutType( d, "%f" );
}
inline void CUtlBuffer::PutPtr( void *p )
{
// LEGACY WARNING: in text mode, PutPtr writes 32 bit pointers in hex, while GetPtr reads 32 or 64 bit pointers in decimal
if (!IsText())
{
PutTypeBin( p );
}
else
{
Printf( "0x%p", p );
}
}
//-----------------------------------------------------------------------------
// Am I a text buffer?