public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 071/238] [optind, optparse] mi/mi-cmd-disas.c: -Wshadow fix
  2011-12-14  5:37 [PATCH 070/238] [optind, optparse] mi/mi-cmd-break.c: -Wshadow fix Andrey Smirnov
  2011-12-14  5:37 ` [PATCH 074/238] [optind, optparse] mi/mi-cmd-var.c: " Andrey Smirnov
  2011-12-14  5:37 ` [PATCH 072/238] [optind, optparse] mi/mi-cmd-env.c: " Andrey Smirnov
@ 2011-12-14  5:37 ` Andrey Smirnov
  2011-12-16 19:19   ` Tom Tromey
  2011-12-14  5:42 ` [PATCH 073/238] [optind, optparse] mi/mi-cmd-target.c: " Andrey Smirnov
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Andrey Smirnov @ 2011-12-14  5:37 UTC (permalink / raw)
  To: gdb-patches

To ChangeLog:
	* mi/mi-cmd-disas.c (mi_cmd_disassemble):  Rename `optind' and `optparse'
	to `oind' and `oparse', respectively(-Wshadow).
---
 gdb/mi/mi-cmd-disas.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/gdb/mi/mi-cmd-disas.c b/gdb/mi/mi-cmd-disas.c
index c2e8265..ebf1c88 100644
--- a/gdb/mi/mi-cmd-disas.c
+++ b/gdb/mi/mi-cmd-disas.c
@@ -77,8 +77,8 @@ mi_cmd_disassemble (char *command, char **argv, int argc)
   struct cleanup *cleanups = make_cleanup (null_cleanup, NULL);
 
   /* Options processing stuff. */
-  int optind = 0;
-  char *optarg;
+  int oind = 0;
+  char *oarg;
   enum opt
   {
     FILE_OPT, LINE_OPT, NUM_OPT, START_OPT, END_OPT
@@ -97,36 +97,36 @@ mi_cmd_disassemble (char *command, char **argv, int argc)
   while (1)
     {
       int opt = mi_getopt ("-data-disassemble", argc, argv, opts,
-			   &optind, &optarg);
+			   &oind, &oarg);
       if (opt < 0)
 	break;
       switch ((enum opt) opt)
 	{
 	case FILE_OPT:
-	  file_string = xstrdup (optarg);
+	  file_string = xstrdup (oarg);
 	  file_seen = 1;
 	  make_cleanup (xfree, file_string);
 	  break;
 	case LINE_OPT:
-	  line_num = atoi (optarg);
+	  line_num = atoi (oarg);
 	  line_seen = 1;
 	  break;
 	case NUM_OPT:
-	  how_many = atoi (optarg);
+	  how_many = atoi (oarg);
 	  num_seen = 1;
 	  break;
 	case START_OPT:
-	  low = parse_and_eval_address (optarg);
+	  low = parse_and_eval_address (oarg);
 	  start_seen = 1;
 	  break;
 	case END_OPT:
-	  high = parse_and_eval_address (optarg);
+	  high = parse_and_eval_address (oarg);
 	  end_seen = 1;
 	  break;
 	}
     }
-  argv += optind;
-  argc -= optind;
+  argv += oind;
+  argc -= oind;
 
   /* Allow only filename + linenum (with how_many which is not
      required) OR start_addr + and_addr */
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 074/238] [optind, optparse] mi/mi-cmd-var.c: -Wshadow fix
  2011-12-14  5:37 [PATCH 070/238] [optind, optparse] mi/mi-cmd-break.c: -Wshadow fix Andrey Smirnov
@ 2011-12-14  5:37 ` Andrey Smirnov
  2011-12-16 19:20   ` Tom Tromey
  2011-12-14  5:37 ` [PATCH 072/238] [optind, optparse] mi/mi-cmd-env.c: " Andrey Smirnov
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Andrey Smirnov @ 2011-12-14  5:37 UTC (permalink / raw)
  To: gdb-patches

To ChangeLog:
	* mi/mi-cmd-var.c (print_varobj):  Rename `optind' and
	`optparse' to `oind' and `oparse', respectively(-Wshadow).
---
 gdb/mi/mi-cmd-var.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c
index 16fbb85..48f8a7d 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)
     {
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 072/238] [optind, optparse] mi/mi-cmd-env.c: -Wshadow fix
  2011-12-14  5:37 [PATCH 070/238] [optind, optparse] mi/mi-cmd-break.c: -Wshadow fix Andrey Smirnov
  2011-12-14  5:37 ` [PATCH 074/238] [optind, optparse] mi/mi-cmd-var.c: " Andrey Smirnov
@ 2011-12-14  5:37 ` Andrey Smirnov
  2011-12-16 19:21   ` Tom Tromey
  2011-12-14  5:37 ` [PATCH 071/238] [optind, optparse] mi/mi-cmd-disas.c: " Andrey Smirnov
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Andrey Smirnov @ 2011-12-14  5:37 UTC (permalink / raw)
  To: gdb-patches

To ChangeLog:
	* mi/mi-cmd-env.c (mi_cmd_env_path):  Rename `optind' and `optparse'
	to `oind' and `oparse', respectively(-Wshadow).
	(mi_cmd_env_dir): Ditto.
---
 gdb/mi/mi-cmd-env.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/gdb/mi/mi-cmd-env.c b/gdb/mi/mi-cmd-env.c
index d9e5088..eb9e976 100644
--- a/gdb/mi/mi-cmd-env.c
+++ b/gdb/mi/mi-cmd-env.c
@@ -118,9 +118,9 @@ mi_cmd_env_path (char *command, char **argv, int argc)
   char *exec_path;
   char *env;
   int reset = 0;
-  int optind = 0;
+  int oind = 0;
   int i;
-  char *optarg;
+  char *oarg;
   enum opt
     {
       RESET_OPT
@@ -144,7 +144,7 @@ mi_cmd_env_path (char *command, char **argv, int argc)
   while (1)
     {
       int opt = mi_getopt ("-environment-path", argc, argv, opts,
-                           &optind, &optarg);
+                           &oind, &oarg);
 
       if (opt < 0)
         break;
@@ -155,8 +155,8 @@ mi_cmd_env_path (char *command, char **argv, int argc)
           break;
         }
     }
-  argv += optind;
-  argc -= optind;
+  argv += oind;
+  argc -= oind;
 
 
   if (reset)
@@ -190,9 +190,9 @@ mi_cmd_env_dir (char *command, char **argv, int argc)
 {
   struct ui_out *uiout = current_uiout;
   int i;
-  int optind = 0;
+  int oind = 0;
   int reset = 0;
-  char *optarg;
+  char *oarg;
   enum opt
     {
       RESET_OPT
@@ -216,7 +216,7 @@ mi_cmd_env_dir (char *command, char **argv, int argc)
   while (1)
     {
       int opt = mi_getopt ("-environment-directory", argc, argv, opts,
-                           &optind, &optarg);
+                           &oind, &oarg);
 
       if (opt < 0)
         break;
@@ -227,8 +227,8 @@ mi_cmd_env_dir (char *command, char **argv, int argc)
           break;
         }
     }
-  argv += optind;
-  argc -= optind;
+  argv += oind;
+  argc -= oind;
 
   if (reset)
     {
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 070/238] [optind, optparse] mi/mi-cmd-break.c: -Wshadow fix
@ 2011-12-14  5:37 Andrey Smirnov
  2011-12-14  5:37 ` [PATCH 074/238] [optind, optparse] mi/mi-cmd-var.c: " Andrey Smirnov
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Andrey Smirnov @ 2011-12-14  5:37 UTC (permalink / raw)
  To: gdb-patches

To ChangeLog:
	* mi/mi-cmd-break.c (mi_cmd_break_insert): Rename `optind' and `optparse'
	to `oind' and `oparse', respectively(-Wshadow).
	(mi_cmd_break_watch): Ditto.
---
 gdb/mi/mi-cmd-break.c |   30 +++++++++++++++---------------
 1 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/gdb/mi/mi-cmd-break.c b/gdb/mi/mi-cmd-break.c
index b3bd5da..3897f30 100644
--- a/gdb/mi/mi-cmd-break.c
+++ b/gdb/mi/mi-cmd-break.c
@@ -99,13 +99,13 @@ mi_cmd_break_insert (char *command, char **argv, int argc)
 
   /* Parse arguments. It could be -r or -h or -t, <location> or ``--''
      to denote the end of the option list. */
-  int optind = 0;
-  char *optarg;
+  int oind = 0;
+  char *oarg;
 
   while (1)
     {
       int opt = mi_getopt ("-break-insert", argc, argv,
-			   opts, &optind, &optarg);
+			   opts, &oind, &oarg);
       if (opt < 0)
 	break;
       switch ((enum opt) opt)
@@ -117,13 +117,13 @@ mi_cmd_break_insert (char *command, char **argv, int argc)
 	  hardware = 1;
 	  break;
 	case CONDITION_OPT:
-	  condition = optarg;
+	  condition = oarg;
 	  break;
 	case IGNORE_COUNT_OPT:
-	  ignore_count = atol (optarg);
+	  ignore_count = atol (oarg);
 	  break;
 	case THREAD_OPT:
-	  thread = atol (optarg);
+	  thread = atol (oarg);
 	  break;
 	case PENDING_OPT:
 	  pending = 1;
@@ -137,11 +137,11 @@ mi_cmd_break_insert (char *command, char **argv, int argc)
 	}
     }
 
-  if (optind >= argc)
+  if (oind >= argc)
     error (_("-break-insert: Missing <location>"));
-  if (optind < argc - 1)
+  if (oind < argc - 1)
     error (_("-break-insert: Garbage following <location>"));
-  address = argv[optind];
+  address = argv[oind];
 
   /* Now we have what we need, let's insert the breakpoint! */
   if (! mi_breakpoint_observers_installed)
@@ -229,13 +229,13 @@ mi_cmd_break_watch (char *command, char **argv, int argc)
   };
 
   /* Parse arguments. */
-  int optind = 0;
-  char *optarg;
+  int oind = 0;
+  char *oarg;
 
   while (1)
     {
       int opt = mi_getopt ("-break-watch", argc, argv,
-			   opts, &optind, &optarg);
+			   opts, &oind, &oarg);
 
       if (opt < 0)
 	break;
@@ -249,11 +249,11 @@ mi_cmd_break_watch (char *command, char **argv, int argc)
 	  break;
 	}
     }
-  if (optind >= argc)
+  if (oind >= argc)
     error (_("-break-watch: Missing <expression>"));
-  if (optind < argc - 1)
+  if (oind < argc - 1)
     error (_("-break-watch: Garbage following <expression>"));
-  expr = argv[optind];
+  expr = argv[oind];
 
   /* Now we have what we need, let's insert the watchpoint! */
   switch (type)
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 073/238] [optind, optparse] mi/mi-cmd-target.c: -Wshadow fix
  2011-12-14  5:37 [PATCH 070/238] [optind, optparse] mi/mi-cmd-break.c: -Wshadow fix Andrey Smirnov
                   ` (2 preceding siblings ...)
  2011-12-14  5:37 ` [PATCH 071/238] [optind, optparse] mi/mi-cmd-disas.c: " Andrey Smirnov
@ 2011-12-14  5:42 ` Andrey Smirnov
  2011-12-16 19:20   ` Tom Tromey
  2011-12-14  5:44 ` [PATCH 075/238] [optind, optparse] mi/mi-getopt.c: " Andrey Smirnov
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Andrey Smirnov @ 2011-12-14  5:42 UTC (permalink / raw)
  To: gdb-patches

To ChangeLog:
	* mi/mi-cmd-target.c (mi_cmd_target_file_get): Rename `optind' and
	`optparse' to `oind' and `oparse', respectively(-Wshadow).
	(mi_cmd_target_file_put): Ditto.
	(mi_cmd_target_file_delete): Ditto.
---
 gdb/mi/mi-cmd-target.c |   34 +++++++++++++++++-----------------
 1 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/gdb/mi/mi-cmd-target.c b/gdb/mi/mi-cmd-target.c
index 5f18365..e270581 100644
--- a/gdb/mi/mi-cmd-target.c
+++ b/gdb/mi/mi-cmd-target.c
@@ -26,8 +26,8 @@
 void
 mi_cmd_target_file_get (char *command, char **argv, int argc)
 {
-  int optind = 0;
-  char *optarg;
+  int oind = 0;
+  char *oarg;
   const char *remote_file, *local_file;
   static const struct mi_opt opts[] =
   {
@@ -35,12 +35,12 @@ mi_cmd_target_file_get (char *command, char **argv, int argc)
   };
   static const char prefix[] = "-target-file-get";
 
-  if (mi_getopt (prefix, argc, argv, opts, &optind, &optarg) != -1
-      || optind != argc - 2)
+  if (mi_getopt (prefix, argc, argv, opts, &oind, &oarg) != -1
+      || oind != argc - 2)
     error (_("-target-file-get: Usage: REMOTE_FILE LOCAL_FILE"));
 
-  remote_file = argv[optind];
-  local_file = argv[optind + 1];
+  remote_file = argv[oind];
+  local_file = argv[oind + 1];
 
   remote_file_get (remote_file, local_file, 0);
 }
@@ -50,8 +50,8 @@ mi_cmd_target_file_get (char *command, char **argv, int argc)
 void
 mi_cmd_target_file_put (char *command, char **argv, int argc)
 {
-  int optind = 0;
-  char *optarg;
+  int oind = 0;
+  char *oarg;
   const char *remote_file, *local_file;
   static const struct mi_opt opts[] =
   {
@@ -59,12 +59,12 @@ mi_cmd_target_file_put (char *command, char **argv, int argc)
   };
   static const char prefix[] = "-target-file-put";
 
-  if (mi_getopt (prefix, argc, argv, opts, &optind, &optarg) != -1
-      || optind != argc - 2)
+  if (mi_getopt (prefix, argc, argv, opts, &oind, &oarg) != -1
+      || oind != argc - 2)
     error (_("-target-file-put: Usage: LOCAL_FILE REMOTE_FILE"));
 
-  local_file = argv[optind];
-  remote_file = argv[optind + 1];
+  local_file = argv[oind];
+  remote_file = argv[oind + 1];
 
   remote_file_put (local_file, remote_file, 0);
 }
@@ -74,8 +74,8 @@ mi_cmd_target_file_put (char *command, char **argv, int argc)
 void
 mi_cmd_target_file_delete (char *command, char **argv, int argc)
 {
-  int optind = 0;
-  char *optarg;
+  int oind = 0;
+  char *oarg;
   const char *remote_file;
   static const struct mi_opt opts[] =
   {
@@ -83,11 +83,11 @@ mi_cmd_target_file_delete (char *command, char **argv, int argc)
   };
   static const char prefix[] = "-target-file-delete";
 
-  if (mi_getopt (prefix, argc, argv, opts, &optind, &optarg) != -1
-      || optind != argc - 1)
+  if (mi_getopt (prefix, argc, argv, opts, &oind, &oarg) != -1
+      || oind != argc - 1)
     error (_("-target-file-delete: Usage: REMOTE_FILE"));
 
-  remote_file = argv[optind];
+  remote_file = argv[oind];
 
   remote_file_delete (remote_file, 0);
 }
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 075/238] [optind, optparse] mi/mi-getopt.c: -Wshadow fix
  2011-12-14  5:37 [PATCH 070/238] [optind, optparse] mi/mi-cmd-break.c: -Wshadow fix Andrey Smirnov
                   ` (3 preceding siblings ...)
  2011-12-14  5:42 ` [PATCH 073/238] [optind, optparse] mi/mi-cmd-target.c: " Andrey Smirnov
@ 2011-12-14  5:44 ` Andrey Smirnov
  2011-12-16 19:21   ` Tom Tromey
  2011-12-14  7:37 ` [PATCH 076/238] [optind, optparse] mi/mi-main.c: " Andrey Smirnov
  2011-12-16 19:17 ` [PATCH 070/238] [optind, optparse] mi/mi-cmd-break.c: " Tom Tromey
  6 siblings, 1 reply; 14+ messages in thread
From: Andrey Smirnov @ 2011-12-14  5:44 UTC (permalink / raw)
  To: gdb-patches

To ChangeLog:
	* mi/mi-getopt.c (mi_getopt):  Rename `optind' and
	`optparse' to `oind' and `oparse', respectively(-Wshadow).
	(mi_valid_noargs): Ditto.
---
 gdb/mi/mi-getopt.c |   34 +++++++++++++++++-----------------
 1 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/gdb/mi/mi-getopt.c b/gdb/mi/mi-getopt.c
index 1748688..09fee9b 100644
--- a/gdb/mi/mi-getopt.c
+++ b/gdb/mi/mi-getopt.c
@@ -26,29 +26,29 @@ int
 mi_getopt (const char *prefix,
 	   int argc, char **argv,
 	   const struct mi_opt *opts,
-	   int *optind, char **optarg)
+	   int *oind, char **oarg)
 {
   char *arg;
   const struct mi_opt *opt;
 
   /* We assume that argv/argc are ok. */
-  if (*optind > argc || *optind < 0)
+  if (*oind > argc || *oind < 0)
     internal_error (__FILE__, __LINE__,
-		    _("mi_getopt_long: optind out of bounds"));
-  if (*optind == argc)
+		    _("mi_getopt_long: oind out of bounds"));
+  if (*oind == argc)
     return -1;
-  arg = argv[*optind];
+  arg = argv[*oind];
   /* ``--''? */
   if (strcmp (arg, "--") == 0)
     {
-      *optind += 1;
-      *optarg = NULL;
+      *oind += 1;
+      *oarg = NULL;
       return -1;
     }
   /* End of option list. */
   if (arg[0] != '-')
     {
-      *optarg = NULL;
+      *oarg = NULL;
       return -1;
     }
   /* Look the option up. */
@@ -58,17 +58,17 @@ mi_getopt (const char *prefix,
 	continue;
       if (opt->arg_p)
 	{
-	  /* A non-simple optarg option. */
-	  if (argc < *optind + 2)
+	  /* A non-simple oarg option. */
+	  if (argc < *oind + 2)
 	    error (_("%s: Option %s requires an argument"), prefix, arg);
-	  *optarg = argv[(*optind) + 1];
-	  *optind = (*optind) + 2;
+	  *oarg = argv[(*oind) + 1];
+	  *oind = (*oind) + 2;
 	  return opt->index;
 	}
       else
 	{
-	  *optarg = NULL;
-	  *optind = (*optind) + 1;
+	  *oarg = NULL;
+	  *oind = (*oind) + 1;
 	  return opt->index;
 	}
     }
@@ -78,14 +78,14 @@ mi_getopt (const char *prefix,
 int 
 mi_valid_noargs (const char *prefix, int argc, char **argv) 
 {
-  int optind = 0;
-  char *optarg;
+  int oind = 0;
+  char *oarg;
   static const struct mi_opt opts[] =
   {
     { 0, 0, 0 }
   };
 
-  if (mi_getopt (prefix, argc, argv, opts, &optind, &optarg) == -1)
+  if (mi_getopt (prefix, argc, argv, opts, &oind, &oarg) == -1)
     return 1;
   else
     return 0;
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 076/238] [optind, optparse] mi/mi-main.c: -Wshadow fix
  2011-12-14  5:37 [PATCH 070/238] [optind, optparse] mi/mi-cmd-break.c: -Wshadow fix Andrey Smirnov
                   ` (4 preceding siblings ...)
  2011-12-14  5:44 ` [PATCH 075/238] [optind, optparse] mi/mi-getopt.c: " Andrey Smirnov
@ 2011-12-14  7:37 ` Andrey Smirnov
  2011-12-16 19:24   ` Tom Tromey
  2011-12-16 19:17 ` [PATCH 070/238] [optind, optparse] mi/mi-cmd-break.c: " Tom Tromey
  6 siblings, 1 reply; 14+ messages in thread
From: Andrey Smirnov @ 2011-12-14  7:37 UTC (permalink / raw)
  To: gdb-patches

To ChangeLog:
	* mi/mi-main.c (mi_cmd_list_thread_groups): Rename `optind' and
	`optparse' to `oind' and `oparse', respectively(-Wshadow).
	(mi_cmd_data_read_memory): Ditto.
	(mi_cmd_data_read_memory_bytes): Ditto.
	(mi_cmd_data_write_memory): Ditto.
---
 gdb/mi/mi-main.c |   56 +++++++++++++++++++++++++++---------------------------
 1 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index a9c7652..598903f 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -807,13 +807,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;
@@ -823,9 +823,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 "
@@ -834,18 +834,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)
@@ -1302,8 +1302,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
@@ -1317,19 +1317,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: "
@@ -1488,8 +1488,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
@@ -1503,18 +1503,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."));
@@ -1589,8 +1589,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
@@ -1604,19 +1604,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: "
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 070/238] [optind, optparse] mi/mi-cmd-break.c: -Wshadow fix
  2011-12-14  5:37 [PATCH 070/238] [optind, optparse] mi/mi-cmd-break.c: -Wshadow fix Andrey Smirnov
                   ` (5 preceding siblings ...)
  2011-12-14  7:37 ` [PATCH 076/238] [optind, optparse] mi/mi-main.c: " Andrey Smirnov
@ 2011-12-16 19:17 ` Tom Tromey
  6 siblings, 0 replies; 14+ messages in thread
From: Tom Tromey @ 2011-12-16 19:17 UTC (permalink / raw)
  To: Andrey Smirnov; +Cc: gdb-patches

>>>>> "Andrey" == Andrey Smirnov <andrew.smirnov@gmail.com> writes:

Andrey> 	* mi/mi-cmd-break.c (mi_cmd_break_insert): Rename `optind' and `optparse'
Andrey> 	to `oind' and `oparse', respectively(-Wshadow).
Andrey> 	(mi_cmd_break_watch): Ditto.

The first line here looks like it wraps.
Could you fix that?

Patch is ok.

Tom

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 071/238] [optind, optparse] mi/mi-cmd-disas.c: -Wshadow fix
  2011-12-14  5:37 ` [PATCH 071/238] [optind, optparse] mi/mi-cmd-disas.c: " Andrey Smirnov
@ 2011-12-16 19:19   ` Tom Tromey
  0 siblings, 0 replies; 14+ messages in thread
From: Tom Tromey @ 2011-12-16 19:19 UTC (permalink / raw)
  To: Andrey Smirnov; +Cc: gdb-patches

>>>>> "Andrey" == Andrey Smirnov <andrew.smirnov@gmail.com> writes:

Andrey> 	* mi/mi-cmd-disas.c (mi_cmd_disassemble):  Rename `optind' and `optparse'
Andrey> 	to `oind' and `oparse', respectively(-Wshadow).

Ok.

Please fix the line wrapping in ChangeLog.
If this applies to the other patches in this part of the series, please
fix those up too.  Thanks.

Tom

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 074/238] [optind, optparse] mi/mi-cmd-var.c: -Wshadow fix
  2011-12-14  5:37 ` [PATCH 074/238] [optind, optparse] mi/mi-cmd-var.c: " Andrey Smirnov
@ 2011-12-16 19:20   ` Tom Tromey
  0 siblings, 0 replies; 14+ messages in thread
From: Tom Tromey @ 2011-12-16 19:20 UTC (permalink / raw)
  To: Andrey Smirnov; +Cc: gdb-patches

>>>>> "Andrey" == Andrey Smirnov <andrew.smirnov@gmail.com> writes:

Andrey> 	* mi/mi-cmd-var.c (print_varobj):  Rename `optind' and
Andrey> 	`optparse' to `oind' and `oparse', respectively(-Wshadow).

Ok.

Tom

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 073/238] [optind, optparse] mi/mi-cmd-target.c: -Wshadow fix
  2011-12-14  5:42 ` [PATCH 073/238] [optind, optparse] mi/mi-cmd-target.c: " Andrey Smirnov
@ 2011-12-16 19:20   ` Tom Tromey
  0 siblings, 0 replies; 14+ messages in thread
From: Tom Tromey @ 2011-12-16 19:20 UTC (permalink / raw)
  To: Andrey Smirnov; +Cc: gdb-patches

>>>>> "Andrey" == Andrey Smirnov <andrew.smirnov@gmail.com> writes:

Andrey> 	* mi/mi-cmd-target.c (mi_cmd_target_file_get): Rename `optind' and
Andrey> 	`optparse' to `oind' and `oparse', respectively(-Wshadow).
Andrey> 	(mi_cmd_target_file_put): Ditto.
Andrey> 	(mi_cmd_target_file_delete): Ditto.

Ok.

I suppose at the end of this sub-series we should be able to grep for
optind and optparse in MI and find no hits.

Tom

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 072/238] [optind, optparse] mi/mi-cmd-env.c: -Wshadow fix
  2011-12-14  5:37 ` [PATCH 072/238] [optind, optparse] mi/mi-cmd-env.c: " Andrey Smirnov
@ 2011-12-16 19:21   ` Tom Tromey
  0 siblings, 0 replies; 14+ messages in thread
From: Tom Tromey @ 2011-12-16 19:21 UTC (permalink / raw)
  To: Andrey Smirnov; +Cc: gdb-patches

>>>>> "Andrey" == Andrey Smirnov <andrew.smirnov@gmail.com> writes:

Andrey> 	* mi/mi-cmd-env.c (mi_cmd_env_path):  Rename `optind' and `optparse'
Andrey> 	to `oind' and `oparse', respectively(-Wshadow).
Andrey> 	(mi_cmd_env_dir): Ditto.

Ok.

Tom

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 075/238] [optind, optparse] mi/mi-getopt.c: -Wshadow fix
  2011-12-14  5:44 ` [PATCH 075/238] [optind, optparse] mi/mi-getopt.c: " Andrey Smirnov
@ 2011-12-16 19:21   ` Tom Tromey
  0 siblings, 0 replies; 14+ messages in thread
From: Tom Tromey @ 2011-12-16 19:21 UTC (permalink / raw)
  To: Andrey Smirnov; +Cc: gdb-patches

>>>>> "Andrey" == Andrey Smirnov <andrew.smirnov@gmail.com> writes:

Andrey> 	* mi/mi-getopt.c (mi_getopt):  Rename `optind' and
Andrey> 	`optparse' to `oind' and `oparse', respectively(-Wshadow).
Andrey> 	(mi_valid_noargs): Ditto.

Ok.

Tom

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 076/238] [optind, optparse] mi/mi-main.c: -Wshadow fix
  2011-12-14  7:37 ` [PATCH 076/238] [optind, optparse] mi/mi-main.c: " Andrey Smirnov
@ 2011-12-16 19:24   ` Tom Tromey
  0 siblings, 0 replies; 14+ messages in thread
From: Tom Tromey @ 2011-12-16 19:24 UTC (permalink / raw)
  To: Andrey Smirnov; +Cc: gdb-patches

>>>>> "Andrey" == Andrey Smirnov <andrew.smirnov@gmail.com> writes:

Andrey> 	* mi/mi-main.c (mi_cmd_list_thread_groups): Rename `optind' and
Andrey> 	`optparse' to `oind' and `oparse', respectively(-Wshadow).
Andrey> 	(mi_cmd_data_read_memory): Ditto.
Andrey> 	(mi_cmd_data_read_memory_bytes): Ditto.
Andrey> 	(mi_cmd_data_write_memory): Ditto.

Ok.

Tom

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2011-12-16 19:21 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-14  5:37 [PATCH 070/238] [optind, optparse] mi/mi-cmd-break.c: -Wshadow fix Andrey Smirnov
2011-12-14  5:37 ` [PATCH 074/238] [optind, optparse] mi/mi-cmd-var.c: " Andrey Smirnov
2011-12-16 19:20   ` Tom Tromey
2011-12-14  5:37 ` [PATCH 072/238] [optind, optparse] mi/mi-cmd-env.c: " Andrey Smirnov
2011-12-16 19:21   ` Tom Tromey
2011-12-14  5:37 ` [PATCH 071/238] [optind, optparse] mi/mi-cmd-disas.c: " Andrey Smirnov
2011-12-16 19:19   ` Tom Tromey
2011-12-14  5:42 ` [PATCH 073/238] [optind, optparse] mi/mi-cmd-target.c: " Andrey Smirnov
2011-12-16 19:20   ` Tom Tromey
2011-12-14  5:44 ` [PATCH 075/238] [optind, optparse] mi/mi-getopt.c: " Andrey Smirnov
2011-12-16 19:21   ` Tom Tromey
2011-12-14  7:37 ` [PATCH 076/238] [optind, optparse] mi/mi-main.c: " Andrey Smirnov
2011-12-16 19:24   ` Tom Tromey
2011-12-16 19:17 ` [PATCH 070/238] [optind, optparse] mi/mi-cmd-break.c: " Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).