astyle formatting

This commit is contained in:
Daniel Marjamäki 2010-02-18 19:55:47 +01:00
parent b59d79c303
commit 375d2b1fcd
3 changed files with 14 additions and 14 deletions

View File

@ -394,11 +394,11 @@ void CheckOther::unreachableCode()
break; break;
// If there is a statement below the return it is unreachable // If there is a statement below the return it is unreachable
/* original: /* original:
if (!Token::Match(tok, "; case|default|}|#") && if (!Token::Match(tok, "; case|default|}|#") &&
!Token::Match(tok, "; %var% :") && !Token::Match(tok, "; %var% :") &&
!Token::simpleMatch(tok, "; break")) !Token::simpleMatch(tok, "; break"))
*/ */
if (Token::simpleMatch(tok, "; break")) if (Token::simpleMatch(tok, "; break"))
{ {
unreachableCodeError(tok->next()); unreachableCodeError(tok->next());

View File

@ -103,7 +103,7 @@ public:
/** Check for unreachable code */ /** Check for unreachable code */
void unreachableCode(); void unreachableCode();
void unreachableCodeError(const Token *tok); void unreachableCodeError(const Token *tok);
/** Check for unused function variables */ /** Check for unused function variables */
void functionVariableUsage(); void functionVariableUsage();
void unusedVariableError(const Token *tok, const std::string &varname); void unusedVariableError(const Token *tok, const std::string &varname);

View File

@ -58,7 +58,7 @@ private:
TEST_CASE(structmember4); TEST_CASE(structmember4);
TEST_CASE(structmember5); TEST_CASE(structmember5);
TEST_CASE(structmember6); TEST_CASE(structmember6);
TEST_CASE(localvar1); TEST_CASE(localvar1);
TEST_CASE(localvar2); TEST_CASE(localvar2);
TEST_CASE(localvar3); TEST_CASE(localvar3);
@ -77,7 +77,7 @@ private:
TEST_CASE(localvarIfElse); // return tmp1 ? tmp2 : tmp3; TEST_CASE(localvarIfElse); // return tmp1 ? tmp2 : tmp3;
TEST_CASE(localvarOpAssign); // a |= b; TEST_CASE(localvarOpAssign); // a |= b;
TEST_CASE(localvarFor); // for ( ; var; ) TEST_CASE(localvarFor); // for ( ; var; )
TEST_CASE(localvarShift); // 1 >> var TEST_CASE(localvarShift); // 1 >> var
} }
void structmember1() void structmember1()
@ -197,10 +197,10 @@ private:
"}\n"); "}\n");
ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());
} }
@ -397,8 +397,8 @@ private:
" return 1 >> var;\n" " return 1 >> var;\n"
"}\n"); "}\n");
ASSERT_EQUALS(std::string(""), errout.str()); ASSERT_EQUALS(std::string(""), errout.str());
} }
}; };
REGISTER_TEST(TestUnusedVar) REGISTER_TEST(TestUnusedVar)