chiark / gitweb /
Put bitmap data and alias target into a union
authorBen Harris <bjh21@bjh21.me.uk>
Thu, 18 Jul 2024 11:59:55 +0000 (12:59 +0100)
committerBen Harris <bjh21@bjh21.me.uk>
Sun, 18 Aug 2024 13:25:10 +0000 (14:25 +0100)
commit874a12b047ea5126e9cfe1be083eb36fedf1d37f
tree99711807a2949b1ec316526c2a4418b7ec0ad941
parentf6a4441d41c4813ba3a10aec7be5fdb391239206
Put bitmap data and alias target into a union

A character can't both be an alias and have its own bitmap data, so we
may as well overlap them.  Wrapping them in a union doesn't require any
changes to the syntax of the glyphs array because C allows for
incomplete bracketing of initialisers.  Because the union doesn't have a
name, its members can be accessed as though they're members of the
containing struct, which means that accesses to them don't need to
change.

There is a new flag to mark a glyph as an alias since "alias_of == NULL"
no longer works, and a corresponding change to the ALIAS() macro.

This saves about 20K of bedstead's data segment on a 64-bit system,
which is kind of silly but it's satisfying nonetheless.
bedstead.c