Skip to content

Commit b9309c3

Browse files
committed
Fix warnings
1 parent 2f1fd82 commit b9309c3

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

simplecpp.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -746,12 +746,10 @@ void simplecpp::TokenList::readfile(Stream &stream, const std::string &filename,
746746
if (!ppTok || !ppTok->number)
747747
continue;
748748

749-
constexpr auto line_limit = std::numeric_limits<decltype(Location::line)>::max();
749+
constexpr unsigned long line_limit = std::numeric_limits<decltype(Location::line)>::max();
750750
unsigned long line;
751751
try {
752-
line = std::stoul(ppTok->str());
753-
if (line > line_limit)
754-
line = line_limit;
752+
line = std::min(line_limit, std::stoul(ppTok->str()));
755753
} catch (...) {
756754
line = line_limit;
757755
}

0 commit comments

Comments
 (0)