diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-06-16 16:35:40 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-06-18 14:40:53 +1000 |
commit | ad6347afead500fefb34131841f4beb5b03ad4ec (patch) | |
tree | 29fc04beabf2c17c1e944fbc03e994da048d5e50 /Xi/xiquerydevice.c | |
parent | d5a15e65b7d2fdda14fb719e3ebf076cce896386 (diff) |
Xi: don't use a constant number for class sizes - use sizeof instead
The protocol is still changing, and having to debug crap like this is
annoying.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'Xi/xiquerydevice.c')
-rw-r--r-- | Xi/xiquerydevice.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Xi/xiquerydevice.c b/Xi/xiquerydevice.c index 98325e112..2c01863bb 100644 --- a/Xi/xiquerydevice.c +++ b/Xi/xiquerydevice.c @@ -237,7 +237,7 @@ ListButtonInfo(DeviceIntPtr dev, xXIButtonInfo* info) info->type = ButtonClass; info->num_buttons = dev->button->numButtons; - info->length = 2 + mask_len + info->num_buttons; + info->length = sizeof(xXIButtonInfo)/4 + mask_len + info->num_buttons; info->sourceid = dev->button->sourceid; bits = (unsigned char*)&info[1]; @@ -281,7 +281,7 @@ ListKeyInfo(DeviceIntPtr dev, xXIKeyInfo* info) info->type = KeyClass; info->num_keycodes = xkb->max_key_code - xkb->min_key_code + 1; - info->length = 2 + info->num_keycodes; + info->length = sizeof(xXIKeyInfo)/4 + info->num_keycodes; info->sourceid = dev->key->sourceid; kc = (uint32_t*)&info[1]; |