qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 16/16] qapi: drop the sentinel in enum array


From: Markus Armbruster
Subject: [Qemu-devel] [PATCH 16/16] qapi: drop the sentinel in enum array
Date: Thu, 24 Aug 2017 10:46:11 +0200

From: Marc-André Lureau <address@hidden>

Now that all usages have been converted to user lookup helpers.

Signed-off-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
[Rebased, superfluous local variable dropped, missing
check-qom-proplist.c update added]
Signed-off-by: Markus Armbruster <address@hidden>
---
 block/parallels.c          | 1 -
 scripts/qapi.py            | 4 +---
 tests/check-qom-proplist.c | 1 -
 3 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/block/parallels.c b/block/parallels.c
index cce7336..2b6c6e5 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -72,7 +72,6 @@ static QEnumLookup prealloc_mode_lookup = {
     .array = (const char *const[]) {
         "falloc",
         "truncate",
-        NULL,
     },
     .size = PRL_PREALLOC_MODE__MAX
 };
diff --git a/scripts/qapi.py b/scripts/qapi.py
index 61be538..a0993ee 100644
--- a/scripts/qapi.py
+++ b/scripts/qapi.py
@@ -1860,14 +1860,12 @@ const QEnumLookup %(c_name)s_lookup = {
 ''',
                      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
 
 
diff --git a/tests/check-qom-proplist.c b/tests/check-qom-proplist.c
index 07e351f..92898e1 100644
--- a/tests/check-qom-proplist.c
+++ b/tests/check-qom-proplist.c
@@ -51,7 +51,6 @@ const QEnumLookup dummy_animal_map = {
         [DUMMY_FROG] = "frog",
         [DUMMY_ALLIGATOR] = "alligator",
         [DUMMY_PLATYPUS] = "platypus",
-        [DUMMY_LAST] = NULL,
     },
     .size = DUMMY_LAST
 };
-- 
2.7.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]