From 367dfee36e95cc758111772e8709a25f6e00b3b2 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 12 Apr 2021 20:55:01 -0400 Subject: [PATCH] Fix unused variable warnings These happen for variables which are only used in assertions, when assertions are disabled. --- gtk/a11y/gtkatspicontext.c | 2 +- gtk/gtkdialog.c | 2 +- gtk/gtkexpression.c | 4 ++-- gtk/gtklistitemmanager.c | 2 +- gtk/gtksettings.c | 2 +- gtk/gtkshortcutaction.c | 4 ++-- gtk/gtktreeview.c | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/gtk/a11y/gtkatspicontext.c b/gtk/a11y/gtkatspicontext.c index c55117587b..23d299818c 100644 --- a/gtk/a11y/gtkatspicontext.c +++ b/gtk/a11y/gtkatspicontext.c @@ -1420,7 +1420,7 @@ gtk_at_spi_context_get_property (GObject *gobject, static void gtk_at_spi_context_constructed (GObject *gobject) { - GtkAtSpiContext *self = GTK_AT_SPI_CONTEXT (gobject); + GtkAtSpiContext *self G_GNUC_UNUSED = GTK_AT_SPI_CONTEXT (gobject); /* Make sure that we were properly constructed */ g_assert (self->bus_address); diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c index 934bd681f8..53b13c68fd 100644 --- a/gtk/gtkdialog.c +++ b/gtk/gtkdialog.c @@ -369,7 +369,7 @@ apply_response_for_action_area (GtkDialog *dialog, GtkWidget *child, int response_id) { - GtkDialogPrivate *priv = gtk_dialog_get_instance_private (dialog); + GtkDialogPrivate *priv G_GNUC_UNUSED = gtk_dialog_get_instance_private (dialog); g_assert (gtk_widget_get_parent (child) == priv->action_area); } diff --git a/gtk/gtkexpression.c b/gtk/gtkexpression.c index 5897d8a512..d8e75cddc9 100644 --- a/gtk/gtkexpression.c +++ b/gtk/gtkexpression.c @@ -1935,9 +1935,9 @@ gtk_expression_watch_ref (GtkExpressionWatch *watch) static void gtk_expression_watch_finalize (gpointer data) { - GtkExpressionWatch *watch = data; + GtkExpressionWatch *watch G_GNUC_UNUSED = data; - g_assert (!gtk_expression_watch_is_watching (watch)); + g_assert (!gtk_expression_watch_is_watching (data)); } /** diff --git a/gtk/gtklistitemmanager.c b/gtk/gtklistitemmanager.c index c795653004..3271fe1de4 100644 --- a/gtk/gtklistitemmanager.c +++ b/gtk/gtklistitemmanager.c @@ -104,7 +104,7 @@ gtk_list_item_manager_augment_node (GtkRbTree *tree, static void gtk_list_item_manager_clear_node (gpointer _item) { - GtkListItemManagerItem *item = _item; + GtkListItemManagerItem *item G_GNUC_UNUSED = _item; g_assert (item->widget == NULL); } diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c index b88c6ea37d..186bebf6aa 100644 --- a/gtk/gtksettings.c +++ b/gtk/gtksettings.c @@ -320,7 +320,7 @@ static void gtk_settings_class_init (GtkSettingsClass *class) { GObjectClass *gobject_class = G_OBJECT_CLASS (class); - guint result; + guint result G_GNUC_UNUSED; gobject_class->finalize = gtk_settings_finalize; gobject_class->get_property = gtk_settings_get_property; diff --git a/gtk/gtkshortcutaction.c b/gtk/gtkshortcutaction.c index 732dfdf0b9..7870b0465c 100644 --- a/gtk/gtkshortcutaction.c +++ b/gtk/gtkshortcutaction.c @@ -882,7 +882,7 @@ gtk_signal_action_print (GtkShortcutAction *action, static void gtk_signal_action_constructed (GObject *gobject) { - GtkSignalAction *self = GTK_SIGNAL_ACTION (gobject); + GtkSignalAction *self G_GNUC_UNUSED = GTK_SIGNAL_ACTION (gobject); g_assert (self->name != NULL && self->name[0] != '\0'); @@ -1162,7 +1162,7 @@ gtk_named_action_get_property (GObject *gobject, static void gtk_named_action_constructed (GObject *gobject) { - GtkNamedAction *self = GTK_NAMED_ACTION (gobject); + GtkNamedAction *self G_GNUC_UNUSED = GTK_NAMED_ACTION (gobject); g_assert (self->name != NULL && self->name[0] != '\0'); diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index f6391c68f8..044f6baaab 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -3513,7 +3513,7 @@ prelight_or_select (GtkTreeView *tree_view, static void ensure_unprelighted (GtkTreeView *tree_view) { - GtkTreeViewPrivate *priv = gtk_tree_view_get_instance_private (tree_view); + GtkTreeViewPrivate *priv G_GNUC_UNUSED = gtk_tree_view_get_instance_private (tree_view); do_prelight (tree_view, NULL, NULL,