Skip to content

Commit

Permalink
qapi: drop the sentinel in enum array
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
elmarco authored and Markus Armbruster committed Sep 4, 2017
1 parent f7abe0e commit ebf677c
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 5 deletions.
1 change: 0 additions & 1 deletion block/parallels.c
Expand Up @@ -72,7 +72,6 @@ static QEnumLookup prealloc_mode_lookup = {
.array = (const char *const[]) {
"falloc",
"truncate",
NULL,
},
.size = PRL_PREALLOC_MODE__MAX
};
Expand Down
4 changes: 1 addition & 3 deletions scripts/qapi.py
Expand Up @@ -1860,14 +1860,12 @@ def gen_enum_lookup(name, values, prefix=None):
''',
index=index, value=value)

max_index = c_enum_const(name, '_MAX', prefix)
ret += mcgen('''
[%(max_index)s] = NULL,
},
.size = %(max_index)s
};
''',
max_index=max_index)
max_index=c_enum_const(name, '_MAX', prefix))
return ret


Expand Down
1 change: 0 additions & 1 deletion tests/check-qom-proplist.c
Expand Up @@ -51,7 +51,6 @@ const QEnumLookup dummy_animal_map = {
[DUMMY_FROG] = "frog",
[DUMMY_ALLIGATOR] = "alligator",
[DUMMY_PLATYPUS] = "platypus",
[DUMMY_LAST] = NULL,
},
.size = DUMMY_LAST
};
Expand Down

0 comments on commit ebf677c

Please sign in to comment.