Sweep out some Wsign-conversion warnings

This commit is contained in:
Martin Hořeňovský
2021-11-23 23:16:08 +01:00
parent 9952f29f01
commit 8cb8f0b08b
15 changed files with 43 additions and 41 deletions
+2 -2
View File
@@ -87,7 +87,7 @@ namespace {
// (see: http://www.w3.org/TR/xml/#syntax)
for( std::size_t idx = 0; idx < m_str.size(); ++ idx ) {
unsigned char c = m_str[idx];
unsigned char c = static_cast<unsigned char>(m_str[idx]);
switch (c) {
case '<': os << "&lt;"; break;
case '&': os << "&amp;"; break;
@@ -147,7 +147,7 @@ namespace {
bool valid = true;
uint32_t value = headerValue(c);
for (std::size_t n = 1; n < encBytes; ++n) {
unsigned char nc = m_str[idx + n];
unsigned char nc = static_cast<unsigned char>(m_str[idx + n]);
valid &= ((nc & 0xC0) == 0x80);
value = (value << 6) | (nc & 0x3F);
}