Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 74e91afd authored by Krzysztof Kosiński's avatar Krzysztof Kosiński Committed by Android (Google) Code Review
Browse files

Merge "Print AIDL 'char' values as numbers." into main

parents 98ab533a 1f53d74b
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -150,12 +150,8 @@ std::string ToString(const _T& t) {
    if constexpr (std::is_same_v<bool, _T>) {
        return t ? "true" : "false";
    } else if constexpr (std::is_same_v<char16_t, _T>) {
        // TODO(b/244494451): codecvt is deprecated in C++17 -- suppress the
        // warnings. There's no replacement in the standard library yet.
        _Pragma("clang diagnostic push")
                _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"");
        return std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t>().to_bytes(t);
        _Pragma("clang diagnostic pop");
        // 'char' fields in AIDL are nearly always used for 16-bit numeric values.
        return std::to_string(static_cast<int>(t));
    } else if constexpr (std::is_arithmetic_v<_T>) {
        return std::to_string(t);
    } else if constexpr (std::is_same_v<std::string, _T>) {