diff --git a/lib/preprocessor.cpp b/lib/preprocessor.cpp index d3496434b..fe86b1627 100644 --- a/lib/preprocessor.cpp +++ b/lib/preprocessor.cpp @@ -134,7 +134,7 @@ void Preprocessor::inlineSuppressions(const simplecpp::TokenList &tokens) void Preprocessor::setDirectives(const simplecpp::TokenList &tokens) { // directive list.. - directives.clear(); + mDirectives.clear(); std::vector list; list.reserve(1U + tokenlists.size()); @@ -160,7 +160,7 @@ void Preprocessor::setDirectives(const simplecpp::TokenList &tokens) else directive.str += tok2->str(); } - directives.push_back(directive); + mDirectives.push_back(directive); } } } @@ -789,7 +789,7 @@ bool Preprocessor::validateCfg(const std::string &cfg, const std::list" << std::endl; - for (std::list::const_iterator it = directives.begin(); it != directives.end(); ++it) { + for (const Directive &dir : mDirectives) { out << " file) << "\" " - << "linenr=\"" << it->linenr << "\" " + << "file=\"" << ErrorLogger::toxml(dir.file) << "\" " + << "linenr=\"" << dir.linenr << "\" " // str might contain characters such as '"', '<' or '>' which // could result in invalid XML, so run it through toxml(). - << "str=\"" << ErrorLogger::toxml(it->str) << "\"/>" << std::endl; + << "str=\"" << ErrorLogger::toxml(dir.str) << "\"/>" << std::endl; } out << " " << std::endl; } diff --git a/lib/preprocessor.h b/lib/preprocessor.h index b9aae6450..6255da91e 100644 --- a/lib/preprocessor.h +++ b/lib/preprocessor.h @@ -93,7 +93,7 @@ public: /** list of all directives met while preprocessing file */ const std::list &getDirectives() const { - return directives; + return mDirectives; } std::set getConfigs(const simplecpp::TokenList &tokens) const; @@ -210,7 +210,7 @@ private: ErrorLogger *mErrorLogger; /** list of all directives met while preprocessing file */ - std::list directives; + std::list mDirectives; std::map tokenlists;