diff src/xselect.c @ 60134:dd37bedfb1f4

(Fx_disown_selection_internal): Use union of struct input_event and struct selection_input_event to avoid aliasing issues.
author Andreas Schwab <schwab@suse.de>
date Thu, 17 Feb 2005 12:50:08 +0000
parents e41b38ec1a82
children 01dd74cb546e 9684495d72bc 7e3f621f1dd4
line wrap: on
line diff
--- a/src/xselect.c	Thu Feb 17 12:49:34 2005 +0000
+++ b/src/xselect.c	Thu Feb 17 12:50:08 2005 +0000
@@ -2189,7 +2189,10 @@
 {
   Time timestamp;
   Atom selection_atom;
-  struct selection_input_event event;
+  union {
+    struct selection_input_event sie;
+    struct input_event ie;
+  } event;
   Display *display;
   struct x_display_info *dpyinfo;
   struct frame *sf = SELECTED_FRAME ();
@@ -2217,10 +2220,10 @@
      the selection owner to None.  The NCD server does, the MIT Sun4 server
      doesn't.  So we synthesize one; this means we might get two, but
      that's ok, because the second one won't have any effect.  */
-  SELECTION_EVENT_DISPLAY (&event) = display;
-  SELECTION_EVENT_SELECTION (&event) = selection_atom;
-  SELECTION_EVENT_TIME (&event) = timestamp;
-  x_handle_selection_clear ((struct input_event *) &event);
+  SELECTION_EVENT_DISPLAY (&event.sie) = display;
+  SELECTION_EVENT_SELECTION (&event.sie) = selection_atom;
+  SELECTION_EVENT_TIME (&event.sie) = timestamp;
+  x_handle_selection_clear (&event.ie);
 
   return Qt;
 }