diff --git a/Makefile b/Makefile index ac1190fa3..ba9251e74 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ SRCS=checkbufferoverrun.cpp checkclass.cpp checkheaders.cpp checkmemoryleak.cpp checkfunctionusage.cpp checkother.cpp filelister.cpp preprocessor.cpp tokenize.cpp cppcheck.cpp settings.cpp token.cpp cppcheckexecutor.cpp OBJS=$(SRCS:%.cpp=%.o) -TESTS=testbufferoverrun.o testcharvar.o testclass.o testconstructors.o testdivision.o testfunctionusage.o testincompletestatement.o testother.o testmemleak.o testpreprocessor.o testredundantif.o testsimplifytokens.o testtokenize.o testtoken.o testunusedprivfunc.o testunusedvar.o testfilelister.o +TESTS=testbufferoverrun.o testcharvar.o testclass.o testconstructors.o testdivision.o testfunctionusage.o testincompletestatement.o testother.o testmemleak.o testmemleakmp.o testpreprocessor.o testredundantif.o testsimplifytokens.o testtokenize.o testtoken.o testunusedprivfunc.o testunusedvar.o testfilelister.o BIN = ${DESTDIR}/usr/bin all: ${OBJS} main.o @@ -49,6 +49,8 @@ testother.o: testother.cpp testsuite.h errorlogger.h tokenize.h settings.h token g++ -Wall -pedantic -g -I. -o $@ -c $*.cpp testmemleak.o: testmemleak.cpp tokenize.h settings.h errorlogger.h token.h checkmemoryleak.h testsuite.h g++ -Wall -pedantic -g -I. -o $@ -c $*.cpp +testmemleakmp.o: testmemleakmp.cpp tokenize.h settings.h errorlogger.h token.h checkmemoryleak.h testsuite.h + g++ -Wall -pedantic -g -I. -o $@ -c $*.cpp testpreprocessor.o: testpreprocessor.cpp testsuite.h errorlogger.h preprocessor.h g++ -Wall -pedantic -g -I. -o $@ -c $*.cpp testredundantif.o: testredundantif.cpp testsuite.h errorlogger.h checkother.h diff --git a/checkclass.cpp b/checkclass.cpp index a0bde190d..e7b035a3f 100644 --- a/checkclass.cpp +++ b/checkclass.cpp @@ -491,21 +491,21 @@ void CheckClass::privateFunctions() break; } - if (tok->aaaa0() == '{') + if (tok->str() == "{") indent_level++; - if (tok->aaaa0() == '}') + else if (tok->str() == "}") { if (indent_level <= 1) break; indent_level--; } - if (strcmp(tok->aaaa(),"};") == 0) + else if (tok->str() == "};") break; - if (strcmp(tok->aaaa(),"private:") == 0) + else if (tok->str() == "private:") priv = true; - else if (strcmp(tok->aaaa(),"public:") == 0) + else if (tok->str() == "public:") priv = false; - else if (strcmp(tok->aaaa(),"protected:") == 0) + else if (tok->str() == "protected:") priv = false; else if (priv && indent_level == 1) { @@ -515,7 +515,7 @@ void CheckClass::privateFunctions() if (TOKEN::Match(tok, "%var% (") && !TOKEN::Match(tok,classname.c_str())) { - FuncList.push_back(tok->aaaa()); + FuncList.push_back(tok->str()); } } } diff --git a/checkmemoryleak.cpp b/checkmemoryleak.cpp index cf66bdc96..6f60b6e69 100644 --- a/checkmemoryleak.cpp +++ b/checkmemoryleak.cpp @@ -1344,5 +1344,12 @@ void CheckMemoryLeakClass::CheckMemoryLeak() +//--------------------------------------------------------------------------- +// Non-recursive function analysis +//--------------------------------------------------------------------------- +TOKEN * CheckMemoryLeakClass::functionCode(const char funcname[]) +{ + return NULL; +} diff --git a/checkmemoryleak.h b/checkmemoryleak.h index 2b97d2693..12ae961c8 100644 --- a/checkmemoryleak.h +++ b/checkmemoryleak.h @@ -102,6 +102,12 @@ private: ErrorLogger *_errorLogger; const Settings _settings; std::list _listAllocFunc; + +// Experimental functionality.. +#ifdef UNIT_TESTING +public: +#endif + TOKEN * functionCode(const char funcname[]); }; //---------------------------------------------------------------------------