| 1 |
/* { dg-additional-options "-std=gnu17" } */ |
| 2 |
|
| 3 |
extern int foobar1 (); |
| 4 |
|
| 5 |
typedef struct |
| 6 |
{ |
| 7 |
unsigned long colormap; |
| 8 |
unsigned long red_max; |
| 9 |
unsigned long red_mult; |
| 10 |
unsigned long green_max; |
| 11 |
unsigned long green_mult; |
| 12 |
unsigned long blue_max; |
| 13 |
unsigned long blue_mult; |
| 14 |
unsigned long base_pixel; |
| 15 |
unsigned long visualid; |
| 16 |
unsigned long killid; |
| 17 |
} |
| 18 |
frotz; |
| 19 |
|
| 20 |
int |
| 21 |
foobar (stdcmap, count) |
| 22 |
frotz **stdcmap; |
| 23 |
int *count; |
| 24 |
{ |
| 25 |
register int i; |
| 26 |
frotz *data = ((void *) 0); |
| 27 |
|
| 28 |
unsigned long nitems; |
| 29 |
int ncmaps; |
| 30 |
int old_style = 0; |
| 31 |
unsigned long def_visual = 0L; |
| 32 |
frotz *cmaps; |
| 33 |
|
| 34 |
|
| 35 |
if ( foobar1 (&data) != 0) |
| 36 |
return 0; |
| 37 |
if (nitems < 10) |
| 38 |
{ |
| 39 |
ncmaps = 1; |
| 40 |
if (nitems < 9) |
| 41 |
{ |
| 42 |
} |
| 43 |
} |
| 44 |
else |
| 45 |
ncmaps = (nitems / 10); |
| 46 |
|
| 47 |
{ |
| 48 |
register frotz *map; |
| 49 |
register frotz *prop; |
| 50 |
|
| 51 |
for (i = ncmaps, map = cmaps, prop = data; i > 0; i--, map++, prop++) |
| 52 |
{ |
| 53 |
map->colormap = prop->colormap; |
| 54 |
map->red_max = prop->red_max; |
| 55 |
map->red_mult = prop->red_mult; |
| 56 |
map->green_max = prop->green_max; |
| 57 |
map->green_mult = prop->green_mult; |
| 58 |
map->blue_max = prop->blue_max; |
| 59 |
map->blue_mult = prop->blue_mult; |
| 60 |
map->base_pixel = prop->base_pixel; |
| 61 |
map->visualid = (def_visual ? def_visual : prop->visualid); |
| 62 |
map->killid = (old_style ? 0L : prop->killid); |
| 63 |
} |
| 64 |
} |
| 65 |
*stdcmap = cmaps; |
| 66 |
*count = ncmaps; |
| 67 |
} |