From f0a87e4f7f5377498960429e96be5dff183c8326 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Wed, 9 Jan 2013 00:18:53 -0800 Subject: Make incoming packets read-only --- src/common/timer.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/common/timer.hpp') diff --git a/src/common/timer.hpp b/src/common/timer.hpp index fc4f8cb..db4dedd 100644 --- a/src/common/timer.hpp +++ b/src/common/timer.hpp @@ -10,9 +10,13 @@ enum TIMER_TYPE TIMER_INTERVAL, }; /// This is needed to produce a signed result when 2 ticks are subtracted -# define DIFF_TICK(a,b) ((int32_t)((a)-(b))) +inline +int32_t DIFF_TICK(int32_t a, int32_t b) +{ + return a - b; +} -// TODO replace with signed 64-bit to make code more clear and protect from the future +// TODO replace with std::chrono::time_point and std::chrono::duration typedef uint32_t tick_t; typedef uint32_t interval_t; typedef uint32_t timer_id; -- cgit v1.2.3-70-g09d2