From: Andrey Smirnov Date: Sat, 17 Dec 2011 06:14:45 +0000 (+0000) Subject: * mi/mi-main.c (mi_cmd_list_thread_groups): Rename `optind' and X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=56934ab1cea1a1569413c26ea3182525e4d335ed;p=binutils-gdb.git * mi/mi-main.c (mi_cmd_list_thread_groups): Rename `optind' and `optarg' to `oind' and `oarg', respectively(-Wshadow). (mi_cmd_data_read_memory): Ditto. (mi_cmd_data_read_memory_bytes): Ditto. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c9711094108..02c5d3b0a9c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2011-12-16 Andrey Smirnov + + * mi/mi-main.c (mi_cmd_list_thread_groups): Rename `optind' and + `optarg' to `oind' and `oarg', respectively(-Wshadow). + (mi_cmd_data_read_memory): Ditto. + (mi_cmd_data_read_memory_bytes): Ditto. + (mi_cmd_data_write_memory): Ditto. + 2011-12-16 Andrey Smirnov * mi/mi-getopt.c (mi_getopt): Rename `optind' and `optarg' to diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index eefe9ecb667..237e1579a5f 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -808,13 +808,13 @@ mi_cmd_list_thread_groups (char *command, char **argv, int argc) { 0, 0, 0 } }; - int optind = 0; - char *optarg; + int oind = 0; + char *oarg; while (1) { int opt = mi_getopt ("-list-thread-groups", argc, argv, opts, - &optind, &optarg); + &oind, &oarg); if (opt < 0) break; @@ -824,9 +824,9 @@ mi_cmd_list_thread_groups (char *command, char **argv, int argc) available = 1; break; case RECURSE_OPT: - if (strcmp (optarg, "0") == 0) + if (strcmp (oarg, "0") == 0) ; - else if (strcmp (optarg, "1") == 0) + else if (strcmp (oarg, "1") == 0) recurse = 1; else error (_("only '0' and '1' are valid values " @@ -835,18 +835,18 @@ mi_cmd_list_thread_groups (char *command, char **argv, int argc) } } - for (; optind < argc; ++optind) + for (; oind < argc; ++oind) { char *end; int inf; - if (*(argv[optind]) != 'i') - error (_("invalid syntax of group id '%s'"), argv[optind]); + if (*(argv[oind]) != 'i') + error (_("invalid syntax of group id '%s'"), argv[oind]); - inf = strtoul (argv[optind] + 1, &end, 0); + inf = strtoul (argv[oind] + 1, &end, 0); if (*end != '\0') - error (_("invalid syntax of group id '%s'"), argv[optind]); + error (_("invalid syntax of group id '%s'"), argv[oind]); VEC_safe_push (int, ids, inf); } if (VEC_length (int, ids) > 1) @@ -1303,8 +1303,8 @@ mi_cmd_data_read_memory (char *command, char **argv, int argc) gdb_byte *mbuf; int nr_bytes; long offset = 0; - int optind = 0; - char *optarg; + int oind = 0; + char *oarg; enum opt { OFFSET_OPT @@ -1318,19 +1318,19 @@ mi_cmd_data_read_memory (char *command, char **argv, int argc) while (1) { int opt = mi_getopt ("-data-read-memory", argc, argv, opts, - &optind, &optarg); + &oind, &oarg); if (opt < 0) break; switch ((enum opt) opt) { case OFFSET_OPT: - offset = atol (optarg); + offset = atol (oarg); break; } } - argv += optind; - argc -= optind; + argv += oind; + argc -= oind; if (argc < 5 || argc > 6) error (_("-data-read-memory: Usage: " @@ -1489,8 +1489,8 @@ mi_cmd_data_read_memory_bytes (char *command, char **argv, int argc) int ix; VEC(memory_read_result_s) *result; long offset = 0; - int optind = 0; - char *optarg; + int oind = 0; + char *oarg; enum opt { OFFSET_OPT @@ -1504,18 +1504,18 @@ mi_cmd_data_read_memory_bytes (char *command, char **argv, int argc) while (1) { int opt = mi_getopt ("-data-read-memory-bytes", argc, argv, opts, - &optind, &optarg); + &oind, &oarg); if (opt < 0) break; switch ((enum opt) opt) { case OFFSET_OPT: - offset = atol (optarg); + offset = atol (oarg); break; } } - argv += optind; - argc -= optind; + argv += oind; + argc -= oind; if (argc != 2) error (_("Usage: [ -o OFFSET ] ADDR LENGTH.")); @@ -1590,8 +1590,8 @@ mi_cmd_data_write_memory (char *command, char **argv, int argc) void *buffer; struct cleanup *old_chain; long offset = 0; - int optind = 0; - char *optarg; + int oind = 0; + char *oarg; enum opt { OFFSET_OPT @@ -1605,19 +1605,19 @@ mi_cmd_data_write_memory (char *command, char **argv, int argc) while (1) { int opt = mi_getopt ("-data-write-memory", argc, argv, opts, - &optind, &optarg); + &oind, &oarg); if (opt < 0) break; switch ((enum opt) opt) { case OFFSET_OPT: - offset = atol (optarg); + offset = atol (oarg); break; } } - argv += optind; - argc -= optind; + argv += oind; + argc -= oind; if (argc != 4) error (_("-data-write-memory: Usage: "