File 0006-utils-Add-some-time-conversion-helpers.patch of Package gnome-remote-desktop
From b09acfa1a8d88113bc500135a712c0d067e26fa3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Wed, 28 May 2025 22:55:20 +0200
Subject: [PATCH 06/13] utils: Add some time conversion helpers
Useful when converting between second, microseconds, etc.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-remote-desktop/-/merge_requests/321>
---
src/grd-utils.h | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff -urp gnome-remote-desktop-45.1.orig/src/grd-utils.h gnome-remote-desktop-45.1/src/grd-utils.h
--- gnome-remote-desktop-45.1.orig/src/grd-utils.h 2026-02-10 19:57:07.927874328 -0600
+++ gnome-remote-desktop-45.1/src/grd-utils.h 2026-02-10 20:19:33.270574667 -0600
@@ -55,4 +55,22 @@ GSource * grd_create_fd_source (int
gpointer user_data,
GDestroyNotify notify);
+
+static inline int64_t
+us (int64_t us)
+{
+ return us;
+}
+
+static inline int64_t
+ms2us (int64_t ms)
+{
+ return us (ms * 1000);
+}
+
+static inline int64_t
+s2us (uint64_t s)
+{
+ return ms2us (s * 1000);
+}
#endif /* GRD_UTILS_H */