widl: Use is_string_type instead of is_attr(..., ATTR_STRING) for detecting strings.
authorRob Shearman <robertshearman@gmail.com>
Fri, 2 Jan 2009 12:14:50 +0000 (12:14 +0000)
committerAlexandre Julliard <julliard@winehq.org>
Fri, 2 Jan 2009 13:27:43 +0000 (14:27 +0100)
Detecting strings is a bit harder than just looking for the string
attribute, so make sure to use the function which has the purpose of
doing just that.

Fixes compilation of generated server/proxy code when a parameter has
both the [out] and [string] attributes.

tools/widl/typegen.c

index 8852ca0d5f31a68ce54c9e50c0b921420e1a37d8..7810f80d50758554b3e2b1c68e63842083bac557 100644 (file)
@@ -2025,7 +2025,7 @@ static size_t write_struct_tfs(FILE *file, type_t *type,
     array = find_array_or_string_in_struct(type);
     if (array && !processed(array->type))
         array_offset
-            = is_attr(array->attrs, ATTR_STRING)
+            = is_string_type(array->attrs, array->type)
             ? write_string_tfs(file, array->attrs, array->type, array->name, tfsoff)
             : write_array_tfs(file, array->attrs, array->type, array->name, tfsoff);
 
@@ -3291,7 +3291,7 @@ void declare_stub_args( FILE *file, int indent, const func_t *func )
 
     LIST_FOR_EACH_ENTRY( var, func->args, const var_t, entry )
     {
-        int is_string = is_attr(var->attrs, ATTR_STRING);
+        int is_string = is_string_type(var->attrs, var->type);
 
         in_attr = is_attr(var->attrs, ATTR_IN);
         out_attr = is_attr(var->attrs, ATTR_OUT);
@@ -3338,7 +3338,7 @@ void assign_stub_out_args( FILE *file, int indent, const func_t *func, const cha
 
     LIST_FOR_EACH_ENTRY( var, func->args, const var_t, entry )
     {
-        int is_string = is_attr(var->attrs, ATTR_STRING);
+        int is_string = is_string_type(var->attrs, var->type);
         in_attr = is_attr(var->attrs, ATTR_IN);
         out_attr = is_attr(var->attrs, ATTR_OUT);
         if (!out_attr && !in_attr)