[Spice-devel] [PATCH] reds: constify renderers_info array

Pavel Grunt pgrunt at redhat.com
Mon Feb 1 16:18:01 CET 2016


On Mon, 2016-02-01 at 13:53 +0000, Frediano Ziglio wrote:
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Pavel Grunt <pgrunt at redhat.com>
> ---
>  server/reds.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/server/reds.c b/server/reds.c
> index dbf0976..0ee55c9 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -3449,7 +3449,7 @@ typedef struct RendererInfo {
>      const char *name;
>  } RendererInfo;
>  
> -static RendererInfo renderers_info[] = {
> +static const RendererInfo renderers_info[] = {
>      {RED_RENDERER_SW, "sw"},
>      {RED_RENDERER_INVALID, NULL},
>  };
> @@ -3457,9 +3457,9 @@ static RendererInfo renderers_info[] = {
>  uint32_t renderers[RED_RENDERER_LAST];
>  uint32_t num_renderers = 0;
>  
> -static RendererInfo *find_renderer(const char *name)
> +static const RendererInfo *find_renderer(const char *name)
>  {
> -    RendererInfo *inf = renderers_info;
> +    const RendererInfo *inf = renderers_info;
>      while (inf->name) {
>          if (strcmp(name, inf->name) == 0) {
>              return inf;
> @@ -3471,7 +3471,7 @@ static RendererInfo *find_renderer(const char
> *name)
>  
>  static int red_add_renderer(const char *name)
>  {
> -    RendererInfo *inf;
> +    const RendererInfo *inf;
>  
>      if (num_renderers == RED_RENDERER_LAST || !(inf =
> find_renderer(name))) {
>          return FALSE;


More information about the Spice-devel mailing list