summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <pwithnall@endlessos.org>2022-12-21 12:33:58 +0000
committerPhilip Withnall <pwithnall@endlessos.org>2022-12-21 12:33:58 +0000
commit1abd7507be7a7f4424f91d2cf476d5d53f8e779e (patch)
tree369d4573cd74bbd713f37d32f3a02de807df3033
parent9e2ad88455e422d9b2b6324388bbadabddbf1489 (diff)
downloadglib-1abd7507be7a7f4424f91d2cf476d5d53f8e779e.tar.gz
gmenuexporter: Fix warning of unused n_items when building with G_DISABLE_ASSERT
Spotted in https://gitlab.gnome.org/GNOME/glib/-/jobs/2461358 Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-rw-r--r--gio/gmenuexporter.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gio/gmenuexporter.c b/gio/gmenuexporter.c
index a87f5c39d..1860b34e8 100644
--- a/gio/gmenuexporter.c
+++ b/gio/gmenuexporter.c
@@ -252,12 +252,16 @@ g_menu_exporter_menu_items_changed (GMenuModel *model,
GMenuExporterMenu *menu = user_data;
GSequenceIter *point;
gint i;
+#ifndef G_DISABLE_ASSERT
gint n_items;
+#endif
g_assert (menu->model == model);
g_assert (menu->item_links != NULL);
+#ifndef G_DISABLE_ASSERT
n_items = g_sequence_get_length (menu->item_links);
+#endif
g_assert (position >= 0 && position < G_MENU_EXPORTER_MAX_SECTION_SIZE);
g_assert (removed >= 0 && removed < G_MENU_EXPORTER_MAX_SECTION_SIZE);
g_assert (added < G_MENU_EXPORTER_MAX_SECTION_SIZE);