[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/8] Rule vmod returns an int with the vmod's bit on.
From: |
Diego Nieto Cid |
Subject: |
[PATCH 3/8] Rule vmod returns an int with the vmod's bit on. |
Date: |
Wed, 4 Aug 2010 04:20:01 -0300 |
This allows to combine virtual modifiers safely using a bitwise or
operation.
Also, warn when too many virtual modifier are defined.
---
parser.y | 5 ++++-
xkbdata.c | 2 ++
2 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/parser.y b/parser.y
index cf1ca33..2def00a 100644
--- a/parser.y
+++ b/parser.y
@@ -315,7 +315,10 @@ vmods_def:
/* Return the number of the virtual modifier. */
vmod:
- IDENTIFIER { $$ = vmod_find ($1); }
+ IDENTIFIER
+ { if (($$ = vmod_find ($1)) != 0)
+ $$ = 1 << ($$ - 1);
+ }
;
/* A single realmodifier. */
diff --git a/xkbdata.c b/xkbdata.c
index 1cba0d5..4f022dd 100644
--- a/xkbdata.c
+++ b/xkbdata.c
@@ -376,6 +376,8 @@ vmod_add (char *vmodname)
vmodnamel = vmn;
lastvmod++;
+ if (lastvmod > 16)
+ debug_printf("warning: only sixteen virtual modifiers are supported,
%s will not be functional.\n", vmodname);
return 0;
}
--
1.7.2
- [PATCH 0/8] Bring console-driver-xkb up to date, Diego Nieto Cid, 2010/08/04
- [PATCH 1/8] Update the parser to work with current XKB files., Diego Nieto Cid, 2010/08/04
- Re: [PATCH 1/8] Update the parser to work with current XKB files., olafBuddenhagen, 2010/08/11
- Re: [PATCH 1/8] Update the parser to work, Diego Nieto Cid, 2010/08/11
- [PATCH 1/5] Add type to $$ in mid-rules., Diego Nieto Cid, 2010/08/11
- [PATCH 2/5] Lexer support for keycodes with +/- symbols and arbitrary level numbers., Diego Nieto Cid, 2010/08/11
- [PATCH 3/5] Skip to main file's default section when needed., Diego Nieto Cid, 2010/08/11
- [PATCH 4/5] Update key type assigment routine., Diego Nieto Cid, 2010/08/11
- [PATCH 5/5] Recreate xkb/keymap/hurd from xkeyboard-config-1.8's xfree86 keymap., Diego Nieto Cid, 2010/08/11
- [PATCH 4/8] Remove glue code and use mig to regenerate it., Diego Nieto Cid, 2010/08/04
- [PATCH 3/8] Rule vmod returns an int with the vmod's bit on.,
Diego Nieto Cid <=
- [PATCH 2/8] Avoid hashing garbage for short keynames., Diego Nieto Cid, 2010/08/04
[PATCH 5/8] Update code borrowed from console-client., Diego Nieto Cid, 2010/08/04
[PATCH 6/8] Add missing functions to input_driver_test., Diego Nieto Cid, 2010/08/04
[PATCH 7/8] Argument's default values are set independently., Diego Nieto Cid, 2010/08/04