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>
This commit is contained in:
parent
d5a15e65b7
commit
ad6347afea
|
@ -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];
|
||||
|
|
Loading…
Reference in New Issue
Block a user