mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fixing additional signedness errors after adding -Wsign-conversion flag
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
This commit is contained in:
co-authored by
Kamil Śliwak
parent
3c57e04751
commit
547590b972
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user