From 142e7d6b52c2206fe84d792d57db4be71934754c Mon Sep 17 00:00:00 2001 From: Barinzaya Date: Tue, 15 Oct 2024 13:43:28 -0400 Subject: [PATCH] Fixed time overflows that occur when running in a 32-bit Linux target. --- core/time/time_linux.odin | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/time/time_linux.odin b/core/time/time_linux.odin index 649f601dcef..4e557766eeb 100644 --- a/core/time/time_linux.odin +++ b/core/time/time_linux.odin @@ -6,8 +6,8 @@ _IS_SUPPORTED :: true _now :: proc "contextless" () -> Time { time_spec_now, _ := linux.clock_gettime(.REALTIME) - ns := time_spec_now.time_sec * 1e9 + time_spec_now.time_nsec - return Time{_nsec=i64(ns)} + ns := i64(time_spec_now.time_sec) * 1e9 + i64(time_spec_now.time_nsec) + return Time{_nsec=ns} } _sleep :: proc "contextless" (d: Duration) { @@ -29,7 +29,7 @@ _sleep :: proc "contextless" (d: Duration) { _tick_now :: proc "contextless" () -> Tick { t, _ := linux.clock_gettime(.MONOTONIC_RAW) - return Tick{_nsec = i64(t.time_sec*1e9 + t.time_nsec)} + return Tick{_nsec = i64(t.time_sec)*1e9 + i64(t.time_nsec)} } _yield :: proc "contextless" () {