[virt-tools-list] [PATCH virt-viewer 5/6] Rename variable, fix gcc warning
Christophe Fergeau
cfergeau at redhat.com
Fri May 17 12:59:05 UTC 2013
On Thu, May 16, 2013 at 09:33:21PM +0200, Marc-André Lureau wrote:
> From: Marc-André Lureau <marcandre.lureau at redhat.com>
>
> virt-viewer-main.c:61: warning: declaration of 'basename' shadows a global declaration
ACK
> ---
> src/remote-viewer-main.c | 8 ++++----
> src/virt-viewer-main.c | 8 ++++----
> 2 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/src/remote-viewer-main.c b/src/remote-viewer-main.c
> index 73187d1..de1544f 100644
> --- a/src/remote-viewer-main.c
> +++ b/src/remote-viewer-main.c
> @@ -246,11 +246,11 @@ main(int argc, char **argv)
> #endif
> g_option_context_parse (context, &argc, &argv, &error);
> if (error) {
> - char *basename;
> - basename = g_path_get_basename(argv[0]);
> + char *base_name;
> + base_name = g_path_get_basename(argv[0]);
> g_printerr(_("%s\nRun '%s --help' to see a full list of available command line options\n"),
> - error->message, basename);
> - g_free(basename);
> + error->message, base_name);
> + g_free(base_name);
> g_error_free(error);
> goto cleanup;
> }
> diff --git a/src/virt-viewer-main.c b/src/virt-viewer-main.c
> index c93d948..caef434 100644
> --- a/src/virt-viewer-main.c
> +++ b/src/virt-viewer-main.c
> @@ -58,7 +58,7 @@ int main(int argc, char **argv)
> gboolean reconnect = FALSE;
> gboolean fullscreen = FALSE;
> VirtViewer *viewer = NULL;
> - char *basename;
> + char *base_name;
> char *help_msg = NULL;
> const GOptionEntry options [] = {
> { "version", 'V', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
> @@ -90,10 +90,10 @@ int main(int argc, char **argv)
>
> virt_viewer_util_init(_("Virt Viewer"));
>
> - basename = g_path_get_basename(argv[0]);
> + base_name = g_path_get_basename(argv[0]);
> help_msg = g_strdup_printf(_("Run '%s --help' to see a full list of available command line options"),
> - basename);
> - g_free(basename);
> + base_name);
> + g_free(base_name);
>
> /* Setup command line options */
> context = g_option_context_new (_("- Virtual machine graphical console"));
> --
> 1.8.3.rc1.49.g8d97506
>
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20130517/d3984753/attachment.sig>
More information about the virt-tools-list
mailing list