Suppressions::NO_LINE : fixed comparisons

This commit is contained in:
Daniel Marjamäki 2018-09-23 16:50:51 +02:00
parent afe09f4d7a
commit 7db671fee6
1 changed files with 4 additions and 4 deletions

View File

@ -147,7 +147,7 @@ std::string Suppressions::addSuppressionLine(const std::string &line)
suppression.lineNumber = Suppressions::Suppression::NO_LINE; suppression.lineNumber = Suppressions::Suppression::NO_LINE;
} }
if (suppression.lineNumber > Suppressions::Suppression::NO_LINE) { if (suppression.lineNumber != Suppressions::Suppression::NO_LINE) {
suppression.fileName.erase(pos); suppression.fileName.erase(pos);
} }
} }
@ -233,7 +233,7 @@ bool Suppressions::Suppression::isSuppressed(const Suppressions::ErrorMessage &e
return false; return false;
if (!fileName.empty() && !matchglob(fileName, errmsg.getFileName())) if (!fileName.empty() && !matchglob(fileName, errmsg.getFileName()))
return false; return false;
if (lineNumber > NO_LINE && lineNumber != errmsg.lineNumber) if (lineNumber != NO_LINE && lineNumber != errmsg.lineNumber)
return false; return false;
if (!symbolName.empty()) { if (!symbolName.empty()) {
for (std::string::size_type pos = 0; pos < errmsg.symbolNames.size();) { for (std::string::size_type pos = 0; pos < errmsg.symbolNames.size();) {
@ -269,7 +269,7 @@ std::string Suppressions::Suppression::getText() const
ret = errorId; ret = errorId;
if (!fileName.empty()) if (!fileName.empty())
ret += " fileName=" + fileName; ret += " fileName=" + fileName;
if (lineNumber > NO_LINE) if (lineNumber != NO_LINE)
ret += " lineNumber=" + MathLib::toString(lineNumber); ret += " lineNumber=" + MathLib::toString(lineNumber);
if (!symbolName.empty()) if (!symbolName.empty())
ret += " symbolName=" + symbolName; ret += " symbolName=" + symbolName;
@ -312,7 +312,7 @@ void Suppressions::dump(std::ostream & out)
out << " errorId=\"" << ErrorLogger::toxml(suppression.errorId) << '"'; out << " errorId=\"" << ErrorLogger::toxml(suppression.errorId) << '"';
if (!suppression.fileName.empty()) if (!suppression.fileName.empty())
out << " fileName=\"" << ErrorLogger::toxml(suppression.fileName) << '"'; out << " fileName=\"" << ErrorLogger::toxml(suppression.fileName) << '"';
if (suppression.lineNumber > Suppression::NO_LINE) if (suppression.lineNumber != Suppression::NO_LINE)
out << " lineNumber=\"" << suppression.lineNumber << '"'; out << " lineNumber=\"" << suppression.lineNumber << '"';
if (!suppression.symbolName.empty()) if (!suppression.symbolName.empty())
out << " symbolName=\"" << ErrorLogger::toxml(suppression.symbolName) << '\"'; out << " symbolName=\"" << ErrorLogger::toxml(suppression.symbolName) << '\"';