diff --git a/libowlps/libowlps.c b/libowlps/libowlps.c index a8cb571..b1f3ae5 100644 --- a/libowlps/libowlps.c +++ b/libowlps/libowlps.c @@ -126,7 +126,7 @@ int owl_timestamp_now_ns(TIMESTAMP *now) */ void owl_timestamp_round_to_ms(TIMESTAMP *now) { - now->tv_nsec = now->tv_nsec / 1000000 * 1000000 ; + now->tv_nsec = now->tv_nsec / 1000000u * 1000000u ; } @@ -151,7 +151,7 @@ TIMESTAMP owl_timeval_to_timestamp(const struct timeval d) { TIMESTAMP res ; res.tv_sec = d.tv_sec ; - res.tv_nsec = d.tv_usec * 1000 ; + res.tv_nsec = d.tv_usec * 1000u ; return res ; } @@ -162,7 +162,7 @@ TIMESTAMP owl_timeval_to_timestamp(const struct timeval d) */ uint64_t owl_timestamp_to_ms(TIMESTAMP d) { - return d.tv_sec * 1000 + d.tv_nsec / 1000000 ; + return (uint64_t) d.tv_sec * 1000u + (uint64_t) d.tv_nsec / 1000000u ; }