[Mesa-dev] [PATCH] glsl: Fix missing-braces warning.

Andres Gomez agomez at igalia.com
Fri Feb 24 08:22:20 UTC 2017


This is:

Reviewed-by: Andres Gomez <agomez at igalia.com>

On Thu, 2017-02-23 at 22:31 +0000, Vinson Lee wrote:
>   CXX    glsl/ast_to_hir.lo
> glsl/ast_to_hir.cpp: In member function 'virtual ir_rvalue* ast_declarator_list::hir(exec_list*, _mesa_glsl_parse_state*)':
> glsl/ast_to_hir.cpp:4846:42: warning: missing braces around initializer for 'unsigned int [16]' [-Wmissing-braces]
> 
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
>  src/compiler/glsl/ast_to_hir.cpp |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
> index b90ad97b1de4..f148db8617d6 100644
> --- a/src/compiler/glsl/ast_to_hir.cpp
> +++ b/src/compiler/glsl/ast_to_hir.cpp
> @@ -4843,7 +4843,7 @@ ast_declarator_list::hir(exec_list *instructions,
>        if ((var->data.mode == ir_var_auto || var->data.mode == ir_var_temporary)
>            && (var->type->is_numeric() || var->type->is_boolean())
>            && state->zero_init) {
> -         const ir_constant_data data = {0};
> +         const ir_constant_data data = { { 0 } };
>           var->data.has_initializer = true;
>           var->constant_initializer = new(var) ir_constant(var->type, &data);
>        }
-- 
Br,

Andres


More information about the mesa-dev mailing list