Fixing additional signedness errors after adding -Wsign-conversion flag

Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
This commit is contained in:
Djordje Mijovic
2020-07-09 17:22:45 +02:00
co-authored by Kamil Śliwak
parent 3c57e04751
commit 547590b972
12 changed files with 20 additions and 20 deletions
+3 -3
View File
@@ -245,14 +245,14 @@ unsigned SemVerMatchExpressionParser::parseVersionPart()
return 0;
else if ('1' <= c && c <= '9')
{
unsigned v(c - '0');
auto v = static_cast<unsigned>(c - '0');
// If we skip to the next token, the current number is terminated.
while (m_pos == startPos && '0' <= currentChar() && currentChar() <= '9')
{
c = currentChar();
if (v * 10 < v || v * 10 + unsigned(c - '0') < v * 10)
if (v * 10 < v || v * 10 + static_cast<unsigned>(c - '0') < v * 10)
throw SemVerError();
v = v * 10 + unsigned(c - '0');
v = v * 10 + static_cast<unsigned>(c - '0');
nextChar();
}
return v;