Patchwork vl.c: Fix compilation failure if CONFIG_SDL isn't defined

login
register
mail settings
Submitter Peter Maydell
Date March 23, 2011, 1:40 p.m.
Message ID <1300887657-9634-1-git-send-email-peter.maydell@linaro.org>
Download mbox | patch
Permalink /patch/88098/
State New
Headers show

Comments

Peter Maydell - March 23, 2011, 1:40 p.m.
Fix a compilation failure if CONFIG_SDL isn't defined (gcc complained
that the label 'invalid_display' wasn't used).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 vl.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

Patch

diff --git a/vl.c b/vl.c
index dbb927d..c387f2b 100644
--- a/vl.c
+++ b/vl.c
@@ -1575,7 +1575,7 @@  static DisplayType select_display(const char *p)
                 } else if (strstart(opts, "off", &nextopt)) {
                     no_frame = 1;
                 } else {
-                    goto invalid_display;
+                    goto invalid_sdl_args;
                 }
             } else if (strstart(opts, ",alt_grab=", &nextopt)) {
                 opts = nextopt;
@@ -1584,7 +1584,7 @@  static DisplayType select_display(const char *p)
                 } else if (strstart(opts, "off", &nextopt)) {
                     alt_grab = 0;
                 } else {
-                    goto invalid_display;
+                    goto invalid_sdl_args;
                 }
             } else if (strstart(opts, ",ctrl_grab=", &nextopt)) {
                 opts = nextopt;
@@ -1593,7 +1593,7 @@  static DisplayType select_display(const char *p)
                 } else if (strstart(opts, "off", &nextopt)) {
                     ctrl_grab = 0;
                 } else {
-                    goto invalid_display;
+                    goto invalid_sdl_args;
                 }
             } else if (strstart(opts, ",window_close=", &nextopt)) {
                 opts = nextopt;
@@ -1602,10 +1602,12 @@  static DisplayType select_display(const char *p)
                 } else if (strstart(opts, "off", &nextopt)) {
                     no_quit = 1;
                 } else {
-                    goto invalid_display;
+                    goto invalid_sdl_args;
                 }
             } else {
-                goto invalid_display;
+            invalid_sdl_args:
+                fprintf(stderr, "Invalid SDL option string: %s\n", p);
+                exit(1);
             }
             opts = nextopt;
         }
@@ -1642,7 +1644,6 @@  static DisplayType select_display(const char *p)
     } else if (strstart(p, "none", &opts)) {
         display = DT_NONE;
     } else {
-    invalid_display:
         fprintf(stderr, "Unknown display type: %s\n", p);
         exit(1);
     }