[PATCH xinput 2/2] Initialize a few more values to defaults.

Peter Hutterer peter.hutterer at who-t.net
Wed May 4 16:14:45 PDT 2011


If we ever print <undefined> for those, we have a buggy X server that's
breaking the protocol. Until that happens this is just to shut up clang.

All three are assigned constant strings only, no free() needed.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/test_xi2.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/test_xi2.c b/src/test_xi2.c
index 5b56397..3c3fee3 100644
--- a/src/test_xi2.c
+++ b/src/test_xi2.c
@@ -99,7 +99,7 @@ static void print_hierarchychangedevent(XIHierarchyEvent *event)
 
     for (i = 0; i < event->num_info; i++)
     {
-        char *use;
+        char *use = "<undefined>";
         switch(event->info[i].use)
         {
             case XIMasterPointer: use = "master pointer"; break;
@@ -149,7 +149,8 @@ static void print_rawevent(XIRawEvent *event)
 
 static void print_enterleave(XILeaveEvent* event)
 {
-    char *mode, *detail;
+    char *mode = "<undefined>",
+         *detail = "<undefined>";
     int i;
 
     printf("    device: %d (%d)\n", event->deviceid, event->sourceid);
-- 
1.7.4.4



More information about the xorg-devel mailing list