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

This commit is contained in:
Dan Hipschman 2007-11-02 15:25:26 -07:00 committed by Alexandre Julliard
parent 8d15820f79
commit b0bc8e58de
3 changed files with 29 additions and 25 deletions

View File

@ -189,13 +189,11 @@ static void free_variable( const var_t *arg )
{
unsigned int type_offset = arg->type->typestring_offset;
var_t *constraint;
type_t *type;
expr_list_t *expr;
type_t *type = arg->type;
expr_t *size = get_size_is_expr(type, arg->name);
expr = get_attrp( arg->attrs, ATTR_SIZEIS );
if (expr)
if (size)
{
const expr_t *size = LIST_ENTRY( list_head(expr), const expr_t, entry );
print_proxy( "_StubMsg.MaxCount = " );
write_expr(proxy, size, 0);
fprintf(proxy, ";\n\n");
@ -205,7 +203,6 @@ static void free_variable( const var_t *arg )
return;
}
type = arg->type;
switch( type->type )
{
case RPC_FC_BYTE:

View File

@ -2609,6 +2609,24 @@ static int needs_freeing(const attr_list_t *attrs, const type_t *t, int out)
|| 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,
enum pass pass, enum remoting_phase phase)
{
@ -2719,13 +2737,13 @@ void write_remoting_arguments(FILE *file, int indent, const func_t *func,
{
unsigned char tc = type->type;
const char *array_type = "FixedArray";
type_t *st;
for (st = type->ref; is_ptr(st) || is_array(st); st = st->ref)
if (st->size_is)
error("in function %s: multidimensional conformant arrays"
" not supported at the top level\n",
func->def->name);
/* We already have the size_is expression since it's at the
top level, but do checks for multidimensional conformant
arrays. When we handle them, we'll need to extend this
function to return a list, and then we'll actually use
the return value. */
get_size_is_expr(type, var->name);
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,
else
{
const var_t *iid;
expr_t *sx = NULL;
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);
}
expr_t *sx = get_size_is_expr(type, var->name);
if ((iid = get_attrp( var->attrs, ATTR_IIDIS )))
print_file( file, indent, "_StubMsg.MaxCount = (unsigned long)%s;\n", iid->name );

View File

@ -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);
int get_padding(const var_list_t *fields);
int is_user_type(const type_t *t);
expr_t *get_size_is_expr(const type_t *t, const char *name);