diff options
author | Evan Huus <eapache@gmail.com> | 2012-12-26 13:18:58 +0000 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2012-12-26 13:18:58 +0000 |
commit | 1fafe099ab2a54349f706630f36e27274f4682b9 (patch) | |
tree | a44a9764a6977651dd9a30d2c542c5c14a7a93da /ui | |
parent | eb34f28b9ff0c5ee97b61fc88a3301a94c35cc61 (diff) | |
download | wireshark-1fafe099ab2a54349f706630f36e27274f4682b9.tar.gz wireshark-1fafe099ab2a54349f706630f36e27274f4682b9.tar.bz2 wireshark-1fafe099ab2a54349f706630f36e27274f4682b9.zip |
Cast away another const warning that only shows up under really recent GCCs.
svn path=/trunk/; revision=46785
Diffstat (limited to 'ui')
-rw-r--r-- | ui/gtk/webbrowser.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/ui/gtk/webbrowser.c b/ui/gtk/webbrowser.c index c32103b18d..4d9ec45923 100644 --- a/ui/gtk/webbrowser.c +++ b/ui/gtk/webbrowser.c @@ -158,21 +158,23 @@ browser_open_url (const gchar *url) #elif defined(HAVE_XDG_OPEN) - GError *error = NULL; - gchar *argv[3]; - gboolean retval; + GError *error = NULL; + const gchar *argv[3]; + gboolean retval; g_return_val_if_fail (url != NULL, FALSE); argv[0] = "xdg-open"; - argv[1] = (char *)url; /* Grr - g_spawn_async() shouldn't modify this */ + argv[1] = url; argv[2] = NULL; /* * XXX - use g_spawn_on_screen() so the browser window shows up on * the same screen? + * + * Also, g_spawn_async() shouldn't modify argv but takes it as non-const! */ - retval = g_spawn_async (NULL, argv, NULL, + retval = g_spawn_async (NULL, (gchar**) argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error); @@ -261,6 +263,8 @@ browser_open_url (const gchar *url) #endif } +/* XXX: Much of this is very similar to browser_open_url - abstract a common + * function out of the two of them? */ gboolean filemanager_open_directory (const gchar *path) { @@ -310,21 +314,23 @@ filemanager_open_directory (const gchar *path) #elif defined(HAVE_XDG_OPEN) - GError *error = NULL; - gchar *argv[3]; - gboolean retval; + GError *error = NULL; + const gchar *argv[3]; + gboolean retval; g_return_val_if_fail (path != NULL, FALSE); argv[0] = "xdg-open"; - argv[1] = (char *)path; /* Grr - g_spawn_async() shouldn't modify this */ + argv[1] = path; argv[2] = NULL; /* * XXX - use g_spawn_on_screen() so the file managaer window shows up on * the same screen? + * + * Also, g_spawn_async shouldn't modify argv but takes it as non-const! */ - retval = g_spawn_async (NULL, argv, NULL, + retval = g_spawn_async (NULL, (gchar**) argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error); |