| 1 |
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */ |
| 2 |
/* { dg-additional-options "-fpermissive" } */ |
| 3 |
|
| 4 |
extern unsigned int __invalid_size_argument_for_IOC; |
| 5 |
typedef unsigned int __u32; |
| 6 |
struct video_window |
| 7 |
{ |
| 8 |
__u32 x, y; |
| 9 |
__u32 width, height; |
| 10 |
}; |
| 11 |
typedef unsigned long XID; |
| 12 |
typedef XID Window; |
| 13 |
typedef struct _XExtData |
| 14 |
{ |
| 15 |
Window root; |
| 16 |
} |
| 17 |
Screen; |
| 18 |
typedef struct |
| 19 |
{ |
| 20 |
int border_width; |
| 21 |
} |
| 22 |
XWindowAttributes; |
| 23 |
typedef struct _XDisplay Display; |
| 24 |
typedef struct |
| 25 |
{ |
| 26 |
int default_screen; |
| 27 |
Screen *screens; |
| 28 |
} |
| 29 |
*_XPrivDisplay; |
| 30 |
typedef struct |
| 31 |
{ |
| 32 |
int x, y; |
| 33 |
} |
| 34 |
XSizeHints; |
| 35 |
typedef struct |
| 36 |
{ |
| 37 |
unsigned short hdisplay; |
| 38 |
unsigned short vdisplay; |
| 39 |
} |
| 40 |
XF86VidModeModeInfo; |
| 41 |
Display *display; |
| 42 |
int tfd; |
| 43 |
int ccapt; |
| 44 |
int tml; |
| 45 |
int fswidth = 0; |
| 46 |
int fsheight = 0; |
| 47 |
Window fmwin; |
| 48 |
XF86VidModeModeInfo **modelines, *fullscreenmode = ((void *) 0); |
| 49 |
struct video_window vswin; |
| 50 |
DoFullScreen (void) |
| 51 |
{ |
| 52 |
int i; |
| 53 |
int rx, ry; |
| 54 |
Window junkwin; |
| 55 |
XSizeHints fmsizehints; |
| 56 |
XWindowAttributes fmwinattr; |
| 57 |
if (ioctl |
| 58 |
(tfd, |
| 59 |
(((1U) << (((0 + 8) + 8) + 14)) | ((('v')) << (0 + 8)) | (((8)) << 0) | |
| 60 |
(((((sizeof (int) == sizeof (int[1]) |
| 61 |
&& sizeof (int) < |
| 62 |
(1 << 14)) ? sizeof (int) : __invalid_size_argument_for_IOC))) << |
| 63 |
((0 + 8) + 8))), &ccapt) < 0) |
| 64 |
{ |
| 65 |
perror ("ioctl VIDIOCCAPTURE"); |
| 66 |
} |
| 67 |
if (!XTranslateCoordinates |
| 68 |
(display, fmwin, |
| 69 |
((&((_XPrivDisplay) display)-> |
| 70 |
screens[(((_XPrivDisplay) display)->default_screen)])->root), |
| 71 |
-fmwinattr.border_width, -fmwinattr.border_width, &rx, &ry, &junkwin)) |
| 72 |
{ |
| 73 |
} |
| 74 |
vswin.width = fswidth; |
| 75 |
vswin.height = fsheight; |
| 76 |
vswin.x = fmsizehints.x + rx; |
| 77 |
vswin.y = fmsizehints.y + ry; |
| 78 |
if (ioctl |
| 79 |
(tfd, |
| 80 |
(((1U) << (((0 + 8) + 8) + 14)) | ((('v')) << (0 + 8)) | (((8)) << 0) | |
| 81 |
(((((sizeof (int) == sizeof (int[1]) |
| 82 |
&& sizeof (int) < |
| 83 |
(1 << 14)) ? sizeof (int) : __invalid_size_argument_for_IOC))) << |
| 84 |
((0 + 8) + 8))), &ccapt) < 0) |
| 85 |
{ |
| 86 |
XF86VidModeGetAllModeLines (display, XDefaultScreen (display), &tml, |
| 87 |
&modelines); |
| 88 |
{ |
| 89 |
if ((modelines[i]->hdisplay == fswidth) |
| 90 |
&& (modelines[i]->vdisplay == fsheight)) |
| 91 |
{ |
| 92 |
fullscreenmode = modelines[i]; |
| 93 |
} |
| 94 |
} |
| 95 |
{ |
| 96 |
XF86VidModeSetViewPort (display, XDefaultScreen (display), vswin.x, |
| 97 |
vswin.y); |
| 98 |
} |
| 99 |
} |
| 100 |
} |