Skip to content

Commit e26e045

Browse files
committed
const
1 parent b4587ff commit e26e045

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

lib/symboldatabase.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2296,7 +2296,7 @@ Variable& Variable::operator=(const Variable &var) &
22962296
if (this == &var)
22972297
return *this;
22982298

2299-
ValueType* vt = nullptr;
2299+
const ValueType* vt = nullptr;
23002300
if (var.mValueType)
23012301
vt = new ValueType(*var.mValueType);
23022302

@@ -2462,7 +2462,7 @@ void Variable::setValueType(const ValueType &valueType)
24622462
if (declType && !declType->next()->valueType())
24632463
return;
24642464
}
2465-
auto* vt = new ValueType(valueType);
2465+
const auto* vt = new ValueType(valueType);
24662466
delete mValueType;
24672467
mValueType = vt;
24682468
if ((mValueType->pointer > 0) && (!isArray() || Token::Match(mNameToken->previous(), "( * %name% )")))

lib/tokenize.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,7 +1243,7 @@ void Tokenizer::simplifyTypedefCpp()
12431243
bool refToArray = false;
12441244
bool ptrMember = false;
12451245
bool typeOf = false;
1246-
Token *namespaceStart = nullptr;
1246+
const Token *namespaceStart = nullptr;
12471247
Token *namespaceEnd = nullptr;
12481248

12491249
// check for invalid input
@@ -3025,7 +3025,7 @@ bool Tokenizer::simplifyUsing()
30253025
ScopeInfo3 scopeInfo1;
30263026
ScopeInfo3 *currentScope1 = &scopeInfo1;
30273027
Token *startToken = list.front();
3028-
Token *endToken = nullptr;
3028+
const Token *endToken = nullptr;
30293029
bool inMemberFunc = false;
30303030
const ScopeInfo3 * memberFuncScope = nullptr;
30313031
const Token * memberFuncEnd = nullptr;
@@ -3039,7 +3039,7 @@ bool Tokenizer::simplifyUsing()
30393039
if (!currentScope1)
30403040
return substitute; // something bad happened
30413041
startToken = usingEnd->next();
3042-
endToken = const_cast<Token*>(currentScope->bodyEnd->next());
3042+
endToken = currentScope->bodyEnd->next();
30433043
if (currentScope->type == ScopeInfo3::MemberFunction) {
30443044
const ScopeInfo3 * temp = currentScope->findScope(currentScope->fullName);
30453045
if (temp) {

0 commit comments

Comments
 (0)