summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dbus/dbus-message.c6
-rw-r--r--test/internals/assertions.c2
2 files changed, 6 insertions, 2 deletions
diff --git a/dbus/dbus-message.c b/dbus/dbus-message.c
index 45b1adfd..4c36aa39 100644
--- a/dbus/dbus-message.c
+++ b/dbus/dbus-message.c
@@ -5459,14 +5459,18 @@ oom:
const char *
_dbus_variant_get_signature (DBusVariant *self)
{
- unsigned char len;
const char *ret;
+#ifndef DBUS_DISABLE_ASSERT
+ unsigned char len;
+#endif
_dbus_assert (self != NULL);
+#ifndef DBUS_DISABLE_ASSERT
/* Here we make use of the fact that the serialization of a variant starts
* with the 1-byte length, then that many bytes of signature, then \0. */
len = _dbus_string_get_byte (&self->data, 0);
+#endif
ret = _dbus_string_get_const_data_len (&self->data, 1, len);
_dbus_assert (strlen (ret) == len);
return ret;
diff --git a/test/internals/assertions.c b/test/internals/assertions.c
index d1360e0f..7d3f8694 100644
--- a/test/internals/assertions.c
+++ b/test/internals/assertions.c
@@ -78,10 +78,10 @@ static void
test_assert_error_is_set (Fixture *f,
gconstpointer context G_GNUC_UNUSED)
{
+#if defined(DBUS_ENABLE_ASSERT) && defined(DBUS_ENABLE_CHECKS)
DBusError e = DBUS_ERROR_INIT;
DBusError *ep = NULL;
-#if defined(DBUS_ENABLE_ASSERT) && defined(DBUS_ENABLE_CHECKS)
if (!g_test_undefined ())
{
g_test_skip ("Not testing programming errors");