[PATCH 2/5] test: fix "userdata shadows global declaration" warnings

Peter Hutterer peter.hutterer at who-t.net
Tue May 15 00:03:00 PDT 2012


protocol-xiquerypointer.c:124:72: warning: declaration of
‘userdata’ shadows a global declaration [-Wshadow]

and similar

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 test/xi2/protocol-xipassivegrabdevice.c |    6 +++---
 test/xi2/protocol-xiquerydevice.c       |    8 ++++----
 test/xi2/protocol-xiquerypointer.c      |    6 +++---
 test/xi2/protocol-xiqueryversion.c      |    8 ++++----
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/test/xi2/protocol-xipassivegrabdevice.c b/test/xi2/protocol-xipassivegrabdevice.c
index 53c65bd..1d8c46b 100644
--- a/test/xi2/protocol-xipassivegrabdevice.c
+++ b/test/xi2/protocol-xipassivegrabdevice.c
@@ -54,7 +54,7 @@ int __wrap_GrabButton(ClientPtr client, DeviceIntPtr dev,
                       GrabParameters *param, enum InputLevel grabtype,
                       GrabMask *mask);
 static void reply_XIPassiveGrabDevice_data(ClientPtr client, int len,
-                                           char *data, void *userdata);
+                                           char *data, void *closure);
 
 int
 __wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access)
@@ -85,7 +85,7 @@ __wrap_GrabButton(ClientPtr client, DeviceIntPtr dev,
 }
 
 static void
-reply_XIPassiveGrabDevice(ClientPtr client, int len, char *data, void *userdata)
+reply_XIPassiveGrabDevice(ClientPtr client, int len, char *data, void *closure)
 {
     xXIPassiveGrabDeviceReply *rep = (xXIPassiveGrabDeviceReply *) data;
 
@@ -107,7 +107,7 @@ reply_XIPassiveGrabDevice(ClientPtr client, int len, char *data, void *userdata)
 
 static void
 reply_XIPassiveGrabDevice_data(ClientPtr client, int len, char *data,
-                               void *userdata)
+                               void *closure)
 {
     int i;
 
diff --git a/test/xi2/protocol-xiquerydevice.c b/test/xi2/protocol-xiquerydevice.c
index 5e59e80..e588f8d 100644
--- a/test/xi2/protocol-xiquerydevice.c
+++ b/test/xi2/protocol-xiquerydevice.c
@@ -54,9 +54,9 @@ struct test_data {
 };
 
 static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data,
-                                     void *userdata);
+                                     void *closure);
 static void reply_XIQueryDevice(ClientPtr client, int len, char *data,
-                                void *userdata);
+                                void *closure);
 
 /* reply handling for the first bytes that constitute the reply */
 static void
@@ -86,10 +86,10 @@ reply_XIQueryDevice(ClientPtr client, int len, char *data, void *userdata)
 
 /* reply handling for the trailing bytes that constitute the device info */
 static void
-reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void *userdata)
+reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void *closure)
 {
     int i, j;
-    struct test_data *querydata = (struct test_data *) userdata;
+    struct test_data *querydata = (struct test_data *) closure;
 
     DeviceIntPtr dev;
     xXIDeviceInfo *info = (xXIDeviceInfo *) data;
diff --git a/test/xi2/protocol-xiquerypointer.c b/test/xi2/protocol-xiquerypointer.c
index 4756a6b..ff7ff5c 100644
--- a/test/xi2/protocol-xiquerypointer.c
+++ b/test/xi2/protocol-xiquerypointer.c
@@ -42,7 +42,7 @@
 
 static ClientRec client_request;
 static void reply_XIQueryPointer_data(ClientPtr client, int len,
-                                      char *data, void *userdata);
+                                      char *data, void *closure);
 
 static struct {
     DeviceIntPtr dev;
@@ -70,7 +70,7 @@ __wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access)
 }
 
 static void
-reply_XIQueryPointer(ClientPtr client, int len, char *data, void *userdata)
+reply_XIQueryPointer(ClientPtr client, int len, char *data, void *closure)
 {
     xXIQueryPointerReply *rep = (xXIQueryPointerReply *) data;
     SpritePtr sprite;
@@ -121,7 +121,7 @@ reply_XIQueryPointer(ClientPtr client, int len, char *data, void *userdata)
 }
 
 static void
-reply_XIQueryPointer_data(ClientPtr client, int len, char *data, void *userdata)
+reply_XIQueryPointer_data(ClientPtr client, int len, char *data, void *closure)
 {
     reply_handler = reply_XIQueryPointer;
 }
diff --git a/test/xi2/protocol-xiqueryversion.c b/test/xi2/protocol-xiqueryversion.c
index 1347e86..aff0237 100644
--- a/test/xi2/protocol-xiqueryversion.c
+++ b/test/xi2/protocol-xiqueryversion.c
@@ -59,10 +59,10 @@ struct test_data {
 };
 
 static void
-reply_XIQueryVersion(ClientPtr client, int len, char *data, void *userdata)
+reply_XIQueryVersion(ClientPtr client, int len, char *data, void *closure)
 {
     xXIQueryVersionReply *rep = (xXIQueryVersionReply *) data;
-    struct test_data *versions = (struct test_data *) userdata;
+    struct test_data *versions = (struct test_data *) closure;
     unsigned int sver, cver, ver;
 
     if (client->swapped) {
@@ -85,10 +85,10 @@ reply_XIQueryVersion(ClientPtr client, int len, char *data, void *userdata)
 }
 
 static void
-reply_XIQueryVersion_multiple(ClientPtr client, int len, char *data, void *userdata)
+reply_XIQueryVersion_multiple(ClientPtr client, int len, char *data, void *closure)
 {
     xXIQueryVersionReply *rep = (xXIQueryVersionReply *) data;
-    struct test_data *versions = (struct test_data *) userdata;
+    struct test_data *versions = (struct test_data *) closure;
 
     reply_check_defaults(rep, len, XIQueryVersion);
     assert(rep->length == 0);
-- 
1.7.10.1



More information about the xorg-devel mailing list