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

@ -4856,7 +4856,7 @@ VarReader::VarReader(LAMMPS *lmp, char *name, char *file, int flag) :
error->all(FLERR,"Cannot use atomfile-style variable unless an atom map exists");
id_fix = utils::strdup(std::string(name) + "_VARIABLE_STORE");
fixstore = (FixStore *) modify->add_fix(std::string(id_fix) + " all STORE peratom 0 1");
fixstore = dynamic_cast<FixStore *>( modify->add_fix(std::string(id_fix) + " all STORE peratom 0 1"));
buffer = new char[CHUNK*MAXLINE];
}
}