Browse Source

ui: use enum to string helpers

Minor code simplification.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-id: 2018080109.4927-1-marcandre.lureau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
tags/v3.1.0-rc0
Marc-André Lureau 10 months ago
parent
commit
c809d1d2f4
2 changed files with 4 additions and 4 deletions
  1. 1
    1
      qemu-keymap.c
  2. 3
    3
      ui/console.c

+ 1
- 1
qemu-keymap.c View File

@@ -84,7 +84,7 @@ static void walk_map(struct xkb_keymap *map, xkb_keycode_t code, void *data)
84 84
     }
85 85
     fprintf(outfile, "# evdev %d (0x%x), QKeyCode \"%s\", number 0x%x\n",
86 86
             evdev, evdev,
87
-            QKeyCode_lookup.array[qcode],
87
+            QKeyCode_str(qcode),
88 88
             qcode_to_number(qcode));
89 89
 
90 90
     /*

+ 3
- 3
ui/console.c View File

@@ -2319,7 +2319,7 @@ bool qemu_display_find_default(DisplayOptions *opts)
2319 2319
 
2320 2320
     for (i = 0; i < ARRAY_SIZE(prio); i++) {
2321 2321
         if (dpys[prio[i]] == NULL) {
2322
-            ui_module_load_one(DisplayType_lookup.array[prio[i]]);
2322
+            ui_module_load_one(DisplayType_str(prio[i]));
2323 2323
         }
2324 2324
         if (dpys[prio[i]] == NULL) {
2325 2325
             continue;
@@ -2337,11 +2337,11 @@ void qemu_display_early_init(DisplayOptions *opts)
2337 2337
         return;
2338 2338
     }
2339 2339
     if (dpys[opts->type] == NULL) {
2340
-        ui_module_load_one(DisplayType_lookup.array[opts->type]);
2340
+        ui_module_load_one(DisplayType_str(opts->type));
2341 2341
     }
2342 2342
     if (dpys[opts->type] == NULL) {
2343 2343
         error_report("Display '%s' is not available.",
2344
-                     DisplayType_lookup.array[opts->type]);
2344
+                     DisplayType_str(opts->type));
2345 2345
         exit(1);
2346 2346
     }
2347 2347
     if (dpys[opts->type]->early_init) {

Loading…
Cancel
Save