diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 143e6010f..12c1e6188 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -2549,7 +2549,7 @@ void CheckOther::checkExpressionRange(const std::list &constFun for (; it != expressions.getMap().end(); ++it) { // check expression.. bool valid = true; - unsigned int parantheses = 0; // () + unsigned int parenthesis = 0; // () unsigned int brackets = 0; // [] // taking address? @@ -2559,13 +2559,13 @@ void CheckOther::checkExpressionRange(const std::list &constFun for (const Token *tok = it->second.start; tok && tok != it->second.end; tok = tok->next()) { if (tok->str() == "(") { - ++parantheses; + ++parenthesis; } else if (tok->str() == ")") { - if (parantheses == 0) { + if (parenthesis == 0) { valid = false; break; } - --parantheses; + --parenthesis; } else if (tok->str() == "[") { ++brackets; } else if (tok->str() == "]") { @@ -2580,7 +2580,7 @@ void CheckOther::checkExpressionRange(const std::list &constFun } } - if (!valid || parantheses!=0 || brackets!=0) + if (!valid || parenthesis!=0 || brackets!=0) continue; const ExpressionTokens &expr = it->second; diff --git a/lib/symboldatabase.h b/lib/symboldatabase.h index e58f5d99a..a26373626 100644 --- a/lib/symboldatabase.h +++ b/lib/symboldatabase.h @@ -363,7 +363,7 @@ private: /** @brief array dimensions */ std::vector _dimensions; - /** @brief fill in information, depending on Tokens given at instanciation */ + /** @brief fill in information, depending on Tokens given at instantiation */ void evaluate(); }; diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index ae9fb5b7d..1d1011bcd 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -7388,17 +7388,17 @@ bool Tokenizer::isFunctionParameterPassedByValue(const Token *fpar) const const Token *ftok; // Look at function call, what parameter number is it? - unsigned int paranthesis = 1; + unsigned int parenthesis = 1; unsigned int parameter = 1; for (ftok = fpar; ftok; ftok = ftok->previous()) { if (ftok->str() == "(") { - --paranthesis; - if (paranthesis == 0) { + --parenthesis; + if (parenthesis == 0) { break; } } else if (ftok->str() == ")") { - ++paranthesis; - } else if (paranthesis == 1 && ftok->str() == ",") { + ++parenthesis; + } else if (parenthesis == 1 && ftok->str() == ",") { ++parameter; } else if (Token::Match(ftok, "[;{}]")) { break; diff --git a/test/testother.cpp b/test/testother.cpp index c481f84f1..006ff23d4 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -142,7 +142,7 @@ private: TEST_CASE(duplicateIf); TEST_CASE(duplicateIf1); // ticket 3689 TEST_CASE(duplicateBranch); - TEST_CASE(duplicateBranch1); // tests extracted by http://www.viva64.com/en/b/0149/ ( Comparision between PVS-Studio and cppcheck ): Errors detected in Quake 3: Arena by PVS-Studio: Fragement 2 + TEST_CASE(duplicateBranch1); // tests extracted by http://www.viva64.com/en/b/0149/ ( Comparison between PVS-Studio and cppcheck ): Errors detected in Quake 3: Arena by PVS-Studio: Fragement 2 TEST_CASE(duplicateExpression1); TEST_CASE(duplicateExpression2); // ticket #2730 TEST_CASE(duplicateExpression3); // ticket #3317 @@ -4070,7 +4070,7 @@ private: void duplicateBranch1() { - // tests inspired by http://www.viva64.com/en/b/0149/ ( Comparision between PVS-Studio and cppcheck ) + // tests inspired by http://www.viva64.com/en/b/0149/ ( Comparison between PVS-Studio and cppcheck ) // Errors detected in Quake 3: Arena by PVS-Studio: Fragement 2 check("void f()\n" "{\n"