perform a more robust casting.

This commit is contained in:
suter_a 2021-06-02 12:29:00 +02:00
parent 7142c6b0b7
commit effab214f9

View File

@ -447,7 +447,8 @@ int dump_header_mud(const std::string fileName, const std::string fileFormat)
// start time // start time
time_t tval; time_t tval;
struct tm *dt; struct tm *dt;
success = MUD_getTimeBegin( fh, (UINT32*)&tval ); success = MUD_getTimeBegin( fh, &val );
tval = static_cast<time_t>(val);
if (success) { if (success) {
dt = localtime(static_cast<const time_t*>(&tval)); dt = localtime(static_cast<const time_t*>(&tval));
assert(dt); assert(dt);
@ -457,7 +458,8 @@ int dump_header_mud(const std::string fileName, const std::string fileFormat)
std::cout << std::endl << "Run Start Time : ???"; std::cout << std::endl << "Run Start Time : ???";
} }
// stop time // stop time
success = MUD_getTimeEnd( fh, (UINT32*)&tval ); success = MUD_getTimeEnd( fh, &val );
tval = static_cast<time_t>(val);
if (success) { if (success) {
dt = localtime(static_cast<const time_t*>(&tval)); dt = localtime(static_cast<const time_t*>(&tval));
assert(dt); assert(dt);