summaryrefslogtreecommitdiff
path: root/xkb
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2008-04-25 19:47:16 +0300
committerDaniel Stone <daniel@fooishbar.org>2009-01-22 15:08:57 +1100
commit61c508fa78aa08ea2666fde950fbafad95d65056 (patch)
tree0a63921127f1ce11c6842d3497c12f3ca4a4953c /xkb
parent4f3078df2acf07364a17f738bc5c32f9a5962723 (diff)
XKB: Sanitise vmods in actions
Turn vmods from two unsigned chars into one int. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'xkb')
-rw-r--r--xkb/XKBMisc.c8
-rw-r--r--xkb/xkbUtils.c4
-rw-r--r--xkb/xkbtext.c4
-rw-r--r--xkb/xkmread.c6
4 files changed, 10 insertions, 12 deletions
diff --git a/xkb/XKBMisc.c b/xkb/XKBMisc.c
index 078f2419c..82d37d19f 100644
--- a/xkb/XKBMisc.c
+++ b/xkb/XKBMisc.c
@@ -343,7 +343,7 @@ unsigned tmp;
case XkbSA_SetMods: case XkbSA_LatchMods: case XkbSA_LockMods:
if (act->mods.flags&XkbSA_UseModMapMods)
act->mods.real_mods= act->mods.mask= mods;
- if ((tmp= XkbModActionVMods(&act->mods))!=0) {
+ if ((tmp= act->mods.vmods)!=0) {
XkbVirtualModsToReal(xkb,tmp,&tmp);
act->mods.mask|= tmp;
}
@@ -351,7 +351,7 @@ unsigned tmp;
case XkbSA_ISOLock:
if (act->iso.flags&XkbSA_UseModMapMods)
act->iso.real_mods= act->iso.mask= mods;
- if ((tmp= XkbModActionVMods(&act->iso))!=0) {
+ if ((tmp= act->iso.vmods)!=0) {
XkbVirtualModsToReal(xkb,tmp,&tmp);
act->iso.mask|= tmp;
}
@@ -666,7 +666,7 @@ unsigned int tmp;
switch (act->type) {
case XkbSA_SetMods: case XkbSA_LatchMods: case XkbSA_LockMods:
- if (((tmp= XkbModActionVMods(&act->mods))&changed)!=0) {
+ if (((tmp= act->mods.vmods)&changed)!=0) {
XkbVirtualModsToReal(xkb,tmp,&tmp);
act->mods.mask= act->mods.real_mods;
act->mods.mask|= tmp;
@@ -674,7 +674,7 @@ unsigned int tmp;
}
break;
case XkbSA_ISOLock:
- if ((((tmp= XkbModActionVMods(&act->iso))!=0)&changed)!=0) {
+ if ((((tmp= act->iso.vmods)!=0)&changed)!=0) {
XkbVirtualModsToReal(xkb,tmp,&tmp);
act->iso.mask= act->iso.real_mods;
act->iso.mask|= tmp;
diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c
index d03195f05..b07dceb80 100644
--- a/xkb/xkbUtils.c
+++ b/xkb/xkbUtils.c
@@ -183,13 +183,13 @@ register unsigned tmp;
case XkbSA_SetMods: case XkbSA_LatchMods: case XkbSA_LockMods:
if (act->mods.flags&XkbSA_UseModMapMods)
act->mods.real_mods= act->mods.mask= mods;
- if ((tmp= XkbModActionVMods(&act->mods))!=0)
+ if ((tmp= act->mods.vmods)!=0)
act->mods.mask|= XkbMaskForVMask(xkb,tmp);
break;
case XkbSA_ISOLock:
if (act->iso.flags&XkbSA_UseModMapMods)
act->iso.real_mods= act->iso.mask= mods;
- if ((tmp= XkbModActionVMods(&act->iso))!=0)
+ if ((tmp= act->iso.vmods)!=0)
act->iso.mask|= XkbMaskForVMask(xkb,tmp);
break;
}
diff --git a/xkb/xkbtext.c b/xkb/xkbtext.c
index f9bfae581..213dbb7aa 100644
--- a/xkb/xkbtext.c
+++ b/xkb/xkbtext.c
@@ -678,7 +678,7 @@ XkbModAction * act;
unsigned tmp;
act= &action->mods;
- tmp= XkbModActionVMods(act);
+ tmp= act->vmods;
TryCopyStr(buf,"modifiers=",sz);
if (act->flags&XkbSA_UseModMapMods)
TryCopyStr(buf,"modMapMods",sz);
@@ -818,7 +818,7 @@ char tbuf[64];
}
else {
unsigned tmp;
- tmp= XkbModActionVMods(act);
+ tmp= act->vmods;
TryCopyStr(buf,"modifiers=",sz);
if (act->flags&XkbSA_UseModMapMods)
TryCopyStr(buf,"modMapMods",sz);
diff --git a/xkb/xkmread.c b/xkb/xkmread.c
index dc6e0d252..ff0537e10 100644
--- a/xkb/xkmread.c
+++ b/xkb/xkmread.c
@@ -457,8 +457,7 @@ XkbAction *act;
act->mods.flags = wire.actionData[0];
act->mods.mask = wire.actionData[1];
act->mods.real_mods = wire.actionData[2];
- act->mods.vmods1 = wire.actionData[3];
- act->mods.vmods2 = wire.actionData[4];
+ act->mods.vmods = (wire.actionData[3] << 8) | wire.actionData[4];
break;
case XkbSA_SetGroup:
case XkbSA_LatchGroup:
@@ -497,8 +496,7 @@ XkbAction *act;
act->iso.real_mods = wire.actionData[2];
act->iso.group_XXX = wire.actionData[3];
act->iso.affect = wire.actionData[4];
- act->iso.vmods1 = wire.actionData[5];
- act->iso.vmods2 = wire.actionData[6];
+ act->iso.vmods = (wire.actionData[5] << 8) | wire.actionData[6];
break;
case XkbSA_SwitchScreen:
act->screen.flags = wire.actionData[0];