DJGPP: Fixed a few compiler errors by using std::size_t instead of size_t
This commit is contained in:
parent
345220b36f
commit
2e08c8c5b1
|
@ -154,10 +154,10 @@ public:
|
|||
}
|
||||
|
||||
/** array size */
|
||||
MathLib::bigint num(size_t index) const {
|
||||
MathLib::bigint num(std::size_t index) const {
|
||||
return _num[index];
|
||||
}
|
||||
void num(size_t index, MathLib::bigint number) {
|
||||
void num(std::size_t index, MathLib::bigint number) {
|
||||
_num[index] = number;
|
||||
}
|
||||
|
||||
|
|
|
@ -2148,15 +2148,15 @@ void CheckOther::checkIncorrectStringCompare()
|
|||
{
|
||||
for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next()) {
|
||||
if (Token::Match(tok, ". substr ( %any% , %num% ) ==|!= %str%")) {
|
||||
size_t clen = MathLib::toLongNumber(tok->strAt(5));
|
||||
size_t slen = Token::getStrLength(tok->tokAt(8));
|
||||
std::size_t clen = MathLib::toLongNumber(tok->strAt(5));
|
||||
std::size_t slen = Token::getStrLength(tok->tokAt(8));
|
||||
if (clen != slen) {
|
||||
incorrectStringCompareError(tok->next(), "substr", tok->strAt(8), tok->strAt(5));
|
||||
}
|
||||
}
|
||||
if (Token::Match(tok, "%str% ==|!= %var% . substr ( %any% , %num% )")) {
|
||||
size_t clen = MathLib::toLongNumber(tok->strAt(8));
|
||||
size_t slen = Token::getStrLength(tok);
|
||||
std::size_t clen = MathLib::toLongNumber(tok->strAt(8));
|
||||
std::size_t slen = Token::getStrLength(tok);
|
||||
if (clen != slen) {
|
||||
incorrectStringCompareError(tok->next(), "substr", tok->str(), tok->strAt(8));
|
||||
}
|
||||
|
@ -2566,7 +2566,7 @@ void CheckOther::checkAlwaysTrueOrFalseStringCompare()
|
|||
|
||||
void CheckOther::alwaysTrueFalseStringCompareError(const Token *tok, const std::string& str1, const std::string& str2)
|
||||
{
|
||||
const size_t stringLen = 10;
|
||||
const std::size_t stringLen = 10;
|
||||
const std::string string1 = (str1.size() < stringLen) ? str1 : (str1.substr(0, stringLen-2) + "..");
|
||||
const std::string string2 = (str2.size() < stringLen) ? str2 : (str2.substr(0, stringLen-2) + "..");
|
||||
|
||||
|
|
|
@ -295,7 +295,7 @@ public:
|
|||
* Get array dimension length.
|
||||
* @return length of dimension
|
||||
*/
|
||||
MathLib::bigint dimension(size_t index_) const {
|
||||
MathLib::bigint dimension(std::size_t index_) const {
|
||||
return _dimensions[index_].num;
|
||||
}
|
||||
|
||||
|
@ -353,7 +353,7 @@ public:
|
|||
functionScope(NULL) {
|
||||
}
|
||||
|
||||
size_t argCount() const {
|
||||
std::size_t argCount() const {
|
||||
return argumentList.size();
|
||||
}
|
||||
unsigned int initializedArgCount() const;
|
||||
|
|
|
@ -737,7 +737,7 @@ bool Token::Match(const Token *tok, const char pattern[], unsigned int varid)
|
|||
return true;
|
||||
}
|
||||
|
||||
size_t Token::getStrLength(const Token *tok)
|
||||
std::size_t Token::getStrLength(const Token *tok)
|
||||
{
|
||||
assert(tok != NULL);
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ public:
|
|||
*
|
||||
* @param tok token with C-string
|
||||
**/
|
||||
static size_t getStrLength(const Token *tok);
|
||||
static std::size_t getStrLength(const Token *tok);
|
||||
|
||||
bool isName() const {
|
||||
return _isName;
|
||||
|
|
Loading…
Reference in New Issue