astyle fix

This commit is contained in:
Reijo Tomperi 2010-04-05 20:57:54 +03:00
parent 218c18496d
commit 04b38e5428
3 changed files with 13 additions and 13 deletions

View File

@ -2563,18 +2563,18 @@ void CheckOther::checkMathFunctions()
{ {
mathfunctionCallError(tok); mathfunctionCallError(tok);
} }
// atan2 ( x , y): x and y can not be zero, because this is mathematically not defined // atan2 ( x , y): x and y can not be zero, because this is mathematically not defined
else if (Token::Match(tok, "atan2 ( %num% , %num% )") && else if (Token::Match(tok, "atan2 ( %num% , %num% )") &&
MathLib::isNullValue(tok->tokAt(2)->str()) && MathLib::isNullValue(tok->tokAt(2)->str()) &&
MathLib::isNullValue(tok->tokAt(4)->str())) MathLib::isNullValue(tok->tokAt(4)->str()))
{ {
mathfunctionCallError(tok,2); mathfunctionCallError(tok, 2);
} }
// fmod ( x , y) If y is zero, then either a range error will occur or the function will return zero (implementation-defined). // fmod ( x , y) If y is zero, then either a range error will occur or the function will return zero (implementation-defined).
else if (Token::Match(tok, "fmod ( %num% , %num% )") && else if (Token::Match(tok, "fmod ( %num% , %num% )") &&
MathLib::isNullValue(tok->tokAt(4)->str())) MathLib::isNullValue(tok->tokAt(4)->str()))
{ {
mathfunctionCallError(tok,2); mathfunctionCallError(tok, 2);
} }
} }
@ -2728,11 +2728,11 @@ void CheckOther::mathfunctionCallError(const Token *tok, const unsigned int numP
{ {
if (tok) if (tok)
{ {
if(numParam == 1) if (numParam == 1)
reportError(tok, Severity::error, "wrongmathcall", "Passing value " + tok->tokAt(2)->str() + " to " + tok->str() + "() leads to undefined result"); reportError(tok, Severity::error, "wrongmathcall", "Passing value " + tok->tokAt(2)->str() + " to " + tok->str() + "() leads to undefined result");
else if (numParam == 2) else if (numParam == 2)
reportError(tok, Severity::error, "wrongmathcall", "Passing value " + tok->tokAt(2)->str() + " and " + tok->tokAt(4)->str() + " to " + tok->str() + "() leads to undefined result"); reportError(tok, Severity::error, "wrongmathcall", "Passing value " + tok->tokAt(2)->str() + " and " + tok->tokAt(4)->str() + " to " + tok->str() + "() leads to undefined result");
} }
else else
reportError(tok, Severity::error, "wrongmathcall", "Passing value " " to " "() leads to undefined result"); reportError(tok, Severity::error, "wrongmathcall", "Passing value " " to " "() leads to undefined result");
} }

View File

@ -189,7 +189,7 @@ public:
void uninitdataError(const Token *tok, const std::string &varname); void uninitdataError(const Token *tok, const std::string &varname);
void uninitvarError(const Token *tok, const std::string &varname); void uninitvarError(const Token *tok, const std::string &varname);
void zerodivError(const Token *tok); void zerodivError(const Token *tok);
void mathfunctionCallError(const Token *tok, const unsigned int numParam=1); void mathfunctionCallError(const Token *tok, const unsigned int numParam = 1);
void postIncrementError(const Token *tok, const std::string &var_name, const bool isIncrement); void postIncrementError(const Token *tok, const std::string &var_name, const bool isIncrement);
void getErrorMessages() void getErrorMessages()