[PATCH 08/15] xkb: Don't check for NULL when pointer can't be NULL

Pauli Nieminen ext-pauli.nieminen at nokia.com
Tue Jul 27 05:09:49 PDT 2010


Caller quarantines that changes pointer is valid.

Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
---
 xkb/xkbUtils.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c
index 14dc784..31aff93 100644
--- a/xkb/xkbUtils.c
+++ b/xkb/xkbUtils.c
@@ -223,7 +223,6 @@ XkbDescPtr		xkb;
 unsigned		key,nG,explicit;
 int			types[XkbNumKbdGroups];
 KeySym			tsyms[XkbMaxSymsPerKey],*syms;
-XkbMapChangesPtr	mc;
 
     xkb= pXDev->key->xkbInfo->desc;
     if (first+num-1>xkb->max_key_code) {
@@ -231,8 +230,6 @@ XkbMapChangesPtr	mc;
 	num= xkb->max_key_code-first+1;
     }
 
-    mc= (changes?(&changes->map):NULL);
-
     syms= &pCore->map[(first - pCore->minKeyCode) * pCore->mapWidth];
     for (key=first; key<(first+num); key++,syms+= pCore->mapWidth) {
         explicit= xkb->server->explicit[key]&XkbExplicitKeyTypesMask;
@@ -242,7 +239,7 @@ XkbMapChangesPtr	mc;
         types[XkbGroup4Index]= XkbKeyKeyTypeIndex(xkb,key,XkbGroup4Index);
         nG= XkbKeyTypesForCoreSymbols(xkb,pCore->mapWidth,syms,explicit,types,
 									tsyms);
-	XkbChangeTypesOfKey(xkb,key,nG,XkbAllGroupsMask,types,mc);
+	XkbChangeTypesOfKey(xkb,key,nG,XkbAllGroupsMask,types,&changes->map);
 	memcpy((char *)XkbKeySymsPtr(xkb,key),(char *)tsyms,
 					XkbKeyNumSyms(xkb,key)*sizeof(KeySym));
     }
-- 
1.6.3.3



More information about the xorg-devel mailing list