Tokenizer::simplifyTypedef: 'tokAt(offset)=>tokOffset': work in progress..
This commit is contained in:
parent
b366bf69ad
commit
187c463475
|
@ -1237,11 +1237,11 @@ void Tokenizer::simplifyTypedef()
|
||||||
functionPtr = true;
|
functionPtr = true;
|
||||||
else
|
else
|
||||||
function = true;
|
function = true;
|
||||||
funcStart = tok->tokAt(offset + 1);
|
funcStart = tokOffset->next();
|
||||||
funcEnd = tok->linkAt(offset)->tokAt(-2);
|
funcEnd = tokOffset->link()->tokAt(-2);
|
||||||
typeName = tok->linkAt(offset)->previous();
|
typeName = tokOffset->link()->previous();
|
||||||
argStart = tok->linkAt(offset)->next();
|
argStart = tokOffset->link()->next();
|
||||||
argEnd = tok->linkAt(offset)->next()->link();
|
argEnd = tokOffset->link()->next()->link();
|
||||||
tok = argEnd->next();
|
tok = argEnd->next();
|
||||||
Token *spec = tok;
|
Token *spec = tok;
|
||||||
if (Token::Match(spec, "const|volatile")) {
|
if (Token::Match(spec, "const|volatile")) {
|
||||||
|
@ -1257,13 +1257,13 @@ void Tokenizer::simplifyTypedef()
|
||||||
tok = tok->next();
|
tok = tok->next();
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (Token::Match(tok->tokAt(offset), "( %type% (")) {
|
else if (Token::Match(tokOffset, "( %type% (")) {
|
||||||
function = true;
|
function = true;
|
||||||
if (tok->linkAt(offset)->next()) {
|
if (tokOffset->link()->next()) {
|
||||||
typeName = tok->tokAt(offset + 1);
|
typeName = tokOffset->next();
|
||||||
argStart = tok->tokAt(offset + 2);
|
argStart = tokOffset->tokAt(2);
|
||||||
argEnd = tok->linkAt(offset + 2);
|
argEnd = tokOffset->linkAt(2);
|
||||||
tok = tok->linkAt(offset)->next();
|
tok = tokOffset->link()->next();
|
||||||
} else {
|
} else {
|
||||||
// internal error
|
// internal error
|
||||||
continue;
|
continue;
|
||||||
|
@ -1271,14 +1271,14 @@ void Tokenizer::simplifyTypedef()
|
||||||
}
|
}
|
||||||
|
|
||||||
// pointer to function returning pointer to function
|
// pointer to function returning pointer to function
|
||||||
else if (Token::Match(tok->tokAt(offset), "( * ( * %type% ) (") &&
|
else if (Token::Match(tokOffset, "( * ( * %type% ) (") &&
|
||||||
Token::simpleMatch(tok->linkAt(offset + 6), ") ) (") &&
|
Token::simpleMatch(tokOffset->linkAt(6), ") ) (") &&
|
||||||
Token::Match(tok->linkAt(offset + 6)->linkAt(2), ") ;|,")) {
|
Token::Match(tokOffset->linkAt(6)->linkAt(2), ") ;|,")) {
|
||||||
functionPtrRetFuncPtr = true;
|
functionPtrRetFuncPtr = true;
|
||||||
|
|
||||||
typeName = tok->tokAt(offset + 4);
|
typeName = tokOffset->tokAt(4);
|
||||||
argStart = tok->tokAt(offset + 6);
|
argStart = tokOffset->tokAt(6);
|
||||||
argEnd = tok->linkAt(offset + 6);
|
argEnd = tokOffset->linkAt(6);
|
||||||
|
|
||||||
argFuncRetStart = argEnd->tokAt(2);
|
argFuncRetStart = argEnd->tokAt(2);
|
||||||
argFuncRetEnd = argEnd->linkAt(2);
|
argFuncRetEnd = argEnd->linkAt(2);
|
||||||
|
|
Loading…
Reference in New Issue