2017-01-31 6:57 GMT+09:00 Bram Moolenaar <[email protected]>:
>
> Patch 8.0.0273
> Problem: Dead code detected by Coverity when not using gnome.
> Solution: Rearrange the #ifdefs to avoid dead code.
> Files: src/gui_gtk_x11.c
>
>
> *** ../vim-8.0.0272/src/gui_gtk_x11.c 2017-01-09 20:30:23.898717562
> +0100
> --- src/gui_gtk_x11.c 2017-01-30 22:45:03.999637769 +0100
>
<snip>
> *** 3192,3198 ****
> --- 3192,3201 ----
> 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,3224 ****
> --- 3213,3235 ----
>
> 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
>
Since FEAT_GUI_GNOME only makes sense with GTK+ 2, and since the #ifdef
block above is enclosed with GTK_CHECK_VERSION(3,0,0), we can reduce the
amount of code a little further as shown in the attached patch.
Best regards,
Kazunobu Kuriyama
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c
index 8781e2c34..eef0bd427 100644
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -3212,15 +3212,7 @@ get_item_dimensions(GtkWidget *widget, GtkOrientation
orientation)
GtkAllocation allocation;
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)