Skip to content

Commit cf3f8c2

Browse files
Dmitry-Medanmar
authored andcommitted
Refactoring: Replace names with underscores with camelCase names
1 parent 02298bf commit cf3f8c2

File tree

4 files changed

+30
-30
lines changed

4 files changed

+30
-30
lines changed

lib/checkbool.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -290,26 +290,26 @@ void CheckBool::checkComparisonOfBoolWithBool()
290290
for (const Token* tok = scope->classStart->next(); tok != scope->classEnd; tok = tok->next()) {
291291
if (tok->type() != Token::eComparisonOp || tok->str() == "==" || tok->str() == "!=")
292292
continue;
293-
bool first_token_bool = false;
293+
bool firstTokenBool = false;
294294

295-
const Token *first_token = tok->previous();
296-
if (first_token->varId()) {
297-
if (isBool(first_token->variable())) {
298-
first_token_bool = true;
295+
const Token *firstToken = tok->previous();
296+
if (firstToken->varId()) {
297+
if (isBool(firstToken->variable())) {
298+
firstTokenBool = true;
299299
}
300300
}
301-
if (!first_token_bool)
301+
if (!firstTokenBool)
302302
continue;
303303

304-
bool second_token_bool = false;
305-
const Token *second_token = tok->next();
306-
if (second_token->varId()) {
307-
if (isBool(second_token->variable())) {
308-
second_token_bool = true;
304+
bool secondTokenBool = false;
305+
const Token *secondToken = tok->next();
306+
if (secondToken->varId()) {
307+
if (isBool(secondToken->variable())) {
308+
secondTokenBool = true;
309309
}
310310
}
311-
if (second_token_bool) {
312-
comparisonOfBoolWithBoolError(first_token->next(), first_token->str());
311+
if (secondTokenBool) {
312+
comparisonOfBoolWithBoolError(firstToken->next(), secondToken->str());
313313
}
314314
}
315315
}

lib/checkboost.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ void CheckBoost::checkBoostForeachModification()
3434
if (!Token::simpleMatch(tok, "BOOST_FOREACH ("))
3535
continue;
3636

37-
const Token *container_tok = tok->next()->link()->previous();
38-
if (!Token::Match(container_tok, "%var% ) {"))
37+
const Token *containerTok = tok->next()->link()->previous();
38+
if (!Token::Match(containerTok, "%var% ) {"))
3939
continue;
4040

41-
const unsigned int container_id = container_tok->varId();
42-
if (container_id == 0)
41+
const unsigned int containerId = containerTok->varId();
42+
if (containerId == 0)
4343
continue;
4444

45-
const Token *tok2 = container_tok->tokAt(2);
45+
const Token *tok2 = containerTok->tokAt(2);
4646
const Token *end = tok2->link();
4747
for (; tok2 != end; tok2 = tok2->next()) {
48-
if (Token::Match(tok2, "%varid% . insert|erase|push_back|push_front|pop_front|pop_back|clear|swap|resize|assign|merge|remove|remove_if|reverse|sort|splice|unique|pop|push", container_id)) {
48+
if (Token::Match(tok2, "%varid% . insert|erase|push_back|push_front|pop_front|pop_back|clear|swap|resize|assign|merge|remove|remove_if|reverse|sort|splice|unique|pop|push", containerId)) {
4949
const Token* nextStatement = Token::findsimplematch(tok2->linkAt(3), ";", end);
5050
if (!Token::Match(nextStatement, "; break|return|throw"))
5151
boostForeachError(tok2);

lib/checkbufferoverrun.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,12 +1116,12 @@ void CheckBufferOverrun::checkGlobalAndLocalVariable()
11161116

11171117
Token sizeTok(0);
11181118
sizeTok.str(type);
1119-
const MathLib::bigint total_size = size * static_cast<int>(_tokenizer->sizeOfType(&sizeTok));
1120-
if (total_size == 0)
1119+
const MathLib::bigint totalSize = size * static_cast<int>(_tokenizer->sizeOfType(&sizeTok));
1120+
if (totalSize == 0)
11211121
continue;
11221122

11231123
std::vector<std::string> v;
1124-
ArrayInfo temp(var->declarationId(), tok->next()->str(), total_size / size, size);
1124+
ArrayInfo temp(var->declarationId(), tok->next()->str(), totalSize / size, size);
11251125
checkScope(tok->tokAt(nextTok), v, temp);
11261126
}
11271127
}

lib/tokenize.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5696,7 +5696,6 @@ void Tokenizer::simplifyPlatformTypes()
56965696
const Library::PlatformType * const platformtype = _settings->library.platform_type(tok->str(), platform_type);
56975697

56985698
if (platformtype) {
5699-
Token *type_token;
57005699
// check for namespace
57015700
if (tok->strAt(-1) == "::") {
57025701
const Token * tok1 = tok->tokAt(-2);
@@ -5706,31 +5705,32 @@ void Tokenizer::simplifyPlatformTypes()
57065705
tok = tok->tokAt(-1);
57075706
tok->deleteThis();
57085707
}
5708+
Token *typeToken;
57095709
if (platformtype->_const_ptr) {
57105710
tok->str("const");
57115711
tok->insertToken("*");
57125712
tok->insertToken(platformtype->_type);
5713-
type_token = tok;
5713+
typeToken = tok;
57145714
} else if (platformtype->_pointer) {
57155715
tok->str(platformtype->_type);
5716-
type_token = tok;
5716+
typeToken = tok;
57175717
tok->insertToken("*");
57185718
} else if (platformtype->_ptr_ptr) {
57195719
tok->str(platformtype->_type);
5720-
type_token = tok;
5720+
typeToken = tok;
57215721
tok->insertToken("*");
57225722
tok->insertToken("*");
57235723
} else {
57245724
tok->originalName(tok->str());
57255725
tok->str(platformtype->_type);
5726-
type_token = tok;
5726+
typeToken = tok;
57275727
}
57285728
if (platformtype->_signed)
5729-
type_token->isSigned(true);
5729+
typeToken->isSigned(true);
57305730
if (platformtype->_unsigned)
5731-
type_token->isUnsigned(true);
5731+
typeToken->isUnsigned(true);
57325732
if (platformtype->_long)
5733-
type_token->isLong(true);
5733+
typeToken->isLong(true);
57345734
}
57355735
}
57365736
}

0 commit comments

Comments
 (0)