OSDN Git Service

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