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