Fixed compiler warning.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 11 Jul 2013 12:26:18 -0400
changeset 7402 235c9aaeefd1
parent 7401 698995795574
child 7403 9de6ef8865a2
Fixed compiler warning.
src/video/x11/SDL_x11events.c
--- a/src/video/x11/SDL_x11events.c	Thu Jul 11 12:17:13 2013 -0400
+++ b/src/video/x11/SDL_x11events.c	Thu Jul 11 12:26:18 2013 -0400
@@ -187,8 +187,9 @@
 #if SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS
 static void X11_HandleGenericEvent(SDL_VideoData *videodata,XEvent event)
 {
-    if (XGetEventData(videodata->display, &event)) {
-        XGenericEventCookie *cookie = &event.xcookie;
+    /* event is a union, so cookie == &event, but this is type safe. */
+    XGenericEventCookie *cookie = &event.xcookie;
+    if (XGetEventData(videodata->display, cookie)) {
         X11_HandleXinput2Event(videodata, cookie);
         XFreeEventData(videodata->display, cookie);
     }