Fix clang 13 compilation problems (#5791)
* Fix clang 13 compilation problems Re-instated ShowPlayedSequencesDebug logic by introducing no-op lambda which replaces missing `Draw2dLabel` functionality ( added TODO marker there ) Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * apply review suggestions Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Fix type in assert message Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>
This commit is contained in:
@@ -375,7 +375,7 @@ extern intptr_t _findfirst64(const char* pFileName, __finddata64_t* pFindData);
|
||||
|
||||
extern DWORD GetFileAttributesW(LPCWSTR lpFileName);
|
||||
|
||||
extern const bool GetFilenameNoCase(const char* file, char*, const bool cCreateNew = false);
|
||||
extern const bool GetFilenameNoCase(const char* file, char*);
|
||||
|
||||
extern BOOL GetUserName(LPSTR lpBuffer, LPDWORD nSize);
|
||||
|
||||
|
||||
@@ -1263,8 +1263,7 @@ ILINE void FS_CLOSEDIR_NOERR(FS_DIR_TYPE pDir)
|
||||
const bool GetFilenameNoCase
|
||||
(
|
||||
const char* file,
|
||||
char* pAdjustedFilename,
|
||||
const bool cCreateNew
|
||||
char* pAdjustedFilename
|
||||
)
|
||||
{
|
||||
assert(file);
|
||||
@@ -1281,29 +1280,19 @@ const bool GetFilenameNoCase
|
||||
}
|
||||
}
|
||||
|
||||
char* slash;
|
||||
const char* dirname;
|
||||
char* name;
|
||||
|
||||
if ((pAdjustedFilename) == (char*)-1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
slash = strrchr(pAdjustedFilename, '/');
|
||||
#if !defined(LINUX) && !defined(APPLE) && !defined(DEFINE_SKIP_WILDCARD_CHECK) // fix the parent path anyhow.
|
||||
char* slash = strrchr(pAdjustedFilename, '/');
|
||||
char* name = pAdjustedFilename;
|
||||
if (slash)
|
||||
{
|
||||
dirname = pAdjustedFilename;
|
||||
name = slash + 1;
|
||||
*slash = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
dirname = ".";
|
||||
name = pAdjustedFilename;
|
||||
}
|
||||
|
||||
#if !defined(LINUX) && !defined(APPLE) && !defined(DEFINE_SKIP_WILDCARD_CHECK) // fix the parent path anyhow.
|
||||
// Check for wildcards. We'll always return true if the specified filename is
|
||||
// a wildcard pattern.
|
||||
if (strchr(name, '*') || strchr(name, '?'))
|
||||
@@ -1314,13 +1303,13 @@ const bool GetFilenameNoCase
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Scan for the file.
|
||||
if (slash)
|
||||
{
|
||||
*slash = '/';
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if FIX_FILENAME_CASE
|
||||
char* path = pAdjustedFilename;
|
||||
|
||||
@@ -1027,8 +1027,6 @@ bool CLocalizedStringsManager::DoLoadExcelXmlSpreadsheet(const char* sFileName,
|
||||
// key CRC
|
||||
uint32 keyCRC;
|
||||
|
||||
size_t nMemSize = 0;
|
||||
|
||||
for (;; )
|
||||
{
|
||||
int nRowIndex = -1;
|
||||
@@ -1509,30 +1507,6 @@ bool CLocalizedStringsManager::DoLoadExcelXmlSpreadsheet(const char* sFileName,
|
||||
pEntry->flags |= SLocalizedStringEntry::IS_INTERCEPTED;
|
||||
}
|
||||
|
||||
nMemSize += sizeof(*pEntry) + pEntry->sCharacterName.length() * sizeof(char);
|
||||
if (m_cvarLocalizationEncode == 0)
|
||||
{
|
||||
//Note that this isn't accurate if we're using encoding/compression to shrink the string as the encoding step hasn't happened yet
|
||||
if (pEntry->TranslatedText.psUtf8Uncompressed)
|
||||
{
|
||||
nMemSize += pEntry->TranslatedText.psUtf8Uncompressed->length() * sizeof(char);
|
||||
}
|
||||
}
|
||||
if (pEntry->pEditorExtension != NULL)
|
||||
{
|
||||
nMemSize += pEntry->pEditorExtension->sKey.length()
|
||||
+ pEntry->pEditorExtension->sOriginalActorLine.length()
|
||||
+ pEntry->pEditorExtension->sUtf8TranslatedActorLine.length() * sizeof(char)
|
||||
+ pEntry->pEditorExtension->sOriginalText.length()
|
||||
+ pEntry->pEditorExtension->sOriginalCharacterName.length();
|
||||
}
|
||||
|
||||
|
||||
// Compression Preparation
|
||||
//unsigned int nSourceSize = pEntry->swTranslatedText.length()*sizeof(wchar_t);
|
||||
//if (nSourceSize)
|
||||
// int zResult = Compress(pDest, nDestLen, pEntry->swTranslatedText.c_str(), nSourceSize);
|
||||
|
||||
AddLocalizedString(m_pLanguage, pEntry, keyCRC);
|
||||
}
|
||||
|
||||
@@ -1540,10 +1514,7 @@ bool CLocalizedStringsManager::DoLoadExcelXmlSpreadsheet(const char* sFileName,
|
||||
{
|
||||
pEncoder->Finalize();
|
||||
|
||||
{
|
||||
uint8 compressionBuffer[COMPRESSION_FIXED_BUFFER_LENGTH];
|
||||
//uint8 decompressionBuffer[COMPRESSION_FIXED_BUFFER_LENGTH];
|
||||
size_t uncompressedTotal = 0, compressedTotal = 0;
|
||||
for (size_t stringToCompress = startOfStringsToCompress; stringToCompress < m_pLanguage->m_vLocalizedStrings.size(); stringToCompress++)
|
||||
{
|
||||
SLocalizedStringEntry* pStringToCompress = m_pLanguage->m_vLocalizedStrings[stringToCompress];
|
||||
@@ -1551,30 +1522,19 @@ bool CLocalizedStringsManager::DoLoadExcelXmlSpreadsheet(const char* sFileName,
|
||||
{
|
||||
size_t compBufSize = COMPRESSION_FIXED_BUFFER_LENGTH;
|
||||
memset(compressionBuffer, 0, COMPRESSION_FIXED_BUFFER_LENGTH);
|
||||
//CryLogAlways("%u Compressing %s (%p)", stringToCompress, pStringToCompress->szCompressedTranslatedText, pStringToCompress->szCompressedTranslatedText);
|
||||
size_t inputStringLength = strlen((const char*)(pStringToCompress->TranslatedText.szCompressed));
|
||||
pEncoder->CompressInput(pStringToCompress->TranslatedText.szCompressed, inputStringLength, compressionBuffer, &compBufSize);
|
||||
compressionBuffer[compBufSize] = 0;
|
||||
pStringToCompress->huffmanTreeIndex = iEncoder;
|
||||
pEncoder->AddRef();
|
||||
//CryLogAlways("Compressed %s (%u) to %s (%u)", pStringToCompress->szCompressedTranslatedText, strlen((const char*)pStringToCompress->szCompressedTranslatedText), compressionBuffer, compBufSize);
|
||||
uncompressedTotal += inputStringLength;
|
||||
compressedTotal += compBufSize;
|
||||
|
||||
uint8* szCompressedString = new uint8[compBufSize];
|
||||
SAFE_DELETE_ARRAY(pStringToCompress->TranslatedText.szCompressed);
|
||||
|
||||
memcpy(szCompressedString, compressionBuffer, compBufSize);
|
||||
pStringToCompress->TranslatedText.szCompressed = szCompressedString;
|
||||
|
||||
//Testing code
|
||||
//memset( decompressionBuffer, 0, COMPRESSION_FIXED_BUFFER_LENGTH );
|
||||
//size_t decompBufSize = pEncoder->UncompressInput(compressionBuffer, COMPRESSION_FIXED_BUFFER_LENGTH, decompressionBuffer, COMPRESSION_FIXED_BUFFER_LENGTH);
|
||||
//CryLogAlways("Decompressed %s (%u) to %s (%u)", compressionBuffer, compBufSize, decompressionBuffer, decompBufSize);
|
||||
}
|
||||
}
|
||||
//CryLogAlways("[LOC PROFILING] %s, %u, Uncompressed %u, Compressed %u", sFileName, m_pLanguage->m_vLocalizedStrings.size() - startOfStringsToCompress, uncompressedTotal, compressedTotal);
|
||||
}
|
||||
}
|
||||
|
||||
pXmlTableReader->Release();
|
||||
@@ -1584,11 +1544,7 @@ bool CLocalizedStringsManager::DoLoadExcelXmlSpreadsheet(const char* sFileName,
|
||||
|
||||
bool CLocalizedStringsManager::DoLoadAGSXmlDocument(const char* sFileName, uint8 nTagID, bool bReload)
|
||||
{
|
||||
if (!sFileName)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!m_pLanguage)
|
||||
if (!sFileName|| !m_pLanguage)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -1731,7 +1687,6 @@ bool CLocalizedStringsManager::DoLoadAGSXmlDocument(const char* sFileName, uint8
|
||||
}
|
||||
{
|
||||
uint8 compressionBuffer[COMPRESSION_FIXED_BUFFER_LENGTH] = {};
|
||||
size_t uncompressedTotal = 0, compressedTotal = 0;
|
||||
for (size_t stringToCompress = startOfStringsToCompress; stringToCompress < m_pLanguage->m_vLocalizedStrings.size(); stringToCompress++)
|
||||
{
|
||||
SLocalizedStringEntry* pStringToCompress = m_pLanguage->m_vLocalizedStrings[stringToCompress];
|
||||
@@ -1744,8 +1699,6 @@ bool CLocalizedStringsManager::DoLoadAGSXmlDocument(const char* sFileName, uint8
|
||||
compressionBuffer[compBufSize] = 0;
|
||||
pStringToCompress->huffmanTreeIndex = iEncoder;
|
||||
pEncoder->AddRef();
|
||||
uncompressedTotal += inputStringLength;
|
||||
compressedTotal += compBufSize;
|
||||
uint8* szCompressedString = new uint8[compBufSize];
|
||||
SAFE_DELETE_ARRAY(pStringToCompress->TranslatedText.szCompressed);
|
||||
memcpy(szCompressedString, compressionBuffer, compBufSize);
|
||||
@@ -1810,7 +1763,7 @@ bool CLocalizedStringsManager::LocalizeString_s(const AZStd::string& sString, AZ
|
||||
bool CLocalizedStringsManager::LocalizeStringInternal(const char* pStr, size_t len, AZStd::string& outLocalizedString, bool bEnglish)
|
||||
{
|
||||
assert (m_pLanguage);
|
||||
if (m_pLanguage == 0)
|
||||
if (m_pLanguage == nullptr)
|
||||
{
|
||||
CryWarning(VALIDATOR_MODULE_SYSTEM, VALIDATOR_WARNING, "LocalizeString: No language set.");
|
||||
outLocalizedString.assign(pStr, pStr + len);
|
||||
|
||||
Reference in New Issue
Block a user