diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-05-25 06:19:09 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-05-25 06:19:09 -0700 |
commit | 02c9c3c46a4e77939f0b2f58b9dcfab950980a82 (patch) | |
tree | 35da71725ab7381105be957037fae2a2c6249078 /combi.c | |
parent | 2948a2b1e01b91e17d90d2e7954f0d3a499a3a4d (diff) | |
download | txr-02c9c3c46a4e77939f0b2f58b9dcfab950980a82.tar.gz txr-02c9c3c46a4e77939f0b2f58b9dcfab950980a82.tar.bz2 txr-02c9c3c46a4e77939f0b2f58b9dcfab950980a82.zip |
ffi: precompute member offsets in struct type.
This change will make bitfield support easier.
* ffi.c (struct smemb): New member, offs.
(ffi_struct_in, ffi_struct_put, ffi_struct_out,
ffi_struct_get, ffi_struct_release): For each member, refer to
the offset in the memb array, rather than calculating it
on-the-fly.
(make_ffi_type_struct): Calculate the offset for each member.
This is exactly the same as the total_size calculation before;
just the name is changed to offs, and bit operations are used
for the alignment calculations.
Diffstat (limited to 'combi.c')
0 files changed, 0 insertions, 0 deletions