From 54dc829719bc3d9d424d2196f811cdde3669cb2d Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Sat, 17 Dec 2011 06:06:49 +0000 Subject: [PATCH] * mi/mi-cmd-var.c (print_varobj): Rename `optind' and `optarg' to `oind' and `oarg', respectively(-Wshadow). --- gdb/ChangeLog | 5 +++++ gdb/mi/mi-cmd-var.c | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index feba95f28fa..cdc332a70bb 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2011-12-16 Andrey Smirnov + + * mi/mi-cmd-var.c (print_varobj): Rename `optind' and `optarg' to + `oind' and `oarg', respectively(-Wshadow). + 2011-12-16 Andrey Smirnov * mi/mi-cmd-target.c (mi_cmd_target_file_get): Rename `optind' and diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c index 16fbb853f61..48f8a7d12b9 100644 --- a/gdb/mi/mi-cmd-var.c +++ b/gdb/mi/mi-cmd-var.c @@ -554,8 +554,8 @@ mi_cmd_var_evaluate_expression (char *command, char **argv, int argc) enum varobj_display_formats format; int formatFound; - int optind; - char *optarg; + int oind; + char *oarg; enum opt { @@ -570,11 +570,11 @@ mi_cmd_var_evaluate_expression (char *command, char **argv, int argc) /* Parse arguments */ format = FORMAT_NATURAL; formatFound = 0; - optind = 0; + oind = 0; while (1) { int opt = mi_getopt ("-var-evaluate-expression", argc, argv, - opts, &optind, &optarg); + opts, &oind, &oarg); if (opt < 0) break; @@ -584,20 +584,20 @@ mi_cmd_var_evaluate_expression (char *command, char **argv, int argc) if (formatFound) error (_("Cannot specify format more than once")); - format = mi_parse_format (optarg); + format = mi_parse_format (oarg); formatFound = 1; break; } } - if (optind >= argc) + if (oind >= argc) error (_("Usage: [-f FORMAT] NAME")); - if (optind < argc - 1) + if (oind < argc - 1) error (_("Garbage at end of command")); /* Get varobj handle, if a valid var obj name was specified */ - var = varobj_get_handle (argv[optind]); + var = varobj_get_handle (argv[oind]); if (formatFound) { -- 2.30.2