From 7ac946e546bba440f87ce95ef022745201744f9c Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 30 Jul 2015 06:00:56 -0700 Subject: glsl: Add constuctors for the common cases of glsl_struct_field Fixes a giant pile of GCC warnings: builtin_types.cpp:60:1: warning: missing initializer for member 'glsl_struct_field::stream' [-Wmissing-field-initializers] I had to add a default constructor because a non-default constructor was added. Otherwise the only constructor would be the one with parameters, and all the plases like glsl_struct_field foo; would fail to compile. I wanted to do this in two patches. All of the initializers of glsl_struct_field structures had to be converted to use the constructor because C++ apparently forces you to do one or the other: builtin_types.cpp:61:1: error: could not convert '{glsl_type::float_type, "near", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0, -1}' from '' to 'glsl_struct_field' Signed-off-by: Ian Romanick Reviewed-by: Francisco Jerez Reviewed-by: Juha-Pekka Heikkila --- src/glsl/tests/general_ir_test.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/glsl/tests/general_ir_test.cpp') diff --git a/src/glsl/tests/general_ir_test.cpp b/src/glsl/tests/general_ir_test.cpp index 882642d141b..217305bf847 100644 --- a/src/glsl/tests/general_ir_test.cpp +++ b/src/glsl/tests/general_ir_test.cpp @@ -31,11 +31,7 @@ TEST(ir_variable_constructor, interface) void *mem_ctx = ralloc_context(NULL); static const glsl_struct_field f[] = { - { - glsl_type::vec(4), - "v", - false - } + glsl_struct_field(glsl_type::vec(4), "v") }; const glsl_type *const interface = @@ -60,11 +56,7 @@ TEST(ir_variable_constructor, interface_array) void *mem_ctx = ralloc_context(NULL); static const glsl_struct_field f[] = { - { - glsl_type::vec(4), - "v", - false - } + glsl_struct_field(glsl_type::vec(4), "v") }; const glsl_type *const interface = -- cgit v1.2.3