Patchwork [1/3] linux-user: arg_table need not have global scope

login
register
mail settings
Submitter riku.voipio@linaro.org
Date Aug. 27, 2012, 6:22 p.m.
Message ID <42644cee08f85202f5d3e8babf6503487849353a.1346088997.git.riku.voipio@linaro.org>
Download mbox | patch
Permalink /patch/180262/
State New
Headers show

Comments

riku.voipio@linaro.org - Aug. 27, 2012, 6:22 p.m.
From: Jim Meyering <meyering@redhat.com>

Declare arg_table to be "static const", and adjust the two users
to also be const.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
 linux-user/main.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Patch

diff --git a/linux-user/main.c b/linux-user/main.c
index 7dea084..b1c228a 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -3222,7 +3222,7 @@  struct qemu_argument {
     const char *help;
 };
 
-struct qemu_argument arg_table[] = {
+static const struct qemu_argument arg_table[] = {
     {"h",          "",                 false, handle_arg_help,
      "",           "print this help"},
     {"g",          "QEMU_GDB",         true,  handle_arg_gdb,
@@ -3264,7 +3264,7 @@  struct qemu_argument arg_table[] = {
 
 static void usage(void)
 {
-    struct qemu_argument *arginfo;
+    const struct qemu_argument *arginfo;
     int maxarglen;
     int maxenvlen;
 
@@ -3330,7 +3330,7 @@  static int parse_args(int argc, char **argv)
 {
     const char *r;
     int optind;
-    struct qemu_argument *arginfo;
+    const struct qemu_argument *arginfo;
 
     for (arginfo = arg_table; arginfo->handle_opt != NULL; arginfo++) {
         if (arginfo->env == NULL) {