From: Marc-André Lureau Date: Thu, 19 May 2022 15:51:14 +0000 (+0200) Subject: dbus: fix unused warning X-Git-Tag: dbus-1.15.0~52^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2cf41e1aeb1b8cb480ed8c0af74be4096e5bb23;p=thirdparty%2Fdbus.git dbus: fix unused warning ../../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 --- diff --git a/dbus/dbus-message.c b/dbus/dbus-message.c index 45b1adfd6..4c36aa392 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;