2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.c-torture / compile / 921011-2.c
blobbf11dad979fff6c2d12b92cc5617a2c3ec4cf143
1 extern int foobar1 ();
3 typedef struct
5 unsigned long colormap;
6 unsigned long red_max;
7 unsigned long red_mult;
8 unsigned long green_max;
9 unsigned long green_mult;
10 unsigned long blue_max;
11 unsigned long blue_mult;
12 unsigned long base_pixel;
13 unsigned long visualid;
14 unsigned long killid;
16 frotz;
18 int
19 foobar (stdcmap, count)
20 frotz **stdcmap;
21 int *count;
23 register int i;
24 frotz *data = ((void *) 0);
26 unsigned long nitems;
27 int ncmaps;
28 int old_style = 0;
29 unsigned long def_visual = 0L;
30 frotz *cmaps;
33 if ( foobar1 (&data) != 0)
34 return 0;
35 if (nitems < 10)
37 ncmaps = 1;
38 if (nitems < 9)
42 else
43 ncmaps = (nitems / 10);
46 register frotz *map;
47 register frotz *prop;
49 for (i = ncmaps, map = cmaps, prop = data; i > 0; i--, map++, prop++)
51 map->colormap = prop->colormap;
52 map->red_max = prop->red_max;
53 map->red_mult = prop->red_mult;
54 map->green_max = prop->green_max;
55 map->green_mult = prop->green_mult;
56 map->blue_max = prop->blue_max;
57 map->blue_mult = prop->blue_mult;
58 map->base_pixel = prop->base_pixel;
59 map->visualid = (def_visual ? def_visual : prop->visualid);
60 map->killid = (old_style ? 0L : prop->killid);
63 *stdcmap = cmaps;
64 *count = ncmaps;