Skip to content

Commit 9c571e0

Browse files
Update simplecpp.cpp
1 parent 04f4dfa commit 9c571e0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

simplecpp.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2514,7 +2514,7 @@ static void simplifySizeof(simplecpp::TokenList &expr, const std::map<std::strin
25142514
if (!tok1) {
25152515
throw std::runtime_error("missing sizeof argument");
25162516
}
2517-
simplecpp::Token *tok2 = tok1->next;
2517+
const simplecpp::Token *tok2 = tok1->next;
25182518
if (!tok2) {
25192519
throw std::runtime_error("missing sizeof argument");
25202520
}
@@ -2529,7 +2529,7 @@ static void simplifySizeof(simplecpp::TokenList &expr, const std::map<std::strin
25292529
}
25302530

25312531
std::string type;
2532-
for (simplecpp::Token *typeToken = tok1; typeToken != tok2; typeToken = typeToken->next) {
2532+
for (const simplecpp::Token *typeToken = tok1; typeToken != tok2; typeToken = typeToken->next) {
25332533
if ((typeToken->str() == "unsigned" || typeToken->str() == "signed") && typeToken->next->name)
25342534
continue;
25352535
if (typeToken->str() == "*" && type.find('*') != std::string::npos)
@@ -2584,7 +2584,7 @@ static void simplifyHasInclude(simplecpp::TokenList &expr, const simplecpp::DUI
25842584
if (!tok1) {
25852585
throw std::runtime_error("missing __has_include argument");
25862586
}
2587-
simplecpp::Token *tok2 = tok1->next;
2587+
const simplecpp::Token *tok2 = tok1->next;
25882588
if (!tok2) {
25892589
throw std::runtime_error("missing __has_include argument");
25902590
}
@@ -2602,7 +2602,7 @@ static void simplifyHasInclude(simplecpp::TokenList &expr, const simplecpp::DUI
26022602
const bool systemheader = (tok1 && tok1->op == '<');
26032603
std::string header;
26042604
if (systemheader) {
2605-
simplecpp::Token *tok3 = tok1->next;
2605+
const simplecpp::Token *tok3 = tok1->next;
26062606
if (!tok3) {
26072607
throw std::runtime_error("missing __has_include closing angular bracket");
26082608
}
@@ -2613,7 +2613,7 @@ static void simplifyHasInclude(simplecpp::TokenList &expr, const simplecpp::DUI
26132613
}
26142614
}
26152615

2616-
for (simplecpp::Token *headerToken = tok1->next; headerToken != tok3; headerToken = headerToken->next)
2616+
for (const simplecpp::Token *headerToken = tok1->next; headerToken != tok3; headerToken = headerToken->next)
26172617
header += headerToken->str();
26182618
} else {
26192619
header = tok1->str().substr(1U, tok1->str().size() - 2U);

0 commit comments

Comments
 (0)