summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2022-05-19 18:15:58 +0000
committerSimon McVittie <smcv@collabora.com>2022-05-19 18:15:58 +0000
commit366b075dec24ff642e04668b78af2713213d8e53 (patch)
tree7fbf3748460591455c9b193ccc4deaf3f23bc58c
parentc64aa0308c72e31d9f7ab8fdea1132ad21372b83 (diff)
parent708dd5a55e03656cad81dcb30947186da3966395 (diff)
Merge branch 'warnings' into 'master'
Fix unused warnings See merge request dbus/dbus!315
-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");