From d08b6e02b77268da52e10b6efd10fde2fec6efde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 16 Jun 2018 16:23:55 +0200 Subject: [PATCH] renamed _files to mFiles --- lib/library.cpp | 4 ++-- lib/library.h | 2 +- lib/tokenlist.cpp | 28 ++++++++++++++-------------- lib/tokenlist.h | 4 ++-- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/library.cpp b/lib/library.cpp index 959e61b70..b9b138fc5 100644 --- a/lib/library.cpp +++ b/lib/library.cpp @@ -102,10 +102,10 @@ Library::Error Library::load(const char exename[], const char path[]) absolute_path = Path::getAbsoluteFilePath(path); if (error == tinyxml2::XML_SUCCESS) { - if (_files.find(absolute_path) == _files.end()) { + if (mFiles.find(absolute_path) == mFiles.end()) { Error err = load(doc); if (err.errorcode == OK) - _files.insert(absolute_path); + mFiles.insert(absolute_path); return err; } diff --git a/lib/library.h b/lib/library.h index 627adfcb1..0e20c9673 100644 --- a/lib/library.h +++ b/lib/library.h @@ -495,7 +495,7 @@ private: std::set _blocks; }; int allocid; - std::set _files; + std::set mFiles; std::map _alloc; // allocation functions std::map _dealloc; // deallocation functions std::map _noreturn; // is function noreturn? diff --git a/lib/tokenlist.cpp b/lib/tokenlist.cpp index 7e3089eb0..98616ec48 100644 --- a/lib/tokenlist.cpp +++ b/lib/tokenlist.cpp @@ -68,21 +68,21 @@ void TokenList::deallocateTokens() deleteTokens(mTokensFrontBack.front); mTokensFrontBack.front = nullptr; mTokensFrontBack.back = nullptr; - _files.clear(); + mFiles.clear(); } unsigned int TokenList::appendFileIfNew(const std::string &fileName) { // Has this file been tokenized already? - for (std::size_t i = 0; i < _files.size(); ++i) - if (Path::sameFileName(_files[i], fileName)) + for (std::size_t i = 0; i < mFiles.size(); ++i) + if (Path::sameFileName(mFiles[i], fileName)) return (unsigned int)i; - // The "_files" vector remembers what files have been tokenized.. - _files.push_back(Path::simplifyPath(fileName)); + // The "mFiles" vector remembers what files have been tokenized.. + mFiles.push_back(Path::simplifyPath(fileName)); // Update _isC and _isCPP properties - if (_files.size() == 1) { // Update only useful if first file added to _files + if (mFiles.size() == 1) { // Update only useful if first file added to _files if (!mSettings) { _isC = Path::isC(getSourceFilePath()); _isCPP = Path::isCPP(getSourceFilePath()); @@ -91,7 +91,7 @@ unsigned int TokenList::appendFileIfNew(const std::string &fileName) _isCPP = mSettings->enforcedLang == Settings::CPP || (mSettings->enforcedLang == Settings::None && Path::isCPP(getSourceFilePath())); } } - return _files.size() - 1U; + return mFiles.size() - 1U; } void TokenList::deleteTokens(Token *tok) @@ -254,7 +254,7 @@ bool TokenList::createTokens(std::istream &code, const std::string& file0) appendFileIfNew(file0); simplecpp::OutputList outputList; - simplecpp::TokenList tokens(code, _files, file0, &outputList); + simplecpp::TokenList tokens(code, mFiles, file0, &outputList); createTokens(&tokens); @@ -266,12 +266,12 @@ bool TokenList::createTokens(std::istream &code, const std::string& file0) void TokenList::createTokens(const simplecpp::TokenList *tokenList) { if (tokenList->cfront()) - _files = tokenList->cfront()->location.files; + mFiles = tokenList->cfront()->location.files; else - _files.clear(); + mFiles.clear(); _isC = _isCPP = false; - if (!_files.empty()) { + if (!mFiles.empty()) { _isC = Path::isC(getSourceFilePath()); _isCPP = Path::isCPP(getSourceFilePath()); } @@ -321,8 +321,8 @@ void TokenList::createTokens(const simplecpp::TokenList *tokenList) } if (mSettings && mSettings->relativePaths) { - for (std::size_t i = 0; i < _files.size(); i++) - _files[i] = Path::getRelativePath(_files[i], mSettings->basePaths); + for (std::size_t i = 0; i < mFiles.size(); i++) + mFiles[i] = Path::getRelativePath(mFiles[i], mSettings->basePaths); } Token::assignProgressValues(mTokensFrontBack.front); @@ -1204,7 +1204,7 @@ void TokenList::validateAst() const const std::string& TokenList::file(const Token *tok) const { - return _files.at(tok->fileIndex()); + return mFiles.at(tok->fileIndex()); } std::string TokenList::fileLine(const Token *tok) const diff --git a/lib/tokenlist.h b/lib/tokenlist.h index ac001739a..39d58c36d 100644 --- a/lib/tokenlist.h +++ b/lib/tokenlist.h @@ -125,7 +125,7 @@ public: * @return vector with filenames */ const std::vector& getFiles() const { - return _files; + return mFiles; } /** @@ -185,7 +185,7 @@ private: TokensFrontBack mTokensFrontBack; /** filenames for the tokenized source code (source + included) */ - std::vector _files; + std::vector mFiles; /** settings */ const Settings* mSettings;