FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / gcc.c-torture / compile / 980506-1.c
blob6ef7796261f591102d3b344c68c1b724ce5f8594
1 unsigned char TIFFFax2DMode[20][256];
2 unsigned char TIFFFax2DNextState[20][256];
3 unsigned char TIFFFaxUncompAction[20][256];
4 unsigned char TIFFFaxUncompNextState[20][256];
5 unsigned char TIFFFax1DAction[230][256];
6 unsigned char TIFFFax1DNextState[230][256];
8 typedef struct tableentry {
9 unsigned short length;
10 unsigned short code;
11 short runlen;
12 } tableentry;
14 extern tableentry TIFFFaxWhiteCodes[];
15 extern tableentry TIFFFaxBlackCodes[];
17 static short sp_data, sp_bit;
19 static unsigned char
20 fetchByte (inbuf)
22 unsigned char **inbuf;
25 unsigned char byte = **inbuf;
26 (*inbuf)++;
27 return (byte);
30 static int
31 decode_white_run (inbuf)
33 unsigned char **inbuf;
36 short state = sp_bit;
37 short action;
38 int runlen = 0;
40 for (;;)
42 if (sp_bit == 0)
44 nextbyte:
45 sp_data = fetchByte (inbuf);
48 action = TIFFFax1DAction[state][sp_data];
49 state = TIFFFax1DNextState[state][sp_data];
50 if (action == 0 )
51 goto nextbyte;
52 if (action == 1 )
53 return (-1 );
54 if (action == 210 )
55 return (-3 );
56 sp_bit = state;
57 action = (TIFFFaxWhiteCodes[ action - 2 ].runlen) ;
58 runlen += action;
59 if (action < 64)
60 return (runlen);