summaryrefslogtreecommitdiff
path: root/dix/eventconvert.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-10-20 16:42:20 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-10-25 14:06:41 +1000
commitffe20acedb3cdc4811eb52f8fc540ba6af7339fa (patch)
treeb5f12d6b17bb7f42190e54e912b6aea1c68d15d6 /dix/eventconvert.c
parent7500d841f4c709ae0edc6420332096d3b9ef9fcc (diff)
Use new FP1616/FP3232 conversion functions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Diffstat (limited to 'dix/eventconvert.c')
-rw-r--r--dix/eventconvert.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/dix/eventconvert.c b/dix/eventconvert.c
index ff42b0398..c9da39685 100644
--- a/dix/eventconvert.c
+++ b/dix/eventconvert.c
@@ -49,6 +49,7 @@
#include "inpututils.h"
#include "xiquerydevice.h"
#include "xkbsrv.h"
+#include "inpututils.h"
static int countValuators(DeviceEvent *ev, int *first);
@@ -686,9 +687,7 @@ eventToDeviceEvent(DeviceEvent *ev, xEvent **xi)
if (BitIsOn(ev->valuators.mask, i))
{
SetBit(ptr, i);
- axisval->integral = trunc(ev->valuators.data[i]);
- axisval->frac = (ev->valuators.data[i] - axisval->integral) *
- (1 << 16) * (1 << 16);
+ *axisval = double_to_fp3232(ev->valuators.data[i]);
axisval++;
}
}
@@ -732,13 +731,8 @@ eventToRawEvent(RawDeviceEvent *ev, xEvent **xi)
if (BitIsOn(ev->valuators.mask, i))
{
SetBit(ptr, i);
- axisval->integral = trunc(ev->valuators.data[i]);
- axisval->frac = (ev->valuators.data[i] - axisval->integral) *
- (1 << 16) * (1 << 16);
- axisval_raw->integral = trunc(ev->valuators.data_raw[i]);
- axisval_raw->frac =
- (ev->valuators.data_raw[i] - axisval_raw->integral) *
- (1 << 16) * (1 << 16);
+ *axisval = double_to_fp3232(ev->valuators.data[i]);
+ *axisval_raw = double_to_fp3232(ev->valuators.data_raw[i]);
axisval++;
axisval_raw++;
}