diff options
author | Daniel Stone <daniel@fooishbar.org> | 2011-03-03 15:36:55 +0000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-09-29 12:24:34 +1000 |
commit | 2d9beeb2174661d0a0732403ad4e49e9ff56718d (patch) | |
tree | 00ff84c46e849882f5908e8d2ad0f4577999f127 /test | |
parent | 626f487b97c99b48bf1d8c8ef4367a686639c3e6 (diff) |
Input: Make DeviceEvent use doubles internally
Change the DeviceEvent InternalEvent to use doubles for its valuators,
instead of data and data_frac.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'test')
-rw-r--r-- | test/xi2/protocol-eventconvert.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/test/xi2/protocol-eventconvert.c b/test/xi2/protocol-eventconvert.c index 6df9af0fe..d7a9ee420 100644 --- a/test/xi2/protocol-eventconvert.c +++ b/test/xi2/protocol-eventconvert.c @@ -374,8 +374,8 @@ static void test_values_XIDeviceEvent(DeviceEvent *in, xXIDeviceEvent *out, { FP3232 vi, vo; - vi.integral = in->valuators.data[i]; - vi.frac = in->valuators.data_frac[i]; + vi.integral = trunc(in->valuators.data[i]); + vi.frac = (in->valuators.data[i] - vi.integral) * (1UL << 32); vo = *values; @@ -617,8 +617,7 @@ static void test_convert_XIDeviceEvent(void) { XISetMask(in.valuators.mask, i); - in.valuators.data[i] = i; - in.valuators.data_frac[i] = i + 20; + in.valuators.data[i] = i + (i * 0.0020); test_XIDeviceEvent(&in); XIClearMask(in.valuators.mask, i); } |