diff options
author | Ayush Joshi <ayush854032@gmail.com> | 2022-01-01 13:58:21 (GMT) |
---|---|---|
committer | Ayush Joshi <ayush854032@gmail.com> | 2022-01-01 13:58:21 (GMT) |
commit | 1b4cf359589d51bd244a779d082589536e2a6c9b (patch) | |
tree | 71fffcee460c7910169e5a6ffdcd039cb568bc5f /googletest/src | |
parent | 6b74da4757a549563d7c37c8fae3e704662a043b (diff) | |
download | googletest-1b4cf359589d51bd244a779d082589536e2a6c9b.zip googletest-1b4cf359589d51bd244a779d082589536e2a6c9b.tar.gz googletest-1b4cf359589d51bd244a779d082589536e2a6c9b.tar.bz2 |
FIX #3719 -- Fix `clang` conversion warningsrefs/pull/3721/head
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 <ayush854032@gmail.com>
Diffstat (limited to 'googletest/src')
-rw-r--r-- | googletest/src/gtest.cc | 7 |
1 files 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<unsigned char>(ch))) { + if (is_attribute && IsNormalizableWhitespace( + static_cast<unsigned char>(ch))) m << "&#x" << String::FormatByte(static_cast<unsigned char>(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<unsigned char>(*it))) output.push_back(*it); return output; |