astyle fix

This commit is contained in:
Reijo Tomperi 2009-08-29 23:33:12 +03:00
parent d3118d85c0
commit fc343b3e9e
3 changed files with 6 additions and 6 deletions

View File

@ -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();

View File

@ -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("&&");
}

View File

@ -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()