astyle formatting

This commit is contained in:
Daniel Marjamäki 2015-06-05 14:34:53 +02:00
parent e36cc9f6d9
commit d208e763df
2 changed files with 10 additions and 11 deletions

View File

@ -542,7 +542,7 @@ Token *Tokenizer::processFunc(Token *tok2, bool inOperator) const
if (tok2->str() == "(" && if (tok2->str() == "(" &&
tok2->link()->next() && tok2->link()->next() &&
tok2->link()->next()->str() == "(") { tok2->link()->next()->str() == "(") {
tok2 = tok2->link(); tok2 = tok2->link();
if (tok2->next()->str() == "(") if (tok2->next()->str() == "(")
@ -552,8 +552,7 @@ Token *Tokenizer::processFunc(Token *tok2, bool inOperator) const
// skip over typedef parameter // skip over typedef parameter
if (tok2->next() && tok2->next()->str() == "(") { if (tok2->next() && tok2->next()->str() == "(") {
tok2 = tok2->next()->link(); tok2 = tok2->next()->link();
if (!tok2->next()) if (!tok2->next()) {
{
syntaxError(tok2); syntaxError(tok2);
return nullptr; return nullptr;
} }
@ -1530,8 +1529,8 @@ void Tokenizer::simplifyTypedef()
simplifyType = false; simplifyType = false;
} }
if (!tok2) if (!tok2)
break; break;
} }
if (tok->str() == ";") if (tok->str() == ";")

View File

@ -115,9 +115,9 @@ private:
TEST_CASE(garbageCode74); TEST_CASE(garbageCode74);
TEST_CASE(garbageCode75); TEST_CASE(garbageCode75);
TEST_CASE(garbageCode76); TEST_CASE(garbageCode76);
TEST_CASE(garbageCode77); TEST_CASE(garbageCode77);
TEST_CASE(garbageCode78); TEST_CASE(garbageCode78);
TEST_CASE(garbageCode79); TEST_CASE(garbageCode79);
TEST_CASE(garbageValueFlow); TEST_CASE(garbageValueFlow);
TEST_CASE(garbageSymbolDatabase); TEST_CASE(garbageSymbolDatabase);
@ -643,15 +643,15 @@ private:
checkCode(" ( ) ( ) { ( ) [ ] } TEST ( ) { ( _broadcast_f32x4 ) ( ) ( ) ( ) ( ) if ( ) ( ) ; } E mask = ( ) [ ] ( ) res1.x ="); checkCode(" ( ) ( ) { ( ) [ ] } TEST ( ) { ( _broadcast_f32x4 ) ( ) ( ) ( ) ( ) if ( ) ( ) ; } E mask = ( ) [ ] ( ) res1.x =");
} }
void garbageCode77() { // #6755 void garbageCode77() { // #6755
checkCode("void foo (int **p) { { { };>= } } unsigned *d = (b b--) --*d"); checkCode("void foo (int **p) { { { };>= } } unsigned *d = (b b--) --*d");
} }
void garbageCode78() { // #6756 void garbageCode78() { // #6756
checkCode("( ) { [ ] } ( ) { } const_array_of_int ( ) { } typedef int A [ ] [ ] ; A a = { { } { } }"); checkCode("( ) { [ ] } ( ) { } const_array_of_int ( ) { } typedef int A [ ] [ ] ; A a = { { } { } }");
} }
void garbageCode79() { // #6757 void garbageCode79() { // #6757
ASSERT_THROW(checkCode("{ } { } typedef void ( func_type ) ( ) ; func_type & ( )"), InternalError); ASSERT_THROW(checkCode("{ } { } typedef void ( func_type ) ( ) ; func_type & ( )"), InternalError);
} }