]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
dbus: fix unused warning
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Thu, 19 May 2022 15:51:14 +0000 (17:51 +0200)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Thu, 19 May 2022 15:57:31 +0000 (17:57 +0200)
../../dbus/dbus-message.c:5462:17: warning: variable ‘len’ set but not used [-Wunused-but-set-variable]
 5462 |   unsigned char len;

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
dbus/dbus-message.c

index 45b1adfd6f6d868fe11b74b4b0add8d36d57a0b0..4c36aa39249a713bdcbc8d6c47e159443b019ea6 100644 (file)
@@ -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;