summaryrefslogtreecommitdiffstats
path: root/googletest/src/gtest-printers.cc
diff options
context:
space:
mode:
authorEnji Cooper <yaneurabeya@gmail.com>2019-04-26 10:59:54 (GMT)
committerEnji Cooper <yaneurabeya@gmail.com>2019-04-26 11:08:16 (GMT)
commitbd47c09b73d40f210238b73f925a8f9196e70675 (patch)
tree624f15a4435e8684042cd2004bd0df57aeaaa374 /googletest/src/gtest-printers.cc
parent84d986531e8df9fb6ea4a7bae8fb130c05b3782c (diff)
downloadgoogletest-bd47c09b73d40f210238b73f925a8f9196e70675.zip
googletest-bd47c09b73d40f210238b73f925a8f9196e70675.tar.gz
googletest-bd47c09b73d40f210238b73f925a8f9196e70675.tar.bz2
Address fallout from -Wsign-conversion work on Windowsrefs/pull/2241/head
Some Windows users builds were broken after a0d60be. This change addresses the lingering -Wsign-conversion issues with those platforms by adding some missing `static_cast` calls as needed. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
Diffstat (limited to 'googletest/src/gtest-printers.cc')
-rw-r--r--googletest/src/gtest-printers.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/googletest/src/gtest-printers.cc b/googletest/src/gtest-printers.cc
index 40a8817..a7c5e00 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 {