diff --git a/src/cppcheck.cpp b/src/cppcheck.cpp index dfaf54894..b0307c4e3 100644 --- a/src/cppcheck.cpp +++ b/src/cppcheck.cpp @@ -159,7 +159,7 @@ std::string CppCheck::parseFromArgs(int argc, const char* const argv[]) if (path[path.length()-1] != '/' && path[path.length()-1] != '\\') path += '/'; - _includePaths.push_back(path); + _settings._includePaths.push_back(path); } // Include paths @@ -344,13 +344,13 @@ unsigned int CppCheck::check() { // File content was given as a string std::istringstream iss(_fileContents[ _filenames[c] ]); - preprocessor.preprocess(iss, filedata, configurations, fname, _includePaths); + preprocessor.preprocess(iss, filedata, configurations, fname, _settings._includePaths); } else { // Only file name was given, read the content from file std::ifstream fin(fname.c_str()); - preprocessor.preprocess(fin, filedata, configurations, fname, _includePaths); + preprocessor.preprocess(fin, filedata, configurations, fname, _settings._includePaths); } int checkCount = 0; diff --git a/src/cppcheck.h b/src/cppcheck.h index 8c8bf810c..1a1967ac7 100644 --- a/src/cppcheck.h +++ b/src/cppcheck.h @@ -141,10 +141,6 @@ private: /** Current configuration */ std::string cfg; - /** List of include paths, e.g. "my/includes/" which should be used - for finding include files inside source files. */ - std::list _includePaths; - std::list _xmllist; }; diff --git a/src/settings.h b/src/settings.h index ff2084aaf..2d5549c0a 100644 --- a/src/settings.h +++ b/src/settings.h @@ -64,6 +64,10 @@ public: Default value is 0. */ int _exitCode; + /** List of include paths, e.g. "my/includes/" which should be used + for finding include files inside source files. */ + std::list _includePaths; + /** Fill list of automaticly deallocated classes */ void autoDealloc(std::istream &istr);