diff options
Diffstat (limited to 'googletest/src/gtest-printers.cc')
-rw-r--r-- | googletest/src/gtest-printers.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/googletest/src/gtest-printers.cc b/googletest/src/gtest-printers.cc index 40a8817e..3337be31 100644 --- a/googletest/src/gtest-printers.cc +++ b/googletest/src/gtest-printers.cc @@ -144,7 +144,8 @@ inline bool IsPrintableAscii(wchar_t c) { // which is the type of c. template <typename UnsignedChar, typename Char> static CharFormat PrintAsCharLiteralTo(Char c, ostream* os) { - switch (static_cast<wchar_t>(c)) { + wchar_t w_c = static_cast<wchar_t>(c); + switch (w_c) { case L'\0': *os << "\\0"; break; @@ -176,7 +177,7 @@ static CharFormat PrintAsCharLiteralTo(Char c, ostream* os) { *os << "\\v"; break; default: - if (IsPrintableAscii(c)) { + if (IsPrintableAscii(w_c)) { *os << static_cast<char>(c); return kAsIs; } else { @@ -236,7 +237,7 @@ void PrintCharAndCodeTo(Char c, ostream* os) { if (format == kHexEscape || (1 <= c && c <= 9)) { // Do nothing. } else { - *os << ", 0x" << String::FormatHexInt(static_cast<UnsignedChar>(c)); + *os << ", 0x" << String::FormatHexInt(static_cast<int>(c)); } *os << ")"; } |