| 1 |
/* { dg-additional-options "-std=gnu89" } */ |
| 2 |
|
| 3 |
typedef unsigned char byte; |
| 4 |
typedef unsigned int uint; |
| 5 |
typedef unsigned long ulong; |
| 6 |
typedef ulong gs_char; |
| 7 |
typedef struct gs_show_enum_s gs_show_enum; |
| 8 |
typedef struct gs_font_s gs_font; |
| 9 |
typedef struct gx_font_stack_item_s { |
| 10 |
gs_font *font; |
| 11 |
} gx_font_stack_item; |
| 12 |
typedef struct gx_font_stack_s { |
| 13 |
gx_font_stack_item items[1 + 5 ]; |
| 14 |
} gx_font_stack; |
| 15 |
struct gs_show_enum_s { |
| 16 |
gx_font_stack fstack; |
| 17 |
}; |
| 18 |
typedef enum { |
| 19 |
ft_composite = 0, |
| 20 |
} font_type; |
| 21 |
struct gs_font_s { |
| 22 |
font_type FontType; |
| 23 |
}; |
| 24 |
typedef enum { |
| 25 |
fmap_escape = 3, |
| 26 |
fmap_shift = 8 |
| 27 |
} fmap_type; |
| 28 |
typedef struct gs_type0_data_s { |
| 29 |
fmap_type FMapType; |
| 30 |
} gs_type0_data; |
| 31 |
gs_type0_next_char(register gs_show_enum *penum) |
| 32 |
{ |
| 33 |
const byte *p; |
| 34 |
int fdepth; |
| 35 |
gs_font *pfont; |
| 36 |
gs_type0_data *pdata; |
| 37 |
uint fidx; |
| 38 |
gs_char chr; |
| 39 |
for (; pfont->FontType == ft_composite; ) |
| 40 |
{ |
| 41 |
fmap_type fmt; |
| 42 |
switch ( fmt ) |
| 43 |
{ |
| 44 |
do {} while (0); |
| 45 |
rdown: |
| 46 |
continue; |
| 47 |
case fmap_shift: |
| 48 |
p++; |
| 49 |
do {} while (0); |
| 50 |
goto rdown; |
| 51 |
} |
| 52 |
break; |
| 53 |
} |
| 54 |
up: |
| 55 |
while ( fdepth > 0 ) |
| 56 |
{ |
| 57 |
switch ( pdata->FMapType ) |
| 58 |
{ |
| 59 |
default: |
| 60 |
continue; |
| 61 |
case fmap_escape: |
| 62 |
fidx = *++p; |
| 63 |
do {} while (0); |
| 64 |
if ( fidx == chr && fdepth > 1 ) |
| 65 |
goto up; |
| 66 |
down: |
| 67 |
fdepth--; |
| 68 |
do {} while (0); |
| 69 |
} |
| 70 |
break; |
| 71 |
} |
| 72 |
while ( (pfont = penum->fstack.items[fdepth].font)->FontType == ft_composite ) |
| 73 |
; |
| 74 |
} |