@@ -1039,7 +1039,7 @@ void SymbolDatabase::createSymbolDatabaseVariableSymbolTable()
1039
1039
for (Scope& scope : scopeList) {
1040
1040
// add all variables
1041
1041
for (Variable& var: scope.varlist) {
1042
- const unsigned int varId = var.declarationId();
1042
+ const int varId = var.declarationId();
1043
1043
if (varId)
1044
1044
mVariableList[varId] = &var;
1045
1045
// fix up variables without type
@@ -1055,7 +1055,7 @@ void SymbolDatabase::createSymbolDatabaseVariableSymbolTable()
1055
1055
for (Variable& arg: func.argumentList) {
1056
1056
// check for named parameters
1057
1057
if (arg.nameToken() && arg.declarationId()) {
1058
- const unsigned int declarationId = arg.declarationId();
1058
+ const int declarationId = arg.declarationId();
1059
1059
mVariableList[declarationId] = &arg;
1060
1060
// fix up parameters without type
1061
1061
if (!arg.type() && !arg.typeStartToken()->isStandardType()) {
@@ -2117,7 +2117,7 @@ namespace {
2117
2117
{
2118
2118
if (const Scope* scope = var->nameToken()->scope()) {
2119
2119
auto it = std::find_if(scope->functionList.begin(), scope->functionList.end(), [&](const Function& function) {
2120
- for (std::size_t arg = 0; arg < function.argCount(); ++arg) {
2120
+ for (nonneg int arg = 0; arg < function.argCount(); ++arg) {
2121
2121
if (var == function.getArgumentVar(arg))
2122
2122
return true;
2123
2123
}
@@ -3011,7 +3011,7 @@ bool Function::argsMatch(const Scope *scope, const Token *first, const Token *se
3011
3011
// remove class name
3012
3012
else if (arg_path_length > 2 && first->strAt(1) != second->strAt(1)) {
3013
3013
std::string short_path = path;
3014
- unsigned int short_path_length = arg_path_length;
3014
+ int short_path_length = arg_path_length;
3015
3015
3016
3016
// remove last " :: "
3017
3017
short_path.resize(short_path.size() - 4);
@@ -3034,7 +3034,7 @@ bool Function::argsMatch(const Scope *scope, const Token *first, const Token *se
3034
3034
3035
3035
param = std::move(short_path);
3036
3036
if (Token::simpleMatch(second->next(), param.c_str(), param.size())) {
3037
- second = second->tokAt(int( short_path_length) );
3037
+ second = second->tokAt(short_path_length);
3038
3038
arg_path_length = 0;
3039
3039
}
3040
3040
}
@@ -5961,7 +5961,7 @@ const Function* Scope::findFunction(const Token *tok, bool requireConst, Referen
5961
5961
// Prioritize matches in derived scopes
5962
5962
for (const auto& fb : { fallback1Func, fallback2Func }) {
5963
5963
const Function* ret = nullptr;
5964
- for (int i = 0; i < fb.size(); ++i) {
5964
+ for (std::size_t i = 0; i < fb.size(); ++i) {
5965
5965
if (std::find(matches.cbegin(), matches.cend(), fb[i]) == matches.cend())
5966
5966
continue;
5967
5967
if (this == fb[i]->nestedIn) {
@@ -7144,7 +7144,7 @@ static const Token* parsedecl(const Token* type,
7144
7144
if (settings.debugnormal || settings.debugwarnings)
7145
7145
valuetype->setDebugPath(type, loc);
7146
7146
const Token * const previousType = type;
7147
- const unsigned int pointer0 = valuetype->pointer;
7147
+ const int pointer0 = valuetype->pointer;
7148
7148
while (Token::Match(type->previous(), "%name%") && !endsWith(type->strAt(-1), ':'))
7149
7149
type = type->previous();
7150
7150
valuetype->sign = ValueType::Sign::UNKNOWN_SIGN;
@@ -7477,9 +7477,9 @@ void SymbolDatabase::setValueTypeInTokenList(bool reportDebugWarnings, Token *to
7477
7477
} else if (tok->isBoolean()) {
7478
7478
setValueType(tok, ValueType(ValueType::Sign::UNKNOWN_SIGN, ValueType::Type::BOOL, 0U));
7479
7479
} else if (tok->tokType() == Token::eChar || tok->tokType() == Token::eString) {
7480
- nonneg int const pointer = tok->tokType() == Token::eChar ? 0U : 1U ;
7481
- nonneg int const constness = tok->tokType() == Token::eChar ? 0U : 1U ;
7482
- nonneg int const volatileness = 0U ;
7480
+ nonneg int const pointer = tok->tokType() == Token::eChar ? 0 : 1 ;
7481
+ nonneg int const constness = tok->tokType() == Token::eChar ? 0 : 1 ;
7482
+ nonneg int const volatileness = 0 ;
7483
7483
ValueType valuetype(ValueType::Sign::UNKNOWN_SIGN, ValueType::Type::CHAR, pointer, constness, volatileness);
7484
7484
7485
7485
if (tok->isCpp() && mSettings.standards.cpp >= Standards::CPP20 && tok->isUtf8()) {
0 commit comments