1 /* { dg-do compile } */
3 typedef unsigned char Uint8
;
5 typedef unsigned int Uint32
;
7 typedef union RMColorDataRef
12 typedef struct RMColorData
15 RMColorDataRef dataRef
;
18 typedef struct RMColorTable
21 RMColorDataRef dataRef
;
24 int fail ( const RMColorData
* pInColor
,
25 RMColorData
* pOutColor
,
26 const RMColorTable
* pColorTable
)
33 Uint32 interpFrac1
, interpFrac2
, interpFrac3
;
34 Sint32 val0
, val1
, val2
, val3
;
38 const Uint8
* pClutData
;
39 const Uint8
* pCornerPoint0
;
41 Uint8 lastOut
[((8) > (4) ? (8) : (4))];
43 pOut
= pOutColor
->dataRef
.data8
;
44 pClutData
= pColorTable
->dataRef
.data8
;
46 nCompOut
= pColorTable
->dataCompsOut
;
48 pCornerPoint0
= pClutData
;
50 for (comp
= 0; comp
< nCompOut
; comp
++)
52 val0
= *pCornerPoint0
++;
56 result
+= (val1
- val0
) * interpFrac1
;
57 result
+= (val2
- val1
) * interpFrac2
;
58 result
+= (val3
- val2
) * interpFrac3
;
60 *pOut
++ = lastOut
[comp
] = (Uint8
)(result
>> 4);