[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [virt-tools-list] [PATCH virt-viewer 5/6] Rename variable, fix gcc warning



On Thu, May 16, 2013 at 09:33:21PM +0200, Marc-André Lureau wrote:
> From: Marc-André Lureau <marcandre lureau 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 redhat com
> https://www.redhat.com/mailman/listinfo/virt-tools-list

Attachment: pgpxff87IR1wI.pgp
Description: PGP signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]