use dynamic cast instead of c-style cast when casting from base type to derived class
This commit is contained in:
@ -37,7 +37,7 @@ void ImproperDeprecated::settings(int, char **)
|
||||
// of the list of substyles
|
||||
|
||||
if (utils::strmatch(my_style,"^hybrid")) {
|
||||
ImproperHybrid *hybrid = (ImproperHybrid *)force->improper;
|
||||
auto hybrid = dynamic_cast<ImproperHybrid *>(force->improper);
|
||||
my_style = hybrid->keywords[hybrid->nstyles];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user