Merge pull request #2241 from ngie-eign:fix-wsign-conversion-fallout

PiperOrigin-RevId: 245430295
This commit is contained in:
Gennadiy Civil 2019-04-26 13:04:12 -04:00
commit 61cdca569b
2 changed files with 4 additions and 3 deletions

View File

@ -279,7 +279,7 @@ size_t GetThreadCount() {
#if GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS #if GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
void SleepMilliseconds(int n) { void SleepMilliseconds(int n) {
::Sleep(n); ::Sleep(static_cast<DWORD>(n));
} }
AutoHandle::AutoHandle() AutoHandle::AutoHandle()

View File

@ -144,7 +144,8 @@ inline bool IsPrintableAscii(wchar_t c) {
// which is the type of c. // which is the type of c.
template <typename UnsignedChar, typename Char> template <typename UnsignedChar, typename Char>
static CharFormat PrintAsCharLiteralTo(Char c, ostream* os) { 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': case L'\0':
*os << "\\0"; *os << "\\0";
break; break;
@ -176,7 +177,7 @@ static CharFormat PrintAsCharLiteralTo(Char c, ostream* os) {
*os << "\\v"; *os << "\\v";
break; break;
default: default:
if (IsPrintableAscii(c)) { if (IsPrintableAscii(w_c)) {
*os << static_cast<char>(c); *os << static_cast<char>(c);
return kAsIs; return kAsIs;
} else { } else {