hw/rtc/m48t59: Use 64-bit arithmetic in set_alarm()
commit7038b6e4e71d9fb3a234e00da31c222d3e97dd5c
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 31 Aug 2023 08:45:17 +0000 (31 09:45 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 31 Aug 2023 08:45:17 +0000 (31 09:45 +0100)
tree14fcdfccf99aff786943d13a20e08c7a05a98694
parent35aa6715ddcd9748bae5bc01563331e8eae8d7cf
hw/rtc/m48t59: Use 64-bit arithmetic in set_alarm()

In the m48t59 device we almost always use 64-bit arithmetic when
dealing with time_t deltas.  The one exception is in set_alarm(),
which currently uses a plain 'int' to hold the difference between two
time_t values.  Switch to int64_t instead to avoid any possible
overflow issues.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
hw/rtc/m48t59.c