Skip to content

Commit

Permalink
trying to fix compilation with Intel compiler
Browse files Browse the repository at this point in the history
the error was:

gemmi/gemmi/src/ddl.cpp(254): error: no suitable conversion function from "std::string" to "unsigned long long" exists
          if (logger.threshold >= 7 || major(version) != major(dict_version))
                                       ^
  • Loading branch information
wojdyr committed Jan 10, 2025
1 parent eb7b5ee commit 5a6d4c1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/ddl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ class Ddl2Rules {
const std::regex* re_ = nullptr;
};

std::string major_ver(const std::string &s) {
return s.substr(0, s.find('.'));
}

} // anonymous namespace

// check if the dictionary name/version correspond to _audit_conform_dict_*
Expand All @@ -250,8 +254,7 @@ void Ddl::check_audit_conform(const cif::Document& doc) const {
} else if (const std::string* dict_ver = b.find_value(audit_conform + "dict_version")) {
std::string version = cif::as_string(*dict_ver);
if (version != dict_version) {
auto major = [](const std::string& s) { return s.substr(0, s.find('.')); };
if (logger.threshold >= 7 || major(version) != major(dict_version))
if (logger.threshold >= 7 || major_ver(version) != major_ver(dict_version))
logger.note(br(b), "conforms to ", name, " ver. ", version,
" while DDL has ver. ", dict_version);
}
Expand Down

0 comments on commit 5a6d4c1

Please sign in to comment.