vmod: ClearVModInfo doesn't need the keymap Signed-off-by: Ran Benita <ran234@gmail.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
diff --git a/src/xkbcomp/compat.c b/src/xkbcomp/compat.c
index dfc6941..bcdc2ee 100644
--- a/src/xkbcomp/compat.c
+++ b/src/xkbcomp/compat.c
@@ -282,7 +282,7 @@ ClearCompatInfo(CompatInfo *info)
FreeActionInfo(info->act);
info->act = NULL;
info->keymap = NULL;
- ClearVModInfo(&info->vmods, keymap);
+ ClearVModInfo(&info->vmods);
}
static SymInterpInfo *
diff --git a/src/xkbcomp/vmod.c b/src/xkbcomp/vmod.c
index c70b884..9ee5d39 100644
--- a/src/xkbcomp/vmod.c
+++ b/src/xkbcomp/vmod.c
@@ -25,27 +25,25 @@
********************************************************/
#include "xkbcomp-priv.h"
-#include "text.h"
#include "expr.h"
#include "vmod.h"
void
InitVModInfo(VModInfo *info, struct xkb_keymap *keymap)
{
- ClearVModInfo(info, keymap);
+ xkb_group_index_t i;
+
+ info->defined = info->available = 0;
+
+ for (i = 0; i < XkbNumVirtualMods; i++)
+ if (keymap->vmod_names[i])
+ info->defined |= (1 << i);
}
void
-ClearVModInfo(VModInfo *info, struct xkb_keymap *keymap)
+ClearVModInfo(VModInfo *info)
{
- xkb_mod_index_t i;
- xkb_mod_mask_t bit;
-
info->defined = info->available = 0;
-
- for (i = 0, bit = 1; i < XkbNumVirtualMods; i++, bit <<= 1)
- if (keymap->vmod_names[i])
- info->defined |= bit;
}
/***====================================================================***/
diff --git a/src/xkbcomp/vmod.h b/src/xkbcomp/vmod.h
index 5748d01..a711b9b 100644
--- a/src/xkbcomp/vmod.h
+++ b/src/xkbcomp/vmod.h
@@ -36,7 +36,7 @@ void
InitVModInfo(VModInfo *info, struct xkb_keymap *keymap);
void
-ClearVModInfo(VModInfo *info, struct xkb_keymap *keymap);
+ClearVModInfo(VModInfo *info);
bool
HandleVModDef(VModDef *stmt, struct xkb_keymap *keymap,