aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong <[email protected]>2011-04-08 15:18:25 -0400
committerChong Yidong <[email protected]>2011-04-08 15:18:25 -0400
commit5324d904a3c7e2eaf0e15edab0d6c55fe7c9dcd2 (patch)
tree7ad646fefaa39116b01d2e99cfa5d4a6d0bc4e1e
parent0080dc6bd919f83c036bb6072800032b1723b248 (diff)
* xterm.c (handle_one_xevent): Avoid type-punned derefencing of X events.
-rw-r--r--src/ChangeLog5
-rw-r--r--src/xterm.c7
2 files changed, 8 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 5e92b45b9d..82c1597e34 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2011-04-08 Chong Yidong <[email protected]>
+
+ * xterm.c (handle_one_xevent): Avoid type-punned derefencing of X
+ events.
+
2011-04-08 Svante Signell <[email protected]> (tiny change)
* term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
diff --git a/src/xterm.c b/src/xterm.c
index 4b1fe20c7a..be7fde03c5 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;