]> Git Repo - qemu.git/blobdiff - tests/check-qom-proplist.c
qapi: Change data type of the FOO_lookup generated for enum FOO
[qemu.git] / tests / check-qom-proplist.c
index c51e6e734dd7b8d270b12833986304aced28f3af..07e351f95047443641bc413715f6e3fb028e0912 100644 (file)
@@ -46,11 +46,14 @@ enum DummyAnimal {
     DUMMY_LAST,
 };
 
-static const char *const dummy_animal_map[DUMMY_LAST + 1] = {
-    [DUMMY_FROG] = "frog",
-    [DUMMY_ALLIGATOR] = "alligator",
-    [DUMMY_PLATYPUS] = "platypus",
-    [DUMMY_LAST] = NULL,
+const QEnumLookup dummy_animal_map = {
+    .array = (const char *const[]) {
+        [DUMMY_FROG] = "frog",
+        [DUMMY_ALLIGATOR] = "alligator",
+        [DUMMY_PLATYPUS] = "platypus",
+        [DUMMY_LAST] = NULL,
+    },
+    .size = DUMMY_LAST
 };
 
 struct DummyObject {
@@ -142,7 +145,7 @@ static void dummy_class_init(ObjectClass *cls, void *data)
                                   NULL);
     object_class_property_add_enum(cls, "av",
                                    "DummyAnimal",
-                                   dummy_animal_map,
+                                   &dummy_animal_map,
                                    dummy_get_av,
                                    dummy_set_av,
                                    NULL);
This page took 0.024128 seconds and 4 git commands to generate.