Merge pull request #714 from Dmitry-Me/betterVariableNames

Better variable names, more linear code
This commit is contained in:
Daniel Marjamäki 2015-12-03 13:46:28 +01:00
commit 7f4dae8de4
1 changed files with 12 additions and 10 deletions

View File

@ -1812,18 +1812,20 @@ std::string Preprocessor::getcode(const std::string &filedata, const std::string
typedef std::set<std::string>::const_iterator It; typedef std::set<std::string>::const_iterator It;
for (It it = _settings.userUndefs.begin(); it != _settings.userUndefs.end(); ++it) { for (It it = _settings.userUndefs.begin(); it != _settings.userUndefs.end(); ++it) {
std::string::size_type pos = line.find_first_not_of(' ',8); const std::string::size_type symbolPos = line.find_first_not_of(' ', 8);
if (pos != std::string::npos) { if (symbolPos == std::string::npos)
std::string::size_type pos2 = line.find(*it,pos); continue;
if ((pos2 != std::string::npos) && const std::string::size_type undefMatchPos = line.find(*it, symbolPos);
((line.size() == pos2 + (*it).size()) || if (undefMatchPos == std::string::npos)
(line[pos2 + (*it).size()] == ' ') || continue;
(line[pos2 + (*it).size()] == '('))) { const std::string::size_type behindUndefPos = undefMatchPos + (*it).size();
if ((line.size() == behindUndefPos) ||
(line[behindUndefPos] == ' ') ||
(line[behindUndefPos] == '(')) {
match = false; match = false;
break; break;
} }
} }
}
if (match) { if (match) {
for (std::list<bool>::const_iterator it = matching_ifdef.begin(); it != matching_ifdef.end(); ++it) { for (std::list<bool>::const_iterator it = matching_ifdef.begin(); it != matching_ifdef.end(); ++it) {