summaryrefslogtreecommitdiffstats
path: root/scripts/qapi-types.py
diff options
context:
space:
mode:
authorPeter Maydell2015-02-26 13:16:46 +0100
committerPeter Maydell2015-02-26 13:16:46 +0100
commit041ccc922ee474693a2869d4e3b59e920c739bc0 (patch)
tree36b046a650b26079b3cbf634ee9ae8fe19384319 /scripts/qapi-types.py
parentMerge remote-tracking branch 'remotes/kraxel/tags/pull-roms-20150219-1' into ... (diff)
parentqapi-types: add C99 index names to arrays (diff)
downloadqemu-041ccc922ee474693a2869d4e3b59e920c739bc0.tar.gz
qemu-041ccc922ee474693a2869d4e3b59e920c739bc0.tar.xz
qemu-041ccc922ee474693a2869d4e3b59e920c739bc0.zip
Merge remote-tracking branch 'remotes/qmp-unstable/queue/qmp' into staging
* remotes/qmp-unstable/queue/qmp: qapi-types: add C99 index names to arrays monitor: Fix missing err = NULL in client_migrate_info() balloon: Fix typo hmp: Fix warning from smatch (wrong argument in function call) Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'scripts/qapi-types.py')
-rw-r--r--scripts/qapi-types.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py
index 1eb272dd26..db872180c6 100644
--- a/scripts/qapi-types.py
+++ b/scripts/qapi-types.py
@@ -123,16 +123,19 @@ const char *%(name)s_lookup[] = {
name=name)
i = 0
for value in values:
+ index = generate_enum_full_value(name, value)
ret += mcgen('''
- "%(value)s",
+ [%(index)s] = "%(value)s",
''',
- value=value)
+ index = index, value = value)
+ max_index = generate_enum_full_value(name, 'MAX')
ret += mcgen('''
- NULL,
+ [%(max_index)s] = NULL,
};
-''')
+''',
+ max_index=max_index)
return ret
def generate_enum(name, values):