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:
Ykkrosh
2011-02-17 20:08:20 +00:00
parent 4f724056d5
commit 1c7e33b528
69 changed files with 372 additions and 562 deletions
+4 -4
View File
@@ -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 "???";