diff --git a/src/date_type.h b/src/date_type.h index e69457070f..9a0581c265 100644 --- a/src/date_type.h +++ b/src/date_type.h @@ -17,7 +17,7 @@ typedef uint16 DateFract; ///< The fraction of a date we're in, i.e. the number typedef int32 Ticks; ///< The type to store ticks in typedef int32 DateTicks; ///< The type to store dates in when tick-precision is required typedef int64 DateTicksScaled; ///< The type to store dates scaled by the day length factor in when tick-precision is required -typedef int32 Minutes; ///< The type to store minutes in +typedef int64 Minutes; ///< The type to store minutes in typedef int32 Year; ///< Type for the year, note: 0 based, i.e. starts at the year 0. typedef uint8 Month; ///< Type for the month, note: 0 based, i.e. 0 = January, 11 = December. diff --git a/src/strings.cpp b/src/strings.cpp index 9cf8c83334..15e5e6d541 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -413,12 +413,12 @@ static char *FormatBytes(char *buff, int64 number, const char *last) return buff; } -static char *FormatWallClockString(char *buff, DateTicks ticks, const char *last, bool show_date, uint case_index) +static char *FormatWallClockString(char *buff, DateTicksScaled ticks, const char *last, bool show_date, uint case_index) { Minutes minutes = ticks / _settings_client.gui.ticks_per_minute + _settings_client.gui.clock_offset; char hour[3], minute[3]; - seprintf(hour, lastof(hour), "%02i", MINUTES_HOUR(minutes) ); - seprintf(minute, lastof(minute), "%02i", MINUTES_MINUTE(minutes)); + seprintf(hour, lastof(hour), "%02i", (int) MINUTES_HOUR(minutes) ); + seprintf(minute, lastof(minute), "%02i", (int) MINUTES_MINUTE(minutes)); if (show_date) { int64 args[3] = { (int64)hour, (int64)minute, (int64)ticks / (DAY_TICKS * _settings_game.economy.day_length_factor) }; if (_settings_client.gui.date_with_time == 1) {