Skip to content

[PATCH] Fix build with clang for enum type GtkOrientation and XfcePanelPluginMode

Submitted by OlivierDuchateau @OlivierDuchateau

Link to original bug (#13915)

Description

Under FreeBSD with clang, it's default compiler (but also noticed on Fedora 26 with gcc 7.2.1) I get this message when I build xfce4-weather-plugin:

weather.c:2035:31: warning: implicit conversion from enumeration type 'XfcePanelPluginMode' to different enumeration type 'GtkOrientation' [-Wenum-conversion]
    data->panel_orientation = xfce_panel_plugin_get_mode(panel);
                            ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~
weather.c:2038:34: warning: comparison of constant 'XFCE_PANEL_PLUGIN_MODE_DESKBAR' (2) with expression of type 'GtkOrientation' is always false [-Wtautological-constant-out-of-range-compare]
        (data->panel_orientation == XFCE_PANEL_PLUGIN_MODE_DESKBAR &&
         ~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~

I suggest to use xfce_panel_plugin_get_orientation() function. It returns GtkOrientation type (GTK_ORIENTATION_HORIZONTAL or GTK_ORIENTATION_VERTICAL).

Patch 7355, "Fix enum type between GtkOrientation and XfcePanelPluginMode":
0001-Fix-enum-type-between-GtkOrientation-and-XfcePanelPluginMode.patch

Version: 0.8.10

Edited by Yousuf Philips