From 4b2953125bdce728854e9f136a2fbda2aa7a37f6 Mon Sep 17 00:00:00 2001 From: Richard Wurth Date: Sat, 21 Aug 2021 22:49:44 -0400 Subject: [PATCH] AK: Use POSIX specified types for Time::to_timespec and to_timeval The previous implementation assumed 64-bit time_t and 32-bit long, which is not true on some 32-bit systems --- AK/Time.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AK/Time.cpp b/AK/Time.cpp index b7740371b6..4d3e8914f6 100644 --- a/AK/Time.cpp +++ b/AK/Time.cpp @@ -170,12 +170,12 @@ i64 Time::to_nanoseconds() const timespec Time::to_timespec() const { VERIFY(m_nanoseconds < 1'000'000'000); - return { static_cast(m_seconds), static_cast(m_nanoseconds) }; + return { static_cast(m_seconds), static_cast(m_nanoseconds) }; } timeval Time::to_timeval() const { VERIFY(m_nanoseconds < 1'000'000'000); - return { static_cast(m_seconds), static_cast(m_nanoseconds) / 1000 }; + return { static_cast(m_seconds), static_cast(m_nanoseconds) / 1000 }; } Time Time::operator+(const Time& other) const