From 1b4cf359589d51bd244a779d082589536e2a6c9b Mon Sep 17 00:00:00 2001 From: Ayush Joshi Date: Sat, 1 Jan 2022 19:28:21 +0530 Subject: FIX #3719 -- Fix `clang` conversion warnings We should perform an explicit type conversion to `unsigned char` before passing the `const char` data to `IsValidXmlCharacter()` and `IsNormalizableWhitespace()` functions in order to avoid compile time conversion warnings Signed-off-by: Ayush Joshi --- googletest/src/gtest.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index d1ccd17..8df3cce 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -4079,8 +4079,9 @@ std::string XmlUnitTestResultPrinter::EscapeXml( m << '"'; break; default: - if (IsValidXmlCharacter(ch)) { - if (is_attribute && IsNormalizableWhitespace(ch)) + if (IsValidXmlCharacter(static_cast(ch))) { + if (is_attribute && IsNormalizableWhitespace( + static_cast(ch))) m << "&#x" << String::FormatByte(static_cast(ch)) << ";"; else @@ -4101,7 +4102,7 @@ std::string XmlUnitTestResultPrinter::RemoveInvalidXmlCharacters( std::string output; output.reserve(str.size()); for (std::string::const_iterator it = str.begin(); it != str.end(); ++it) - if (IsValidXmlCharacter(*it)) + if (IsValidXmlCharacter(static_cast(*it))) output.push_back(*it); return output; -- cgit v0.12