Commit b0bc8e58 authored by Dan Hipschman's avatar Dan Hipschman Committed by Alexandre Julliard

widl: Don't output a void conformance for NdrClearOutParameters.

parent 8d15820f
...@@ -189,13 +189,11 @@ static void free_variable( const var_t *arg ) ...@@ -189,13 +189,11 @@ static void free_variable( const var_t *arg )
{ {
unsigned int type_offset = arg->type->typestring_offset; unsigned int type_offset = arg->type->typestring_offset;
var_t *constraint; var_t *constraint;
type_t *type; type_t *type = arg->type;
expr_list_t *expr; expr_t *size = get_size_is_expr(type, arg->name);
expr = get_attrp( arg->attrs, ATTR_SIZEIS ); if (size)
if (expr)
{ {
const expr_t *size = LIST_ENTRY( list_head(expr), const expr_t, entry );
print_proxy( "_StubMsg.MaxCount = " ); print_proxy( "_StubMsg.MaxCount = " );
write_expr(proxy, size, 0); write_expr(proxy, size, 0);
fprintf(proxy, ";\n\n"); fprintf(proxy, ";\n\n");
...@@ -205,7 +203,6 @@ static void free_variable( const var_t *arg ) ...@@ -205,7 +203,6 @@ static void free_variable( const var_t *arg )
return; return;
} }
type = arg->type;
switch( type->type ) switch( type->type )
{ {
case RPC_FC_BYTE: case RPC_FC_BYTE:
......
...@@ -2609,6 +2609,24 @@ static int needs_freeing(const attr_list_t *attrs, const type_t *t, int out) ...@@ -2609,6 +2609,24 @@ static int needs_freeing(const attr_list_t *attrs, const type_t *t, int out)
|| is_array(t))); || is_array(t)));
} }
expr_t *get_size_is_expr(const type_t *t, const char *name)
{
expr_t *x = NULL;
for ( ; is_ptr(t) || is_array(t); t = t->ref)
if (t->size_is)
{
if (!x)
x = t->size_is;
else
error("%s: multidimensional conformant"
" arrays not supported at the top level\n",
name);
}
return x;
}
void write_remoting_arguments(FILE *file, int indent, const func_t *func, void write_remoting_arguments(FILE *file, int indent, const func_t *func,
enum pass pass, enum remoting_phase phase) enum pass pass, enum remoting_phase phase)
{ {
...@@ -2719,13 +2737,13 @@ void write_remoting_arguments(FILE *file, int indent, const func_t *func, ...@@ -2719,13 +2737,13 @@ void write_remoting_arguments(FILE *file, int indent, const func_t *func,
{ {
unsigned char tc = type->type; unsigned char tc = type->type;
const char *array_type = "FixedArray"; const char *array_type = "FixedArray";
type_t *st;
for (st = type->ref; is_ptr(st) || is_array(st); st = st->ref) /* We already have the size_is expression since it's at the
if (st->size_is) top level, but do checks for multidimensional conformant
error("in function %s: multidimensional conformant arrays" arrays. When we handle them, we'll need to extend this
" not supported at the top level\n", function to return a list, and then we'll actually use
func->def->name); the return value. */
get_size_is_expr(type, var->name);
if (tc == RPC_FC_SMVARRAY || tc == RPC_FC_LGVARRAY) if (tc == RPC_FC_SMVARRAY || tc == RPC_FC_LGVARRAY)
{ {
...@@ -2841,19 +2859,7 @@ void write_remoting_arguments(FILE *file, int indent, const func_t *func, ...@@ -2841,19 +2859,7 @@ void write_remoting_arguments(FILE *file, int indent, const func_t *func,
else else
{ {
const var_t *iid; const var_t *iid;
expr_t *sx = NULL; expr_t *sx = get_size_is_expr(type, var->name);
type_t *st;
for (st = type->ref; is_ptr(st) || is_array(st); st = st->ref)
if (st->size_is)
{
if (!sx)
sx = st->size_is;
else
error("in function %s: multidimensional conformant"
" arrays not supported at the top level\n",
func->def->name);
}
if ((iid = get_attrp( var->attrs, ATTR_IIDIS ))) if ((iid = get_attrp( var->attrs, ATTR_IIDIS )))
print_file( file, indent, "_StubMsg.MaxCount = (unsigned long)%s;\n", iid->name ); print_file( file, indent, "_StubMsg.MaxCount = (unsigned long)%s;\n", iid->name );
......
...@@ -59,3 +59,4 @@ void write_parameters_init(FILE *file, int indent, const func_t *func); ...@@ -59,3 +59,4 @@ void write_parameters_init(FILE *file, int indent, const func_t *func);
void print(FILE *file, int indent, const char *format, va_list ap); void print(FILE *file, int indent, const char *format, va_list ap);
int get_padding(const var_list_t *fields); int get_padding(const var_list_t *fields);
int is_user_type(const type_t *t); int is_user_type(const type_t *t);
expr_t *get_size_is_expr(const type_t *t, const char *name);
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