forked from aniani/vim
patch 8.0.0273: dead code detected by Coverity
Problem: Dead code detected by Coverity when not using gnome. Solution: Rearrange the #ifdefs to avoid dead code.
This commit is contained in:
@@ -3171,9 +3171,9 @@ delete_event_cb(GtkWidget *widget UNUSED,
|
|||||||
static int
|
static int
|
||||||
get_item_dimensions(GtkWidget *widget, GtkOrientation orientation)
|
get_item_dimensions(GtkWidget *widget, GtkOrientation orientation)
|
||||||
{
|
{
|
||||||
|
# ifdef FEAT_GUI_GNOME
|
||||||
GtkOrientation item_orientation = GTK_ORIENTATION_HORIZONTAL;
|
GtkOrientation item_orientation = GTK_ORIENTATION_HORIZONTAL;
|
||||||
|
|
||||||
# ifdef FEAT_GUI_GNOME
|
|
||||||
if (using_gnome && widget != NULL)
|
if (using_gnome && widget != NULL)
|
||||||
{
|
{
|
||||||
GtkWidget *parent;
|
GtkWidget *parent;
|
||||||
@@ -3192,7 +3192,10 @@ get_item_dimensions(GtkWidget *widget, GtkOrientation orientation)
|
|||||||
item_orientation = bonobo_dock_item_get_orientation(dockitem);
|
item_orientation = bonobo_dock_item_get_orientation(dockitem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
# else
|
||||||
|
# define item_orientation GTK_ORIENTATION_HORIZONTAL
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# if GTK_CHECK_VERSION(3,0,0)
|
# if GTK_CHECK_VERSION(3,0,0)
|
||||||
if (widget != NULL
|
if (widget != NULL
|
||||||
&& item_orientation == orientation
|
&& item_orientation == orientation
|
||||||
@@ -3210,15 +3213,23 @@ get_item_dimensions(GtkWidget *widget, GtkOrientation orientation)
|
|||||||
|
|
||||||
gtk_widget_get_allocation(widget, &allocation);
|
gtk_widget_get_allocation(widget, &allocation);
|
||||||
|
|
||||||
|
# ifdef FEAT_GUI_GNOME
|
||||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||||
return allocation.height;
|
return allocation.height;
|
||||||
else
|
else
|
||||||
return allocation.width;
|
return allocation.width;
|
||||||
|
# else
|
||||||
|
return allocation.height;
|
||||||
|
#endif
|
||||||
# else
|
# else
|
||||||
|
# ifdef FEAT_GUI_GNOME
|
||||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||||
return widget->allocation.height;
|
return widget->allocation.height;
|
||||||
else
|
else
|
||||||
return widget->allocation.width;
|
return widget->allocation.width;
|
||||||
|
# else
|
||||||
|
return widget->allocation.height;
|
||||||
|
# endif
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -764,6 +764,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
273,
|
||||||
/**/
|
/**/
|
||||||
272,
|
272,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user