mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
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:
parent
7378ecf9a7
commit
aed9c392eb
1 changed files with 3 additions and 3 deletions
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue