]> git.eshelyaron.com Git - emacs.git/commitdiff
* xterm.c (handle_one_xevent): Avoid type-punned derefencing of X events.
authorChong Yidong <cyd@stupidchicken.com>
Fri, 8 Apr 2011 19:18:25 +0000 (15:18 -0400)
committerChong Yidong <cyd@stupidchicken.com>
Fri, 8 Apr 2011 19:18:25 +0000 (15:18 -0400)
src/ChangeLog
src/xterm.c

index 5e92b45b9d0b1a1d18768e09bd73dfe3af63fc01..82c1597e3438c2465a423ec11004318cf5512bea 100644 (file)
@@ -1,3 +1,8 @@
+2011-04-08  Chong Yidong  <cyd@stupidchicken.com>
+
+       * xterm.c (handle_one_xevent): Avoid type-punned derefencing of X
+       events.
+
 2011-04-08  Svante Signell  <svante.signell@telia.com>  (tiny change)
 
        * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
index 4b1fe20c7a2f02aa98695e318641c3f7b7214e45..be7fde03c58b1e90278aa3257379099a6d59c783 100644 (file)
@@ -4074,7 +4074,7 @@ x_window_to_scroll_bar (display, window_id)
          return XSCROLL_BAR (bar);
     }
 
-  return 0;
+  return NULL;
 }
 
 
@@ -6086,7 +6086,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
         goto OTHER;
 #endif /* USE_X_TOOLKIT */
       {
-        XSelectionClearEvent *eventp = (XSelectionClearEvent *) &event;
+        XSelectionClearEvent *eventp = &(event.xselectionclear);
 
         inev.ie.kind = SELECTION_CLEAR_EVENT;
         SELECTION_EVENT_DISPLAY (&inev.sie) = eventp->display;
@@ -6103,8 +6103,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
         goto OTHER;
 #endif /* USE_X_TOOLKIT */
       {
-          XSelectionRequestEvent *eventp
-            = (XSelectionRequestEvent *) &event;
+         XSelectionRequestEvent *eventp = &(event.xselectionrequest);
 
           inev.ie.kind = SELECTION_REQUEST_EVENT;
           SELECTION_EVENT_DISPLAY (&inev.sie) = eventp->display;