[Mesa-dev] [PATCH 1/5] meta: Initialize the variable in declaration statement

Pohjolainen, Topi topi.pohjolainen at intel.com
Mon Aug 4 01:59:55 PDT 2014


On Wed, Jul 30, 2014 at 07:11:23PM -0700, Anuj Phogat wrote:
> Saves one line of code :)
> 
> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
> ---
> Realized today that I never really sent this series out to the list.
> 
>  src/mesa/drivers/common/meta.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
> index f1f5729..28bd065 100644
> --- a/src/mesa/drivers/common/meta.c
> +++ b/src/mesa/drivers/common/meta.c
> @@ -2721,9 +2721,7 @@ _mesa_meta_blit_shader_table_cleanup(struct blit_shader_table *table)
>  static GLenum
>  get_temp_image_type(struct gl_context *ctx, mesa_format format)
>  {
> -   GLenum baseFormat;
> -
> -   baseFormat = _mesa_get_format_base_format(format);
> +   GLenum baseFormat = _mesa_get_format_base_format(format);

You could declare it constant while you're at it.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com>

>  
>     switch (baseFormat) {
>     case GL_RGBA:
> -- 
> 1.9.3
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list