WIDL: Default in/out attributes

Filip Navara xnavara at volny.cz
Mon Sep 27 10:23:17 CDT 2004


Changelog:
- Force default [in] attribute on all parameters where explicit [in] or 
[out] attributes aren't specified.
- Force default [out] attribute on return values.

-------------- next part --------------
Index: tools/widl/parser.y
===================================================================
RCS file: /home/wine/wine/tools/widl/parser.y,v
retrieving revision 1.20
diff -u -r1.20 parser.y
--- tools/widl/parser.y	20 Sep 2004 19:11:16 -0000	1.20
+++ tools/widl/parser.y	27 Sep 2004 15:15:20 -0000
@@ -280,19 +280,31 @@
 arg:	  attributes type pident array		{ $$ = $3;
 						  set_type($$, $2, $4);
 						  $$->attrs = $1;
+						  if (!is_attr($$->attrs, ATTR_OUT) &&
+						      !is_attr($$->attrs, ATTR_IN)) {
+						    attr_t *a = make_attr(ATTR_IN);
+						    LINK(a, $$->attrs); $$->attrs = a;
+						  }
 						}
 	| type pident array			{ $$ = $2;
 						  set_type($$, $1, $3);
+						  $$->attrs = make_attr(ATTR_IN);
 						}
 	| attributes type pident '(' m_args ')'	{ $$ = $3;
 						  $$->ptr_level--;
 						  set_type($$, $2, NULL);
 						  $$->attrs = $1;
 						  $$->args = $5;
+						  if (!is_attr($$->attrs, ATTR_OUT) &&
+						      !is_attr($$->attrs, ATTR_IN)) {
+						    attr_t *a = make_attr(ATTR_IN);
+						    LINK(a, $$->attrs); $$->attrs = a;
+						  }
 						}
 	| type pident '(' m_args ')'		{ $$ = $2;
 						  $$->ptr_level--;
 						  set_type($$, $1, NULL);
+						  $$->attrs = make_attr(ATTR_IN);
 						  $$->args = $4;
 						}
 	;
@@ -489,6 +501,13 @@
 	  '(' m_args ')'			{ set_type($4, $2, NULL);
 						  $4->attrs = $1;
 						  $$ = make_func($4, $6);
+						  if (is_attr($4->attrs, ATTR_IN)) {
+						    yyerror("Inapplicatable attribute");
+						  }
+						  if (!is_attr($4->attrs, ATTR_OUT)) {
+						    attr_t *a = make_attr(ATTR_OUT);
+						    LINK(a, $4->attrs); $4->attrs = a;
+						  }
 						}
 	;
 


More information about the wine-patches mailing list