diff options
author | Chase Douglas <chase.douglas@canonical.com> | 2012-03-07 14:52:54 -0800 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2012-03-08 14:01:33 +1000 |
commit | 1b9f0394c3d4d3833f8560ae8170a4d5842419ab (patch) | |
tree | f22001809a8e6917bf5720474e9e1f597eac4717 /src | |
parent | c1a5a70b51f12dedf354102217c7cd4247ed3a4b (diff) |
Fix XIScrollClass increment value on 32-bit machines
This fixes scroll class increment values on 32-bit machines. Performing
1UL << 32 shifts the bit off the end of a 32-bit unsigned long value. By
expanding to 1ULL, we have the full 64-bits of an unsigned long long
including on 32-bit machines.
Before this change, xinput list --long would output scroll increment
values of -nan.
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/XExtInt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/XExtInt.c b/src/XExtInt.c index 7694f06..89c0894 100644 --- a/src/XExtInt.c +++ b/src/XExtInt.c @@ -1695,7 +1695,7 @@ copy_classes(XIDeviceInfo* to, xXIAnyInfo* from, int *nclasses) cls_lib->scroll_type= cls_wire->scroll_type; cls_lib->flags = cls_wire->flags; cls_lib->increment = cls_wire->increment.integral; - cls_lib->increment += (unsigned int)cls_wire->increment.frac/(double)(1UL << 32); + cls_lib->increment += (unsigned int)cls_wire->increment.frac/(double)(1ULL << 32); to->classes[cls_idx++] = any_lib; } |