@@ -2587,35 +2587,28 @@ void Tokenizer::labels()
25872587 if (Token::Match (tok, " ) const| {" )) {
25882588 // Simplify labels in the executable scope..
25892589 unsigned int indentlevel = 0 ;
2590- unsigned int indentroundbraces = 0 ;
25912590 while (NULL != (tok = tok->next ())) {
25922591 if (tok->str () == " {" )
25932592 ++indentlevel;
25942593 else if (tok->str () == " }" ) {
25952594 --indentlevel;
25962595 if (!indentlevel)
25972596 break ;
2598- }
2597+ } else if (tok->str () == " (" )
2598+ tok = tok->link ();
25992599
2600- if (tok->str () == " (" )
2601- ++indentroundbraces;
2602- else if (tok->str () == " )" ) {
2603- if (!indentroundbraces)
2604- break ;
2605- --indentroundbraces;
2606- }
2607- if (!indentroundbraces && tok->str () == " case" ) {
2600+ else if (tok->str () == " case" ) {
26082601 while (NULL != (tok = tok->next ())) {
26092602 if (tok->str () == " :" )
26102603 break ;
26112604 }
2612- if (!(tok->next ()) || tok->next ()->str () != " ;" ) {
2605+ if (tok && ( !(tok->next ()) || tok->next ()->str () != " ;" ) ) {
26132606 tok->insertToken (" ;" );
26142607 tok = tok->next ();
26152608 }
26162609 }
26172610 // simplify label.. except for unhandled macro
2618- if (!indentroundbraces && Token::Match (tok, " [;{}] %var% :" )
2611+ if (Token::Match (tok, " [;{}] %var% :" )
26192612 && !Token::Match (tok->next (), " public|protected|private" )
26202613 && tok->strAt (3 ) != " ;" ) {
26212614 for (Token *tok2 = tok->tokAt (3 ); tok2; tok2 = tok2->next ()) {
@@ -7004,7 +6997,7 @@ bool Tokenizer::simplifyKnownVariablesSimplify(Token **tok2, Token *tok3, unsign
70046997 if (Token::Match (tok3, (" %var% ( " + structname + " %varid% ," ).c_str (), varid)) {
70056998 const char * const functionName[] = {
70066999 " memcmp" ," memcpy" ," memmove" ," memset" ,
7007- " strcmp" ," strcpy" ," strncpy" ," strdup"
7000+ " strcmp" ," strcpy" ," strncmp " , " strncpy" ," strdup"
70087001 };
70097002 for (unsigned int i = 0 ; i < (sizeof (functionName) / sizeof (*functionName)); ++i) {
70107003 if (tok3->str () == functionName[i]) {
@@ -8277,12 +8270,6 @@ const Token *Tokenizer::getFunctionTokenByName(const char funcname[]) const
82778270 return NULL ;
82788271}
82798272
8280-
8281- void Tokenizer::fillFunctionList ()
8282- {
8283- getSymbolDatabase ();
8284- }
8285-
82868273// ---------------------------------------------------------------------------
82878274
82888275// Deallocate lists..
0 commit comments