astyle fix
This commit is contained in:
parent
d3118d85c0
commit
fc343b3e9e
|
@ -627,7 +627,7 @@ Token *CheckMemoryLeakInFunction::getcode(const Token *tok, std::list<const Toke
|
|||
if (parlevel == 0 && tok->str() == ";")
|
||||
addtoken(";");
|
||||
|
||||
// var = strcpy|.. ( var ,
|
||||
// var = strcpy|.. ( var ,
|
||||
if (Token::Match(tok, "[;{}] %varid% = memcpy|memmove|memset|strcpy|strncpy|strcat|strncat ( %varid% ,", varid))
|
||||
{
|
||||
tok = tok->tokAt(4)->link();
|
||||
|
|
|
@ -2789,7 +2789,7 @@ void Tokenizer::simplifyLogicalOperators()
|
|||
// "%var%|) and %var%|("
|
||||
else if (tok->str() == "and" &&
|
||||
((Token::Match(tok->previous(), "%var%") || tok->previous()->str() == ")") ||
|
||||
(Token::Match(tok->next(), "%var%") || tok->next()->str() == "(")))
|
||||
(Token::Match(tok->next(), "%var%") || tok->next()->str() == "(")))
|
||||
{
|
||||
tok->str("&&");
|
||||
}
|
||||
|
|
|
@ -1037,16 +1037,16 @@ private:
|
|||
void and1()
|
||||
{
|
||||
ASSERT_EQUALS("if ( p && q ) ;",
|
||||
simplifyLogicalOperators("if (p and q) ;"));
|
||||
simplifyLogicalOperators("if (p and q) ;"));
|
||||
|
||||
ASSERT_EQUALS("if ( foo ( ) && q ) ;",
|
||||
simplifyLogicalOperators("if (foo() and q) ;"));
|
||||
simplifyLogicalOperators("if (foo() and q) ;"));
|
||||
|
||||
ASSERT_EQUALS("if ( foo ( ) && bar ( ) ) ;",
|
||||
simplifyLogicalOperators("if (foo() and bar()) ;"));
|
||||
simplifyLogicalOperators("if (foo() and bar()) ;"));
|
||||
|
||||
ASSERT_EQUALS("if ( p && bar ( ) ) ;",
|
||||
simplifyLogicalOperators("if (p and bar()) ;"));
|
||||
simplifyLogicalOperators("if (p and bar()) ;"));
|
||||
}
|
||||
|
||||
void comma_keyword()
|
||||
|
|
Loading…
Reference in New Issue