111
|
1 // { dg-do compile }
|
|
2 typedef unsigned char uint8;
|
|
3 typedef unsigned int uint32;
|
|
4 class PixelARGB {
|
|
5 public:
|
|
6 ~PixelARGB() throw() { }
|
|
7 PixelARGB (const uint32 argb_) throw() : argb (argb_) { }
|
|
8 inline __attribute__((always_inline)) uint8 getRed() const throw() {
|
|
9 return components.r;
|
|
10 }
|
|
11 union {
|
|
12 uint32 argb;
|
|
13 struct {
|
|
14 uint8 b, g, r, a;
|
|
15 } components;
|
|
16 };
|
|
17 };
|
|
18 class Colour {
|
|
19 public:
|
|
20 Colour() throw() : argb (0) {};
|
|
21 uint8 getRed() const throw() {
|
|
22 return argb.getRed();
|
|
23 }
|
|
24 PixelARGB argb;
|
|
25 };
|
|
26 uint8 writeImage (void) {
|
|
27 Colour pixel;
|
|
28 pixel = Colour ();
|
|
29 return pixel.getRed();
|
|
30 }
|