OSDN Git Service

* g++.dg/init/new1.C, g++.dg/template/alignof1.C,
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.c-torture / compile / 980506-1.c
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];
7
8 typedef struct tableentry {
9     unsigned short length;
10     unsigned short code;
11     short       runlen;
12 } tableentry;
13
14 extern tableentry TIFFFaxWhiteCodes[];
15 extern tableentry TIFFFaxBlackCodes[];
16
17 static short sp_data, sp_bit;
18
19 static unsigned char
20 fetchByte (inbuf)
21
22 unsigned char **inbuf;
23
24 {
25     unsigned char byte = **inbuf;
26     (*inbuf)++;
27     return (byte);
28 }
29
30 static int
31 decode_white_run (inbuf)
32
33 unsigned char **inbuf;
34
35 {
36     short state = sp_bit;
37     short action;
38     int runlen = 0;
39
40     for (;;)
41     {
42         if (sp_bit == 0)
43         {
44         nextbyte:
45             sp_data = fetchByte (inbuf);
46         }
47
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);
61     }
62 }
63