mirror of
https://github.com/micropython/micropython.git
synced 2025-12-16 09:50:15 +01:00
shared/timeutils: Add missing mp_uint_t casts.
To prevent compiler warnings. Signed-off-by: Yoctopuce <dev@yoctopuce.com>
This commit is contained in:
@@ -62,7 +62,7 @@ mp_uint_t timeutils_mktime_2000(mp_uint_t year, mp_int_t month, mp_int_t mday,
|
||||
|
||||
static inline void timeutils_seconds_since_epoch_to_struct_time(uint64_t t, timeutils_struct_time_t *tm) {
|
||||
// TODO this will give incorrect results for dates before 2000/1/1
|
||||
timeutils_seconds_since_2000_to_struct_time(t - TIMEUTILS_SECONDS_1970_TO_2000, tm);
|
||||
timeutils_seconds_since_2000_to_struct_time((mp_uint_t)(t - TIMEUTILS_SECONDS_1970_TO_2000), tm);
|
||||
}
|
||||
|
||||
// Year is absolute, month/mday are 1-based, hours/minutes/seconds are 0-based.
|
||||
@@ -78,7 +78,7 @@ static inline uint64_t timeutils_seconds_since_epoch(mp_uint_t year, mp_uint_t m
|
||||
}
|
||||
|
||||
static inline mp_uint_t timeutils_seconds_since_epoch_from_nanoseconds_since_1970(uint64_t ns) {
|
||||
return ns / 1000000000ULL;
|
||||
return (mp_uint_t)(ns / 1000000000ULL);
|
||||
}
|
||||
|
||||
static inline uint64_t timeutils_nanoseconds_since_epoch_to_nanoseconds_since_1970(uint64_t ns) {
|
||||
|
||||
Reference in New Issue
Block a user