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" } */
9 /* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
11 typedef unsigned long XID
;
14 typedef unsigned long Time
;
63 typedef union _XEvent
{
67 XCrossingEvent xcrossing
;
74 typedef struct _CorePart
{
77 typedef struct _WidgetRec
{
80 typedef struct _WidgetRec
*Widget
;
82 typedef struct _SmeRec
*SmeObject
;
83 typedef struct _SimpleMenuPart
{
86 typedef struct _SimpleMenuRec
{
87 SimpleMenuPart simple_menu
;
89 typedef struct _SimpleMenuRec
* SimpleMenuWidget
;
91 typedef short Position
;
92 typedef unsigned short Dimension
;
95 typedef struct _RectObjPart
{
97 Dimension width
, height
;
98 Dimension border_width
;
101 Boolean ancestor_sensitive
;
103 typedef struct _RectObjRec
{
104 RectObjPart rectangle
;
106 typedef struct _RectObjRec
*RectObj
;
108 SmeObject
DoGetEventEntry();
109 int XtWidgetToApplicationContext();
116 GetEventEntry(Widget w
, XEvent
*event
)
118 int x_loc
, y_loc
, x_root
;
119 SimpleMenuWidget smw
= (SimpleMenuWidget
)w
;
122 switch (event
->type
) {
124 x_loc
= event
->xmotion
.x
;
125 y_loc
= event
->xmotion
.y
;
126 x_root
= event
->xmotion
.x_root
;
130 x_loc
= event
->xcrossing
.x
;
131 y_loc
= event
->xcrossing
.y
;
132 x_root
= event
->xcrossing
.x_root
;
136 x_loc
= event
->xbutton
.x
;
137 y_loc
= event
->xbutton
.y
;
138 x_root
= event
->xbutton
.x_root
;
141 XtAppError(XtWidgetToApplicationContext(w
),
142 "Unknown event type in GetEventEntry().");
143 return (((void *)0));
145 if (x_loc
< 0 || x_loc
>= (((RectObj
)smw
)->rectangle
.width
) ||
146 y_loc
< 0 || y_loc
>= (((RectObj
)smw
)->rectangle
.height
))
147 return (((void *)0));
148 if (x_root
== ((((w
)->core
.screen
))->width
) - 1 &&
149 (((RectObj
)w
)->rectangle
.x
) + (((RectObj
)w
)->rectangle
.width
) + ((((RectObj
)w
)->rectangle
.border_width
)) > x_root
) {
151 if (smw
->simple_menu
.entry_set
) {
152 entry
= DoGetEventEntry(w
,
153 (((RectObj
)smw
->simple_menu
.entry_set
)->rectangle
.x
)
154 + (((RectObj
)smw
->simple_menu
.entry_set
)->rectangle
.width
) + 1,
156 Unhighlight(w
, event
, ((void *)0), ((void *)0));
158 warp
= -(int)(((RectObj
)entry
)->rectangle
.width
) >> 1;
159 move
= x_loc
- (((RectObj
)entry
)->rectangle
.width
) - (((RectObj
)entry
)->rectangle
.x
) + (((RectObj
)w
)->rectangle
.border_width
);
163 move
= ((((w
)->core
.screen
))->width
) -
164 ((((RectObj
)w
)->rectangle
.x
) + (((RectObj
)w
)->rectangle
.width
) + ((((RectObj
)w
)->rectangle
.border_width
) << 1));
169 move
= ((((w
)->core
.screen
))->width
) -
170 ((((RectObj
)w
)->rectangle
.x
) + (((RectObj
)w
)->rectangle
.width
) + ((((RectObj
)w
)->rectangle
.border_width
) << 1));
173 else if (x_root
== 0 && (((RectObj
)w
)->rectangle
.x
) < 0) {
175 if (smw
->simple_menu
.entry_set
) {
176 entry
= DoGetEventEntry(w
, (((RectObj
)smw
->simple_menu
.entry_set
)->rectangle
.x
) - 1,
178 Unhighlight(w
, event
, ((void *)0), ((void *)0));
180 warp
= (((RectObj
)entry
)->rectangle
.width
) >> 1;
181 move
= x_loc
- (((RectObj
)entry
)->rectangle
.x
);
184 move
= x_loc
+ (((RectObj
)w
)->rectangle
.border_width
);
187 move
= x_loc
+ (((RectObj
)w
)->rectangle
.border_width
);
192 XtMoveWidget(w
, (((RectObj
)w
)->rectangle
.x
) + move
, (((RectObj
)w
)->rectangle
.y
));
194 XWarpPointer((((w
)->core
.screen
)->display
), 0L, 0L, 0, 0, 0, 0, warp
, 0);
195 return (DoGetEventEntry(w
, x_loc
, y_loc
));