Skip to content

Commit 3dd605e

Browse files
yoctopucedpgeorge
authored andcommitted
shared/timeutils: Add missing mp_uint_t casts.
To prevent compiler warnings. Signed-off-by: Yoctopuce <[email protected]>
1 parent 61e2931 commit 3dd605e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

shared/timeutils/timeutils.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ mp_uint_t timeutils_mktime_2000(mp_uint_t year, mp_int_t month, mp_int_t mday,
6262

6363
static inline void timeutils_seconds_since_epoch_to_struct_time(uint64_t t, timeutils_struct_time_t *tm) {
6464
// TODO this will give incorrect results for dates before 2000/1/1
65-
timeutils_seconds_since_2000_to_struct_time(t - TIMEUTILS_SECONDS_1970_TO_2000, tm);
65+
timeutils_seconds_since_2000_to_struct_time((mp_uint_t)(t - TIMEUTILS_SECONDS_1970_TO_2000), tm);
6666
}
6767

6868
// 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
7878
}
7979

8080
static inline mp_uint_t timeutils_seconds_since_epoch_from_nanoseconds_since_1970(uint64_t ns) {
81-
return ns / 1000000000ULL;
81+
return (mp_uint_t)(ns / 1000000000ULL);
8282
}
8383

8484
static inline uint64_t timeutils_nanoseconds_since_epoch_to_nanoseconds_since_1970(uint64_t ns) {

0 commit comments

Comments
 (0)