From fdd9d87f80cccdd7d8d17336778aae643191e924 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sun, 15 Apr 2018 12:51:36 -0700 Subject: [PATCH] SCP: Fix MinGW build warnings due to sizeof time_t --- sim_console.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sim_console.c b/sim_console.c index 43208219..e14786da 100644 --- a/sim_console.c +++ b/sim_console.c @@ -2240,11 +2240,13 @@ if (r != SCPE_OK) sim_deb_switches = sim_switches; /* save debug switches */ if (sim_deb_switches & SWMASK ('R')) { struct tm loc_tm, gmt_tm; + time_t time_t_now; clock_gettime(CLOCK_REALTIME, &sim_deb_basetime); + time_t_now = (time_t)sim_deb_basetime.tv_sec; /* Adjust the relative timebase to reflect the localtime GMT offset */ - loc_tm = *localtime (&sim_deb_basetime.tv_sec); - gmt_tm = *gmtime (&sim_deb_basetime.tv_sec); + loc_tm = *localtime (&time_t_now); + gmt_tm = *gmtime (&time_t_now); sim_deb_basetime.tv_sec -= mktime (&gmt_tm) - mktime (&loc_tm); if (!(sim_deb_switches & (SWMASK ('A') | SWMASK ('T')))) sim_deb_switches |= SWMASK ('T');