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>
This commit is contained in:
Peter Maydell 2015-02-26 12:16:46 +00:00
commit 041ccc922e
4 changed files with 13 additions and 9 deletions

View file

@ -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):