mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice-common
synced 2026-08-08 16:08:10 +00:00
add a check for negate cases on enumerations
Not supported by code so trigger an error to avoid invalid usages Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
parent
1d47225a8e
commit
c5a61aaa30
@ -686,6 +686,7 @@ class SwitchCase:
|
||||
if v == None:
|
||||
return "1"
|
||||
elif var_type.is_enum():
|
||||
assert v[0] == "", "Negation of enumeration in switch is not supported"
|
||||
checks.append("%s == %s" % (var_cname, var_type.c_enumname_by_name(v[1])))
|
||||
else:
|
||||
checks.append("%s(%s & %s)" % (v[0], var_cname, var_type.c_enumname_by_name(v[1])))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user