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

widl: Respect pointer attributes better.

parent 33da66d6
......@@ -363,6 +363,12 @@ s_sum_bogus(bogus_t *b)
}
void
s_check_null(int *null)
{
ok(!null, "RPC check_null\n");
}
void
s_stop(void)
{
ok(RPC_S_OK == RpcMgmtStopServerListening(NULL), "RpcMgmtStopServerListening\n");
......@@ -504,6 +510,8 @@ basic_tests(void)
bogus.p3 = &i3;
bogus.c = 9;
ok(sum_bogus(&bogus) == 12, "RPC sum_bogus\n");
check_null(NULL);
}
static void
......
......@@ -223,6 +223,7 @@ interface IServer
} bogus_t;
int sum_bogus(bogus_t *b);
void check_null([unique] int *null);
void stop(void);
}
......@@ -1266,6 +1266,7 @@ static void set_type(var_t *v, type_t *type, int ptr_level, array_dims_t *arr)
{
expr_list_t *sizes = get_attrp(v->attrs, ATTR_SIZEIS);
expr_list_t *lengs = get_attrp(v->attrs, ATTR_LENGTHIS);
int ptr_type = get_attrv(v->attrs, ATTR_POINTERTYPE);
int sizeless, has_varconf;
expr_t *dim;
type_t *atype, **ptype;
......@@ -1273,7 +1274,25 @@ static void set_type(var_t *v, type_t *type, int ptr_level, array_dims_t *arr)
v->type = type;
for ( ; 0 < ptr_level; --ptr_level)
{
v->type = make_type(RPC_FC_RP, v->type);
if (ptr_level == 1 && ptr_type && !arr)
{
v->type->type = ptr_type;
ptr_type = 0;
}
}
if (ptr_type)
{
if (is_ptr(v->type))
{
v->type = duptype(v->type, 1);
v->type->type = ptr_type;
}
else if (!arr)
error("%s: pointer attribute applied to non-pointer type", v->name);
}
sizeless = FALSE;
if (arr) LIST_FOR_EACH_ENTRY_REV(dim, arr, expr_t, entry)
......
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