qapi: drop the sentinel in enum array
Now that all usages have been converted to user lookup helpers. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170822132255.23945-14-marcandre.lureau@redhat.com> [Rebased, superfluous local variable dropped, missing check-qom-proplist.c update added] Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1503564371-26090-17-git-send-email-armbru@redhat.com>
This commit is contained in:
parent
f7abe0ecd4
commit
ebf677c849
|
@ -72,7 +72,6 @@ static QEnumLookup prealloc_mode_lookup = {
|
||||||
.array = (const char *const[]) {
|
.array = (const char *const[]) {
|
||||||
"falloc",
|
"falloc",
|
||||||
"truncate",
|
"truncate",
|
||||||
NULL,
|
|
||||||
},
|
},
|
||||||
.size = PRL_PREALLOC_MODE__MAX
|
.size = PRL_PREALLOC_MODE__MAX
|
||||||
};
|
};
|
||||||
|
|
|
@ -1860,14 +1860,12 @@ const QEnumLookup %(c_name)s_lookup = {
|
||||||
''',
|
''',
|
||||||
index=index, value=value)
|
index=index, value=value)
|
||||||
|
|
||||||
max_index = c_enum_const(name, '_MAX', prefix)
|
|
||||||
ret += mcgen('''
|
ret += mcgen('''
|
||||||
[%(max_index)s] = NULL,
|
|
||||||
},
|
},
|
||||||
.size = %(max_index)s
|
.size = %(max_index)s
|
||||||
};
|
};
|
||||||
''',
|
''',
|
||||||
max_index=max_index)
|
max_index=c_enum_const(name, '_MAX', prefix))
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,6 @@ const QEnumLookup dummy_animal_map = {
|
||||||
[DUMMY_FROG] = "frog",
|
[DUMMY_FROG] = "frog",
|
||||||
[DUMMY_ALLIGATOR] = "alligator",
|
[DUMMY_ALLIGATOR] = "alligator",
|
||||||
[DUMMY_PLATYPUS] = "platypus",
|
[DUMMY_PLATYPUS] = "platypus",
|
||||||
[DUMMY_LAST] = NULL,
|
|
||||||
},
|
},
|
||||||
.size = DUMMY_LAST
|
.size = DUMMY_LAST
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue