diff --git a/bedstead.c b/bedstead.c index 1031a32..ebdb1b3 100644 --- a/bedstead.c +++ b/bedstead.c @@ -194,10 +194,13 @@ static void glyph_complement(void); /* U(N) sets the code point and name of a glyph not in AGLFN */ #define U(N) 0x ## N, 0x ## N >= 0x10000 ? "u" #N : "uni" #N -#define ALIAS(alias, canonical) {{},-1,alias,0,canonical} +#define ALIAS(alias, canonical) {{.alias_of=canonical},-1,alias,IS_ALIAS} static struct glyph { - char data[YSIZE]; + union { + char data[YSIZE]; + char const *alias_of; + }; int_least32_t unicode; char const *name; uint_least8_t flags; @@ -206,7 +209,7 @@ static struct glyph { #define MOS4 0x04 /* 4-cell mosaic graphics character */ #define SEP6 (SEP | MOS6) #define SEP4 (SEP | MOS4) - char const *alias_of; +#define IS_ALIAS 0x08 } glyphs[] = { /* * The first batch of glyphs comes from the code tables at the end of @@ -2859,7 +2862,7 @@ main(int argc, char **argv) printf("Flags: HW\n"); printf("LayerCount: 2\n"); dolookups(&glyphs[i]); - if (glyphs[i].alias_of != NULL) + if (glyphs[i].flags & IS_ALIAS) doalias(glyphs[i].alias_of); else if (glyphs[i].flags & MOS6) domosaic(glyphs[i].data[0], @@ -2998,7 +3001,7 @@ dopalt(struct glyph const *g) unsigned char cols = 0; int dx = 0, dh = 0; - while (g->alias_of != NULL) + while (g->flags & IS_ALIAS) g = get_glyph_by_name(g->alias_of); if (g->flags & (MOS6|MOS4)) return; /*