comparison src/gui_gtk_x11.c @ 10767:a8ce0dbbb1d0 v8.0.0273

patch 8.0.0273: dead code detected by Coverity commit https://github.com/vim/vim/commit/c4a249a736d40ec54794827ef95804c225d0e38f Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jan 30 22:56:48 2017 +0100 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.
author Christian Brabandt <cb@256bit.org>
date Mon, 30 Jan 2017 23:00:05 +0100
parents a3cef16bea27
children bda1d67f83f3
comparison
equal deleted inserted replaced
10766:34c2934fc222 10767:a8ce0dbbb1d0
3169 3169
3170 #if defined(FEAT_MENU) || defined(FEAT_TOOLBAR) || defined(FEAT_GUI_TABLINE) 3170 #if defined(FEAT_MENU) || defined(FEAT_TOOLBAR) || defined(FEAT_GUI_TABLINE)
3171 static int 3171 static int
3172 get_item_dimensions(GtkWidget *widget, GtkOrientation orientation) 3172 get_item_dimensions(GtkWidget *widget, GtkOrientation orientation)
3173 { 3173 {
3174 # ifdef FEAT_GUI_GNOME
3174 GtkOrientation item_orientation = GTK_ORIENTATION_HORIZONTAL; 3175 GtkOrientation item_orientation = GTK_ORIENTATION_HORIZONTAL;
3175 3176
3176 # ifdef FEAT_GUI_GNOME
3177 if (using_gnome && widget != NULL) 3177 if (using_gnome && widget != NULL)
3178 { 3178 {
3179 GtkWidget *parent; 3179 GtkWidget *parent;
3180 BonoboDockItem *dockitem; 3180 BonoboDockItem *dockitem;
3181 3181
3190 if (dockitem == NULL || dockitem->is_floating) 3190 if (dockitem == NULL || dockitem->is_floating)
3191 return 0; 3191 return 0;
3192 item_orientation = bonobo_dock_item_get_orientation(dockitem); 3192 item_orientation = bonobo_dock_item_get_orientation(dockitem);
3193 } 3193 }
3194 } 3194 }
3195 # endif 3195 # else
3196 # define item_orientation GTK_ORIENTATION_HORIZONTAL
3197 # endif
3198
3196 # if GTK_CHECK_VERSION(3,0,0) 3199 # if GTK_CHECK_VERSION(3,0,0)
3197 if (widget != NULL 3200 if (widget != NULL
3198 && item_orientation == orientation 3201 && item_orientation == orientation
3199 && gtk_widget_get_realized(widget) 3202 && gtk_widget_get_realized(widget)
3200 && gtk_widget_get_visible(widget)) 3203 && gtk_widget_get_visible(widget))
3208 # if GTK_CHECK_VERSION(3,0,0) 3211 # if GTK_CHECK_VERSION(3,0,0)
3209 GtkAllocation allocation; 3212 GtkAllocation allocation;
3210 3213
3211 gtk_widget_get_allocation(widget, &allocation); 3214 gtk_widget_get_allocation(widget, &allocation);
3212 3215
3216 # ifdef FEAT_GUI_GNOME
3213 if (orientation == GTK_ORIENTATION_HORIZONTAL) 3217 if (orientation == GTK_ORIENTATION_HORIZONTAL)
3214 return allocation.height; 3218 return allocation.height;
3215 else 3219 else
3216 return allocation.width; 3220 return allocation.width;
3221 # else
3222 return allocation.height;
3223 #endif
3217 # else 3224 # else
3225 # ifdef FEAT_GUI_GNOME
3218 if (orientation == GTK_ORIENTATION_HORIZONTAL) 3226 if (orientation == GTK_ORIENTATION_HORIZONTAL)
3219 return widget->allocation.height; 3227 return widget->allocation.height;
3220 else 3228 else
3221 return widget->allocation.width; 3229 return widget->allocation.width;
3230 # else
3231 return widget->allocation.height;
3232 # endif
3222 # endif 3233 # endif
3223 } 3234 }
3224 return 0; 3235 return 0;
3225 } 3236 }
3226 #endif 3237 #endif