From 830059fca201dae5277ee5353590ca9252151f2d Mon Sep 17 00:00:00 2001 From: Michael Zillgith Date: Wed, 14 Aug 2024 12:52:07 +0100 Subject: [PATCH] - HAL (Linux): fixed problem with Hal_getTimeInNs on 32 bit systems --- hal/time/unix/time.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hal/time/unix/time.c b/hal/time/unix/time.c index 44094038..8596b6fc 100644 --- a/hal/time/unix/time.c +++ b/hal/time/unix/time.c @@ -41,8 +41,8 @@ Hal_getTimeInNs() clock_gettime(CLOCK_REALTIME, &now); - nsSinceEpoch nsTime = now.tv_sec * 1000000000UL; - nsTime += now.tv_nsec; + nsSinceEpoch nsTime = (nsSinceEpoch)(now.tv_sec) * 1000000000UL; + nsTime += (nsSinceEpoch)(now.tv_nsec); return nsTime; } @@ -62,6 +62,4 @@ Hal_setTimeInNs(nsSinceEpoch nsTime) return true; } - #endif -