Commit 3c2a9f5d authored by Alexandre Julliard's avatar Alexandre Julliard

widl: size_is and length_is are expression lists now.

parent 3bfa88dc
...@@ -85,6 +85,16 @@ int is_conformant_array( const array_dims_t *array ) ...@@ -85,6 +85,16 @@ int is_conformant_array( const array_dims_t *array )
return !dim->is_const; return !dim->is_const;
} }
int is_non_void(const expr_list_t *list)
{
const expr_t *expr;
if (list)
LIST_FOR_EACH_ENTRY( expr, list, const expr_t, entry )
if (expr->type != EXPR_VOID) return 1;
return 0;
}
void write_guid(FILE *f, const char *guid_prefix, const char *name, const UUID *uuid) void write_guid(FILE *f, const char *guid_prefix, const char *name, const UUID *uuid)
{ {
if (!uuid) return; if (!uuid) return;
......
...@@ -26,6 +26,7 @@ extern void *get_attrp(const attr_list_t *list, enum attr_type t); ...@@ -26,6 +26,7 @@ extern void *get_attrp(const attr_list_t *list, enum attr_type t);
extern unsigned long get_attrv(const attr_list_t *list, enum attr_type t); extern unsigned long get_attrv(const attr_list_t *list, enum attr_type t);
extern int is_void(const type_t *t, const var_t *v); extern int is_void(const type_t *t, const var_t *v);
extern int is_conformant_array( const array_dims_t *array ); extern int is_conformant_array( const array_dims_t *array );
extern int is_non_void(const expr_list_t *list);
extern void write_name(FILE *h, const var_t *v); extern void write_name(FILE *h, const var_t *v);
extern const char* get_name(const var_t *v); extern const char* get_name(const var_t *v);
extern void write_type(FILE *h, type_t *t, const var_t *v, const char *n); extern void write_type(FILE *h, type_t *t, const var_t *v, const char *n);
......
...@@ -196,13 +196,14 @@ static void free_variable( const var_t *arg ) ...@@ -196,13 +196,14 @@ static void free_variable( const var_t *arg )
var_t *constraint; var_t *constraint;
int index = 0; /* FIXME */ int index = 0; /* FIXME */
type_t *type; type_t *type;
expr_t *expr; expr_list_t *expr;
expr = get_attrp( arg->attrs, ATTR_SIZEIS ); expr = get_attrp( arg->attrs, ATTR_SIZEIS );
if (expr) if (expr)
{ {
const expr_t *size = LIST_ENTRY( list_head(expr), const expr_t, entry );
print_proxy( "_StubMsg.MaxCount = ", arg->name ); print_proxy( "_StubMsg.MaxCount = ", arg->name );
write_expr(proxy, expr, 0); write_expr(proxy, size, 0);
fprintf(proxy, ";\n\n"); fprintf(proxy, ";\n\n");
print_proxy( "NdrClearOutParameters( &_StubMsg, "); print_proxy( "NdrClearOutParameters( &_StubMsg, ");
fprintf(proxy, "&__MIDL_TypeFormatString.Format[%d], ", index ); fprintf(proxy, "&__MIDL_TypeFormatString.Format[%d], ", index );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment