From 3ed9db546e1143bc9aa2d83a6f423fdd81227352 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Fri, 28 Jan 2005 03:06:56 +0000 Subject: 2005-01-27 Havoc Pennington * dbus/dbus-arch-deps.h.in: add 16/32-bit types * configure.in: find the right type for 16 and 32 bit ints as well as 64 * dbus/dbus-protocol.h (DBUS_TYPE_INT16, DBUS_TYPE_UINT16): add the 16-bit types so people don't have to stuff them in 32-bit or byte arrays. --- dbus/dbus-marshal-byteswap.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'dbus/dbus-marshal-byteswap.c') diff --git a/dbus/dbus-marshal-byteswap.c b/dbus/dbus-marshal-byteswap.c index 434d7e4b..7670ec45 100644 --- a/dbus/dbus-marshal-byteswap.c +++ b/dbus/dbus-marshal-byteswap.c @@ -47,6 +47,15 @@ byteswap_body_helper (DBusTypeReader *reader, ++p; break; + case DBUS_TYPE_INT16: + case DBUS_TYPE_UINT16: + { + p = _DBUS_ALIGN_ADDRESS (p, 2); + *((dbus_uint16_t*)p) = DBUS_UINT16_SWAP_LE_BE (*((dbus_uint16_t*)p)); + p += 2; + } + break; + case DBUS_TYPE_BOOLEAN: case DBUS_TYPE_INT32: case DBUS_TYPE_UINT32: -- cgit