summaryrefslogtreecommitdiff
path: root/src/common/timer.hpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2013-01-09 00:18:53 -0800
committerBen Longbons <b.r.longbons@gmail.com>2013-01-09 00:43:27 -0800
commitf0a87e4f7f5377498960429e96be5dff183c8326 (patch)
tree2661728f73f3c163e971d94cd123ef6e378264aa /src/common/timer.hpp
parentf2fd4885c2a906414e0f36acf95d252e5a9d5805 (diff)
downloadtmwa-f0a87e4f7f5377498960429e96be5dff183c8326.tar.gz
tmwa-f0a87e4f7f5377498960429e96be5dff183c8326.tar.bz2
tmwa-f0a87e4f7f5377498960429e96be5dff183c8326.tar.xz
tmwa-f0a87e4f7f5377498960429e96be5dff183c8326.zip
Make incoming packets read-only
Diffstat (limited to 'src/common/timer.hpp')
-rw-r--r--src/common/timer.hpp8
1 files changed, 6 insertions, 2 deletions
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;