CommonCheck: Refactoring. Renamed clGlobalFunction to GlobalFunction
This commit is contained in:
parent
3708fde176
commit
bbd8c03369
|
@ -11,14 +11,14 @@ bool OnlyReportUniqueErrors;
|
||||||
std::ostringstream errout;
|
std::ostringstream errout;
|
||||||
static std::list<const TOKEN *> FunctionList;
|
static std::list<const TOKEN *> FunctionList;
|
||||||
|
|
||||||
class clGlobalFunction
|
class GlobalFunction
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
unsigned int _FileId;
|
unsigned int _FileId;
|
||||||
std::string _FuncName;
|
std::string _FuncName;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
clGlobalFunction( const unsigned int FileId, const char FuncName[] )
|
GlobalFunction( const unsigned int FileId, const char FuncName[] )
|
||||||
{
|
{
|
||||||
_FileId = FileId;
|
_FileId = FileId;
|
||||||
_FuncName = FuncName;
|
_FuncName = FuncName;
|
||||||
|
@ -28,8 +28,8 @@ public:
|
||||||
const std::string &name() const { return _FuncName; }
|
const std::string &name() const { return _FuncName; }
|
||||||
};
|
};
|
||||||
|
|
||||||
static std::list< clGlobalFunction > GlobalFunctions;
|
static std::list< GlobalFunction > GlobalFunctions;
|
||||||
static std::list< clGlobalFunction > UsedGlobalFunctions;
|
static std::list< GlobalFunction > UsedGlobalFunctions;
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ void FillFunctionList(const unsigned int file_id)
|
||||||
if ( Match(tok2, ") {") )
|
if ( Match(tok2, ") {") )
|
||||||
{
|
{
|
||||||
if (CheckCodingStyle && !staticfunc && !classfunc && tok->FileIndex==0)
|
if (CheckCodingStyle && !staticfunc && !classfunc && tok->FileIndex==0)
|
||||||
GlobalFunctions.push_back( clGlobalFunction(file_id, tok->str) );
|
GlobalFunctions.push_back( GlobalFunction(file_id, tok->str) );
|
||||||
FunctionList.push_back( tok );
|
FunctionList.push_back( tok );
|
||||||
tok = tok2;
|
tok = tok2;
|
||||||
}
|
}
|
||||||
|
@ -184,7 +184,7 @@ void FillFunctionList(const unsigned int file_id)
|
||||||
{
|
{
|
||||||
if ( *it != 0 )
|
if ( *it != 0 )
|
||||||
{
|
{
|
||||||
UsedGlobalFunctions.push_back( clGlobalFunction(file_id, *it) );
|
UsedGlobalFunctions.push_back( GlobalFunction(file_id, *it) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -207,10 +207,10 @@ const TOKEN *GetFunctionTokenByName( const char funcname[] )
|
||||||
void CheckGlobalFunctionUsage(const std::vector<std::string> &filenames)
|
void CheckGlobalFunctionUsage(const std::vector<std::string> &filenames)
|
||||||
{
|
{
|
||||||
// Iterator for GlobalFunctions
|
// Iterator for GlobalFunctions
|
||||||
std::list<clGlobalFunction>::const_iterator func;
|
std::list<GlobalFunction>::const_iterator func;
|
||||||
|
|
||||||
// Iterator for UsedGlobalFunctions
|
// Iterator for UsedGlobalFunctions
|
||||||
std::list<clGlobalFunction>::const_iterator usedfunc;
|
std::list<GlobalFunction>::const_iterator usedfunc;
|
||||||
|
|
||||||
// Check that every function in GlobalFunctions are used
|
// Check that every function in GlobalFunctions are used
|
||||||
for ( func = GlobalFunctions.begin(); func != GlobalFunctions.end(); func++ )
|
for ( func = GlobalFunctions.begin(); func != GlobalFunctions.end(); func++ )
|
||||||
|
|
Loading…
Reference in New Issue