[PATCH:x11perf] Make NameFromFormat() const.

Alan Coopersmith alan.coopersmith at oracle.com
Sun Jul 19 08:14:13 PDT 2015


On 07/19/15 03:08 AM, Thomas Klausner wrote:
> Fixes a const-discard warning.
>
> Signed-off-by: Thomas Klausner <wiz at NetBSD.org>
> ---
>   x11perf.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/x11perf.c b/x11perf.c
> index 3872bcb..e98cca5 100644
> --- a/x11perf.c
> +++ b/x11perf.c
> @@ -167,7 +167,7 @@ static int GetRops(int argi, int argc, char **argv, int *ropsp, int *nump);
>   static int GetPops(int argi, int argc, char **argv, int *popsp, int *nump);
>   static int GetFormats(int argi, int argc, char **argv, int *formatsp, int *nump);
>   static int FormatFromName (char *name);
> -static char *NameFromFormat (int format);
> +static const char *NameFromFormat (int format);
>
>
>   /************************************************
> @@ -1399,7 +1399,7 @@ main(int argc, char *argv[])
>   					     LABELP(i));
>   				}
>   			    } else {
> -				char *name = NameFromFormat (formats[format]);
> +				const char *name = NameFromFormat (formats[format]);
>   				sprintf (label, "(%s %s) %s",
>   					 popNames[pops[pop]].name,
>   					 name,
> @@ -1560,7 +1560,7 @@ FormatFromName (char *name)
>       return -1;
>   }
>
> -static char *
> +static const char *
>   NameFromFormat (int format)
>   {
>       int i;
>

Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>

-- 
	-Alan Coopersmith-              alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc


More information about the xorg-devel mailing list