spiegel-keyman/common/include
Marc Durdin 56da64796f fix(common): specify alignment for COMP_ structs
When we read .kmx files, they have no alignment guarantees, so we need
to tell the compiler to generate unaligned-safe code for accesses to
`COMP_` structure members, because typically we point into the buffer
and read at any offset.

A .kmx file will generally be 2-byte aligned, as there are no structures
or data types with smaller than 2 byte widths. There is no requirement
that this be the case per the .kmx spec, though. So we use a 1 byte
alignment attribute for the compiler, so it will generate safe code when
reading these structs.

Note that we are assuming that `COMP_KEYBOARD` is aligned because it is
always the start of the file, so will be at the start of any buffer
which will automatically be aligned correctly.

We should probably review some of our design decisions and structs for
KMXPlus given this.
2023-06-30 08:29:20 +07:00
..
.gitignore refactor(common): move keymanversion_build.in to /common/include 2023-03-24 14:42:12 +07:00
build.sh refactor(common): move keymanversion_build.in to /common/include 2023-03-24 14:42:12 +07:00
keymanversion_build.in chore(developer): fix typos 2023-03-24 15:06:12 +07:00
km_types.h chore(developer): Merge branch 'feature-kmcompx' into chore/developer/master-to-kmcompx-A17S7 2023-03-02 12:37:37 +07:00
kmx_file.h fix(common): specify alignment for COMP_ structs 2023-06-30 08:29:20 +07:00
test_assert.h chore(core): move test_assert.h and test_color.h to common 2023-04-10 15:21:45 +07:00
test_color.h chore(core): move test_assert.h and test_color.h to common 2023-04-10 15:21:45 +07:00