Fixed gcc compiler warnings
This commit is contained in:
parent
fb3115a199
commit
69d3d4a17d
|
@ -2170,14 +2170,14 @@ void CheckOther::checkIncorrectStringCompare()
|
||||||
if (Token::Match(tok, ". substr ( %any% , %num% ) ==|!= %str%")) {
|
if (Token::Match(tok, ". substr ( %any% , %num% ) ==|!= %str%")) {
|
||||||
MathLib::bigint clen = MathLib::toLongNumber(tok->strAt(5));
|
MathLib::bigint clen = MathLib::toLongNumber(tok->strAt(5));
|
||||||
std::size_t slen = Token::getStrLength(tok->tokAt(8));
|
std::size_t slen = Token::getStrLength(tok->tokAt(8));
|
||||||
if (clen != slen) {
|
if (clen != (int)slen) {
|
||||||
incorrectStringCompareError(tok->next(), "substr", tok->strAt(8), tok->strAt(5));
|
incorrectStringCompareError(tok->next(), "substr", tok->strAt(8), tok->strAt(5));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Token::Match(tok, "%str% ==|!= %var% . substr ( %any% , %num% )")) {
|
if (Token::Match(tok, "%str% ==|!= %var% . substr ( %any% , %num% )")) {
|
||||||
MathLib::bigint clen = MathLib::toLongNumber(tok->strAt(8));
|
MathLib::bigint clen = MathLib::toLongNumber(tok->strAt(8));
|
||||||
std::size_t slen = Token::getStrLength(tok);
|
std::size_t slen = Token::getStrLength(tok);
|
||||||
if (clen != slen) {
|
if (clen != (int)slen) {
|
||||||
incorrectStringCompareError(tok->next(), "substr", tok->str(), tok->strAt(8));
|
incorrectStringCompareError(tok->next(), "substr", tok->str(), tok->strAt(8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue