Split DBUS_GENERIC_STRING_PREAMBLE into sensible lines
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Wed, 22 Jun 2011 13:44:28 +0000 (14:44 +0100)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Wed, 22 Jun 2011 18:14:46 +0000 (19:14 +0100)
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38570
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
dbus/dbus-string-private.h

index 365d89a..500e0b7 100644 (file)
@@ -73,7 +73,16 @@ typedef struct
  *
  * @param real the DBusRealString
  */
-#define DBUS_GENERIC_STRING_PREAMBLE(real) _dbus_assert ((real) != NULL); _dbus_assert (!(real)->invalid); _dbus_assert ((real)->len >= 0); _dbus_assert ((real)->allocated >= 0); _dbus_assert ((real)->max_length >= 0); _dbus_assert ((real)->len <= ((real)->allocated - _DBUS_STRING_ALLOCATION_PADDING)); _dbus_assert ((real)->len <= (real)->max_length)
+#define DBUS_GENERIC_STRING_PREAMBLE(real) \
+  do { \
+      _dbus_assert ((real) != NULL); \
+      _dbus_assert (!(real)->invalid); \
+      _dbus_assert ((real)->len >= 0); \
+      _dbus_assert ((real)->allocated >= 0); \
+      _dbus_assert ((real)->max_length >= 0); \
+      _dbus_assert ((real)->len <= ((real)->allocated - _DBUS_STRING_ALLOCATION_PADDING)); \
+      _dbus_assert ((real)->len <= (real)->max_length); \
+  } while (0)
 
 /**
  * Checks assertions about a string object that needs to be