summaryrefslogtreecommitdiff
path: root/Xext/xtest.c
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2009-10-08 13:38:44 +1100
committerDaniel Stone <daniel@fooishbar.org>2009-10-08 13:38:44 +1100
commitb0dd6be2c8703f7062d45ac9fd646550c7d54e3b (patch)
tree98c7ac7a8d90fea6fcdd44525fc42e84d0cb4914 /Xext/xtest.c
parentb680a89262efcfef4644adb4a61ae42ea0db0c93 (diff)
Cast small-int values through intptr_t when passed as pointers
On 64-bit systems, int and pointers don't have the same size, so GCC gives warnings about casts between int and pointer types. However, in the cases covered by this patch, it's always a value that fits in int being stored temporarily as a pointer and then converted back later, which is safe. Casting through the pointer-sized integer type intptr_t convinces the compiler that this is OK. Signed-off-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'Xext/xtest.c')
-rw-r--r--Xext/xtest.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Xext/xtest.c b/Xext/xtest.c
index 6b0e9fd14..5af2b5c83 100644
--- a/Xext/xtest.c
+++ b/Xext/xtest.c
@@ -640,8 +640,8 @@ int AllocXTestDevice (ClientPtr client, char* name,
retval = AllocDevicePair( client, xtestname, ptr, keybd, CorePointerProc, CoreKeyboardProc, FALSE);
if ( retval == Success ){
- dixSetPrivate(&((*ptr)->devPrivates), XTestDevicePrivateKey, (void *)master_ptr->id);
- dixSetPrivate(&((*keybd)->devPrivates), XTestDevicePrivateKey, (void *)master_keybd->id);
+ dixSetPrivate(&((*ptr)->devPrivates), XTestDevicePrivateKey, (void *)(intptr_t)master_ptr->id);
+ dixSetPrivate(&((*keybd)->devPrivates), XTestDevicePrivateKey, (void *)(intptr_t)master_keybd->id);
XIChangeDeviceProperty(*ptr, XIGetKnownProperty(XI_PROP_XTEST_DEVICE),
XA_INTEGER, 8, PropModeReplace, 1, &dummy,
@@ -677,7 +677,7 @@ IsXTestDevice(DeviceIntPtr dev, DeviceIntPtr master)
return is_XTest;
tmp = dixLookupPrivate(&dev->devPrivates, XTestDevicePrivateKey);
- mid = (int)tmp;
+ mid = (intptr_t)tmp;
/* deviceid 0 is reserved for XIAllDevices, non-zero mid means XTest
* device */