mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-28 20:43:45 +08:00
* 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.
This commit is contained in:
parent
324478caa7
commit
56934ab1ce
@ -1,3 +1,11 @@
|
||||
2011-12-16 Andrey Smirnov <andrew.smirnov@gmail.com>
|
||||
|
||||
* 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 <andrew.smirnov@gmail.com>
|
||||
|
||||
* mi/mi-getopt.c (mi_getopt): Rename `optind' and `optarg' to
|
||||
|
@ -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: "
|
||||
|
Loading…
Reference in New Issue
Block a user