Class checking : Renamed the check functions

This commit is contained in:
Daniel Marjamäki 2008-12-20 08:48:52 +00:00
parent fe94c577bc
commit 6b06df766b
5 changed files with 14 additions and 14 deletions

View File

@ -311,7 +311,7 @@ void CheckClass::ClassChecking_VarList_Initialize(const TOKEN *tok1, const TOKEN
// ClassCheck: Check that all class constructors are ok.
//---------------------------------------------------------------------------
void CheckClass::CheckConstructors()
void CheckClass::constructors()
{
const char pattern_class[] = "class %var% {";
@ -465,7 +465,7 @@ void CheckClass::CheckConstructors(const TOKEN *tok1, struct VAR *varlist, const
// ClassCheck: Unused private functions
//---------------------------------------------------------------------------
void CheckClass::CheckUnusedPrivateFunctions()
void CheckClass::privateFunctions()
{
// Locate some class
const char *pattern_class[] = {"class","","{",NULL};
@ -601,7 +601,7 @@ void CheckClass::CheckUnusedPrivateFunctions()
// ClassCheck: Check that memset is not used on classes
//---------------------------------------------------------------------------
void CheckClass::CheckMemset()
void CheckClass::noMemset()
{
// Locate all 'memset' tokens..
for (const TOKEN *tok = _tokenizer->tokens(); tok; tok = tok->next())
@ -664,7 +664,7 @@ void CheckClass::CheckMemset()
// ClassCheck: "void operator=("
//---------------------------------------------------------------------------
void CheckClass::CheckOperatorEq1()
void CheckClass::operatorEq()
{
if (const TOKEN *tok = TOKEN::findmatch(_tokenizer->tokens(), "void operator = ("))
{

View File

@ -31,13 +31,13 @@ public:
CheckClass( const Tokenizer *tokenizer, const Settings &settings, ErrorLogger *errorLogger );
~CheckClass();
void CheckConstructors();
void constructors();
void CheckUnusedPrivateFunctions();
void privateFunctions();
void CheckMemset();
void noMemset();
void CheckOperatorEq1(); // Warning upon "void operator=(.."
void operatorEq(); // Warning upon "void operator=(.."
// The destructor in a base class should be virtual
void virtualDestructor();

View File

@ -211,7 +211,7 @@ void CppCheck::checkFile(const std::string &code, const char FileName[])
// The 'memset' function can do dangerous things if used wrong.
// Important: The checking doesn't work on simplified tokens list.
CheckClass checkClass( &_tokenizer, _settings, this );
checkClass.CheckMemset();
checkClass.noMemset();
// Check for unsigned divisions where one operand is signed
@ -249,7 +249,7 @@ void CppCheck::checkFile(const std::string &code, const char FileName[])
checkBufferOverrun.CheckBufferOverrun();
// Check that all class constructors are ok.
checkClass.CheckConstructors();
checkClass.constructors();
// Check that all base classes have virtual destructors
checkClass.virtualDestructor();
@ -281,14 +281,14 @@ void CppCheck::checkFile(const std::string &code, const char FileName[])
if (_settings._checkCodingStyle)
{
// Check that all private functions are called.
checkClass.CheckUnusedPrivateFunctions();
checkClass.privateFunctions();
// Warning upon c-style pointer casts
const char *ext = strrchr(FileName, '.');
if (ext && strcmp(ext,".cpp")==0)
checkOther.WarningOldStylePointerCast();
checkClass.CheckOperatorEq1();
checkClass.operatorEq();
// if (a) delete a;
checkOther.WarningRedundantCode();

View File

@ -50,7 +50,7 @@ private:
Settings settings;
settings._checkCodingStyle = true;
CheckClass checkClass( &tokenizer, settings, this );
checkClass.CheckConstructors();
checkClass.constructors();
}
void run()

View File

@ -56,7 +56,7 @@ private:
Settings settings;
settings._checkCodingStyle = true;
CheckClass checkClass( &tokenizer, settings, this );
checkClass.CheckUnusedPrivateFunctions();
checkClass.privateFunctions();
}