1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2024-12-22 17:47:38 +08:00

Fixed tier1 compilation failure against clang 10.0.0.

This commit is contained in:
Ted Wang 2021-08-25 16:40:51 -07:00 committed by David Anderson
parent eea4d13b82
commit f0aedc6359

View File

@ -1411,7 +1411,7 @@ int _V_UCS2ToUnicode( const ucs2 *pUCS2, wchar_t *pUnicode, int cubDestSizeInByt
size_t nMaxUTF8 = cubDestSizeInBytes; size_t nMaxUTF8 = cubDestSizeInBytes;
char *pIn = (char *)pUCS2; char *pIn = (char *)pUCS2;
char *pOut = (char *)pUnicode; char *pOut = (char *)pUnicode;
if ( conv_t > 0 ) if ( reinterpret_cast<int>(conv_t) > 0 )
{ {
cchResult = iconv( conv_t, &pIn, &nLenUnicde, &pOut, &nMaxUTF8 ); cchResult = iconv( conv_t, &pIn, &nLenUnicde, &pOut, &nMaxUTF8 );
iconv_close( conv_t ); iconv_close( conv_t );
@ -1451,7 +1451,7 @@ int _V_UnicodeToUCS2( const wchar_t *pUnicode, int cubSrcInBytes, char *pUCS2, i
size_t nMaxUCS2 = cubDestSizeInBytes; size_t nMaxUCS2 = cubDestSizeInBytes;
char *pIn = (char*)pUnicode; char *pIn = (char*)pUnicode;
char *pOut = pUCS2; char *pOut = pUCS2;
if ( conv_t > 0 ) if ( reinterpret_cast<int>(conv_t) > 0 )
{ {
cchResult = iconv( conv_t, &pIn, &nLenUnicde, &pOut, &nMaxUCS2 ); cchResult = iconv( conv_t, &pIn, &nLenUnicde, &pOut, &nMaxUCS2 );
iconv_close( conv_t ); iconv_close( conv_t );
@ -1499,7 +1499,7 @@ int _V_UCS2ToUTF8( const ucs2 *pUCS2, char *pUTF8, int cubDestSizeInBytes )
size_t nMaxUTF8 = cubDestSizeInBytes - 1; size_t nMaxUTF8 = cubDestSizeInBytes - 1;
char *pIn = (char *)pUCS2; char *pIn = (char *)pUCS2;
char *pOut = (char *)pUTF8; char *pOut = (char *)pUTF8;
if ( conv_t > 0 ) if ( reinterpret_cast<int>(conv_t) > 0 )
{ {
const size_t nBytesToWrite = nMaxUTF8; const size_t nBytesToWrite = nMaxUTF8;
cchResult = iconv( conv_t, &pIn, &nLenUnicde, &pOut, &nMaxUTF8 ); cchResult = iconv( conv_t, &pIn, &nLenUnicde, &pOut, &nMaxUTF8 );
@ -1544,7 +1544,7 @@ int _V_UTF8ToUCS2( const char *pUTF8, int cubSrcInBytes, ucs2 *pUCS2, int cubDes
size_t nMaxUTF8 = cubDestSizeInBytes; size_t nMaxUTF8 = cubDestSizeInBytes;
char *pIn = (char *)pUTF8; char *pIn = (char *)pUTF8;
char *pOut = (char *)pUCS2; char *pOut = (char *)pUCS2;
if ( conv_t > 0 ) if ( reinterpret_cast<int>(conv_t) > 0 )
{ {
cchResult = iconv( conv_t, &pIn, &nLenUnicde, &pOut, &nMaxUTF8 ); cchResult = iconv( conv_t, &pIn, &nLenUnicde, &pOut, &nMaxUTF8 );
iconv_close( conv_t ); iconv_close( conv_t );