change sys_timestamp into macro
authorLaurent MAZET <laurent.mazet@thalesgroup.com>
Wed, 15 Oct 2025 16:09:48 +0000 (18:09 +0200)
committerLaurent MAZET <laurent.mazet@thalesgroup.com>
Wed, 15 Oct 2025 16:09:48 +0000 (18:09 +0200)
mtime.c
mtime.h

diff --git a/mtime.c b/mtime.c
index 220d4d6dcdf6f4528c8cf4bb6f014255c04cdc4e..67c6ee7f0c91d97160af589dab0468a49d11fbce 100644 (file)
--- a/mtime.c
+++ b/mtime.c
@@ -2,11 +2,6 @@
 
 #include "mtime.h"
 
-void sys_timestamp (ts_t *ts)
-{
-    clock_gettime (CLOCK_REALTIME, ts);
-}
-
 dts_t diff_timestamp  (ts_t *ts1, ts_t *ts2)
 {
     return  (dts_t)(ts1->tv_sec - ts2->tv_sec) * 1000000000 +
diff --git a/mtime.h b/mtime.h
index 7085bb79440671332a46a7ec42cc636d2d6c79f4..974441acec688026d9c3c959c0b5c9cb7fab21ee 100644 (file)
--- a/mtime.h
+++ b/mtime.h
@@ -9,7 +9,7 @@ typedef struct timespec ts_t;
 
 typedef unsigned int dts_t;
 
-void sys_timestamp (ts_t *ts);
+#define sys_timestamp(ts) clock_gettime (CLOCK_REALTIME, (ts))
 
 dts_t diff_timestamp  (ts_t *ts1, ts_t *ts2);