astyle formatting

[ci skip]
This commit is contained in:
Daniel Marjamäki 2014-09-14 10:29:12 +02:00
parent 27459761c9
commit 865a252c89
2 changed files with 5 additions and 5 deletions

View File

@ -1671,7 +1671,7 @@ bool CheckUninitVar::isVariableUsage(const Token *vartok, bool pointer, bool all
if (Token::Match(vartok->tokAt(-3), "typeof|__alignof__ ( * %var%")) if (Token::Match(vartok->tokAt(-3), "typeof|__alignof__ ( * %var%"))
return false; return false;
// Accessing Rvalue member using "." or "->" // Accessing Rvalue member using "." or "->"
if (vartok->strAt(1) == "." && vartok->strAt(-1) != "&") { if (vartok->strAt(1) == "." && vartok->strAt(-1) != "&") {
bool assignment = false; bool assignment = false;
const Token* parent = vartok->astParent(); const Token* parent = vartok->astParent();
@ -1682,7 +1682,7 @@ bool CheckUninitVar::isVariableUsage(const Token *vartok, bool pointer, bool all
} }
parent = parent->astParent(); parent = parent->astParent();
} }
if(!assignment) if (!assignment)
return true; return true;
} }

View File

@ -3459,9 +3459,9 @@ private:
" struct AB *ab = malloc(sizeof(struct AB));\n" " struct AB *ab = malloc(sizeof(struct AB));\n"
" return ab->a;\n" " return ab->a;\n"
"}"); "}");
ASSERT_EQUALS( "[test.cpp:4]: (error) Memory is allocated but not initialized: ab\n" ASSERT_EQUALS("[test.cpp:4]: (error) Memory is allocated but not initialized: ab\n"
"[test.cpp:4]: (error) Uninitialized struct member: ab.a\n", "[test.cpp:4]: (error) Uninitialized struct member: ab.a\n",
errout.str()); errout.str());
checkUninitVar2("struct t_udf_file { int dir_left; };\n" checkUninitVar2("struct t_udf_file { int dir_left; };\n"
"\n" "\n"