Fix compiler warnings about type mismatch

This commit is contained in:
Alexander Mai 2014-07-08 21:47:22 +02:00
parent 14def42c99
commit df95cd09f0
2 changed files with 3 additions and 3 deletions

View File

@ -287,7 +287,7 @@ static bool checkMinSizes(const std::list<Library::ArgumentChecks::MinSize> &min
case Library::ArgumentChecks::MinSize::ARGVALUE:
if (Token::Match(argtok, "%num% ,|)")) {
const MathLib::bigint sz = MathLib::toLongNumber(argtok->str());
if (sz > arraySize)
if ((std::size_t)sz > arraySize)
error = true;
} else if (argtok->type() == Token::eChar && Token::Match(argtok->next(), ",|)") && charSizeToken)
*charSizeToken = argtok; //sizeArgumentAsCharError(argtok);
@ -296,7 +296,7 @@ static bool checkMinSizes(const std::list<Library::ArgumentChecks::MinSize> &min
// TODO: handle arbitrary arg2
if (minsize->arg2 == minsize->arg+1 && Token::Match(argtok, "%num% , %num% ,|)")) {
const MathLib::bigint sz = MathLib::toLongNumber(argtok->str()) * MathLib::toLongNumber(argtok->strAt(2));
if (sz > arraySize)
if ((std::size_t)sz > arraySize)
error = true;
}
break;

View File

@ -77,7 +77,7 @@ unsigned int TokenList::appendFileIfNew(const std::string &fileName)
// Has this file been tokenized already?
for (std::size_t i = 0; i < _files.size(); ++i)
if (Path::sameFileName(_files[i], fileName))
return i;
return (unsigned int)i;
// The "_files" vector remembers what files have been tokenized..
_files.push_back(Path::simplifyPath(fileName));