Re: [PATCH] reds: constification

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

 



On Thu, Feb 04, 2016 at 04:03:10PM +0000, Frediano Ziglio wrote:
> Make version_string a constant.
> Also there is no need to have a pointer but declare the buffer as static
> 
> Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
> ---
>  server/reds.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/server/reds.c b/server/reds.c
> index edbdaad..4225847 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -3299,7 +3299,7 @@ static void reds_init_vd_agent_resources(RedsState *reds)
>      }
>  }
>  
> -const char *version_string = VERSION;
> +static const char version_string[] = VERSION;

The 'version_string' is only used once:

$ git grep version_string
reds.c:const char *version_string = VERSION;
reds.c:    spice_info("starting %s", version_string);

So why not just kill the pointless variable and directly
use 'VERSION' in the call to spice_info()

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]