Skip to content

Commit

Permalink
Appease compiler warning
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomofiorin committed Dec 12, 2023
1 parent 9dcfdd7 commit edeeea6
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/colvarcomp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ cvm::atom_group *colvar::cvc::parse_group(std::string const &conf,
std::string group_conf;

if (key_lookup(conf, group_key, &group_conf)) {

group = new cvm::atom_group(group_key);

if (b_try_scalable) {
Expand All @@ -190,14 +191,6 @@ cvm::atom_group *colvar::cvc::parse_group(std::string const &conf,
// TODO check for other types of parallelism here
}

if (group_conf.empty()) {
error_code |= cvm::error("Error: atom group \"" + group->key + "\" has no definition.\n",
COLVARS_INPUT_ERROR);
delete group;
group = nullptr;
return group;
}

cvm::increase_depth();
error_code |= group->parse(group_conf);
if (error_code != COLVARS_OK) {
Expand All @@ -221,6 +214,9 @@ cvm::atom_group *colvar::cvc::parse_group(std::string const &conf,
}
}

// Silence unused variable warning; TODO stop returning a pointer
(void) error_code;

return group;
}

Expand Down

0 comments on commit edeeea6

Please sign in to comment.