summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGennadiy Civil <misterg@google.com>2019-04-26 13:04:12 -0400
committerGennadiy Civil <misterg@google.com>2019-04-26 13:04:12 -0400
commit61cdca569b1f7e4629f8b949f0a9606c28281a6b (patch)
tree624f15a4435e8684042cd2004bd0df57aeaaa374
parent84d986531e8df9fb6ea4a7bae8fb130c05b3782c (diff)
parentbd47c09b73d40f210238b73f925a8f9196e70675 (diff)
downloadgoogletest-61cdca569b1f7e4629f8b949f0a9606c28281a6b.tar.gz
googletest-61cdca569b1f7e4629f8b949f0a9606c28281a6b.zip
Merge pull request #2241 from ngie-eign:fix-wsign-conversion-fallout
PiperOrigin-RevId: 245430295
-rw-r--r--googletest/src/gtest-port.cc2
-rw-r--r--googletest/src/gtest-printers.cc5
2 files changed, 4 insertions, 3 deletions
diff --git a/googletest/src/gtest-port.cc b/googletest/src/gtest-port.cc
index e5b91fd0..4015a1c1 100644
--- a/googletest/src/gtest-port.cc
+++ b/googletest/src/gtest-port.cc
@@ -279,7 +279,7 @@ size_t GetThreadCount() {
#if GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
void SleepMilliseconds(int n) {
- ::Sleep(n);
+ ::Sleep(static_cast<DWORD>(n));
}
AutoHandle::AutoHandle()
diff --git a/googletest/src/gtest-printers.cc b/googletest/src/gtest-printers.cc
index 40a8817e..a7c5e002 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 {
OpenPOWER on IntegriCloud