Skip to content

Commit 94c2aa3

Browse files
committed
const
1 parent 753501c commit 94c2aa3

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

externals/simplecpp/simplecpp.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2516,7 +2516,7 @@ static void simplifySizeof(simplecpp::TokenList &expr, const std::map<std::strin
25162516
if (!tok1) {
25172517
throw std::runtime_error("missing sizeof argument");
25182518
}
2519-
simplecpp::Token *tok2 = tok1->next;
2519+
const simplecpp::Token *tok2 = tok1->next;
25202520
if (!tok2) {
25212521
throw std::runtime_error("missing sizeof argument");
25222522
}
@@ -2531,7 +2531,7 @@ static void simplifySizeof(simplecpp::TokenList &expr, const std::map<std::strin
25312531
}
25322532

25332533
std::string type;
2534-
for (simplecpp::Token *typeToken = tok1; typeToken != tok2; typeToken = typeToken->next) {
2534+
for (const simplecpp::Token *typeToken = tok1; typeToken != tok2; typeToken = typeToken->next) {
25352535
if ((typeToken->str() == "unsigned" || typeToken->str() == "signed") && typeToken->next->name)
25362536
continue;
25372537
if (typeToken->str() == "*" && type.find('*') != std::string::npos)
@@ -2586,7 +2586,7 @@ static void simplifyHasInclude(simplecpp::TokenList &expr, const simplecpp::DUI
25862586
if (!tok1) {
25872587
throw std::runtime_error("missing __has_include argument");
25882588
}
2589-
simplecpp::Token *tok2 = tok1->next;
2589+
const simplecpp::Token *tok2 = tok1->next;
25902590
if (!tok2) {
25912591
throw std::runtime_error("missing __has_include argument");
25922592
}
@@ -2604,7 +2604,7 @@ static void simplifyHasInclude(simplecpp::TokenList &expr, const simplecpp::DUI
26042604
const bool systemheader = (tok1 && tok1->op == '<');
26052605
std::string header;
26062606
if (systemheader) {
2607-
simplecpp::Token *tok3 = tok1->next;
2607+
const simplecpp::Token *tok3 = tok1->next;
26082608
if (!tok3) {
26092609
throw std::runtime_error("missing __has_include closing angular bracket");
26102610
}
@@ -2615,7 +2615,7 @@ static void simplifyHasInclude(simplecpp::TokenList &expr, const simplecpp::DUI
26152615
}
26162616
}
26172617

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

0 commit comments

Comments
 (0)