diff options
author | Alex Richardson <arichardson@FreeBSD.org> | 2022-08-12 10:34:06 +0000 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2022-09-21 11:35:05 +0000 |
commit | 91f4ac9cf62f8bb99c28ddfa4f376e45fd1b2b94 (patch) | |
tree | 90e4cee1ae1d7ada7f28db090114f36298f64db5 /dbus | |
parent | 33dbeb5ebe28aadcde9f6f6bf22eb86fa7023dfa (diff) | |
download | dbus-91f4ac9cf62f8bb99c28ddfa4f376e45fd1b2b94.tar.gz |
dbus-marshal-recursive.h: reduce padding in DBusType{Reader,Writer}
When building for Arm Morello (where pointers are 16 bytes), I hit the
static assertion that sizeof (DBusMessageRealIter) <= sizeof (DBusMessageIter)
inside _dbus_message_iter_init_common() otherwise. This can be fixed by
moving the pointers to the beginning of the struct to remove padding.
Diffstat (limited to 'dbus')
-rw-r--r-- | dbus/dbus-marshal-recursive.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/dbus/dbus-marshal-recursive.h b/dbus/dbus-marshal-recursive.h index c3b96819..5822e058 100644 --- a/dbus/dbus-marshal-recursive.h +++ b/dbus/dbus-marshal-recursive.h @@ -38,18 +38,19 @@ typedef struct DBusArrayLenFixup DBusArrayLenFixup; */ struct DBusTypeReader { + const DBusTypeReaderClass *klass; /**< the vtable for the reader */ + const DBusString *type_str; /**< string containing signature of block */ + const DBusString *value_str; /**< string containing values of block */ + dbus_uint32_t byte_order : 8; /**< byte order of the block */ dbus_uint32_t finished : 1; /**< marks we're at end iterator for cases * where we don't have another way to tell */ dbus_uint32_t array_len_offset : 3; /**< bytes back from start_pos that len ends */ - const DBusString *type_str; /**< string containing signature of block */ int type_pos; /**< current position in signature */ - const DBusString *value_str; /**< string containing values of block */ int value_pos; /**< current position in values */ - const DBusTypeReaderClass *klass; /**< the vtable for the reader */ union { struct { @@ -63,6 +64,8 @@ struct DBusTypeReader */ struct DBusTypeWriter { + DBusString *type_str; /**< where to write typecodes (or read type expectations) */ + DBusString *value_str; /**< where to write values */ dbus_uint32_t byte_order : 8; /**< byte order to write values with */ dbus_uint32_t container_type : 8; /**< what are we inside? (e.g. struct, variant, array) */ @@ -71,9 +74,7 @@ struct DBusTypeWriter dbus_uint32_t enabled : 1; /**< whether to write values */ - DBusString *type_str; /**< where to write typecodes (or read type expectations) */ int type_pos; /**< current pos in type_str */ - DBusString *value_str; /**< where to write values */ int value_pos; /**< next position to write */ union |