summaryrefslogtreecommitdiffstats
path: root/src/gui_gtk_x11.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-01-30 22:56:48 +0100
committerBram Moolenaar <Bram@vim.org>2017-01-30 22:56:48 +0100
commitc4a249a736d40ec54794827ef95804c225d0e38f (patch)
treef61752362c0ef75e2e2a79f10d2540136511a3f9 /src/gui_gtk_x11.c
parent432c839ebd5b99d548de82f66ddb5a47740fdb28 (diff)
patch 8.0.0273: dead code detected by Coverityv8.0.0273
Problem: Dead code detected by Coverity when not using gnome. Solution: Rearrange the #ifdefs to avoid dead code.
Diffstat (limited to 'src/gui_gtk_x11.c')
-rw-r--r--src/gui_gtk_x11.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c
index 71bcd6a3a6..8781e2c347 100644
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -3171,9 +3171,9 @@ delete_event_cb(GtkWidget *widget UNUSED,
static int
get_item_dimensions(GtkWidget *widget, GtkOrientation orientation)
{
+# ifdef FEAT_GUI_GNOME
GtkOrientation item_orientation = GTK_ORIENTATION_HORIZONTAL;
-# ifdef FEAT_GUI_GNOME
if (using_gnome && widget != NULL)
{
GtkWidget *parent;
@@ -3192,7 +3192,10 @@ get_item_dimensions(GtkWidget *widget, GtkOrientation orientation)
item_orientation = bonobo_dock_item_get_orientation(dockitem);
}
}
+# else
+# define item_orientation GTK_ORIENTATION_HORIZONTAL
# endif
+
# if GTK_CHECK_VERSION(3,0,0)
if (widget != NULL
&& item_orientation == orientation
@@ -3210,15 +3213,23 @@ get_item_dimensions(GtkWidget *widget, GtkOrientation orientation)
gtk_widget_get_allocation(widget, &allocation);
+# ifdef FEAT_GUI_GNOME
if (orientation == GTK_ORIENTATION_HORIZONTAL)
return allocation.height;
else
return allocation.width;
+# else
+ return allocation.height;
+#endif
# else
+# ifdef FEAT_GUI_GNOME
if (orientation == GTK_ORIENTATION_HORIZONTAL)
return widget->allocation.height;
else
return widget->allocation.width;
+# else
+ return widget->allocation.height;
+# endif
# endif
}
return 0;