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 <ayush854032@gmail.com>
This commit is contained in:
parent
6b74da4757
commit
1b4cf35958
@ -4079,8 +4079,9 @@ std::string XmlUnitTestResultPrinter::EscapeXml(
|
|||||||
m << '"';
|
m << '"';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (IsValidXmlCharacter(ch)) {
|
if (IsValidXmlCharacter(static_cast<unsigned char>(ch))) {
|
||||||
if (is_attribute && IsNormalizableWhitespace(ch))
|
if (is_attribute && IsNormalizableWhitespace(
|
||||||
|
static_cast<unsigned char>(ch)))
|
||||||
m << "&#x" << String::FormatByte(static_cast<unsigned char>(ch))
|
m << "&#x" << String::FormatByte(static_cast<unsigned char>(ch))
|
||||||
<< ";";
|
<< ";";
|
||||||
else
|
else
|
||||||
@ -4101,7 +4102,7 @@ std::string XmlUnitTestResultPrinter::RemoveInvalidXmlCharacters(
|
|||||||
std::string output;
|
std::string output;
|
||||||
output.reserve(str.size());
|
output.reserve(str.size());
|
||||||
for (std::string::const_iterator it = str.begin(); it != str.end(); ++it)
|
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);
|
output.push_back(*it);
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
|
Loading…
Reference in New Issue
Block a user