From 706b6e107ba9f203ca89c76e5a421292de0c402d Mon Sep 17 00:00:00 2001 From: nareix Date: Sun, 22 Nov 2015 08:03:58 +0800 Subject: [PATCH] add types.go --- atom/types.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 atom/types.go diff --git a/atom/types.go b/atom/types.go new file mode 100644 index 0000000..56ca122 --- /dev/null +++ b/atom/types.go @@ -0,0 +1,14 @@ + +package atom + +type Fixed uint32 +type TimeStamp uint32 + +func IntToFixed(val int) Fixed { + return Fixed(val<<16) +} + +func FixedToInt(val Fixed) int { + return int(val>>16) +} +