mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-24 14:47:12 +00:00
Remove a load of implicit CStr type conversions, since they're error-prone and can cause silent data loss.
Handle most CStr8/CStrW conversions via UTF-8 instead of effectively assuming Latin-1. Return UTF-8 strings from Xeromyces API. This was SVN commit r8929.
This commit is contained in:
@@ -87,28 +87,28 @@ CStr CScriptStatsTable::GetCellText(size_t row, size_t col)
|
||||
if (col == 0)
|
||||
return "max nominal heap bytes";
|
||||
uint32_t n = JS_GetGCParameter(m_ScriptInterfaces.at(col-1).first->GetRuntime(), JSGC_MAX_BYTES);
|
||||
return CStr(n);
|
||||
return CStr::FromUInt(n);
|
||||
}
|
||||
case Row_MaxMallocBytes:
|
||||
{
|
||||
if (col == 0)
|
||||
return "max JS_malloc bytes";
|
||||
uint32_t n = JS_GetGCParameter(m_ScriptInterfaces.at(col-1).first->GetRuntime(), JSGC_MAX_MALLOC_BYTES);
|
||||
return CStr(n);
|
||||
return CStr::FromUInt(n);
|
||||
}
|
||||
case Row_Bytes:
|
||||
{
|
||||
if (col == 0)
|
||||
return "allocated bytes";
|
||||
uint32_t n = JS_GetGCParameter(m_ScriptInterfaces.at(col-1).first->GetRuntime(), JSGC_BYTES);
|
||||
return CStr(n);
|
||||
return CStr::FromUInt(n);
|
||||
}
|
||||
case Row_NumberGC:
|
||||
{
|
||||
if (col == 0)
|
||||
return "number of GCs";
|
||||
uint32_t n = JS_GetGCParameter(m_ScriptInterfaces.at(col-1).first->GetRuntime(), JSGC_NUMBER);
|
||||
return CStr(n);
|
||||
return CStr::FromUInt(n);
|
||||
}
|
||||
default:
|
||||
return "???";
|
||||
|
||||
Reference in New Issue
Block a user