renamed _files to mFiles

This commit is contained in:
Daniel Marjamäki 2018-06-16 16:23:55 +02:00
parent cc521bef99
commit d08b6e02b7
4 changed files with 19 additions and 19 deletions

View File

@ -102,10 +102,10 @@ Library::Error Library::load(const char exename[], const char path[])
absolute_path = Path::getAbsoluteFilePath(path); absolute_path = Path::getAbsoluteFilePath(path);
if (error == tinyxml2::XML_SUCCESS) { if (error == tinyxml2::XML_SUCCESS) {
if (_files.find(absolute_path) == _files.end()) { if (mFiles.find(absolute_path) == mFiles.end()) {
Error err = load(doc); Error err = load(doc);
if (err.errorcode == OK) if (err.errorcode == OK)
_files.insert(absolute_path); mFiles.insert(absolute_path);
return err; return err;
} }

View File

@ -495,7 +495,7 @@ private:
std::set<std::string> _blocks; std::set<std::string> _blocks;
}; };
int allocid; int allocid;
std::set<std::string> _files; std::set<std::string> mFiles;
std::map<std::string, AllocFunc> _alloc; // allocation functions std::map<std::string, AllocFunc> _alloc; // allocation functions
std::map<std::string, AllocFunc> _dealloc; // deallocation functions std::map<std::string, AllocFunc> _dealloc; // deallocation functions
std::map<std::string, bool> _noreturn; // is function noreturn? std::map<std::string, bool> _noreturn; // is function noreturn?

View File

@ -68,21 +68,21 @@ void TokenList::deallocateTokens()
deleteTokens(mTokensFrontBack.front); deleteTokens(mTokensFrontBack.front);
mTokensFrontBack.front = nullptr; mTokensFrontBack.front = nullptr;
mTokensFrontBack.back = nullptr; mTokensFrontBack.back = nullptr;
_files.clear(); mFiles.clear();
} }
unsigned int TokenList::appendFileIfNew(const std::string &fileName) unsigned int TokenList::appendFileIfNew(const std::string &fileName)
{ {
// Has this file been tokenized already? // Has this file been tokenized already?
for (std::size_t i = 0; i < _files.size(); ++i) for (std::size_t i = 0; i < mFiles.size(); ++i)
if (Path::sameFileName(_files[i], fileName)) if (Path::sameFileName(mFiles[i], fileName))
return (unsigned int)i; return (unsigned int)i;
// The "_files" vector remembers what files have been tokenized.. // The "mFiles" vector remembers what files have been tokenized..
_files.push_back(Path::simplifyPath(fileName)); mFiles.push_back(Path::simplifyPath(fileName));
// Update _isC and _isCPP properties // 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) { if (!mSettings) {
_isC = Path::isC(getSourceFilePath()); _isC = Path::isC(getSourceFilePath());
_isCPP = Path::isCPP(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())); _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) void TokenList::deleteTokens(Token *tok)
@ -254,7 +254,7 @@ bool TokenList::createTokens(std::istream &code, const std::string& file0)
appendFileIfNew(file0); appendFileIfNew(file0);
simplecpp::OutputList outputList; simplecpp::OutputList outputList;
simplecpp::TokenList tokens(code, _files, file0, &outputList); simplecpp::TokenList tokens(code, mFiles, file0, &outputList);
createTokens(&tokens); createTokens(&tokens);
@ -266,12 +266,12 @@ bool TokenList::createTokens(std::istream &code, const std::string& file0)
void TokenList::createTokens(const simplecpp::TokenList *tokenList) void TokenList::createTokens(const simplecpp::TokenList *tokenList)
{ {
if (tokenList->cfront()) if (tokenList->cfront())
_files = tokenList->cfront()->location.files; mFiles = tokenList->cfront()->location.files;
else else
_files.clear(); mFiles.clear();
_isC = _isCPP = false; _isC = _isCPP = false;
if (!_files.empty()) { if (!mFiles.empty()) {
_isC = Path::isC(getSourceFilePath()); _isC = Path::isC(getSourceFilePath());
_isCPP = Path::isCPP(getSourceFilePath()); _isCPP = Path::isCPP(getSourceFilePath());
} }
@ -321,8 +321,8 @@ void TokenList::createTokens(const simplecpp::TokenList *tokenList)
} }
if (mSettings && mSettings->relativePaths) { if (mSettings && mSettings->relativePaths) {
for (std::size_t i = 0; i < _files.size(); i++) for (std::size_t i = 0; i < mFiles.size(); i++)
_files[i] = Path::getRelativePath(_files[i], mSettings->basePaths); mFiles[i] = Path::getRelativePath(mFiles[i], mSettings->basePaths);
} }
Token::assignProgressValues(mTokensFrontBack.front); Token::assignProgressValues(mTokensFrontBack.front);
@ -1204,7 +1204,7 @@ void TokenList::validateAst() const
const std::string& TokenList::file(const Token *tok) 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 std::string TokenList::fileLine(const Token *tok) const

View File

@ -125,7 +125,7 @@ public:
* @return vector with filenames * @return vector with filenames
*/ */
const std::vector<std::string>& getFiles() const { const std::vector<std::string>& getFiles() const {
return _files; return mFiles;
} }
/** /**
@ -185,7 +185,7 @@ private:
TokensFrontBack mTokensFrontBack; TokensFrontBack mTokensFrontBack;
/** filenames for the tokenized source code (source + included) */ /** filenames for the tokenized source code (source + included) */
std::vector<std::string> _files; std::vector<std::string> mFiles;
/** settings */ /** settings */
const Settings* mSettings; const Settings* mSettings;