use dynamic cast instead of c-style cast when casting from base type to derived class
This commit is contained in:
@ -74,10 +74,10 @@ void WriteDump::command(int narg, char **arg)
|
||||
// set multifile_override for DumpImage so that filename needs no "*"
|
||||
|
||||
if (strcmp(arg[1],"image") == 0)
|
||||
((DumpImage *) dump)->multifile_override = 1;
|
||||
(dynamic_cast<DumpImage *>( dump))->multifile_override = 1;
|
||||
|
||||
if (strcmp(arg[1],"cfg") == 0)
|
||||
((DumpCFG *) dump)->multifile_override = 1;
|
||||
(dynamic_cast<DumpCFG *>( dump))->multifile_override = 1;
|
||||
|
||||
if ((update->first_update == 0) && (comm->me == 0))
|
||||
error->warning(FLERR,"Calling write_dump before a full system init.");
|
||||
|
||||
Reference in New Issue
Block a user