gdebugcontrollerdbus: Mark a variable as G_GNUC_UNUSED

It’s not used when compiling with `G_DISABLE_ASSERT`. This fixes the CI
build failure here: https://gitlab.gnome.org/GNOME/glib/-/jobs/1843082
```
[461/1229] Compiling C object 'gio/6ae6c9e@@gio-2.0@sha/gdebugcontrollerdbus.c.o'.
FAILED: gio/6ae6c9e@@gio-2.0@sha/gdebugcontrollerdbus.c.o
cc -Igio/6ae6c9e@@gio-2.0@sha -Igio -I../gio -I. -I../ -Iglib -I../glib -Igobject -I../gobject -Igmodule -I../gmodule -I/usr/include/libmount -I/usr/include/blkid -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -Werror -std=gnu99 -g -D_GNU_SOURCE -fno-strict-aliasing -DG_ENABLE_DEBUG -DG_DISABLE_ASSERT -Wduplicated-branches -Wimplicit-fallthrough -Wmisleading-indentation -Wunused -Wno-unused-parameter -Wno-cast-function-type -Wno-pedantic -Wno-format-zero-length -Wno-variadic-macros -Werror=format=2 -Werror=init-self -Werror=missing-include-dirs -Werror=pointer-arith -Wstrict-prototypes -Wno-bad-function-cast -Werror=declaration-after-statement -Werror=implicit-function-declaration -Werror=missing-prototypes -fPIC '-DG_LOG_DOMAIN="GLib-GIO"' -DGIO_COMPILATION '-DGIO_MODULE_DIR="/usr/local/lib64/gio/modules"' '-DLOCALSTATEDIR="/usr/local/var"' -fvisibility=hidden -MD -MQ 'gio/6ae6c9e@@gio-2.0@sha/gdebugcontrollerdbus.c.o' -MF 'gio/6ae6c9e@@gio-2.0@sha/gdebugcontrollerdbus.c.o.d' -o 'gio/6ae6c9e@@gio-2.0@sha/gdebugcontrollerdbus.c.o' -c ../gio/gdebugcontrollerdbus.c
../gio/gdebugcontrollerdbus.c: In function ‘authorize_cb’:
../gio/gdebugcontrollerdbus.c:345:32: error: unused variable ‘priv’ [-Werror=unused-variable]
  345 |   GDebugControllerDBusPrivate *priv = g_debug_controller_dbus_get_instance_private (self);
      |                                ^~~~
cc1: all warnings being treated as errors
```

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
Philip Withnall 2022-02-22 09:25:56 +00:00
parent 7cef814b7d
commit cd9ed612a7

View File

@ -342,13 +342,14 @@ authorize_cb (GObject *object,
gpointer user_data)
{
GDebugControllerDBus *self = G_DEBUG_CONTROLLER_DBUS (object);
GDebugControllerDBusPrivate *priv = g_debug_controller_dbus_get_instance_private (self);
GDebugControllerDBusPrivate *priv G_GNUC_UNUSED /* when compiling with G_DISABLE_ASSERT */;
GTask *task = G_TASK (result);
GDBusMethodInvocation *invocation = g_task_get_task_data (task);
GVariant *parameters = g_dbus_method_invocation_get_parameters (invocation);
gboolean enabled = FALSE;
gboolean authorized;
priv = g_debug_controller_dbus_get_instance_private (self);
authorized = g_task_propagate_boolean (task, NULL);
if (!authorized)