[PATCH:libX11 1/2] Fix map->num_types check in XkbAddKeyType()

walter harms wharms at bfs.de
Thu Jul 10 01:13:11 PDT 2014


hi Alan,

since you are looking into LibX11 ... can you take a look at XKBMisc.c ?
I already tried to fix this with Peter Hutterer but he is very busy also.

what caused my attention was this construct:
(tmp= XkbModActionVMods(&act->iso))!=0) & changed)

my guess is that the !=0 is nonsens.

re,
 wh


Bool
XkbUpdateActionVirtualMods(XkbDescPtr xkb,XkbAction *act,unsigned changed)
{
unsigned int	tmp;

    switch (act->type) {
	case XkbSA_SetMods: case XkbSA_LatchMods: case XkbSA_LockMods:
	    if (((tmp= XkbModActionVMods(&act->mods))&changed)!=0) {
		XkbVirtualModsToReal(xkb,tmp,&tmp);
		act->mods.mask= act->mods.real_mods;
		act->mods.mask|= tmp;
		return True;
	    }
	    break;
	case XkbSA_ISOLock:
	    if ((((tmp= XkbModActionVMods(&act->iso))!=0)&changed)!=0) {

	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
this looks strange.


		XkbVirtualModsToReal(xkb,tmp,&tmp);
		act->iso.mask= act->iso.real_mods;
		act->iso.mask|= tmp;
		return True;
	    }
	    break;
    }
    return False;
}



More information about the xorg-devel mailing list