Bring declarations closer to where they're needed.

This commit is contained in:
Dmitry-Me 2014-07-24 18:34:13 +04:00
parent 65e9085b66
commit f104aa237f
1 changed files with 5 additions and 6 deletions

View File

@ -1428,13 +1428,8 @@ Function* SymbolDatabase::addGlobalFunctionDecl(Scope*& scope, const Token *tok,
void SymbolDatabase::addClassFunction(Scope **scope, const Token **tok, const Token *argStart)
{
int count = 0;
std::string path;
unsigned int path_length = 0;
const Token *tok1;
const bool destructor((*tok)->previous()->str() == "~");
const Token *tok1;
// skip class/struct name
if (destructor)
tok1 = (*tok)->tokAt(-3);
@ -1445,6 +1440,10 @@ void SymbolDatabase::addClassFunction(Scope **scope, const Token **tok, const To
if (!tok1)
return;
int count = 0;
std::string path;
unsigned int path_length = 0;
// back up to head of path
while (tok1 && tok1->previous() && tok1->previous()->str() == "::" &&
tok1->tokAt(-2) && tok1->tokAt(-2)->isName()) {