1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-09-19 12:06:07 +08:00

Fixed compilation of tier1 caused by min/max.

This commit is contained in:
Ted Wang
2021-08-25 15:34:39 -07:00
committed by David Anderson
parent c33f7155e9
commit eea4d13b82
6 changed files with 19 additions and 19 deletions

View File

@ -928,7 +928,7 @@ char *V_strncat(char *pDest, const char *pSrc, size_t destBufferSize, int max_ch
}
else
{
charstocopy = (size_t)min( max_chars_to_copy, (int)srclen );
charstocopy = (size_t)V_min( max_chars_to_copy, (int)srclen );
}
if ( len + charstocopy >= destBufferSize )
@ -960,7 +960,7 @@ wchar_t *V_wcsncat( INOUT_Z_CAP(cchDest) wchar_t *pDest, const wchar_t *pSrc, si
}
else
{
charstocopy = (size_t)min( max_chars_to_copy, (int)srclen );
charstocopy = (size_t)V_min( max_chars_to_copy, (int)srclen );
}
if ( len + charstocopy >= cchDest )
@ -1020,7 +1020,7 @@ char *V_pretifymem( float value, int digitsafterdecimal /*= 2*/, bool usebinaryo
char val[ 32 ];
// Clamp to >= 0
digitsafterdecimal = max( digitsafterdecimal, 0 );
digitsafterdecimal = V_max( digitsafterdecimal, 0 );
// If it's basically integral, don't do any decimals
if ( FloatMakePositive( value - (int)value ) < 0.00001 )
@ -1439,7 +1439,7 @@ int _V_UnicodeToUCS2( const wchar_t *pUnicode, int cubSrcInBytes, char *pUCS2, i
#ifdef _WIN32
// Figure out which buffer is smaller and convert from bytes to character
// counts.
int cchResult = min( (size_t)cubSrcInBytes/sizeof(wchar_t), cubDestSizeInBytes/sizeof(wchar_t) );
int cchResult = V_min( (size_t)cubSrcInBytes/sizeof(wchar_t), cubDestSizeInBytes/sizeof(wchar_t) );
wchar_t *pDest = (wchar_t*)pUCS2;
wcsncpy( pDest, pUnicode, cchResult );
// Make sure we NULL-terminate.
@ -1599,7 +1599,7 @@ unsigned char V_nibble( char c )
void V_hextobinary( char const *in, int numchars, byte *out, int maxoutputbytes )
{
int len = V_strlen( in );
numchars = min( len, numchars );
numchars = V_min( len, numchars );
// Make sure it's even
numchars = ( numchars ) & ~0x1;
@ -1710,7 +1710,7 @@ void V_FileBase( const char *in, char *out, int maxlen )
// Length of new sting
len = end - start + 1;
int maxcopy = min( len + 1, maxlen );
int maxcopy = V_min( len + 1, maxlen );
// Copy partial string
V_strncpy( out, &in[start], maxcopy );
@ -1754,7 +1754,7 @@ void V_StripExtension( const char *in, char *out, int outSize )
if (end > 0 && !PATHSEPARATOR( in[end] ) && end < outSize)
{
int nChars = min( end, outSize-1 );
int nChars = V_min( end, outSize-1 );
if ( out != in )
{
memcpy( out, in, nChars );
@ -2001,7 +2001,7 @@ bool V_ExtractFilePath (const char *path, char *dest, int destSize )
src--;
}
int copysize = min( src - path, destSize - 1 );
int copysize = V_min( src - path, destSize - 1 );
memcpy( dest, path, copysize );
dest[copysize] = 0;
@ -2392,7 +2392,7 @@ char* AllocString( const char *pStr, int nMaxChars )
if ( nMaxChars == -1 )
allocLen = strlen( pStr ) + 1;
else
allocLen = min( (int)strlen(pStr), nMaxChars ) + 1;
allocLen = V_min( (int)strlen(pStr), nMaxChars ) + 1;
char *pOut = new char[allocLen];
V_strncpy( pOut, pStr, allocLen );