@@ -51,7 +51,7 @@ SuppressionList::ErrorMessage SuppressionList::ErrorMessage::fromErrorMessage(co
5151 ret.lineNumber = msg.callStack .back ().line ;
5252 } else {
5353 ret.setFileName (msg.file0 );
54- ret.lineNumber = SuppressionList::Suppression::NO_LINE ;
54+ ret.lineNumber = 0 ;
5555 }
5656 ret.certainty = msg.certainty ;
5757 ret.symbolNames = msg.symbolNames ();
@@ -133,7 +133,7 @@ std::string SuppressionList::parseXmlFile(const char *filename)
133133 else if (std::strcmp (name, " fileName" ) == 0 )
134134 s.fileName = Path::simplifyPath (text);
135135 else if (std::strcmp (name, " lineNumber" ) == 0 )
136- s.lineNumber = strToInt<int >(text);
136+ s.lineNumber = strToInt<unsigned int >(text);
137137 else if (std::strcmp (name, " symbolName" ) == 0 )
138138 s.symbolName = text;
139139 else if (*text && std::strcmp (name, " hash" ) == 0 )
@@ -248,7 +248,7 @@ SuppressionList::Suppression SuppressionList::parseLine(std::string line)
248248 throw std::runtime_error (" filename is missing" );
249249
250250 try {
251- suppression.lineNumber = strToInt<int >(line_s);
251+ suppression.lineNumber = strToInt<unsigned int >(line_s);
252252 } catch (const std::runtime_error& e) {
253253 throw std::runtime_error (std::string (" invalid line number (" ) + e.what () + " )" );
254254 }
@@ -416,7 +416,7 @@ SuppressionList::Suppression::Result SuppressionList::Suppression::isSuppressed(
416416 if (!errorId.empty () && !matchglob (errorId, errmsg.errorId ))
417417 return Result::Checked;
418418 } else {
419- if ((SuppressionList::Type::unique == type) && (lineNumber != NO_LINE ) && (lineNumber != errmsg.lineNumber )) {
419+ if ((SuppressionList::Type::unique == type) && (lineNumber != 0 ) && (lineNumber != errmsg.lineNumber )) {
420420 if (!thisAndNextLine || lineNumber + 1 != errmsg.lineNumber )
421421 return Result::None;
422422 }
@@ -525,15 +525,15 @@ void SuppressionList::dump(std::ostream & out, const std::string& filePath) cons
525525 out << " errorId=\" " << ErrorLogger::toxml (suppression.errorId ) << ' "' ;
526526 if (!suppression.fileName .empty ())
527527 out << " fileName=\" " << ErrorLogger::toxml (suppression.fileName ) << ' "' ;
528- if (suppression.lineNumber != Suppression::NO_LINE )
528+ if (suppression.lineNumber != 0 )
529529 out << " lineNumber=\" " << suppression.lineNumber << ' "' ;
530530 if (!suppression.symbolName .empty ())
531531 out << " symbolName=\" " << ErrorLogger::toxml (suppression.symbolName ) << ' \" ' ;
532532 if (suppression.hash > 0 )
533533 out << " hash=\" " << suppression.hash << ' \" ' ;
534- if (suppression.lineBegin != Suppression::NO_LINE )
534+ if (suppression.lineBegin != 0 )
535535 out << " lineBegin=\" " << suppression.lineBegin << ' "' ;
536- if (suppression.lineEnd != Suppression::NO_LINE )
536+ if (suppression.lineEnd != 0 )
537537 out << " lineEnd=\" " << suppression.lineEnd << ' "' ;
538538 if (suppression.type == SuppressionList::Type::file)
539539 out << " type=\" file\" " ;
@@ -566,7 +566,7 @@ std::list<SuppressionList::Suppression> SuppressionList::getUnmatchedLocalSuppre
566566 continue ;
567567 if (s.matched )
568568 continue ;
569- if ((s.lineNumber != Suppression::NO_LINE ) && !s.checked )
569+ if ((s.lineNumber != 0 ) && !s.checked )
570570 continue ;
571571 if (s.type == SuppressionList::Type::macro)
572572 continue ;
@@ -632,7 +632,7 @@ std::list<SuppressionList::Suppression> SuppressionList::getSuppressions() const
632632void SuppressionList::markUnmatchedInlineSuppressionsAsChecked (const TokenList &tokenlist) {
633633 std::lock_guard<std::mutex> lg (mSuppressionsSync );
634634
635- int currLineNr = - 1 ;
635+ unsigned int currLineNr = 0 ;
636636 int currFileIdx = -1 ;
637637 for (const Token *tok = tokenlist.front (); tok; tok = tok->next ()) {
638638 if (currFileIdx != tok->fileIndex () || currLineNr != tok->linenr ()) {
@@ -662,7 +662,7 @@ std::string SuppressionList::Suppression::toString() const
662662 if (!fileName.empty ()) {
663663 s += ' :' ;
664664 s += fileName;
665- if (lineNumber != - 1 ) {
665+ if (lineNumber != 0 ) {
666666 s += ' :' ;
667667 s += std::to_string (lineNumber);
668668 }
@@ -747,7 +747,7 @@ polyspace::CommentKind polyspace::Parser::parseKind(const std::string& comment,
747747}
748748
749749
750- std::list<SuppressionList::Suppression> polyspace::Parser::parse (const std::string &comment, int line, const std::string &filename) const
750+ std::list<SuppressionList::Suppression> polyspace::Parser::parse (const std::string &comment, unsigned int line, const std::string &filename) const
751751{
752752 // Syntax for a polyspace suppression:
753753 // https://se.mathworks.com/help/bugfinder/ug/annotate-hide-known-acceptable-polyspace-results-web-browser.html
0 commit comments