[vlc-commits] vlc_tick: use a macro for vlc_tick_from_timespec()

Steve Lhomme git at videolan.org
Wed Jul 4 18:24:57 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Jul  4 18:24:16 2018 +0200| [6735a69b79e13180a8c0f4a06ffc6ec246e14b01] | committer: Steve Lhomme

vlc_tick: use a macro for vlc_tick_from_timespec()

So we don't have to include extra headers for struct timespec (time.h).

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6735a69b79e13180a8c0f4a06ffc6ec246e14b01
---

 include/vlc_tick.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/include/vlc_tick.h b/include/vlc_tick.h
index c923e78976..a8db0f19a3 100644
--- a/include/vlc_tick.h
+++ b/include/vlc_tick.h
@@ -158,10 +158,8 @@ typedef int64_t msftime_t;
 #define vlc_tick_from_timeval(tv) \
     (vlc_tick_from_sec( (tv)->tv_sec ) + VLC_TICK_FROM_US( (tv)->tv_usec ))
 
-static inline vlc_tick_t vlc_tick_from_timespec(const struct timespec *tv)
-{
-    return vlc_tick_from_sec( tv->tv_sec ) + VLC_TICK_FROM_NS( tv->tv_nsec );
-}
+#define vlc_tick_from_timespec(tv) \
+    (vlc_tick_from_sec( (tv)->tv_sec ) + VLC_TICK_FROM_NS( (tv)->tv_nsec ))
 
 struct timespec timespec_from_vlc_tick(vlc_tick_t date);
 



More information about the vlc-commits mailing list