From 2f26045d303b1f7b6162a3c070b4e2d299896ced Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Fri, 19 Jul 2024 23:57:44 +0800 Subject: [PATCH] Common: fix compiler warnings --- src/common/time.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/time.h b/src/common/time.h index c402321f9..d98ca8e34 100644 --- a/src/common/time.h +++ b/src/common/time.h @@ -20,7 +20,7 @@ static inline uint64_t ffTimeGetTick() //In msec #else struct timespec timeNow; clock_gettime(CLOCK_MONOTONIC, &timeNow); - return (uint64_t)((timeNow.tv_sec * 1000ull) + (timeNow.tv_nsec / 1000000ull)); + return (uint64_t)(((uint64_t) timeNow.tv_sec * 1000u) + ((uint64_t) timeNow.tv_nsec / 1000000u)); #endif } @@ -33,7 +33,7 @@ static inline uint64_t ffTimeGetNow() #else struct timespec timeNow; clock_gettime(CLOCK_REALTIME, &timeNow); - return (uint64_t)((timeNow.tv_sec * 1000ull) + (timeNow.tv_nsec / 1000000ull)); + return (uint64_t)(((uint64_t) timeNow.tv_sec * 1000u) + ((uint64_t) timeNow.tv_nsec / 1000000u)); #endif }