From e9d158fffebf728a0715c74e561aaaf4e1ebd861 Mon Sep 17 00:00:00 2001 From: Sabine Date: Wed, 3 Jul 2024 14:10:38 +0200 Subject: [PATCH] feat(linux): remaining comments on u16 --- linux/mcompile/keymap/u16.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/linux/mcompile/keymap/u16.cpp b/linux/mcompile/keymap/u16.cpp index 32a3bd52c4..f5deaeaa04 100644 --- a/linux/mcompile/keymap/u16.cpp +++ b/linux/mcompile/keymap/u16.cpp @@ -25,6 +25,8 @@ std::vector convert_argvW_to_Vector_u16str(int argc, wchar_t* ar return vector_u16; } +// ToDo codecvt needs to be replaced !! + //String <- wstring std::string string_from_wstring(std::wstring const str) { std::wstring_convert, wchar_t> converter; @@ -96,7 +98,6 @@ long int u16tol(const KMX_WCHAR* str, KMX_WCHAR** endptr, int base) auto s = string_from_u16string(str); char* t; size_t idx; - // long int result = strtol(s.c_str(), &t, base); long int result = stol(s, &idx, base); if (endptr != nullptr) *endptr = (KMX_WCHAR*)str + (t - s.c_str()); return result; @@ -135,10 +136,7 @@ KMX_CHAR* strrchr_slash(KMX_CHAR* Name) */ // u16rchr returns last occurence of ch in p; It returns '\0' if ch == '\0' and NULL if ch is not found const KMX_WCHAR* u16rchr(const KMX_WCHAR* p, KMX_WCHAR ch) { - /*const KMX_WCHAR* p_end = p + u16len(p) - 1; - - if (ch == '\0') return p_end + 1; */ - const KMX_WCHAR* p_end = p + u16len(p); + const KMX_WCHAR* p_end = p + u16len(p); while (p_end >= p) { if (*p_end == ch) return p_end;