get rid of ATOBIGINT

This commit is contained in:
Axel Kohlmeyer
2024-07-30 01:18:22 -04:00
parent 95513838da
commit 1035dcf735

View File

@ -527,7 +527,8 @@ std::string ReadRestart::file_search(const std::string &inpfile)
loc = pattern.find('*');
if (loc != std::string::npos) {
// the regex matcher in utils::strmatch() only checks the first 256 characters.
if (loc > 256)
// a 64-bit integer timestep will consume 20 characters, so 236 chars is the cutoff.
if (loc > 236)
error->one(FLERR, "Filename part before '*' is too long to find restart with largest step");
// convert pattern to equivalent regexp
@ -538,7 +539,7 @@ std::string ReadRestart::file_search(const std::string &inpfile)
for (const auto &candidate : platform::list_directory(dirname)) {
if (utils::strmatch(candidate,pattern)) {
bigint num = ATOBIGINT(utils::strfind(candidate.substr(loc),"\\d+").c_str());
auto num = (bigint) std::stoll(utils::strfind(candidate.substr(loc),"\\d+"));
if (num > maxnum) maxnum = num;
}
}