scanner: allow referencing foreign enums

It's already possible to reference foreign interfaces, so it
should also be possible to reference foreign enums.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Silvan Jegen <s.jegen@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
Simon Ser 2018-05-25 17:24:41 -04:00 committed by Pekka Paalanen
parent a060822399
commit 8b2ba84bd0

View file

@ -894,14 +894,9 @@ verify_arguments(struct parse_context *ctx,
e = find_enumeration(ctx->protocol, interface,
a->enumeration_name);
if (e == NULL)
fail(&ctx->loc,
"could not find enumeration %s",
a->enumeration_name);
switch (a->type) {
case INT:
if (e->bitfield)
if (e && e->bitfield)
fail(&ctx->loc,
"bitfield-style enum must only be referenced by uint");
break;