xserver: Branch 'master' - 2 commits

Peter Hutterer whot at kemper.freedesktop.org
Sun Mar 8 21:03:49 PDT 2009


 Xi/exevents.c   |   10 +++++-----
 Xi/xiproperty.c |    6 ++++++
 2 files changed, 11 insertions(+), 5 deletions(-)

New commits:
commit 0d9a42dc0380d1583889b6b6521bd5a2451735d4
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Mar 9 08:59:01 2009 +1000

    Xi: don't crash on a NULL property name, just return None.
    
    strcmp doesn't like NULL-pointers.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c
index c961ea5..d633f51 100644
--- a/Xi/xiproperty.c
+++ b/Xi/xiproperty.c
@@ -172,11 +172,17 @@ static long XIPropHandlerID = 1;
 /**
  * Return the atom assigned to the specified string or 0 if the atom isn't known
  * to the DIX.
+ *
+ * If name is NULL, None is returned.
  */
 Atom
 XIGetKnownProperty(char *name)
 {
     int i;
+
+    if (!name)
+        return None;
+
     for (i = 0; i < (sizeof(dev_properties)/sizeof(struct dev_properties)); i++)
     {
         if (strcmp(name, dev_properties[i].name) == 0){
commit 432a95032eb10f82fb59caa29e52d3f56dfb363c
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Sun Mar 8 21:34:02 2009 +1000

    Remove useless (void) typecasts.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 1915e3f..6a48a8e 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1117,7 +1117,7 @@ DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail,
     event.window = pWin->drawable.id;
     event.time = currentTime.milliseconds;
 
-    (void)DeliverEventsToWindow(dev, pWin, (xEvent *) & event, 1,
+    DeliverEventsToWindow(dev, pWin, (xEvent *) & event, 1,
 				DeviceFocusChangeMask, NullGrab, dev->id);
 
     if ((type == DeviceFocusIn) &&
@@ -1214,7 +1214,7 @@ DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail,
 	    }
 	}
 
-	(void)DeliverEventsToWindow(dev, pWin, (xEvent *) sev, evcount,
+	DeliverEventsToWindow(dev, pWin, (xEvent *) sev, evcount,
 				    DeviceStateNotifyMask, NullGrab, dev->id);
 	xfree(sev);
     }
@@ -1565,7 +1565,7 @@ SendEvent(ClientPtr client, DeviceIntPtr d, Window dest, Bool propagate,
 		break;
 	}
     } else if (!XaceHook(XACE_SEND_ACCESS, client, NULL, pWin, ev, count))
-	(void)(DeliverEventsToWindow(d, pWin, ev, count, mask, NullGrab, d->id));
+	DeliverEventsToWindow(d, pWin, ev, count, mask, NullGrab, d->id);
     return Success;
 }
 
@@ -1870,7 +1870,7 @@ FindInterestedChildren(DeviceIntPtr dev, WindowPtr p1, Mask mask,
 
     while (p1) {
         p2 = p1->firstChild;
-        (void)DeliverEventsToWindow(dev, p1, ev, count, mask, NullGrab, dev->id);
+        DeliverEventsToWindow(dev, p1, ev, count, mask, NullGrab, dev->id);
         FindInterestedChildren(dev, p2, mask, ev, count);
         p1 = p1->nextSib;
     }
@@ -1892,7 +1892,7 @@ SendEventToAllWindows(DeviceIntPtr dev, Mask mask, xEvent * ev, int count)
         pWin = WindowTable[i];
         if (!pWin)
             continue;
-        (void)DeliverEventsToWindow(dev, pWin, ev, count, mask, NullGrab, dev->id);
+        DeliverEventsToWindow(dev, pWin, ev, count, mask, NullGrab, dev->id);
         p1 = pWin->firstChild;
         FindInterestedChildren(dev, p1, mask, ev, count);
     }


More information about the xorg-commit mailing list