Don't use shifted virtual modifier masks
authorRan Benita <ran234@gmail.com>
Fri, 5 Oct 2012 20:07:04 +0000 (22:07 +0200)
committerRan Benita <ran234@gmail.com>
Sat, 6 Oct 2012 19:41:59 +0000 (21:41 +0200)
commit1005b320f14339236ff53a07b13d6dcbad52bf19
tree57bbf751a4daaca29fbef2faecf1403d471964f9
parent6974e1f9acc42a946203a48c3a57d8bbb19e3316
Don't use shifted virtual modifier masks

Modifier masks can be confusing in some places. For example,
key->vmodmap only contains virtual modifiers, where the first is in
position 0, the second in 1 etc., while normally in a xkb_mod_mask_t the
virtual modifiers start from the 8th (XKB_NUM_CORE_MODS) position. This
happens in some other places as well.

Change all of the masks to be in the usual real+virtual format, and when
we need to access e.g. keymap->vmods we just adjust by
XKB_NUM_CORE_MODS. (This also goes for indexes, e.g.
interpret->virtual_modifier).

This makes this stuff easier to reason about.

Signed-off-by: Ran Benita <ran234@gmail.com>
src/keymap-dump.c
src/text.c
src/xkbcomp/expr.c
src/xkbcomp/keymap.c
src/xkbcomp/symbols.c