From: Hans Leidekker hans@codeweavers.com
--- tools/widl/metadata.c | 5 +++-- tools/widl/parser.y | 10 +++++----- tools/widl/widl.h | 2 ++ 3 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/tools/widl/metadata.c b/tools/widl/metadata.c index e02a82f6647..ab2e310cedd 100644 --- a/tools/widl/metadata.c +++ b/tools/widl/metadata.c @@ -1669,7 +1669,7 @@ static UINT make_method_sig( const var_t *method, BYTE *buf, BOOL is_static ) /* add remaining parameters */ LIST_FOR_EACH_ENTRY( arg, arg_list, var_t, entry ) { - if (is_attr( arg->attrs, ATTR_RETVAL ) ) continue; + if (is_size_param( arg, arg_list ) || is_attr( arg->attrs, ATTR_RETVAL ) ) continue; len += make_type_sig( arg->declspec.type, buf + len ); buf[1]++; } @@ -2210,6 +2210,7 @@ static void add_method_params_step1( var_list_t *arg_list ) { type_t *type = arg->declspec.type;
+ if (is_size_param( arg, arg_list )) continue; if (type_get_type( type ) == TYPE_POINTER) type = type_pointer_get_ref_type( type ); if (type->name && !strcmp( type->name, "EventRegistrationToken" )) { @@ -2283,7 +2284,7 @@ static UINT add_method_params_step2( var_list_t *arg_list )
LIST_FOR_EACH_ENTRY( arg, arg_list, var_t, entry ) { - if (is_attr( arg->attrs, ATTR_RETVAL )) continue; + if (is_size_param( arg, arg_list) || is_attr( arg->attrs, ATTR_RETVAL )) continue; row = add_param_row( get_param_attrs(arg), seq++, add_string(arg->name) ); if (!first) first = row; } diff --git a/tools/widl/parser.y b/tools/widl/parser.y index 0ff3de3c179..1473054dfc4 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -2614,7 +2614,7 @@ static void check_eventremove_args( const var_t *func, const var_list_t *args ) } }
-static int is_size_parameter( const var_t *param, const var_list_t *args ) +bool is_size_param( const var_t *param, const var_list_t *args ) { const var_t *arg;
@@ -2627,9 +2627,9 @@ static int is_size_parameter( const var_t *param, const var_list_t *args ) if (type->type_type != TYPE_ARRAY || !(size_is = type_array_get_conformance( type ))) continue;
if (size_is->type == EXPR_PPTR) size_is = size_is->ref; - if (!strcmp( param->name, size_is->u.sval )) return 1; + if (!strcmp( param->name, size_is->u.sval )) return true; } - return 0; + return false; }
static void check_propget_args( const var_t *func, const var_list_t *args ) @@ -2640,7 +2640,7 @@ static void check_propget_args( const var_t *func, const var_list_t *args ) LIST_FOR_EACH_ENTRY_REV( arg, args, const var_t, entry ) { const type_t *type = arg->declspec.type; - int is_size = is_size_parameter( arg, args ); + bool is_size = is_size_param( arg, args );
count++; if (count == 1 && (!is_ptr( type ) || !is_attr( arg->attrs, ATTR_RETVAL ))) @@ -2663,7 +2663,7 @@ static void check_propput_args( const var_t *func, const var_list_t *args )
LIST_FOR_EACH_ENTRY_REV( arg, args, const var_t, entry ) { - int is_size = is_size_parameter( arg, args ); + bool is_size = is_size_param( arg, args );
count++; if (is_attr( arg->attrs, ATTR_OUT )) diff --git a/tools/widl/widl.h b/tools/widl/widl.h index a6d3bc6bf33..2951a6ce1e9 100644 --- a/tools/widl/widl.h +++ b/tools/widl/widl.h @@ -93,6 +93,8 @@ extern void write_metadata(const statement_list_t *stmts); extern void start_cplusplus_guard(FILE *fp); extern void end_cplusplus_guard(FILE *fp);
+extern bool is_size_param( const var_t *param, const var_list_t *args ); + /* attribute.c */
extern attr_t *attr_int( struct location where, enum attr_type attr_type, unsigned int val );