Hi Rémi,
On 26.01.2021 15:36, Rémi Bernon wrote:
+static inline type_t *type_runtimeclass_get_default_iface(const type_t *type) +{
- ifref_list_t *ifaces = type_runtimeclass_get_ifaces(type);
- ifref_t *entry;
- attr_t *attr;
- LIST_FOR_EACH_ENTRY(entry, ifaces, ifref_t, entry)
LIST_FOR_EACH_ENTRY(attr, entry->attrs, attr_t, entry)
if (attr->type == ATTR_DEFAULT) return entry->iface;
is_type() could make it slightly cleaner.
- assert(0);
- return NULL;
+}
This is probably right to do here, but I think it's not enforced when constructing types in parser, so it may crash. It should probably cause a proper parser error (but I didn't test it with midl).
Other than that, the patch looks good.
Thanks,
Jacek