diff options
author | Alex Richardson <arichardson.kde@gmail.com> | 2022-05-15 11:23:29 +0100 |
---|---|---|
committer | Alexander Richardson <alexander.richardson@cl.cam.ac.uk> | 2022-05-17 11:21:33 +0000 |
commit | 13eeb2c656435ae0721fb0c73d1a8fb3cebc7733 (patch) | |
tree | 1ca13cc72984728744de29a727b480b63fee4e7f /dbus | |
parent | eb70deaaab9dba370f3d56ee1fa560a322cca464 (diff) | |
download | dbus-13eeb2c656435ae0721fb0c73d1a8fb3cebc7733.tar.gz |
dbus-marshal-bytes.c: Silence -Wcast-align warnings
We have ensured that the values are aligned at runtime, but Clang's
warning cannot see that. Silence the warning with a void* cast.
Diffstat (limited to 'dbus')
-rw-r--r-- | dbus/dbus-marshal-byteswap.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/dbus/dbus-marshal-byteswap.c b/dbus/dbus-marshal-byteswap.c index 27695aaf..e9de6f02 100644 --- a/dbus/dbus-marshal-byteswap.c +++ b/dbus/dbus-marshal-byteswap.c @@ -53,7 +53,8 @@ byteswap_body_helper (DBusTypeReader *reader, case DBUS_TYPE_UINT16: { p = _DBUS_ALIGN_ADDRESS (p, 2); - *((dbus_uint16_t*)p) = DBUS_UINT16_SWAP_LE_BE (*((dbus_uint16_t*)p)); + *((dbus_uint16_t *) (void *) p) = + DBUS_UINT16_SWAP_LE_BE (*((dbus_uint16_t *) (void *) p)); p += 2; } break; @@ -63,7 +64,8 @@ byteswap_body_helper (DBusTypeReader *reader, case DBUS_TYPE_UINT32: { p = _DBUS_ALIGN_ADDRESS (p, 4); - *((dbus_uint32_t*)p) = DBUS_UINT32_SWAP_LE_BE (*((dbus_uint32_t*)p)); + *((dbus_uint32_t *) (void *) p) = + DBUS_UINT32_SWAP_LE_BE (*((dbus_uint32_t *) (void *) p)); p += 4; } break; @@ -73,7 +75,8 @@ byteswap_body_helper (DBusTypeReader *reader, case DBUS_TYPE_DOUBLE: { p = _DBUS_ALIGN_ADDRESS (p, 8); - *((dbus_uint64_t*)p) = DBUS_UINT64_SWAP_LE_BE (*((dbus_uint64_t*)p)); + *((dbus_uint64_t *) (void *) p) = + DBUS_UINT64_SWAP_LE_BE (*((dbus_uint64_t *) (void *) p)); p += 8; } break; @@ -88,7 +91,8 @@ byteswap_body_helper (DBusTypeReader *reader, array_len = _dbus_unpack_uint32 (old_byte_order, p); - *((dbus_uint32_t*)p) = DBUS_UINT32_SWAP_LE_BE (*((dbus_uint32_t*)p)); + *((dbus_uint32_t *) (void *) p) = + DBUS_UINT32_SWAP_LE_BE (*((dbus_uint32_t *) (void *) p)); p += 4; if (current_type == DBUS_TYPE_ARRAY) |