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();
108 int XtWidgetToApplicationContext();
115 GetEventEntry(Widget w
, XEvent
*event
)
117 int x_loc
, y_loc
, x_root
;
118 SimpleMenuWidget smw
= (SimpleMenuWidget
)w
;
121 switch (event
->type
) {
123 x_loc
= event
->xmotion
.x
;
124 y_loc
= event
->xmotion
.y
;
125 x_root
= event
->xmotion
.x_root
;
129 x_loc
= event
->xcrossing
.x
;
130 y_loc
= event
->xcrossing
.y
;
131 x_root
= event
->xcrossing
.x_root
;
135 x_loc
= event
->xbutton
.x
;
136 y_loc
= event
->xbutton
.y
;
137 x_root
= event
->xbutton
.x_root
;
140 XtAppError(XtWidgetToApplicationContext(w
),
141 "Unknown event type in GetEventEntry().");
142 return (((void *)0));
144 if (x_loc
< 0 || x_loc
>= (((RectObj
)smw
)->rectangle
.width
) ||
145 y_loc
< 0 || y_loc
>= (((RectObj
)smw
)->rectangle
.height
))
146 return (((void *)0));
147 if (x_root
== ((((w
)->core
.screen
))->width
) - 1 &&
148 (((RectObj
)w
)->rectangle
.x
) + (((RectObj
)w
)->rectangle
.width
) + ((((RectObj
)w
)->rectangle
.border_width
)) > x_root
) {
150 if (smw
->simple_menu
.entry_set
) {
151 entry
= DoGetEventEntry(w
,
152 (((RectObj
)smw
->simple_menu
.entry_set
)->rectangle
.x
)
153 + (((RectObj
)smw
->simple_menu
.entry_set
)->rectangle
.width
) + 1,
155 Unhighlight(w
, event
, ((void *)0), ((void *)0));
157 warp
= -(int)(((RectObj
)entry
)->rectangle
.width
) >> 1;
158 move
= x_loc
- (((RectObj
)entry
)->rectangle
.width
) - (((RectObj
)entry
)->rectangle
.x
) + (((RectObj
)w
)->rectangle
.border_width
);
162 move
= ((((w
)->core
.screen
))->width
) -
163 ((((RectObj
)w
)->rectangle
.x
) + (((RectObj
)w
)->rectangle
.width
) + ((((RectObj
)w
)->rectangle
.border_width
) << 1));
168 move
= ((((w
)->core
.screen
))->width
) -
169 ((((RectObj
)w
)->rectangle
.x
) + (((RectObj
)w
)->rectangle
.width
) + ((((RectObj
)w
)->rectangle
.border_width
) << 1));
172 else if (x_root
== 0 && (((RectObj
)w
)->rectangle
.x
) < 0) {
174 if (smw
->simple_menu
.entry_set
) {
175 entry
= DoGetEventEntry(w
, (((RectObj
)smw
->simple_menu
.entry_set
)->rectangle
.x
) - 1,
177 Unhighlight(w
, event
, ((void *)0), ((void *)0));
179 warp
= (((RectObj
)entry
)->rectangle
.width
) >> 1;
180 move
= x_loc
- (((RectObj
)entry
)->rectangle
.x
);
183 move
= x_loc
+ (((RectObj
)w
)->rectangle
.border_width
);
186 move
= x_loc
+ (((RectObj
)w
)->rectangle
.border_width
);
191 XtMoveWidget(w
, (((RectObj
)w
)->rectangle
.x
) + move
, (((RectObj
)w
)->rectangle
.y
));
193 XWarpPointer((((w
)->core
.screen
)->display
), 0L, 0L, 0, 0, 0, 0, warp
, 0);
194 return (DoGetEventEntry(w
, x_loc
, y_loc
));