From: Chong Yidong Date: Fri, 8 Apr 2011 19:18:25 +0000 (-0400) Subject: * xterm.c (handle_one_xevent): Avoid type-punned derefencing of X events. X-Git-Tag: emacs-pretest-24.0.90~104^3~85 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5324d904a3c7e2eaf0e15edab0d6c55fe7c9dcd2;p=emacs.git * xterm.c (handle_one_xevent): Avoid type-punned derefencing of X events. --- diff --git a/src/ChangeLog b/src/ChangeLog index 5e92b45b9d0..82c1597e343 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-04-08 Chong Yidong + + * xterm.c (handle_one_xevent): Avoid type-punned derefencing of X + events. + 2011-04-08 Svante Signell (tiny change) * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450). diff --git a/src/xterm.c b/src/xterm.c index 4b1fe20c7a2..be7fde03c58 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -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;