scripts: generate-emoji-variation-sequences: compact the C struct

Lookups in this table is not performance critical at all.

Thus, let's compact it to bring down the binary size of foot.

This brings the size of each entry down from 9 bytes to 6, bringing
the size of the whole thing down from 1647 bytes to 1098 bytes, saving
us 549 bytes.
This commit is contained in:
Daniel Eklöf 2024-06-25 16:22:22 +02:00
parent 7378ecf9a7
commit aed9c392eb
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -67,12 +67,12 @@ def main():
opts.output.write('#include <stdbool.h>\n')
opts.output.write('\n')
opts.output.write('struct emoji_vs {\n')
opts.output.write(' uint32_t start;\n')
opts.output.write(' uint32_t end;\n')
opts.output.write(' uint32_t start:21;\n')
opts.output.write(' uint32_t end:21;\n')
opts.output.write(' bool vs15:1;\n')
opts.output.write(' bool vs16:1;\n')
opts.output.write('} __attribute__((packed));\n')
opts.output.write('_Static_assert(sizeof(struct emoji_vs) == 9, "unexpected struct size");\n')
opts.output.write('_Static_assert(sizeof(struct emoji_vs) == 6, "unexpected struct size");\n')
opts.output.write('\n')
opts.output.write('#if defined(FOOT_GRAPHEME_CLUSTERING)\n')
opts.output.write('\n')