[PATCH xts 2/2] XI: Fix random failures on LP64 platforms

Peter Harris pharris at opentext.com
Thu May 30 15:46:34 PDT 2013


It turns out that XID is a 'long' for historical reasons, but the XInput
error macros expect a pointer-to-int.

Signed-off-by: Peter Harris <pharris at opentext.com>
---
 xts5/XI/AllowDeviceEvents.m         |    2 +-
 xts5/XI/ChangeDeviceControl.m       |    2 +-
 xts5/XI/ChangeFeedbackControl.m     |    2 +-
 xts5/XI/ChangeKeyboardDevice.m      |    4 ++--
 xts5/XI/ChangePointerDevice.m       |    4 ++--
 xts5/XI/CloseDevice.m               |    4 ++--
 xts5/XI/DeviceBell.m                |    2 +-
 xts5/XI/GetDeviceMotionEvents.m     |    2 +-
 xts5/XI/GetFeedbackControl.m        |    2 +-
 xts5/XI/GrabDevice.m                |    6 +++---
 xts5/XI/GrabDeviceButton.m          |    6 +++---
 xts5/XI/GrabDeviceKey.m             |    6 +++---
 xts5/XI/OpenDevice.m                |    4 ++--
 xts5/XI/SendExtensionEvent.m        |    4 ++--
 xts5/XI/SetDeviceButtonMapping.m    |    2 +-
 xts5/XI/SetDeviceMode.m             |    2 +-
 xts5/XI/SetDeviceModifierMapping.m  |    2 +-
 xts5/XI/SetDeviceValuators.m        |    2 +-
 xts5/XI/UngrabDeviceButton.m        |    5 +++--
 xts5/XI/UngrabDeviceKey.m           |    4 ++--
 xts5/XI/XGetDeviceControl.m         |    2 +-
 xts5/XI/XGetDeviceFocus.m           |    2 +-
 xts5/XI/XGetDeviceKeyMapping.m      |    2 +-
 xts5/XI/XGetDeviceModifierMapping.m |    2 +-
 xts5/XI/XQueryDeviceState.m         |    2 +-
 xts5/XI/XSelectExtensionEvent.m     |    2 +-
 xts5/XI/XSetDeviceFocus.m           |    2 +-
 xts5/XI/XUngrabDevice.m             |    2 +-
 28 files changed, 42 insertions(+), 41 deletions(-)

diff --git a/xts5/XI/AllowDeviceEvents.m b/xts5/XI/AllowDeviceEvents.m
index 90e26a2..ecde6ae 100644
--- a/xts5/XI/AllowDeviceEvents.m
+++ b/xts5/XI/AllowDeviceEvents.m
@@ -1338,7 +1338,7 @@ is specified.
 Make the call with an invalid device.
 >>CODE baddevice
 XDevice nodevice;
-XID baddevice;
+int baddevice;
 int ret;
 
 	if (!grabstartup())
diff --git a/xts5/XI/ChangeDeviceControl.m b/xts5/XI/ChangeDeviceControl.m
index 92f56d6..4ce7ae7 100644
--- a/xts5/XI/ChangeDeviceControl.m
+++ b/xts5/XI/ChangeDeviceControl.m
@@ -465,7 +465,7 @@ If an invalid device is specified, a BadDevice error will result.
 Do a ChangeDeviceControl request, specifying an invalid device.
 >>CODE baddevice
 XDevice bogus;
-XID baddevice;
+int baddevice;
 int ximajor, first, err, ret, val;
 
     if (!XQueryExtension (display, INAME, &ximajor, &first, &err))
diff --git a/xts5/XI/ChangeFeedbackControl.m b/xts5/XI/ChangeFeedbackControl.m
index febb934..e240e67 100644
--- a/xts5/XI/ChangeFeedbackControl.m
+++ b/xts5/XI/ChangeFeedbackControl.m
@@ -590,7 +590,7 @@ If an invalid device is specified, a BadDevice error will result.
 Do a ChangeFeedbackControl, specifying an invalid device.
 >>CODE baddevice
 XDevice bogus;
-XID baddevice;
+int baddevice;
 int ximajor, first, err;
 
     if (!XQueryExtension (display, INAME, &ximajor, &first, &err)) {
diff --git a/xts5/XI/ChangeKeyboardDevice.m b/xts5/XI/ChangeKeyboardDevice.m
index 678db9e..b0b6b16 100644
--- a/xts5/XI/ChangeKeyboardDevice.m
+++ b/xts5/XI/ChangeKeyboardDevice.m
@@ -351,7 +351,7 @@ Change the keyboard to a new device.
 Verify that all input device extension requests that require a Device pointer
 fail with a BadDevice error, when the new keyboard is specified.
 >>CODE
-XID baddevice;
+int baddevice;
 int devicekeypress;
 XDeviceInfo *list;
 int i, ndevices, revert, nfeed, mask, ksyms_per;
@@ -690,7 +690,7 @@ is specified.
 Make the call with an invalid device.
 >>CODE baddevice
 XDevice nodevice;
-XID baddevice;
+int baddevice;
 int ximajor, first, err;
 
 	if (!XQueryExtension (display, INAME, &ximajor, &first, &err))
diff --git a/xts5/XI/ChangePointerDevice.m b/xts5/XI/ChangePointerDevice.m
index 0c18a58..d203f6e 100644
--- a/xts5/XI/ChangePointerDevice.m
+++ b/xts5/XI/ChangePointerDevice.m
@@ -358,7 +358,7 @@ Change the pointer to a new device.
 Verify that all input device extension requests that require a Device pointer
 fail with a BadDevice error, when the new pointer is specified.
 >>CODE
-XID baddevice;
+int baddevice;
 int devicemotionnotify;
 XDeviceInfo *list;
 int i, ndevices, revert, nfeed, mask, ksyms_per, savid;
@@ -722,7 +722,7 @@ When an invalid device is specified, a BadDevice error will result.
 Make the call with an invalid device.
 >>CODE baddevice
 XDevice nodevice;
-XID baddevice;
+int baddevice;
 int ximajor, first, err;
 
 	if (!XQueryExtension (display, INAME, &ximajor, &first, &err))
diff --git a/xts5/XI/CloseDevice.m b/xts5/XI/CloseDevice.m
index 1ab0273..c1bc64c 100644
--- a/xts5/XI/CloseDevice.m
+++ b/xts5/XI/CloseDevice.m
@@ -400,7 +400,7 @@ Call xname to close a device.
 Call other input device extension requests.
 Verify a BadDevice error occurs.
 >>CODE
-XID 	baddevice; 
+int 	baddevice;
 int	devicekeypress;
 XDeviceInfo *list;
 int ret, i, j, ndevices, revert, nfeed, mask, ksyms_per;
@@ -813,7 +813,7 @@ is specified.
 >>STRATEGY
 Make the call with an invalid device.
 >>CODE baddevice
-XID baddevice;
+int baddevice;
 int ret;
 
 	if (!Setup_Extension_DeviceInfo(KeyMask))
diff --git a/xts5/XI/DeviceBell.m b/xts5/XI/DeviceBell.m
index 95d2df3..a4bd580 100644
--- a/xts5/XI/DeviceBell.m
+++ b/xts5/XI/DeviceBell.m
@@ -224,7 +224,7 @@ is specified.
 Make the call with an invalid device.
 >>CODE baddevice
 XDevice nodevice;
-XID baddevice;
+int baddevice;
 int ximajor, first, err;
 
 	if (!XQueryExtension (display, INAME, &ximajor, &first, &err))
diff --git a/xts5/XI/GetDeviceMotionEvents.m b/xts5/XI/GetDeviceMotionEvents.m
index b963296..29e20e3 100644
--- a/xts5/XI/GetDeviceMotionEvents.m
+++ b/xts5/XI/GetDeviceMotionEvents.m
@@ -448,7 +448,7 @@ results.
 Specify an invalid device.
 Verify that a BadDevice error results.
 >>CODE baddevice
-XID baddevice;
+int baddevice;
 XDevice nodevice;
 XDeviceTimeCoord *tc;
 int ximajor, first, err;
diff --git a/xts5/XI/GetFeedbackControl.m b/xts5/XI/GetFeedbackControl.m
index fd13075..bc0097e 100644
--- a/xts5/XI/GetFeedbackControl.m
+++ b/xts5/XI/GetFeedbackControl.m
@@ -139,7 +139,7 @@ XFeedbackState *state;
 A call to xname
 returns a BadDevice error if an invalid device is specified.
 >>CODE baddevice
-XID 	baddevice;
+int 	baddevice;
 XDevice bogus;
 XFeedbackState *state;
 int ximajor, first, err;
diff --git a/xts5/XI/GrabDevice.m b/xts5/XI/GrabDevice.m
index 7eae5d7..9f6bf17 100644
--- a/xts5/XI/GrabDevice.m
+++ b/xts5/XI/GrabDevice.m
@@ -260,7 +260,7 @@ Call xname, specifying event classes from another device.
 Verify that a BadClass error occurs.
 >>CODE badclass
 int 	ret;
-XID	badclass;
+int	badclass;
 int	dkp;
 XEventClass dkpclass;
 
@@ -679,7 +679,7 @@ a BadClass error will result.
 Verify that xname fails and returns BadValue.
 >>CODE badclass
 int 	ret;
-XID badclass;
+int badclass;
 XEventClass	bogus[2];
 
 	if (!Setup_Extension_DeviceInfo(AnyMask))
@@ -795,7 +795,7 @@ Verify that xname fails and returns BadDevice.
 >>CODE baddevice
 int 	ret;
 XDevice bogus;
-XID baddevice;
+int baddevice;
 
 	if (!Setup_Extension_DeviceInfo(AnyMask))
 	    {
diff --git a/xts5/XI/GrabDeviceButton.m b/xts5/XI/GrabDeviceButton.m
index e95a77b..511122c 100644
--- a/xts5/XI/GrabDeviceButton.m
+++ b/xts5/XI/GrabDeviceButton.m
@@ -1079,7 +1079,7 @@ a BadDevice error will result.
 Specify an invalid device.
 >>CODE baddevice
 XDevice bogus;
-XID baddevice;
+int baddevice;
 
 	if (!Setup_Extension_DeviceInfo(BtnMask))
 	    {
@@ -1106,7 +1106,7 @@ a BadDevice error will result.
 Specify an invalid modifier device.
 >>CODE baddevice
 XDevice bogus;
-XID baddevice;
+int baddevice;
 
 	if (!Setup_Extension_DeviceInfo(BtnMask))
 	    {
@@ -1133,7 +1133,7 @@ a BadClass error will result.
 Specify an invalid event class.
 >>CODE badclass
 XEventClass eclass = -1;
-XID badclass;
+int badclass;
 
 	if (!Setup_Extension_DeviceInfo(ModMask | BtnMask))
 	    {
diff --git a/xts5/XI/GrabDeviceKey.m b/xts5/XI/GrabDeviceKey.m
index 2dd5bcf..a3eeada 100644
--- a/xts5/XI/GrabDeviceKey.m
+++ b/xts5/XI/GrabDeviceKey.m
@@ -1063,7 +1063,7 @@ BadMatch error results.
 When an invalid modifier_device is specified in an xname protocol request, a
 BadValue error results.
 >>CODE baddevice
-XID baddevice;
+int baddevice;
 XDevice bogus;
 
 	if (!Setup_Extension_DeviceInfo(KeyMask))
@@ -1088,7 +1088,7 @@ XDevice bogus;
 When an invalid device is specified in an xname protocol request, a
 BadValue error results.
 >>CODE baddevice
-XID baddevice;
+int baddevice;
 XDevice bogus;
 
 	if (!Setup_Extension_DeviceInfo(KeyMask))
@@ -1116,7 +1116,7 @@ BadValue error results.
 Specify an invalid event class.
 >>CODE badclass
 XEventClass eclass = -1;
-XID badclass;
+int badclass;
 
 	if (!Setup_Extension_DeviceInfo(KeyMask))
 	    {
diff --git a/xts5/XI/OpenDevice.m b/xts5/XI/OpenDevice.m
index 595e01b..66d19ac 100644
--- a/xts5/XI/OpenDevice.m
+++ b/xts5/XI/OpenDevice.m
@@ -150,7 +150,7 @@ A call to xname with an invalid deviceid returns a BadDevice error.
 Call xname.
 >>CODE baddevice
 XDevice *dev;
-XID	baddevice;
+int	baddevice;
 int ximajor, first, err;
 
 	if (!XQueryExtension (display, INAME, &ximajor, &first, &err))
@@ -173,7 +173,7 @@ returns a BadDevice error.
 Call xname.
 >>CODE baddevice
 int 	i, ndevs;
-XID	baddevice;
+int	baddevice;
 XDeviceInfo *list;
 XDevice *ret;
 
diff --git a/xts5/XI/SendExtensionEvent.m b/xts5/XI/SendExtensionEvent.m
index 01f448d..2a13d8e 100644
--- a/xts5/XI/SendExtensionEvent.m
+++ b/xts5/XI/SendExtensionEvent.m
@@ -2282,7 +2282,7 @@ Specify a bad device.
 Initialise the event structure for the call.
 Verify that a baddevice error occurs.
 >>CODE baddevice
-XID baddevice;
+int baddevice;
 int	 dbp;
 XEventClass dbpc;
 XDevice bogus;
@@ -2329,7 +2329,7 @@ Specify a bad event class;
 Initialise the event structure for the call.
 Verify that a badclass error occurs.
 >>CODE badclass
-XID badclass;
+int badclass;
 int	dbp;
 XEventClass bogus=-1, dbpc;
 int	return_value;
diff --git a/xts5/XI/SetDeviceButtonMapping.m b/xts5/XI/SetDeviceButtonMapping.m
index 54b03ad..62108ec 100644
--- a/xts5/XI/SetDeviceButtonMapping.m
+++ b/xts5/XI/SetDeviceButtonMapping.m
@@ -111,7 +111,7 @@ int 	nmap = 255;
  */
 #define	MAPSIZE	256
 static	unsigned char	Map[MAPSIZE];
-static 	XID baddevice; 
+static 	int baddevice;
 
 static	int 	nbtns;
 extern ExtDeviceInfo Devs;
diff --git a/xts5/XI/SetDeviceMode.m b/xts5/XI/SetDeviceMode.m
index 8139cbf..0430597 100644
--- a/xts5/XI/SetDeviceMode.m
+++ b/xts5/XI/SetDeviceMode.m
@@ -224,7 +224,7 @@ is specified.
 Make the call with an invalid device.
 >>CODE baddevice
 XDevice nodevice;
-XID baddevice;
+int baddevice;
 int ximajor, first, err;
 
 	if (!XQueryExtension (display, INAME, &ximajor, &first, &err)) {
diff --git a/xts5/XI/SetDeviceModifierMapping.m b/xts5/XI/SetDeviceModifierMapping.m
index fad3d26..22f179a 100644
--- a/xts5/XI/SetDeviceModifierMapping.m
+++ b/xts5/XI/SetDeviceModifierMapping.m
@@ -465,7 +465,7 @@ If an invalid device is specified, a BadDevice error occurs.
 Specifiy an invalid device.
 >>CODE baddevice
 int ret;
-XID baddevice;
+int baddevice;
 XDevice bogus;
 int ximajor, first, err;
 
diff --git a/xts5/XI/SetDeviceValuators.m b/xts5/XI/SetDeviceValuators.m
index 54b4ccd..94bae1c 100644
--- a/xts5/XI/SetDeviceValuators.m
+++ b/xts5/XI/SetDeviceValuators.m
@@ -380,7 +380,7 @@ is specified.
 Make the call with an invalid device.
 >>CODE baddevice
 XDevice nodevice;
-XID baddevice;
+int baddevice;
 int ximajor, first, err;
 
 	if (!XQueryExtension (display, INAME, &ximajor, &first, &err)) {
diff --git a/xts5/XI/UngrabDeviceButton.m b/xts5/XI/UngrabDeviceButton.m
index 64c214b..203b6fc 100644
--- a/xts5/XI/UngrabDeviceButton.m
+++ b/xts5/XI/UngrabDeviceButton.m
@@ -648,7 +648,8 @@ BadMatch error.
 A call to xname specifying an invalid device results in a 
 BadDevice error.
 >>CODE baddevice
-XID baddevice, savedevice;
+int baddevice;
+XID savedevice;
 
 	if (!Setup_Extension_DeviceInfo(BtnMask))
 	    {
@@ -675,7 +676,7 @@ XID baddevice, savedevice;
 A call to xname specifying an invalid modifier device results in a 
 BadDevice error.
 >>CODE baddevice
-XID baddevice;
+int baddevice;
 XDevice bogus;
 
 	if (!Setup_Extension_DeviceInfo(BtnMask))
diff --git a/xts5/XI/UngrabDeviceKey.m b/xts5/XI/UngrabDeviceKey.m
index 1b577f8..85927c4 100644
--- a/xts5/XI/UngrabDeviceKey.m
+++ b/xts5/XI/UngrabDeviceKey.m
@@ -656,7 +656,7 @@ BadMatch error.
 A call to xname specifying an invalid modifier device results in a
 BadDevice error.
 >>CODE baddevice
-XID baddevice;
+int baddevice;
 XDevice bogus;
 
 	if (!Setup_Extension_DeviceInfo(KeyMask))
@@ -680,7 +680,7 @@ XDevice bogus;
 A call to xname specifying an invalid grab device results in a
 BadDevice error.
 >>CODE baddevice
-XID baddevice;
+int baddevice;
 XDevice bogus;
 
 	if (!Setup_Extension_DeviceInfo(KeyMask))
diff --git a/xts5/XI/XGetDeviceControl.m b/xts5/XI/XGetDeviceControl.m
index 403447e..ff1fdc0 100644
--- a/xts5/XI/XGetDeviceControl.m
+++ b/xts5/XI/XGetDeviceControl.m
@@ -171,7 +171,7 @@ is specified.
 Make the call with an invalid device.
 >>CODE baddevice
 XDevice nodevice;
-XID baddevice;
+int baddevice;
 int ximajor, first, err;
 
 	if (!XQueryExtension (display, INAME, &ximajor, &first, &err))
diff --git a/xts5/XI/XGetDeviceFocus.m b/xts5/XI/XGetDeviceFocus.m
index 5afd482..e088747 100644
--- a/xts5/XI/XGetDeviceFocus.m
+++ b/xts5/XI/XGetDeviceFocus.m
@@ -107,7 +107,7 @@ Time	*time1 = &focus_time;
 Window fwin;
 int revert;
 Time focus_time;
-XID baddevice;
+int baddevice;
 extern ExtDeviceInfo Devs;
 
 >>ASSERTION Good B 3
diff --git a/xts5/XI/XGetDeviceKeyMapping.m b/xts5/XI/XGetDeviceKeyMapping.m
index 69dd253..3b621cd 100644
--- a/xts5/XI/XGetDeviceKeyMapping.m
+++ b/xts5/XI/XGetDeviceKeyMapping.m
@@ -412,7 +412,7 @@ is specified.
 Make the call with an invalid device.
 >>CODE baddevice
 XDevice nodevice;
-XID baddevice;
+int baddevice;
 int ximajor, first, err;
 
 	if (!XQueryExtension (display, INAME, &ximajor, &first, &err))
diff --git a/xts5/XI/XGetDeviceModifierMapping.m b/xts5/XI/XGetDeviceModifierMapping.m
index a94a628..fef3bb6 100644
--- a/xts5/XI/XGetDeviceModifierMapping.m
+++ b/xts5/XI/XGetDeviceModifierMapping.m
@@ -301,7 +301,7 @@ If an invalid device is specified, a BadDevice error occurs.
 Specifiy an invalid device.
 >>CODE baddevice
 XModifierKeymap *ret;
-XID baddevice;
+int baddevice;
 XDevice bogus;
 int ximajor, first, err;
 
diff --git a/xts5/XI/XQueryDeviceState.m b/xts5/XI/XQueryDeviceState.m
index 003477e..4ac6e92 100644
--- a/xts5/XI/XQueryDeviceState.m
+++ b/xts5/XI/XQueryDeviceState.m
@@ -593,7 +593,7 @@ is specified.
 Make the call with an invalid device.
 >>CODE baddevice
 XDevice nodevice;
-XID baddevice;
+int baddevice;
 int ximajor, first, err;
 
 	if (!XQueryExtension (display, INAME, &ximajor, &first, &err))
diff --git a/xts5/XI/XSelectExtensionEvent.m b/xts5/XI/XSelectExtensionEvent.m
index 1b361e1..253d54e 100644
--- a/xts5/XI/XSelectExtensionEvent.m
+++ b/xts5/XI/XSelectExtensionEvent.m
@@ -1382,7 +1382,7 @@ XEventClass dbpgclass;
 A call to xname specifying an invalid eventclass results in a BadClass
 error.
 >>CODE badclass
-XID badclass;
+int badclass;
 XEventClass bogus;
 
 	if (!Setup_Extension_DeviceInfo(BtnMask))
diff --git a/xts5/XI/XSetDeviceFocus.m b/xts5/XI/XSetDeviceFocus.m
index 0fafc4f..e0c3920 100644
--- a/xts5/XI/XSetDeviceFocus.m
+++ b/xts5/XI/XSetDeviceFocus.m
@@ -104,7 +104,7 @@ Window	focus = PointerRoot;
 int	revert_to = RevertToPointerRoot;
 int	time1 = CurrentTime;
 >>EXTERN
-XID baddevice;
+int baddevice;
 extern ExtDeviceInfo Devs;
 extern int MinKeyCode;
 
diff --git a/xts5/XI/XUngrabDevice.m b/xts5/XI/XUngrabDevice.m
index 864adea..2f3b7f8 100644
--- a/xts5/XI/XUngrabDevice.m
+++ b/xts5/XI/XUngrabDevice.m
@@ -377,7 +377,7 @@ is specified.
 Make the call with an invalid device.
 >>CODE baddevice
 XDevice nodevice;
-XID baddevice;
+int baddevice;
 int ximajor, first, err;
 
 	if (!XQueryExtension (display, INAME, &ximajor, &first, &err))
-- 
1.7.10.4



More information about the xorg-devel mailing list