qapi: Do not define enumeration value explicitly
commit9c2f56e9f9d5a1f9ddac77dda35f997738e85d11
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Thu, 13 Dec 2018 12:37:03 +0000 (13 16:37 +0400)
committerMarkus Armbruster <armbru@redhat.com>
Thu, 13 Dec 2018 18:20:11 +0000 (13 19:20 +0100)
tree4709ebd75b467238d56624acd26ab146f13e2c16
parentb0ddeba22a33c667e86e149232c6296bf95b07e7
qapi: Do not define enumeration value explicitly

The generated C enumeration types explicitly set the enumeration
constants to 0, 1, 2, ...  That's exactly what you get when you don't
supply values.

Drop the explicit values.  No change now, but it will avoid gaps in
the values when we later add support for 'if' conditions.  Avoiding
such gaps will save us the trouble of changing the ENUM_lookup[]
tables to work without a sentinel.

We'll have to take care to ensure the headers required by the 'if'
conditions get always included before the generated QAPI code.
Fortunately, our convention to include "qemu/osdep.h" first in any .c
ensures that's the case for our CONFIG_FOO macros.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20181213123724.4866-2-marcandre.lureau@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
scripts/qapi/common.py