From 017f0090fabac2621ca203e25e067c0520723f23 Mon Sep 17 00:00:00 2001 From: Edoardo Prezioso Date: Mon, 30 Jan 2012 13:10:50 +0100 Subject: [PATCH] Tokenizer::simplifyTypedef: 'tokAt(offset)=>tokOffset': begin conversion. --- lib/tokenize.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index c61b59581..e219d2374 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -985,6 +985,7 @@ void Tokenizer::simplifyTypedef() Token *funcStart = 0; Token *funcEnd = 0; unsigned int offset = 1; + Token *tokOffset = tok->next(); bool function = false; bool functionPtr = false; bool functionRef = false; @@ -1003,14 +1004,15 @@ void Tokenizer::simplifyTypedef() return; } - if (Token::simpleMatch(tok->next(), "::") || - Token::Match(tok->next(), "%type%")) { + if (tok->next()->str() == "::" || Token::Match(tok->next(), "%type%")) { typeStart = tok->next(); offset = 1; - while (Token::Match(tok->tokAt(offset), "const|signed|unsigned|struct|enum %type%") || - (tok->tokAt(offset + 1) && tok->tokAt(offset + 1)->isStandardType())) + while (Token::Match(tokOffset, "const|signed|unsigned|struct|enum %type%") || + (tokOffset->next() && tokOffset->next()->isStandardType())) { ++offset; + tokOffset = tokOffset->next(); + } typeEnd = tok->tokAt(offset++);