Exemplo n.º 1
0
int decl_conv_array_func_to_ptr(decl *d)
{
	type *old = d->ref;

	d->ref = type_decay(d->ref);

	return old != d->ref;
}
Exemplo n.º 2
0
type *type_dereference_decay(type *const ty_ptr)
{
	type *const pointee = type_is_ptr(ty_ptr);
	assert(pointee);

	/* *(void (*)()) does nothing */
	if(type_is(pointee, type_func))
		return ty_ptr;

	/* decay never returns an array type - decay to pointer */
	if(type_is(pointee, type_array))
		return type_decay(pointee);

	return pointee;
}