aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Schwab2005-02-17 12:50:08 +0000
committerAndreas Schwab2005-02-17 12:50:08 +0000
commit31df61d66239245c68d85d1bb485539034782bec (patch)
tree66b9ae639b9987daccf3de10ca1503074c881b7e /src
parenta3db4b26919bd467a30b9658b5f84aec06b2b35e (diff)
downloademacs-31df61d66239245c68d85d1bb485539034782bec.tar.gz
emacs-31df61d66239245c68d85d1bb485539034782bec.zip
(Fx_disown_selection_internal): Use union of struct
input_event and struct selection_input_event to avoid aliasing issues.
Diffstat (limited to 'src')
-rw-r--r--src/xselect.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/xselect.c b/src/xselect.c
index 8d8efd8db8a..a49b6b89ee4 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -2189,7 +2189,10 @@ Disowning it means there is no such selection. */)
2189{ 2189{
2190 Time timestamp; 2190 Time timestamp;
2191 Atom selection_atom; 2191 Atom selection_atom;
2192 struct selection_input_event event; 2192 union {
2193 struct selection_input_event sie;
2194 struct input_event ie;
2195 } event;
2193 Display *display; 2196 Display *display;
2194 struct x_display_info *dpyinfo; 2197 struct x_display_info *dpyinfo;
2195 struct frame *sf = SELECTED_FRAME (); 2198 struct frame *sf = SELECTED_FRAME ();
@@ -2217,10 +2220,10 @@ Disowning it means there is no such selection. */)
2217 the selection owner to None. The NCD server does, the MIT Sun4 server 2220 the selection owner to None. The NCD server does, the MIT Sun4 server
2218 doesn't. So we synthesize one; this means we might get two, but 2221 doesn't. So we synthesize one; this means we might get two, but
2219 that's ok, because the second one won't have any effect. */ 2222 that's ok, because the second one won't have any effect. */
2220 SELECTION_EVENT_DISPLAY (&event) = display; 2223 SELECTION_EVENT_DISPLAY (&event.sie) = display;
2221 SELECTION_EVENT_SELECTION (&event) = selection_atom; 2224 SELECTION_EVENT_SELECTION (&event.sie) = selection_atom;
2222 SELECTION_EVENT_TIME (&event) = timestamp; 2225 SELECTION_EVENT_TIME (&event.sie) = timestamp;
2223 x_handle_selection_clear ((struct input_event *) &event); 2226 x_handle_selection_clear (&event.ie);
2224 2227
2225 return Qt; 2228 return Qt;
2226} 2229}