summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2017-06-20 15:55:39 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2017-12-07 13:53:42 +0100
commitee528fbd5dc482ceece52832d4a8ea5a08251bfa (patch)
tree243ea4b34196fd7a36cb42d591aa55ba86c04484 /lib
parent92cc1e745758893a57a2432a0e11e4cd3ad289b7 (diff)
Timers: Add typecast to unit-converting macros
Diffstat (limited to 'lib')
-rw-r--r--lib/birdlib.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/birdlib.h b/lib/birdlib.h
index a0826aab..9a77fc7b 100644
--- a/lib/birdlib.h
+++ b/lib/birdlib.h
@@ -71,9 +71,9 @@ static inline int u64_cmp(u64 i1, u64 i2)
typedef s64 btime;
typedef s64 bird_clock_t;
-#define S_ *1000000
-#define MS_ *1000
-#define US_ *1
+#define S_ * (btime) 1000000
+#define MS_ * (btime) 1000
+#define US_ * (btime) 1
#define TO_S /1000000
#define TO_MS /1000
#define TO_US /1
@@ -82,6 +82,7 @@ typedef s64 bird_clock_t;
#define S S_
#define MS MS_
#define US US_
+#define NS /1000
#endif