Fixing liblangutil conversion warnings

This commit is contained in:
Djordje Mijovic 2020-06-05 14:30:57 +02:00
parent 18a196c21d
commit 731b2efc97
2 changed files with 3 additions and 3 deletions

View File

@ -107,7 +107,7 @@ tuple<int, int> CharStream::translatePositionToLineColumn(int _position) const
using size_type = string::size_type;
using diff_type = string::difference_type;
size_type searchPosition = min<size_type>(m_source.size(), size_type(_position));
int lineNumber = count(m_source.begin(), m_source.begin() + diff_type(searchPosition), '\n');
int lineNumber = static_cast<int>(count(m_source.begin(), m_source.begin() + diff_type(searchPosition), '\n'));
size_type lineStart;
if (searchPosition == 0)
lineStart = 0;

View File

@ -179,7 +179,7 @@ bool Scanner::scanHexByte(char& o_scannedByte)
rollback(i);
return false;
}
x = x * 16 + d;
x = static_cast<char>(x * 16 + d);
advance();
}
o_scannedByte = x;
@ -197,7 +197,7 @@ std::optional<unsigned> Scanner::scanUnicode()
rollback(i);
return {};
}
x = x * 16 + static_cast<size_t>(d);
x = x * 16 + static_cast<unsigned>(d);
advance();
}
return x;