[glib/wip/pwithnall/disable-assert] gfileicon: Fix unused-but-set variable with G_DISABLE_ASSERT
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/pwithnall/disable-assert] gfileicon: Fix unused-but-set variable with G_DISABLE_ASSERT
- Date: Tue, 24 Nov 2020 08:56:53 +0000 (UTC)
commit e8355655232aa2039a22e49dba6f48a54348b80d
Author: Philip Withnall <pwithnall endlessos org>
Date: Tue Nov 24 08:55:58 2020 +0000
gfileicon: Fix unused-but-set variable with G_DISABLE_ASSERT
This fixes a warning (which is promoted to an error) in our
`G_DISABLE_ASSERT` CI.
Signed-off-by: Philip Withnall <pwithnall endlessos org>
gio/gfileicon.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gio/gfileicon.c b/gio/gfileicon.c
index 5e6e65250..2f28d48f8 100644
--- a/gio/gfileicon.c
+++ b/gio/gfileicon.c
@@ -114,12 +114,12 @@ g_file_icon_set_property (GObject *object,
static void
g_file_icon_constructed (GObject *object)
{
- GFileIcon *icon;
+#ifndef G_DISABLE_ASSERT
+ GFileIcon *icon = G_FILE_ICON (object);
+#endif
G_OBJECT_CLASS (g_file_icon_parent_class)->constructed (object);
- icon = G_FILE_ICON (object);
-
/* Must have be set during construction */
g_assert (icon->file != NULL);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]