From bb30169c882ef6ba71b9e14ba9bbe3d796e67e7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 22 Mar 2020 19:20:23 +0100 Subject: [PATCH] Address feedback --- Core/Debugger/SymbolMap.cpp | 2 -- ext/native/util/text/utf8.cpp | 7 ++++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Core/Debugger/SymbolMap.cpp b/Core/Debugger/SymbolMap.cpp index c0f48f14ff..5786898624 100644 --- a/Core/Debugger/SymbolMap.cpp +++ b/Core/Debugger/SymbolMap.cpp @@ -1003,7 +1003,6 @@ void SymbolMap::GetLabels(std::vector &dest) { if (activeNeedUpdate_) UpdateActiveSymbols(); -#ifdef _WIN32 std::lock_guard guard(lock_); for (auto it = activeLabels.begin(); it != activeLabels.end(); it++) { LabelDefinition entry; @@ -1011,7 +1010,6 @@ void SymbolMap::GetLabels(std::vector &dest) { entry.name = ConvertUTF8ToWString(it->second.name); dest.push_back(entry); } -#endif } #if defined(_WIN32) && !PPSSPP_PLATFORM(UWP) diff --git a/ext/native/util/text/utf8.cpp b/ext/native/util/text/utf8.cpp index f1e6efc4cd..21c6a1fb7b 100644 --- a/ext/native/util/text/utf8.cpp +++ b/ext/native/util/text/utf8.cpp @@ -486,12 +486,13 @@ static size_t ConvertUTF8ToUCS2Internal(char16_t *dest, size_t destSize, const s char16_t *destw = (char16_t *)dest; const char16_t *const destwEnd = destw + destSize; - // TODO: Instead of encoding UTF16 here we should encode UCS2. + // TODO: Ignore characters that are invalid in UCS2 by encoding to UTF-16, as we do, and + // then failing/ignoring any 16-bit unit produced by UTF-16 in the range U+D800 — U+DFFF. while (uint32_t c = utf.next()) { if (destw + UTF16LE::encodeUnits(c) >= destwEnd) { break; } - // TODO: Update UTF16LE to take uint16_t + // TODO: Update UTF16LE to take char16_t destw += UTF16LE::encode((uint16_t *)destw, c); } @@ -518,7 +519,7 @@ std::u16string ConvertUTF8ToUCS2(const std::string &source) { #ifndef _WIN32 -// Replacements for the Win32 functions. Not to be used from emulation code! +// Replacements for the Win32 wstring functions. Not to be used from emulation code! std::string ConvertWStringToUTF8(const std::wstring &wstr) { std::string s;