2 /* On x86, something about the structure of this function prevented
3 cross-jumping from combining the three arms of the switch statement
4 until the last moment. After which we did not delete dead code,
5 which left a reference to the deleted ADDR_VEC. */
7 /* { dg-do compile { target fpic } } */
8 /* { dg-options "-O2 -frename-registers -fpic" } */
10 typedef unsigned long XID
;
13 typedef unsigned long Time
;
62 typedef union _XEvent
{
66 XCrossingEvent xcrossing
;
73 typedef struct _CorePart
{
76 typedef struct _WidgetRec
{
79 typedef struct _WidgetRec
*Widget
;
81 typedef struct _SmeRec
*SmeObject
;
82 typedef struct _SimpleMenuPart
{
85 typedef struct _SimpleMenuRec
{
86 SimpleMenuPart simple_menu
;
88 typedef struct _SimpleMenuRec
* SimpleMenuWidget
;
90 typedef short Position
;
91 typedef unsigned short Dimension
;
94 typedef struct _RectObjPart
{
96 Dimension width
, height
;
97 Dimension border_width
;
100 Boolean ancestor_sensitive
;
102 typedef struct _RectObjRec
{
103 RectObjPart rectangle
;
105 typedef struct _RectObjRec
*RectObj
;
107 SmeObject
DoGetEventEntry();
110 GetEventEntry(Widget w
, XEvent
*event
)
112 int x_loc
, y_loc
, x_root
;
113 SimpleMenuWidget smw
= (SimpleMenuWidget
)w
;
116 switch (event
->type
) {
118 x_loc
= event
->xmotion
.x
;
119 y_loc
= event
->xmotion
.y
;
120 x_root
= event
->xmotion
.x_root
;
124 x_loc
= event
->xcrossing
.x
;
125 y_loc
= event
->xcrossing
.y
;
126 x_root
= event
->xcrossing
.x_root
;
130 x_loc
= event
->xbutton
.x
;
131 y_loc
= event
->xbutton
.y
;
132 x_root
= event
->xbutton
.x_root
;
135 XtAppError(XtWidgetToApplicationContext(w
),
136 "Unknown event type in GetEventEntry().");
137 return (((void *)0));
139 if (x_loc
< 0 || x_loc
>= (((RectObj
)smw
)->rectangle
.width
) ||
140 y_loc
< 0 || y_loc
>= (((RectObj
)smw
)->rectangle
.height
))
141 return (((void *)0));
142 if (x_root
== ((((w
)->core
.screen
))->width
) - 1 &&
143 (((RectObj
)w
)->rectangle
.x
) + (((RectObj
)w
)->rectangle
.width
) + ((((RectObj
)w
)->rectangle
.border_width
)) > x_root
) {
145 if (smw
->simple_menu
.entry_set
) {
146 entry
= DoGetEventEntry(w
,
147 (((RectObj
)smw
->simple_menu
.entry_set
)->rectangle
.x
)
148 + (((RectObj
)smw
->simple_menu
.entry_set
)->rectangle
.width
) + 1,
150 Unhighlight(w
, event
, ((void *)0), ((void *)0));
152 warp
= -(int)(((RectObj
)entry
)->rectangle
.width
) >> 1;
153 move
= x_loc
- (((RectObj
)entry
)->rectangle
.width
) - (((RectObj
)entry
)->rectangle
.x
) + (((RectObj
)w
)->rectangle
.border_width
);
157 move
= ((((w
)->core
.screen
))->width
) -
158 ((((RectObj
)w
)->rectangle
.x
) + (((RectObj
)w
)->rectangle
.width
) + ((((RectObj
)w
)->rectangle
.border_width
) << 1));
163 move
= ((((w
)->core
.screen
))->width
) -
164 ((((RectObj
)w
)->rectangle
.x
) + (((RectObj
)w
)->rectangle
.width
) + ((((RectObj
)w
)->rectangle
.border_width
) << 1));
167 else if (x_root
== 0 && (((RectObj
)w
)->rectangle
.x
) < 0) {
169 if (smw
->simple_menu
.entry_set
) {
170 entry
= DoGetEventEntry(w
, (((RectObj
)smw
->simple_menu
.entry_set
)->rectangle
.x
) - 1,
172 Unhighlight(w
, event
, ((void *)0), ((void *)0));
174 warp
= (((RectObj
)entry
)->rectangle
.width
) >> 1;
175 move
= x_loc
- (((RectObj
)entry
)->rectangle
.x
);
178 move
= x_loc
+ (((RectObj
)w
)->rectangle
.border_width
);
181 move
= x_loc
+ (((RectObj
)w
)->rectangle
.border_width
);
186 XtMoveWidget(w
, (((RectObj
)w
)->rectangle
.x
) + move
, (((RectObj
)w
)->rectangle
.y
));
188 XWarpPointer((((w
)->core
.screen
)->display
), 0L, 0L, 0, 0, 0, 0, warp
, 0);
189 return (DoGetEventEntry(w
, x_loc
, y_loc
));