use dynamic cast instead of c-style cast when casting from base type to derived class

This commit is contained in:
Axel Kohlmeyer
2022-04-10 18:18:06 -04:00
parent 39b316729b
commit 200b4f13c7
262 changed files with 669 additions and 676 deletions

View File

@ -37,7 +37,7 @@ void DihedralDeprecated::settings(int, char **)
// of the list of substyles
if (utils::strmatch(my_style,"^hybrid")) {
DihedralHybrid *hybrid = (DihedralHybrid *)force->dihedral;
auto hybrid = dynamic_cast<DihedralHybrid *>(force->dihedral);
my_style = hybrid->keywords[hybrid->nstyles];
}