[spice v4] utils: Make all the NSEC_PER_XXX constants 64 bit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Code dealing with nanosecond timestamps normally uses 64 bit integers
and not long long ints. So this makes it easier to print the value of
expressions using these constants.

Signed-off-by: Francois Gouget <fgouget@xxxxxxxxxxxxxxx>
---

v3: https://lists.freedesktop.org/archives/spice-devel/2019-June/049361.html
v4: Following the discussion above, switch to using INT64_C().
    This does not modify MSEC_PER_SEC.

 server/utils.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/server/utils.h b/server/utils.h
index 54bc9d490..2cbd779c3 100644
--- a/server/utils.h
+++ b/server/utils.h
@@ -52,9 +52,9 @@ static inline int test_bit(int index, uint32_t val)
 
 typedef int64_t red_time_t;
 
-#define NSEC_PER_SEC      1000000000LL
-#define NSEC_PER_MILLISEC 1000000
-#define NSEC_PER_MICROSEC 1000
+#define NSEC_PER_SEC      INT64_C(1000000000)
+#define NSEC_PER_MILLISEC INT64_C(1000000)
+#define NSEC_PER_MICROSEC INT64_C(1000)
 
 /* g_get_monotonic_time() does not have enough precision */
 static inline red_time_t spice_get_monotonic_time_ns(void)
-- 
2.20.1
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]