[gparted] Fix warning from double assigning to gscreen
- From: Mike Fleetwood <mfleetwo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gparted] Fix warning from double assigning to gscreen
- Date: Fri, 17 Sep 2021 16:17:23 +0000 (UTC)
commit 1b85bf00cff5eb9bf76a1ab26c4e0304c6147227
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date: Sat Sep 4 22:31:56 2021 +0100
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:
26f4dc504ab6837d717b1f047edc3853b1c67a5f
Replace deprecated gtk_show_uri() method for help window (!82)
src/Win_GParted.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc
index ae7998f2..b4cf5051 100644
--- a/src/Win_GParted.cc
+++ b/src/Win_GParted.cc
@@ -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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]