spelling fixes
This commit is contained in:
parent
dce16a970d
commit
98d608231d
|
@ -2549,7 +2549,7 @@ void CheckOther::checkExpressionRange(const std::list<const Function*> &constFun
|
||||||
for (; it != expressions.getMap().end(); ++it) {
|
for (; it != expressions.getMap().end(); ++it) {
|
||||||
// check expression..
|
// check expression..
|
||||||
bool valid = true;
|
bool valid = true;
|
||||||
unsigned int parantheses = 0; // ()
|
unsigned int parenthesis = 0; // ()
|
||||||
unsigned int brackets = 0; // []
|
unsigned int brackets = 0; // []
|
||||||
|
|
||||||
// taking address?
|
// taking address?
|
||||||
|
@ -2559,13 +2559,13 @@ void CheckOther::checkExpressionRange(const std::list<const Function*> &constFun
|
||||||
|
|
||||||
for (const Token *tok = it->second.start; tok && tok != it->second.end; tok = tok->next()) {
|
for (const Token *tok = it->second.start; tok && tok != it->second.end; tok = tok->next()) {
|
||||||
if (tok->str() == "(") {
|
if (tok->str() == "(") {
|
||||||
++parantheses;
|
++parenthesis;
|
||||||
} else if (tok->str() == ")") {
|
} else if (tok->str() == ")") {
|
||||||
if (parantheses == 0) {
|
if (parenthesis == 0) {
|
||||||
valid = false;
|
valid = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
--parantheses;
|
--parenthesis;
|
||||||
} else if (tok->str() == "[") {
|
} else if (tok->str() == "[") {
|
||||||
++brackets;
|
++brackets;
|
||||||
} else if (tok->str() == "]") {
|
} else if (tok->str() == "]") {
|
||||||
|
@ -2580,7 +2580,7 @@ void CheckOther::checkExpressionRange(const std::list<const Function*> &constFun
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!valid || parantheses!=0 || brackets!=0)
|
if (!valid || parenthesis!=0 || brackets!=0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const ExpressionTokens &expr = it->second;
|
const ExpressionTokens &expr = it->second;
|
||||||
|
|
|
@ -363,7 +363,7 @@ private:
|
||||||
/** @brief array dimensions */
|
/** @brief array dimensions */
|
||||||
std::vector<Dimension> _dimensions;
|
std::vector<Dimension> _dimensions;
|
||||||
|
|
||||||
/** @brief fill in information, depending on Tokens given at instanciation */
|
/** @brief fill in information, depending on Tokens given at instantiation */
|
||||||
void evaluate();
|
void evaluate();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -7388,17 +7388,17 @@ bool Tokenizer::isFunctionParameterPassedByValue(const Token *fpar) const
|
||||||
const Token *ftok;
|
const Token *ftok;
|
||||||
|
|
||||||
// Look at function call, what parameter number is it?
|
// Look at function call, what parameter number is it?
|
||||||
unsigned int paranthesis = 1;
|
unsigned int parenthesis = 1;
|
||||||
unsigned int parameter = 1;
|
unsigned int parameter = 1;
|
||||||
for (ftok = fpar; ftok; ftok = ftok->previous()) {
|
for (ftok = fpar; ftok; ftok = ftok->previous()) {
|
||||||
if (ftok->str() == "(") {
|
if (ftok->str() == "(") {
|
||||||
--paranthesis;
|
--parenthesis;
|
||||||
if (paranthesis == 0) {
|
if (parenthesis == 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (ftok->str() == ")") {
|
} else if (ftok->str() == ")") {
|
||||||
++paranthesis;
|
++parenthesis;
|
||||||
} else if (paranthesis == 1 && ftok->str() == ",") {
|
} else if (parenthesis == 1 && ftok->str() == ",") {
|
||||||
++parameter;
|
++parameter;
|
||||||
} else if (Token::Match(ftok, "[;{}]")) {
|
} else if (Token::Match(ftok, "[;{}]")) {
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -142,7 +142,7 @@ private:
|
||||||
TEST_CASE(duplicateIf);
|
TEST_CASE(duplicateIf);
|
||||||
TEST_CASE(duplicateIf1); // ticket 3689
|
TEST_CASE(duplicateIf1); // ticket 3689
|
||||||
TEST_CASE(duplicateBranch);
|
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(duplicateExpression1);
|
||||||
TEST_CASE(duplicateExpression2); // ticket #2730
|
TEST_CASE(duplicateExpression2); // ticket #2730
|
||||||
TEST_CASE(duplicateExpression3); // ticket #3317
|
TEST_CASE(duplicateExpression3); // ticket #3317
|
||||||
|
@ -4070,7 +4070,7 @@ private:
|
||||||
|
|
||||||
void duplicateBranch1() {
|
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
|
// Errors detected in Quake 3: Arena by PVS-Studio: Fragement 2
|
||||||
check("void f()\n"
|
check("void f()\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
|
|
Loading…
Reference in New Issue