mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-09-20 04:26:03 +08:00
Modified SDK for GCC 4.1
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
// Serialization buffer
|
||||
//===========================================================================//
|
||||
|
||||
#ifndef _XBOX
|
||||
#if !defined _XBOX && defined _MSC_VER
|
||||
#pragma warning (disable : 4514)
|
||||
#endif
|
||||
#include "utlbuffer.h"
|
||||
@ -92,14 +92,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 +122,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 +158,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 +179,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];
|
||||
}
|
||||
}
|
||||
@ -872,7 +872,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 )
|
||||
{
|
||||
@ -884,7 +886,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() )
|
||||
@ -1043,7 +1045,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, ... )
|
||||
{
|
||||
|
Reference in New Issue
Block a user