[PATCH 2/5] d3dcompiler: Make declaration_statement return a list.

Matteo Bruni mbruni at codeweavers.com
Wed Jul 11 10:27:50 CDT 2012


Make it alike the other statement types, also later on it will be needed
anyway.
---
 dlls/d3dcompiler_43/hlsl.y |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y
index b4c9b25..03aa4eb 100644
--- a/dlls/d3dcompiler_43/hlsl.y
+++ b/dlls/d3dcompiler_43/hlsl.y
@@ -251,6 +251,7 @@ static unsigned int components_count_expr_list(struct list *list)
 %type <boolval> boolean
 %type <type> base_type
 %type <type> type
+%type <list> declaration_statement
 %type <list> complex_initializer
 %type <list> initializer_expr_list
 %type <instr> initializer_expr
@@ -530,6 +531,8 @@ base_type:                KW_VOID
 
 declaration_statement:    declaration
                             {
+                                $$ = d3dcompiler_alloc(sizeof(*$$));
+                                list_init($$);
                             }
 
 declaration:              var_modifiers type variables_def ';'
@@ -713,8 +716,7 @@ statement_list:           statement
 
 statement:                declaration_statement
                             {
-                                $$ = d3dcompiler_alloc(sizeof(*$$));
-                                list_init($$);
+                                $$ = $1;
                             }
                         | expr_statement
                             {
-- 
1.7.8.6




More information about the wine-patches mailing list