summaryrefslogtreecommitdiff
path: root/xkb/xkbUtils.c
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-14 16:49:22 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-14 16:49:22 +0000
commitd568221710959cf7d783e6ff0fb80fb43a231124 (patch)
tree8d6f039393294c6ffac8533639afdebe5d68bfc1 /xkb/xkbUtils.c
parent9508a382f8a9f241dab097d921b6d290c1c3a776 (diff)
Diffstat (limited to 'xkb/xkbUtils.c')
-rw-r--r--xkb/xkbUtils.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c
index 05a817ba3..7d81d0169 100644
--- a/xkb/xkbUtils.c
+++ b/xkb/xkbUtils.c
@@ -24,6 +24,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
+/* $XFree86: xc/programs/Xserver/xkb/xkbUtils.c,v 3.13 2001/08/23 14:33:26 alanh Exp $ */
#include <stdio.h>
#include <ctype.h>
@@ -362,7 +363,7 @@ register unsigned key;
XkbApplyCompatMapToKey(xkb,key,changes);
}
- if (changes->map.changed&XkbVirtualModMapMask|XkbModifierMapMask) {
+ if (changes->map.changed&(XkbVirtualModMapMask|XkbModifierMapMask)) {
unsigned char newVMods[XkbNumVirtualMods];
register unsigned bit,i;
unsigned present;
@@ -550,15 +551,15 @@ CARD8 keysPerMod[XkbNumModifiers];
if (maxKeysPerMod>0) {
tmp= maxKeysPerMod*XkbNumModifiers;
if (keyc->modifierKeyMap==NULL)
- keyc->modifierKeyMap= (KeyCode *)Xcalloc(tmp);
+ keyc->modifierKeyMap= (KeyCode *)_XkbCalloc(1, tmp);
else if (keyc->maxKeysPerModifier<maxKeysPerMod)
- keyc->modifierKeyMap= (KeyCode *)Xrealloc(keyc->modifierKeyMap,tmp);
+ keyc->modifierKeyMap= (KeyCode *)_XkbRealloc(keyc->modifierKeyMap,tmp);
if (keyc->modifierKeyMap==NULL)
FatalError("Couldn't allocate modifierKeyMap in UpdateCore\n");
bzero(keyc->modifierKeyMap,tmp);
}
else if ((keyc->maxKeysPerModifier>0)&&(keyc->modifierKeyMap!=NULL)) {
- Xfree(keyc->modifierKeyMap);
+ _XkbFree(keyc->modifierKeyMap);
keyc->modifierKeyMap= NULL;
}
keyc->maxKeysPerModifier= maxKeysPerMod;
@@ -854,22 +855,22 @@ XkbComputeDerivedState(xkbi)
{
XkbStatePtr state= &xkbi->state;
XkbControlsPtr ctrls= xkbi->desc->ctrls;
-unsigned grp;
+char grp;
state->mods= (state->base_mods|state->latched_mods);
state->mods|= state->locked_mods;
state->lookup_mods= state->mods&(~ctrls->internal.mask);
state->grab_mods= state->lookup_mods&(~ctrls->ignore_lock.mask);
state->grab_mods|=
- (state->base_mods|state->latched_mods&ctrls->ignore_lock.mask);
+ ((state->base_mods|state->latched_mods)&ctrls->ignore_lock.mask);
grp= state->locked_group;
- if (grp>=ctrls->num_groups)
+ if ((grp>=ctrls->num_groups) || (grp<0))
state->locked_group= XkbAdjustGroup(grp,ctrls);
grp= state->locked_group+state->base_group+state->latched_group;
- if (grp>=ctrls->num_groups)
+ if ((grp>=ctrls->num_groups) || (grp<0))
state->group= XkbAdjustGroup(grp,ctrls);
else state->group= grp;
XkbComputeCompatState(xkbi);
@@ -1137,5 +1138,3 @@ XkbConvertCase(sym, lower, upper)
break;
}
}
-
-