Fix #713 (Tokenizer: Simplify 0L)
http://sourceforge.net/apps/trac/cppcheck/ticket/713
This commit is contained in:
parent
73a48c2e7b
commit
ef09f3475c
|
@ -1700,7 +1700,8 @@ void Tokenizer::simplifyTokenList()
|
|||
for (Token *tok = _tokens; tok; tok = tok->next())
|
||||
{
|
||||
if (tok->str() == "NULL" ||
|
||||
tok->str() == "'\\0'")
|
||||
tok->str() == "'\\0'" ||
|
||||
tok->str() == "0L")
|
||||
tok->str("0");
|
||||
}
|
||||
|
||||
|
|
|
@ -381,6 +381,7 @@ private:
|
|||
" if (p1 != NULL || p2 == NULL) { ; }\n"
|
||||
" if (p1 != NULL && p2 == NULL) { ; }\n"
|
||||
" if (p == '\\0');\n"
|
||||
" if (p == 0L);\n"
|
||||
"}\n";
|
||||
|
||||
ASSERT_EQUALS("void f ( )\n"
|
||||
|
@ -412,6 +413,7 @@ private:
|
|||
"if ( p1 || ! p2 ) { ; }\n"
|
||||
"if ( p1 && ! p2 ) { ; }\n"
|
||||
"if ( ! p ) { ; }\n"
|
||||
"if ( ! p ) { ; }\n"
|
||||
"}", tokenizeAndStringify(code, true));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue