1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-09-20 04:26:03 +08:00

Modified SDK for GCC 4.2

This commit is contained in:
Scott Ehlert
2008-09-15 02:50:57 -05:00
parent 86f3bc8a60
commit 7ff7f366d5
696 changed files with 23423 additions and 22634 deletions

View File

@ -6,7 +6,9 @@
// Serialization buffer
//===========================================================================//
#ifdef _MSC_VER
#pragma warning (disable : 4514)
#endif
#include "utlbuffer.h"
#include <stdio.h>
@ -92,14 +94,14 @@ CUtlCStringConversion::CUtlCStringConversion( char nEscapeChar, const char *pDel
memset( m_pConversion, 0x0, sizeof(m_pConversion) );
for ( int i = 0; i < nCount; ++i )
{
m_pConversion[ pArray[i].m_pReplacementString[0] ] = pArray[i].m_nActualChar;
m_pConversion[ static_cast<size_t>(pArray[i].m_pReplacementString[0]) ] = pArray[i].m_nActualChar;
}
}
// Finds a conversion for the passed-in string, returns length
char CUtlCStringConversion::FindConversion( const char *pString, int *pLength )
{
char c = m_pConversion[ pString[0] ];
char c = m_pConversion[ static_cast<size_t>(pString[0]) ];
*pLength = (c != '\0') ? 1 : 0;
return c;
}
@ -122,7 +124,7 @@ CUtlCharConversion::CUtlCharConversion( char nEscapeChar, const char *pDelimiter
for ( int i = 0; i < nCount; ++i )
{
m_pList[i] = pArray[i].m_nActualChar;
ConversionInfo_t &info = m_pReplacements[ m_pList[i] ];
ConversionInfo_t &info = m_pReplacements[ static_cast<size_t>(m_pList[i]) ];
Assert( info.m_pReplacementString == 0 );
info.m_pReplacementString = pArray[i].m_pReplacementString;
info.m_nLength = Q_strlen( info.m_pReplacementString );
@ -158,12 +160,12 @@ int CUtlCharConversion::GetDelimiterLength() const
//-----------------------------------------------------------------------------
const char *CUtlCharConversion::GetConversionString( char c ) const
{
return m_pReplacements[ c ].m_pReplacementString;
return m_pReplacements[ static_cast<size_t>(c) ].m_pReplacementString;
}
int CUtlCharConversion::GetConversionLength( char c ) const
{
return m_pReplacements[ c ].m_nLength;
return m_pReplacements[ static_cast<size_t>(c) ].m_nLength;
}
int CUtlCharConversion::MaxConversionLength() const
@ -179,9 +181,9 @@ char CUtlCharConversion::FindConversion( const char *pString, int *pLength )
{
for ( int i = 0; i < m_nCount; ++i )
{
if ( !Q_strcmp( pString, m_pReplacements[ m_pList[i] ].m_pReplacementString ) )
if ( !Q_strcmp( pString, m_pReplacements[ static_cast<size_t>(m_pList[i]) ].m_pReplacementString ) )
{
*pLength = m_pReplacements[ m_pList[i] ].m_nLength;
*pLength = m_pReplacements[ static_cast<size_t>(m_pList[i]) ].m_nLength;
return m_pList[i];
}
}
@ -891,7 +893,9 @@ void CUtlBuffer::SeekGet( SeekType_t type, int offset )
// Parse...
//-----------------------------------------------------------------------------
#ifdef _MSC_VER
#pragma warning ( disable : 4706 )
#endif
int CUtlBuffer::VaScanf( const char* pFmt, va_list list )
{
@ -903,7 +907,7 @@ int CUtlBuffer::VaScanf( const char* pFmt, va_list list )
int nLength;
char c;
char* pEnd;
while ( c = *pFmt++ )
while ( (c = *pFmt++) )
{
// Stop if we hit the end of the buffer
if ( m_Get >= TellMaxPut() )
@ -1062,7 +1066,9 @@ int CUtlBuffer::VaScanf( const char* pFmt, va_list list )
return numScanned;
}
#ifdef _MSC_VER
#pragma warning ( default : 4706 )
#endif
int CUtlBuffer::Scanf( const char* pFmt, ... )
{
@ -1681,7 +1687,7 @@ bool CUtlBuffer::ConvertCRLF( CUtlBuffer &outBuf )
CUtlInplaceBuffer::CUtlInplaceBuffer( int growSize /* = 0 */, int initSize /* = 0 */, int nFlags /* = 0 */ ) :
CUtlBuffer( growSize, initSize, nFlags )
{
NULL;
}
bool CUtlInplaceBuffer::InplaceGetLinePtr( char **ppszInBufferPtr, int *pnLineLength )