widl: Respect pointer attributes better.
This commit is contained in:
parent
33da66d6c8
commit
dbfabf68a2
@ -362,6 +362,12 @@ s_sum_bogus(bogus_t *b)
|
|||||||
return *b->h.p1 + *b->p2 + *b->p3 + b->c;
|
return *b->h.p1 + *b->p2 + *b->p3 + b->c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
s_check_null(int *null)
|
||||||
|
{
|
||||||
|
ok(!null, "RPC check_null\n");
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
s_stop(void)
|
s_stop(void)
|
||||||
{
|
{
|
||||||
@ -504,6 +510,8 @@ basic_tests(void)
|
|||||||
bogus.p3 = &i3;
|
bogus.p3 = &i3;
|
||||||
bogus.c = 9;
|
bogus.c = 9;
|
||||||
ok(sum_bogus(&bogus) == 12, "RPC sum_bogus\n");
|
ok(sum_bogus(&bogus) == 12, "RPC sum_bogus\n");
|
||||||
|
|
||||||
|
check_null(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -223,6 +223,7 @@ interface IServer
|
|||||||
} bogus_t;
|
} bogus_t;
|
||||||
|
|
||||||
int sum_bogus(bogus_t *b);
|
int sum_bogus(bogus_t *b);
|
||||||
|
void check_null([unique] int *null);
|
||||||
|
|
||||||
void stop(void);
|
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 *sizes = get_attrp(v->attrs, ATTR_SIZEIS);
|
||||||
expr_list_t *lengs = get_attrp(v->attrs, ATTR_LENGTHIS);
|
expr_list_t *lengs = get_attrp(v->attrs, ATTR_LENGTHIS);
|
||||||
|
int ptr_type = get_attrv(v->attrs, ATTR_POINTERTYPE);
|
||||||
int sizeless, has_varconf;
|
int sizeless, has_varconf;
|
||||||
expr_t *dim;
|
expr_t *dim;
|
||||||
type_t *atype, **ptype;
|
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;
|
v->type = type;
|
||||||
|
|
||||||
for ( ; 0 < ptr_level; --ptr_level)
|
for ( ; 0 < ptr_level; --ptr_level)
|
||||||
|
{
|
||||||
v->type = make_type(RPC_FC_RP, v->type);
|
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;
|
sizeless = FALSE;
|
||||||
if (arr) LIST_FOR_EACH_ENTRY_REV(dim, arr, expr_t, entry)
|
if (arr) LIST_FOR_EACH_ENTRY_REV(dim, arr, expr_t, entry)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user