]> granicus.if.org Git - vim/commitdiff
patch 8.0.0273: dead code detected by Coverity v8.0.0273
authorBram Moolenaar <Bram@vim.org>
Mon, 30 Jan 2017 21:56:48 +0000 (22:56 +0100)
committerBram Moolenaar <Bram@vim.org>
Mon, 30 Jan 2017 21:56:48 +0000 (22:56 +0100)
Problem:    Dead code detected by Coverity when not using gnome.
Solution:   Rearrange the #ifdefs to avoid dead code.

src/gui_gtk_x11.c
src/version.c

index 71bcd6a3a66ebc35fec8cfb0e4eb1a5b78941746..8781e2c347169a42aa2c1790d9bfad91353483ed 100644 (file)
@@ -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;
index cfaa0b84376f24b31eb0a7db0a329a0628f62454..a60de4c16eb5448b171e6965082d61a50c0d51d7 100644 (file)
@@ -764,6 +764,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    273,
 /**/
     272,
 /**/