Fix warning from double assigning to gscreen

Compiling GParted on an older distribution with gtk+-3.0 < 3.22.0, where
HAVE_GTK_SHOW_URI_ON_WINDOW is undefined, produces this warning message:
    Win_GParted.cc: In member function 'void GParted::Win_GParted::show_help(const Glib::ustring&, const Glib::ustring&)':
    Win_GParted.cc:1822:56: warning: operation on 'gscreen' may be undefined [-Wsequence-point]
      GdkScreen *gscreen = gscreen = gdk_screen_get_default();
                                                            ^

Found on Ubuntu 16.04 LTS with gtk+ 3.18.0.

Stop double assigning to gscreen.  Fixes commit:
    26f4dc504a
    Replace deprecated gtk_show_uri() method for help window (!82)
This commit is contained in:
Mike Fleetwood 2021-09-04 22:31:56 +01:00
parent ba1bafc5ac
commit 1b85bf00cf
1 changed files with 1 additions and 1 deletions

View File

@ -1819,7 +1819,7 @@ void Win_GParted::show_help(const Glib::ustring & filename /* E.g., "gparted" */
// https://gitlab.gnome.org/GNOME/gparted/-/merge_requests/82#note_1106114
gtk_show_uri_on_window(NULL, uri.c_str(), gtk_get_current_event_time(), &error);
#else
GdkScreen *gscreen = gscreen = gdk_screen_get_default();
GdkScreen *gscreen = gdk_screen_get_default();
gtk_show_uri(gscreen, uri.c_str(), gtk_get_current_event_time(), &error);
#endif
if (error != NULL)