This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 01/17] Enable building with -Wshadow


Hello everyone,

On the supr of the moment, while reading Project Ideas page on GDB wiki,
I've decided to undertake the task of making compilation with -Wshadow
flag possible (seeing how that is a simple task for a person unfamiliar
with gdb's code base). So, having configured the code with
gcc.gnu.org
CFLAGS="-D_BSD_SOURCE -D_POSIX_C_SOURCE=199309L -Wshadow -Werror
-ansi" ./configure

I rummaged through it and fixed all naming clashes.
In the attachment to this letter is a 1st in the series of 17 patches.
The majority of the changes is related to fixing -Wshadow caused errors
with two or three fixes related to -Werror and -ansi flags.

A couple of quick questions:

- What is the common way(etiquette?) of sending a series patches to this
  list? Do I send them all at once or do I wait 'till the end of
  discussion about the first one?

- Does the part of MAINTAINERS file about patches to libiberty,
  libdecnumber and intl needing to be sent to GCC still holds true or
  should I send them to this list?  Bfd and binutils?

- In case the patches got applied and building with -Wshadow is working
  would it be possible to add aforementioned CFLAGS to the set of
  default ones?

Andrey Smirnov

P.S. Forgot to mention that I checked for regressions by running 'make
check' and, to the best of my knowledge, fixed all that have been cased by
my patches.
From c055cfe0c630a7a16bd55df4253badbf0c4f8626 Mon Sep 17 00:00:00 2001
From: Andrey Smirnov <andrew.smirnov@gmail.com>
Date: Tue, 1 Nov 2011 17:48:38 +0700
Subject: [PATCH 01/17] gdb: Fix -Wshadow warnings (part 01)

---
 gdb/ada-exp.y          |    6 +-
 gdb/ada-lang.c         |  160 ++++++++--------
 gdb/ada-valprint.c     |   71 ++++----
 gdb/amd64-linux-tdep.c |    4 +-
 gdb/amd64-tdep.c       |    9 +-
 gdb/annotate.c         |    4 +-
 gdb/bcache.c           |   88 +++++-----
 gdb/bfd-target.c       |    6 +-
 gdb/breakpoint.c       |   96 +++++-----
 gdb/buildsym.c         |   30 ++--
 gdb/c-typeprint.c      |  491 ++++++++++++++++++++++++------------------------
 gdb/c-valprint.c       |   14 +-
 gdb/coffread.c         |   28 ++--
 gdb/complaints.c       |   52 +++---
 gdb/completer.c        |    8 +-
 gdb/cp-abi.c           |    4 +-
 gdb/cp-name-parser.y   |    4 +-
 gdb/cp-support.c       |   68 ++++----
 gdb/cp-valprint.c      |   37 ++--
 19 files changed, 596 insertions(+), 584 deletions(-)

diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y
index 9576be5..bfa3913 100644
--- a/gdb/ada-exp.y
+++ b/gdb/ada-exp.y
@@ -1287,12 +1287,12 @@ write_var_or_type (struct block *block, struct stoken name0)
 	     FIXME pnh 7/20/2007. */
 	  if (nsyms == 1)
 	    {
-	      struct symbol *renaming =
+	      struct symbol *ren_sym =
 		ada_find_renaming_symbol (SYMBOL_LINKAGE_NAME (syms[0].sym), 
 					  syms[0].block);
 
-	      if (renaming != NULL)
-		syms[0].sym = renaming;
+	      if (ren_sym != NULL)
+		syms[0].sym = ren_sym;
 	    }
 
 	  type_sym = select_possible_type_sym (syms, nsyms);
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 1dabd0f..39ec8ff 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -1421,18 +1421,18 @@ is_thin_pntr (struct type *type)
 static struct type *
 thin_descriptor_type (struct type *type)
 {
-  struct type *base_type = desc_base_type (type);
+  struct type *btype = desc_base_type (type);
 
-  if (base_type == NULL)
+  if (btype == NULL)
     return NULL;
-  if (is_suffix (ada_type_name (base_type), "___XVE"))
-    return base_type;
+  if (is_suffix (ada_type_name (btype), "___XVE"))
+    return btype;
   else
     {
-      struct type *alt_type = ada_find_parallel_type (base_type, "___XVE");
+      struct type *alt_type = ada_find_parallel_type (btype, "___XVE");
 
       if (alt_type == NULL)
-        return base_type;
+        return btype;
       else
         return alt_type;
     }
@@ -4321,19 +4321,19 @@ ada_lookup_simple_minsym (const char *name)
 {
   struct objfile *objfile;
   struct minimal_symbol *msymbol;
-  int wild_match;
+  int wild_mode_flag;
 
   if (strncmp (name, "standard__", sizeof ("standard__") - 1) == 0)
     {
       name += sizeof ("standard__") - 1;
-      wild_match = 0;
+      wild_mode_flag = 0;
     }
   else
-    wild_match = (strstr (name, "__") == NULL);
+    wild_mode_flag = (strstr (name, "__") == NULL);
 
   ALL_MSYMBOLS (objfile, msymbol)
   {
-    if (match_name (SYMBOL_LINKAGE_NAME (msymbol), name, wild_match)
+    if (match_name (SYMBOL_LINKAGE_NAME (msymbol), name, wild_mode_flag)
         && MSYMBOL_TYPE (msymbol) != mst_solib_trampoline)
       return msymbol;
   }
@@ -4350,7 +4350,7 @@ ada_lookup_simple_minsym (const char *name)
 static void
 add_symbols_from_enclosing_procs (struct obstack *obstackp,
                                   const char *name, domain_enum namespace,
-                                  int wild_match)
+                                  int wild_mode_flag)
 {
 }
 
@@ -4488,7 +4488,7 @@ remove_extra_symbols (struct ada_symbol_info *syms, int nsyms)
   i = 0;
   while (i < nsyms)
     {
-      int remove = 0;
+      int remove_flag = 0;
 
       /* If two symbols have the same name and one of them is a stub type,
          the get rid of the stub.  */
@@ -4503,7 +4503,7 @@ remove_extra_symbols (struct ada_symbol_info *syms, int nsyms)
                   && SYMBOL_LINKAGE_NAME (syms[j].sym) != NULL
                   && strcmp (SYMBOL_LINKAGE_NAME (syms[i].sym),
                              SYMBOL_LINKAGE_NAME (syms[j].sym)) == 0)
-                remove = 1;
+                remove_flag = 1;
             }
         }
 
@@ -4523,11 +4523,11 @@ remove_extra_symbols (struct ada_symbol_info *syms, int nsyms)
                   && SYMBOL_CLASS (syms[i].sym) == SYMBOL_CLASS (syms[j].sym)
                   && SYMBOL_VALUE_ADDRESS (syms[i].sym)
                   == SYMBOL_VALUE_ADDRESS (syms[j].sym))
-                remove = 1;
+                remove_flag = 1;
             }
         }
       
-      if (remove)
+      if (remove_flag)
         {
           for (j = i + 1; j < nsyms; j += 1)
             syms[j - 1] = syms[j];
@@ -4793,14 +4793,14 @@ remove_irrelevant_renamings (struct ada_symbol_info *syms,
 static void
 ada_add_local_symbols (struct obstack *obstackp, const char *name,
                        struct block *block, domain_enum domain,
-                       int wild_match)
+                       int wild_mode_flag)
 {
   int block_depth = 0;
 
   while (block != NULL)
     {
       block_depth += 1;
-      ada_add_block_symbols (obstackp, block, name, domain, NULL, wild_match);
+      ada_add_block_symbols (obstackp, block, name, domain, NULL, wild_mode_flag);
 
       /* If we found a non-function match, assume that's the one.  */
       if (is_nonfunction (defns_collected (obstackp, 0),
@@ -4813,7 +4813,7 @@ ada_add_local_symbols (struct obstack *obstackp, const char *name,
   /* If no luck so far, try to find NAME as a local symbol in some lexically
      enclosing subprogram.  */
   if (num_defns_collected (obstackp) == 0 && block_depth > 2)
-    add_symbols_from_enclosing_procs (obstackp, name, domain, wild_match);
+    add_symbols_from_enclosing_procs (obstackp, name, domain, wild_mode_flag);
 }
 
 /* An object of this type is used as the user_data argument when
@@ -4973,7 +4973,7 @@ ada_lookup_symbol_list (const char *name0, const struct block *block0,
   struct symbol *sym;
   struct block *block;
   const char *name;
-  int wild_match;
+  int wild_mode_flag;
   int cacheIfUnique;
   int ndefns;
 
@@ -4984,7 +4984,7 @@ ada_lookup_symbol_list (const char *name0, const struct block *block0,
 
   /* Search specified block and its superiors.  */
 
-  wild_match = (strstr (name0, "__") == NULL);
+  wild_mode_flag = (strstr (name0, "__") == NULL);
   name = name0;
   block = (struct block *) block0;      /* FIXME: No cast ought to be
                                            needed, but adding const will
@@ -4999,7 +4999,7 @@ ada_lookup_symbol_list (const char *name0, const struct block *block0,
      entity inside its program).  */
   if (strncmp (name0, "standard__", sizeof ("standard__") - 1) == 0)
     {
-      wild_match = 0;
+      wild_mode_flag = 0;
       block = NULL;
       name = name0 + sizeof ("standard__") - 1;
     }
@@ -5007,7 +5007,7 @@ ada_lookup_symbol_list (const char *name0, const struct block *block0,
   /* Check the non-global symbols.  If we have ANY match, then we're done.  */
 
   ada_add_local_symbols (&symbol_list_obstack, name, block, namespace,
-                         wild_match);
+                         wild_mode_flag);
   if (num_defns_collected (&symbol_list_obstack) > 0)
     goto done;
 
@@ -5026,14 +5026,14 @@ ada_lookup_symbol_list (const char *name0, const struct block *block0,
   /* Search symbols from all global blocks.  */
  
   add_nonlocal_symbols (&symbol_list_obstack, name, namespace, 1,
-			wild_match);
+			wild_mode_flag);
 
   /* Now add symbols from all per-file blocks if we've gotten no hits
      (not strictly correct, but perhaps better than an error).  */
 
   if (num_defns_collected (&symbol_list_obstack) == 0)
     add_nonlocal_symbols (&symbol_list_obstack, name, namespace, 0,
-			  wild_match);
+			  wild_mode_flag);
 
 done:
   ndefns = num_defns_collected (&symbol_list_obstack);
@@ -5054,7 +5054,7 @@ done:
 
 struct symbol *
 ada_lookup_encoded_symbol (const char *name, const struct block *block0,
-			   domain_enum namespace, struct block **block_found)
+			   domain_enum namespace, struct block **found_block)
 {
   struct ada_symbol_info *candidates;
   int n_candidates;
@@ -5064,8 +5064,8 @@ ada_lookup_encoded_symbol (const char *name, const struct block *block0,
   if (n_candidates == 0)
     return NULL;
 
-  if (block_found != NULL)
-    *block_found = candidates[0].block;
+  if (found_block != NULL)
+    *found_block = candidates[0].block;
 
   return fixup_symbol_section (candidates[0].sym, NULL);
 }  
@@ -5488,7 +5488,7 @@ ada_add_block_symbols (struct obstack *obstackp,
 static const char *
 symbol_completion_match (const char *sym_name,
                          const char *text, int text_len,
-                         int wild_match, int encoded)
+                         int wild_mode_flag, int encoded)
 {
   const int verbatim_match = (text[0] == '<');
   int match = 0;
@@ -5536,7 +5536,7 @@ symbol_completion_match (const char *sym_name,
 
   /* Second: Try wild matching...  */
 
-  if (!match && wild_match)
+  if (!match && wild_mode_flag)
     {
       /* Since we are doing wild matching, this means that TEXT
          may represent an unqualified symbol name.  We therefore must
@@ -5573,7 +5573,7 @@ DEF_VEC_P (char_ptr);
    completion should be performed.  These two parameters are used to
    determine which part of the symbol name should be added to the
    completion vector.
-   if WILD_MATCH is set, then wild matching is performed.
+   if WILD_MODE_FLAG is set, then wild matching is performed.
    ENCODED should be set if TEXT represents a symbol name in its
    encoded formed (in which case the completion should also be
    encoded).  */
@@ -5583,10 +5583,10 @@ symbol_completion_add (VEC(char_ptr) **sv,
                        const char *sym_name,
                        const char *text, int text_len,
                        const char *orig_text, const char *word,
-                       int wild_match, int encoded)
+                       int wild_mode_flag, int encoded)
 {
   const char *match = symbol_completion_match (sym_name, text, text_len,
-                                               wild_match, encoded);
+                                               wild_mode_flag, encoded);
   char *completion;
 
   if (match == NULL)
@@ -5637,8 +5637,10 @@ ada_expand_partial_symbol_name (const char *name, void *user_data)
 {
   struct add_partial_datum *data = user_data;
   
-  return symbol_completion_match (name, data->text, data->text_len,
-                                  data->wild_match, data->encoded) != NULL;
+  const int match = symbol_completion_match (name, data->text, data->text_len,
+                                             data->wild_match, data->encoded) != NULL;
+
+  return match;
 }
 
 /* Return a list of possible symbol names completing TEXT0.  The list
@@ -5650,7 +5652,7 @@ ada_make_symbol_completion_list (char *text0, char *word)
 {
   char *text;
   int text_len;
-  int wild_match;
+  int wild_mode_flag;
   int encoded;
   VEC(char_ptr) *completions = VEC_alloc (char_ptr, 128);
   struct symbol *sym;
@@ -5666,7 +5668,7 @@ ada_make_symbol_completion_list (char *text0, char *word)
       text = xstrdup (text0);
       make_cleanup (xfree, text);
       text_len = strlen (text);
-      wild_match = 0;
+      wild_mode_flag = 0;
       encoded = 1;
     }
   else
@@ -5682,7 +5684,7 @@ ada_make_symbol_completion_list (char *text0, char *word)
          qualified entity name, and the match must not be done in wild
          mode.  Similarly, if the user wants to complete what looks like
          an encoded name, the match must not be done in wild mode.  */
-      wild_match = (strchr (text0, '.') == NULL && !encoded);
+      wild_mode_flag = (strchr (text0, '.') == NULL && !encoded);
     }
 
   /* First, look at the partial symtab symbols.  */
@@ -5694,7 +5696,7 @@ ada_make_symbol_completion_list (char *text0, char *word)
     data.text_len = text_len;
     data.text0 = text0;
     data.word = word;
-    data.wild_match = wild_match;
+    data.wild_match = wild_mode_flag;
     data.encoded = encoded;
     expand_partial_symbol_names (ada_expand_partial_symbol_name, &data);
   }
@@ -5708,7 +5710,7 @@ ada_make_symbol_completion_list (char *text0, char *word)
   {
     QUIT;
     symbol_completion_add (&completions, SYMBOL_LINKAGE_NAME (msymbol),
-                           text, text_len, text0, word, wild_match, encoded);
+                           text, text_len, text0, word, wild_mode_flag, encoded);
   }
 
   /* Search upwards from currently selected frame (so that we can
@@ -5723,7 +5725,7 @@ ada_make_symbol_completion_list (char *text0, char *word)
       {
         symbol_completion_add (&completions, SYMBOL_LINKAGE_NAME (sym),
                                text, text_len, text0, word,
-                               wild_match, encoded);
+                               wild_mode_flag, encoded);
       }
     }
 
@@ -5738,7 +5740,7 @@ ada_make_symbol_completion_list (char *text0, char *word)
     {
       symbol_completion_add (&completions, SYMBOL_LINKAGE_NAME (sym),
                              text, text_len, text0, word,
-                             wild_match, encoded);
+                             wild_mode_flag, encoded);
     }
   }
 
@@ -5753,7 +5755,7 @@ ada_make_symbol_completion_list (char *text0, char *word)
     {
       symbol_completion_add (&completions, SYMBOL_LINKAGE_NAME (sym),
                              text, text_len, text0, word,
-                             wild_match, encoded);
+                             wild_mode_flag, encoded);
     }
   }
 
@@ -6450,10 +6452,10 @@ static struct value *ada_index_struct_field_1 (int *, struct value *,
  * If found, return value, else return NULL.  */
 
 static struct value *
-ada_index_struct_field (int index, struct value *arg, int offset,
+ada_index_struct_field (int idx, struct value *arg, int offset,
 			struct type *type)
 {
-  return ada_index_struct_field_1 (&index, arg, offset, type);
+  return ada_index_struct_field_1 (&idx, arg, offset, type);
 }
 
 
@@ -6953,7 +6955,7 @@ static struct symbol *
 find_old_style_renaming_symbol (const char *name, struct block *block)
 {
   const struct symbol *function_sym = block_linkage_function (block);
-  char *rename;
+  char *symname;
 
   if (function_sym != NULL)
     {
@@ -6987,20 +6989,20 @@ find_old_style_renaming_symbol (const char *name, struct block *block)
 	  function_name_len -= 5;
         }
 
-      rename = (char *) alloca (rename_len * sizeof (char));
-      strncpy (rename, function_name, function_name_len);
-      xsnprintf (rename + function_name_len, rename_len - function_name_len,
+      symname = (char *) alloca (rename_len * sizeof (char));
+      strncpy (symname, function_name, function_name_len);
+      xsnprintf (symname + function_name_len, rename_len - function_name_len,
 		 "__%s___XR", name);
     }
   else
     {
       const int rename_len = strlen (name) + 6;
 
-      rename = (char *) alloca (rename_len * sizeof (char));
-      xsnprintf (rename, rename_len * sizeof (char), "%s___XR", name);
+      symname = (char *) alloca (rename_len * sizeof (char));
+      xsnprintf (symname, rename_len * sizeof (char), "%s___XR", name);
     }
 
-  return ada_find_any_symbol (rename);
+  return ada_find_any_symbol (symname);
 }
 
 /* Because of GNAT encoding conventions, several GDB symbols may match a
@@ -8611,7 +8613,7 @@ num_component_specs (struct expression *exp, int pc)
    LHS == CONTAINER).  */
 
 static void
-assign_component (struct value *container, struct value *lhs, LONGEST index,
+assign_component (struct value *container, struct value *lhs, LONGEST idx,
 		  struct expression *exp, int *pos)
 {
   struct value *mark = value_mark ();
@@ -8620,13 +8622,13 @@ assign_component (struct value *container, struct value *lhs, LONGEST index,
   if (TYPE_CODE (value_type (lhs)) == TYPE_CODE_ARRAY)
     {
       struct type *index_type = builtin_type (exp->gdbarch)->builtin_int;
-      struct value *index_val = value_from_longest (index_type, index);
+      struct value *index_val = value_from_longest (index_type, idx);
 
       elt = unwrap_value (ada_value_subscript (lhs, 1, &index_val));
     }
   else
     {
-      elt = ada_index_struct_field (index, lhs, 0, value_type (lhs));
+      elt = ada_index_struct_field (idx, lhs, 0, value_type (lhs));
       elt = ada_to_fixed_value (unwrap_value (elt));
     }
 
@@ -8665,8 +8667,6 @@ assign_aggregate (struct value *container,
   *pos += 3;
   if (noside != EVAL_NORMAL)
     {
-      int i;
-
       for (i = 0; i < n; i += 1)
 	ada_evaluate_subexp (NULL, exp, pos, noside);
       return container;
@@ -8707,26 +8707,26 @@ assign_aggregate (struct value *container,
   for (i = 0; i < n; i += 1)
     {
       switch (exp->elts[*pos].opcode)
-	{
-	case OP_CHOICES:
-	  aggregate_assign_from_choices (container, lhs, exp, pos, indices, 
-					 &num_indices, max_indices,
-					 low_index, high_index);
-	  break;
-	case OP_POSITIONAL:
-	  aggregate_assign_positional (container, lhs, exp, pos, indices,
-				       &num_indices, max_indices,
-				       low_index, high_index);
-	  break;
-	case OP_OTHERS:
-	  if (i != n-1)
-	    error (_("Misplaced 'others' clause"));
-	  aggregate_assign_others (container, lhs, exp, pos, indices, 
-				   num_indices, low_index, high_index);
-	  break;
-	default:
-	  error (_("Internal error: bad aggregate clause"));
-	}
+        {
+        case OP_CHOICES:
+          aggregate_assign_from_choices (container, lhs, exp, pos, indices, 
+                                         &num_indices, max_indices,
+                                         low_index, high_index);
+          break;
+        case OP_POSITIONAL:
+          aggregate_assign_positional (container, lhs, exp, pos, indices,
+                                       &num_indices, max_indices,
+                                       low_index, high_index);
+          break;
+        case OP_OTHERS:
+          if (i != n-1)
+            error (_("Misplaced 'others' clause"));
+          aggregate_assign_others (container, lhs, exp, pos, indices, 
+                                   num_indices, low_index, high_index);
+          break;
+        default:
+          error (_("Internal error: bad aggregate clause"));
+        }
     }
 
   return container;
@@ -10345,16 +10345,16 @@ static struct type *
 to_fixed_range_type (struct type *raw_type, struct value *dval)
 {
   char *name;
-  struct type *base_type;
+  struct type *btype;
   char *subtype_info;
 
   gdb_assert (raw_type != NULL);
   gdb_assert (TYPE_NAME (raw_type) != NULL);
 
   if (TYPE_CODE (raw_type) == TYPE_CODE_RANGE)
-    base_type = TYPE_TARGET_TYPE (raw_type);
+    btype = TYPE_TARGET_TYPE (raw_type);
   else
-    base_type = raw_type;
+    btype = raw_type;
 
   name = TYPE_NAME (raw_type);
   subtype_info = strstr (name, "___XD");
@@ -10431,7 +10431,7 @@ to_fixed_range_type (struct type *raw_type, struct value *dval)
             }
         }
 
-      type = create_range_type (alloc_type_copy (raw_type), base_type, L, U);
+      type = create_range_type (alloc_type_copy (raw_type), btype, L, U);
       TYPE_NAME (type) = name;
       return type;
     }
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
index 8a72b9e..bbea5ed 100644
--- a/gdb/ada-valprint.c
+++ b/gdb/ada-valprint.c
@@ -673,10 +673,10 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr,
 		 const struct value *original_value,
 		 const struct value_print_options *options)
 {
-  unsigned int len;
+  /* unsigned int len; */
   int i;
   struct type *elttype;
-  LONGEST val;
+  /* LONGEST val; */
   int offset_aligned;
 
   type = ada_check_typedef (type);
@@ -822,37 +822,40 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr,
 	}
 
     case TYPE_CODE_ENUM:
-      if (options->format)
-	{
-	  val_print_scalar_formatted (type, valaddr, offset_aligned,
-				      original_value, options, 0, stream);
-	  break;
-	}
-      len = TYPE_NFIELDS (type);
-      val = unpack_long (type, valaddr + offset_aligned);
-      for (i = 0; i < len; i++)
-	{
-	  QUIT;
-	  if (val == TYPE_FIELD_BITPOS (type, i))
-	    {
-	      break;
-	    }
-	}
-      if (i < len)
-	{
-	  const char *name = ada_enum_name (TYPE_FIELD_NAME (type, i));
-
-	  if (name[0] == '\'')
-	    fprintf_filtered (stream, "%ld %s", (long) val, name);
-	  else
-	    fputs_filtered (name, stream);
-	}
-      else
-	{
-	  print_longest (stream, 'd', 0, val);
-	}
-      break;
-
+      {
+        const unsigned int len = TYPE_NFIELDS (type);
+        const LONGEST val      = unpack_long (type, valaddr + offset_aligned);
+
+
+        if (options->format)
+          {
+            val_print_scalar_formatted (type, valaddr, offset_aligned,
+                                        original_value, options, 0, stream);
+            break;
+          }
+        for (i = 0; i < len; i++)
+          {
+            QUIT;
+            if (val == TYPE_FIELD_BITPOS (type, i))
+              {
+                break;
+              }
+          }
+        if (i < len)
+          {
+            const char *name = ada_enum_name (TYPE_FIELD_NAME (type, i));
+
+            if (name[0] == '\'')
+              fprintf_filtered (stream, "%ld %s", (long) val, name);
+            else
+              fputs_filtered (name, stream);
+          }
+        else
+          {
+            print_longest (stream, 'd', 0, val);
+          }
+        break;
+      }
     case TYPE_CODE_FLAGS:
       if (options->format)
 	val_print_scalar_formatted (type, valaddr, offset_aligned,
@@ -912,7 +915,7 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr,
           deref_val_int = unpack_pointer (type, valaddr + offset_aligned);
           if (deref_val_int != 0)
             {
-              struct value *deref_val =
+              deref_val =
                 ada_value_ind (value_from_pointer
                                (lookup_pointer_type (elttype),
                                 deref_val_int));
diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
index 0119838..84b58a0 100644
--- a/gdb/amd64-linux-tdep.c
+++ b/gdb/amd64-linux-tdep.c
@@ -339,9 +339,9 @@ amd64_all_but_ip_registers_record (struct regcache *regcache)
    process record.  */
 
 static enum gdb_syscall
-amd64_canonicalize_syscall (enum amd64_syscall syscall)
+amd64_canonicalize_syscall (enum amd64_syscall syscall_number)
 {
-  switch (syscall) {
+  switch (syscall_number) {
   case amd64_sys_read:
     return gdb_sys_read;
 
diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
index b85f255..bd370f7 100644
--- a/gdb/amd64-tdep.c
+++ b/gdb/amd64-tdep.c
@@ -878,10 +878,11 @@ amd64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
   /* Pass "hidden" argument".  */
   if (struct_return)
     {
-      struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
       /* The "hidden" argument is passed throught the first argument
          register.  */
-      const int arg_regnum = tdep->call_dummy_integer_regs[0];
+      
+      const int arg_regnum = 
+        gdbarch_tdep (gdbarch)->call_dummy_integer_regs[0];
 
       store_unsigned_integer (buf, 8, byte_order, struct_addr);
       regcache_cooked_write (regcache, arg_regnum, buf);
@@ -1082,9 +1083,9 @@ amd64_get_unused_input_int_reg (const struct amd64_insn *details)
       if (have_sib)
 	{
 	  int base = SIB_BASE_FIELD (details->raw_insn[details->modrm_offset + 1]);
-	  int index = SIB_INDEX_FIELD (details->raw_insn[details->modrm_offset + 1]);
+	  int idx = SIB_INDEX_FIELD (details->raw_insn[details->modrm_offset + 1]);
 	  used_regs_mask |= 1 << base;
-	  used_regs_mask |= 1 << index;
+	  used_regs_mask |= 1 << idx;
 	}
       else
 	{
diff --git a/gdb/annotate.c b/gdb/annotate.c
index 2f0769a..93c65a1 100644
--- a/gdb/annotate.c
+++ b/gdb/annotate.c
@@ -522,11 +522,11 @@ annotate_frame_end (void)
 }
 
 void
-annotate_array_section_begin (int index, struct type *elttype)
+annotate_array_section_begin (int idx, struct type *elttype)
 {
   if (annotation_level == 2)
     {
-      printf_filtered (("\n\032\032array-section-begin %d "), index);
+      printf_filtered (("\n\032\032array-section-begin %d "), idx);
       print_value_flags (elttype);
       printf_filtered (("\n"));
     }
diff --git a/gdb/bcache.c b/gdb/bcache.c
index 76e3893..f9c31e0 100644
--- a/gdb/bcache.c
+++ b/gdb/bcache.c
@@ -130,7 +130,7 @@ hash_continue (const void *addr, int length, unsigned long h)
 #define CHAIN_LENGTH_THRESHOLD (5)
 
 static void
-expand_hash_table (struct bcache *bcache)
+expand_hash_table (struct bcache *cahce)
 {
   /* A table of good hash table sizes.  Whenever we grow, we pick the
      next larger size from this table.  sizes[i] is close to 1 << (i+10),
@@ -149,13 +149,13 @@ expand_hash_table (struct bcache *bcache)
 
   /* Count the stats.  Every unique item needs to be re-hashed and
      re-entered.  */
-  bcache->expand_count++;
-  bcache->expand_hash_count += bcache->unique_count;
+  cahce->expand_count++;
+  cahce->expand_hash_count += cahce->unique_count;
 
   /* Find the next size.  */
-  new_num_buckets = bcache->num_buckets * 2;
+  new_num_buckets = cahce->num_buckets * 2;
   for (i = 0; i < (sizeof (sizes) / sizeof (sizes[0])); i++)
-    if (sizes[i] > bcache->num_buckets)
+    if (sizes[i] > cahce->num_buckets)
       {
 	new_num_buckets = sizes[i];
 	break;
@@ -168,22 +168,22 @@ expand_hash_table (struct bcache *bcache)
     new_buckets = (struct bstring **) xmalloc (new_size);
     memset (new_buckets, 0, new_size);
 
-    bcache->structure_size -= (bcache->num_buckets
-			       * sizeof (bcache->bucket[0]));
-    bcache->structure_size += new_size;
+    cahce->structure_size -= (cahce->num_buckets
+			       * sizeof (cahce->bucket[0]));
+    cahce->structure_size += new_size;
   }
 
   /* Rehash all existing strings.  */
-  for (i = 0; i < bcache->num_buckets; i++)
+  for (i = 0; i < cahce->num_buckets; i++)
     {
       struct bstring *s, *next;
 
-      for (s = bcache->bucket[i]; s; s = next)
+      for (s = cahce->bucket[i]; s; s = next)
 	{
 	  struct bstring **new_bucket;
 	  next = s->next;
 
-	  new_bucket = &new_buckets[(bcache->hash_function (&s->d.data,
+	  new_bucket = &new_buckets[(cahce->hash_function (&s->d.data,
 							    s->length)
 				     % new_num_buckets)];
 	  s->next = *new_bucket;
@@ -192,10 +192,10 @@ expand_hash_table (struct bcache *bcache)
     }
 
   /* Plug in the new table.  */
-  if (bcache->bucket)
-    xfree (bcache->bucket);
-  bcache->bucket = new_buckets;
-  bcache->num_buckets = new_num_buckets;
+  if (cahce->bucket)
+    xfree (cahce->bucket);
+  cahce->bucket = new_buckets;
+  cahce->num_buckets = new_num_buckets;
 }
 
 
@@ -209,9 +209,9 @@ expand_hash_table (struct bcache *bcache)
    never seen those bytes before, add a copy of them to BCACHE.  In
    either case, return a pointer to BCACHE's copy of that string.  */
 const void *
-bcache (const void *addr, int length, struct bcache *bcache)
+bcache (const void *addr, int length, struct bcache *cahce)
 {
-  return bcache_full (addr, length, bcache, NULL);
+  return bcache_full (addr, length, cahce, NULL);
 }
 
 /* Find a copy of the LENGTH bytes at ADDR in BCACHE.  If BCACHE has
@@ -221,7 +221,7 @@ bcache (const void *addr, int length, struct bcache *bcache)
    returning an old entry.  */
 
 const void *
-bcache_full (const void *addr, int length, struct bcache *bcache, int *added)
+bcache_full (const void *addr, int length, struct bcache *cahce, int *added)
 {
   unsigned long full_hash;
   unsigned short half_hash;
@@ -233,55 +233,55 @@ bcache_full (const void *addr, int length, struct bcache *bcache, int *added)
 
   /* Lazily initialize the obstack.  This can save quite a bit of
      memory in some cases.  */
-  if (bcache->total_count == 0)
+  if (cahce->total_count == 0)
     {
       /* We could use obstack_specify_allocation here instead, but
 	 gdb_obstack.h specifies the allocation/deallocation
 	 functions.  */
-      obstack_init (&bcache->cache);
+      obstack_init (&cahce->cache);
     }
 
   /* If our average chain length is too high, expand the hash table.  */
-  if (bcache->unique_count >= bcache->num_buckets * CHAIN_LENGTH_THRESHOLD)
-    expand_hash_table (bcache);
+  if (cahce->unique_count >= cahce->num_buckets * CHAIN_LENGTH_THRESHOLD)
+    expand_hash_table (cahce);
 
-  bcache->total_count++;
-  bcache->total_size += length;
+  cahce->total_count++;
+  cahce->total_size += length;
 
-  full_hash = bcache->hash_function (addr, length);
+  full_hash = cahce->hash_function (addr, length);
 
   half_hash = (full_hash >> 16);
-  hash_index = full_hash % bcache->num_buckets;
+  hash_index = full_hash % cahce->num_buckets;
 
   /* Search the hash bucket for a string identical to the caller's.
      As a short-circuit first compare the upper part of each hash
      values.  */
-  for (s = bcache->bucket[hash_index]; s; s = s->next)
+  for (s = cahce->bucket[hash_index]; s; s = s->next)
     {
       if (s->half_hash == half_hash)
 	{
 	  if (s->length == length
-	      && bcache->compare_function (&s->d.data, addr, length))
+	      && cahce->compare_function (&s->d.data, addr, length))
 	    return &s->d.data;
 	  else
-	    bcache->half_hash_miss_count++;
+	    cahce->half_hash_miss_count++;
 	}
     }
 
   /* The user's string isn't in the list.  Insert it after *ps.  */
   {
     struct bstring *new
-      = obstack_alloc (&bcache->cache, BSTRING_SIZE (length));
+      = obstack_alloc (&cahce->cache, BSTRING_SIZE (length));
 
     memcpy (&new->d.data, addr, length);
     new->length = length;
-    new->next = bcache->bucket[hash_index];
+    new->next = cahce->bucket[hash_index];
     new->half_hash = half_hash;
-    bcache->bucket[hash_index] = new;
+    cahce->bucket[hash_index] = new;
 
-    bcache->unique_count++;
-    bcache->unique_size += length;
-    bcache->structure_size += BSTRING_SIZE (length);
+    cahce->unique_count++;
+    cahce->unique_size += length;
+    cahce->structure_size += BSTRING_SIZE (length);
 
     if (added)
       *added = 1;
@@ -330,15 +330,15 @@ bcache_xmalloc (unsigned long (*hash_function)(const void *, int length),
 
 /* Free all the storage associated with BCACHE.  */
 void
-bcache_xfree (struct bcache *bcache)
+bcache_xfree (struct bcache *cahce)
 {
-  if (bcache == NULL)
+  if (cahce == NULL)
     return;
   /* Only free the obstack if we actually initialized it.  */
-  if (bcache->total_count > 0)
-    obstack_free (&bcache->cache, 0);
-  xfree (bcache->bucket);
-  xfree (bcache);
+  if (cahce->total_count > 0)
+    obstack_free (&cahce->cache, 0);
+  xfree (cahce->bucket);
+  xfree (cahce);
 }
 
 
@@ -488,9 +488,9 @@ Total memory used by bcache, including overhead: %ld\n"),
 }
 
 int
-bcache_memory_used (struct bcache *bcache)
+bcache_memory_used (struct bcache *cahce)
 {
-  if (bcache->total_count == 0)
+  if (cahce->total_count == 0)
     return 0;
-  return obstack_memory_used (&bcache->cache);
+  return obstack_memory_used (&cahce->cache);
 }
diff --git a/gdb/bfd-target.c b/gdb/bfd-target.c
index cfeb0b1..d1c8caf 100644
--- a/gdb/bfd-target.c
+++ b/gdb/bfd-target.c
@@ -78,14 +78,14 @@ target_bfd_xclose (struct target_ops *t, int quitting)
 }
 
 struct target_ops *
-target_bfd_reopen (struct bfd *bfd)
+target_bfd_reopen (struct bfd *binary_descr)
 {
   struct target_ops *t;
   struct target_bfd_data *data;
 
   data = XZALLOC (struct target_bfd_data);
-  data->bfd = bfd;
-  build_section_table (bfd, &data->table.sections, &data->table.sections_end);
+  data->bfd = binary_descr;
+  build_section_table (binary_descr, &data->table.sections, &data->table.sections_end);
 
   t = XZALLOC (struct target_ops);
   t->to_shortname = "bfd";
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index ba1b08f..1d82efc 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -1953,7 +1953,7 @@ insert_breakpoint_locations (void)
 {
   struct breakpoint *bpt;
   struct bp_location *bl, **blp_tmp;
-  int error = 0;
+  int error_flag = 0;
   int val = 0;
   int disabled_breaks = 0;
   int hw_breakpoint_error = 0;
@@ -1992,7 +1992,7 @@ insert_breakpoint_locations (void)
       val = insert_bp_location (bl, tmp_error_stream, &disabled_breaks,
 				    &hw_breakpoint_error);
       if (val)
-	error = val;
+	error_flag = val;
     }
 
   /* If we failed to insert all locations of a watchpoint, remove
@@ -2027,11 +2027,11 @@ insert_breakpoint_locations (void)
 	  fprintf_unfiltered (tmp_error_stream,
 			      "Could not insert hardware watchpoint %d.\n", 
 			      bpt->number);
-	  error = -1;
+	  error_flag = -1;
 	}
     }
 
-  if (error)
+  if (error_flag)
     {
       /* If a hardware breakpoint or watchpoint was inserted, add a
          message about possibly exhausted resources.  */
@@ -7151,7 +7151,7 @@ bp_loc_is_permanent (struct bp_location *loc)
 {
   int len;
   CORE_ADDR addr;
-  const gdb_byte *brk;
+  const gdb_byte *bpoint;
   gdb_byte *target_mem;
   struct cleanup *cleanup;
   int retval = 0;
@@ -7159,10 +7159,10 @@ bp_loc_is_permanent (struct bp_location *loc)
   gdb_assert (loc != NULL);
 
   addr = loc->address;
-  brk = gdbarch_breakpoint_from_pc (loc->gdbarch, &addr, &len);
+  bpoint = gdbarch_breakpoint_from_pc (loc->gdbarch, &addr, &len);
 
   /* Software breakpoints unsupported?  */
-  if (brk == NULL)
+  if (bpoint == NULL)
     return 0;
 
   target_mem = alloca (len);
@@ -7176,7 +7176,7 @@ bp_loc_is_permanent (struct bp_location *loc)
   make_show_memory_breakpoints_cleanup (0);
 
   if (target_read_memory (loc->address, target_mem, len) == 0
-      && memcmp (target_mem, brk, len) == 0)
+      && memcmp (target_mem, bpoint, len) == 0)
     retval = 1;
 
   do_cleanups (cleanup);
@@ -7203,8 +7203,10 @@ init_breakpoint_sal (struct breakpoint *b, struct gdbarch *gdbarch,
 
   if (type == bp_hardware_breakpoint)
     {
-      int i = hw_breakpoint_used_count ();
-      int target_resources_ok = 
+      int target_resources_ok;
+
+      i = hw_breakpoint_used_count ();
+      target_resources_ok = 
 	target_can_use_hardware_watchpoint (bp_hardware_breakpoint, 
 					    i + 1, 0);
       if (target_resources_ok == 0)
@@ -7254,7 +7256,6 @@ init_breakpoint_sal (struct breakpoint *b, struct gdbarch *gdbarch,
 		  char *p = &addr_string[3];
 		  char *endp;
 		  char *marker_str;
-		  int i;
 
 		  p = skip_spaces (p);
 
@@ -7784,7 +7785,7 @@ create_breakpoint (struct gdbarch *gdbarch,
 		   int parse_condition_and_thread,
 		   int tempflag, enum bptype type_wanted,
 		   int ignore_count,
-		   enum auto_boolean pending_break_support,
+		   enum auto_boolean pending_break_support_type,
 		   const struct breakpoint_ops *ops,
 		   int from_tty, int enabled, int internal)
 {
@@ -7809,7 +7810,7 @@ create_breakpoint (struct gdbarch *gdbarch,
 
   if (type_wanted == bp_static_tracepoint && is_marker_spec (arg))
     {
-      int i;
+
 
       sals = decode_static_tracepoint_spec (&arg);
 
@@ -7838,14 +7839,14 @@ create_breakpoint (struct gdbarch *gdbarch,
 	  /* If pending breakpoint support is turned off, throw
 	     error.  */
 
-	  if (pending_break_support == AUTO_BOOLEAN_FALSE)
+	  if (pending_break_support_type == AUTO_BOOLEAN_FALSE)
 	    throw_exception (e);
 
 	  exception_print (gdb_stderr, e);
 
           /* If pending breakpoint support is auto query and the user
 	     selects no, then simply return the error code.  */
-	  if (pending_break_support == AUTO_BOOLEAN_AUTO
+	  if (pending_break_support_type == AUTO_BOOLEAN_AUTO
 	      && !nquery (_("Make breakpoint pending on "
 			    "future shared library load? ")))
 	    return 0;
@@ -7944,18 +7945,17 @@ create_breakpoint (struct gdbarch *gdbarch,
       if (type_wanted == bp_static_tracepoint
 	  && is_marker_spec (canonical.canonical[0]))
 	{
-	  int i;
 
 	  for (i = 0; i < sals.nelts; ++i)
 	    {
 	      struct symtabs_and_lines expanded;
 	      struct tracepoint *tp;
-	      struct cleanup *old_chain;
+	      struct cleanup *old_chain_cleanup;
 
 	      expanded.nelts = 1;
 	      expanded.sals = xmalloc (sizeof (struct symtab_and_line));
 	      expanded.sals[0] = sals.sals[i];
-	      old_chain = make_cleanup (xfree, expanded.sals);
+	      old_chain_cleanup = make_cleanup (xfree, expanded.sals);
 
 	      tp = XCNEW (struct tracepoint);
 	      init_breakpoint_sal (&tp->base, gdbarch, expanded,
@@ -7975,7 +7975,7 @@ create_breakpoint (struct gdbarch *gdbarch,
 
 	      install_breakpoint (internal, &tp->base);
 
-	      do_cleanups (old_chain);
+	      do_cleanups (old_chain_cleanup);
 	    }
 	}
       else
@@ -9187,17 +9187,17 @@ watch_command_1 (char *arg, int accessflag, int from_tty,
 	      /* We've found a "mask" token, which means the user wants to
 		 create a hardware watchpoint that is going to have the mask
 		 facility.  */
-	      struct value *mask_value, *mark;
+	      struct value *mask_value, *mark_value;
 
 	      if (use_mask)
 		error(_("You can specify only one mask."));
 
 	      use_mask = just_location = 1;
 
-	      mark = value_mark ();
+	      mark_value = value_mark ();
 	      mask_value = parse_to_comma_and_eval (&value_start);
 	      mask = value_as_address (mask_value);
-	      value_free_to_mark (mark);
+	      value_free_to_mark (mark_value);
 	    }
 	  else
 	    /* We didn't recognize what we found.  We should stop here.  */
@@ -10621,29 +10621,29 @@ update_global_location_list (int should_insert)
     {
       /* ALL_BP_LOCATIONS bp_location has LOC->OWNER always
 	 non-NULL.  */
-      struct breakpoint *b = loc->owner;
+      struct breakpoint *bp = loc->owner;
       struct bp_location **loc_first_p;
 
-      if (b->enable_state == bp_disabled
-	  || b->enable_state == bp_call_disabled
-	  || b->enable_state == bp_startup_disabled
+      if (bp->enable_state == bp_disabled
+	  || bp->enable_state == bp_call_disabled
+	  || bp->enable_state == bp_startup_disabled
 	  || !loc->enabled
 	  || loc->shlib_disabled
-	  || !breakpoint_address_is_meaningful (b)
-	  || is_tracepoint (b))
+	  || !breakpoint_address_is_meaningful (bp)
+	  || is_tracepoint (bp))
 	continue;
 
       /* Permanent breakpoint should always be inserted.  */
-      if (b->enable_state == bp_permanent && ! loc->inserted)
+      if (bp->enable_state == bp_permanent && ! loc->inserted)
 	internal_error (__FILE__, __LINE__,
 			_("allegedly permanent breakpoint is not "
 			"actually inserted"));
 
-      if (b->type == bp_hardware_watchpoint)
+      if (bp->type == bp_hardware_watchpoint)
 	loc_first_p = &wp_loc_first;
-      else if (b->type == bp_read_watchpoint)
+      else if (bp->type == bp_read_watchpoint)
 	loc_first_p = &rwp_loc_first;
-      else if (b->type == bp_access_watchpoint)
+      else if (bp->type == bp_access_watchpoint)
 	loc_first_p = &awp_loc_first;
       else
 	loc_first_p = &bp_loc_first;
@@ -10666,7 +10666,7 @@ update_global_location_list (int should_insert)
       loc->duplicate = 1;
 
       if ((*loc_first_p)->owner->enable_state == bp_permanent && loc->inserted
-	  && b->enable_state != bp_permanent)
+	  && bp->enable_state != bp_permanent)
 	internal_error (__FILE__, __LINE__,
 			_("another breakpoint was inserted on top of "
 			"a permanent breakpoint"));
@@ -11588,26 +11588,26 @@ update_static_tracepoint (struct breakpoint *b, struct symtab_and_line sal)
 
       if (!VEC_empty(static_tracepoint_marker_p, markers))
 	{
-	  struct symtab_and_line sal;
+	  struct symtab_and_line las;
 	  struct symbol *sym;
-	  struct static_tracepoint_marker *marker;
+	  struct static_tracepoint_marker *tpmarker;
 	  struct ui_out *uiout = current_uiout;
 
-	  marker = VEC_index (static_tracepoint_marker_p, markers, 0);
+	  tpmarker = VEC_index (static_tracepoint_marker_p, markers, 0);
 
 	  xfree (tp->static_trace_marker_id);
-	  tp->static_trace_marker_id = xstrdup (marker->str_id);
+	  tp->static_trace_marker_id = xstrdup (tpmarker->str_id);
 
 	  warning (_("marker for static tracepoint %d (%s) not "
 		     "found at previous line number"),
 		   b->number, tp->static_trace_marker_id);
 
-	  init_sal (&sal);
+	  init_sal (&las);
 
-	  sal.pc = marker->address;
+	  las.pc = tpmarker->address;
 
-	  sal = find_pc_line (marker->address, 0);
-	  sym = find_pc_sect_function (marker->address, NULL);
+	  las = find_pc_line (tpmarker->address, 0);
+	  sym = find_pc_sect_function (tpmarker->address, NULL);
 	  ui_out_text (uiout, "Now in ");
 	  if (sym)
 	    {
@@ -11615,36 +11615,36 @@ update_static_tracepoint (struct breakpoint *b, struct symtab_and_line sal)
 				   SYMBOL_PRINT_NAME (sym));
 	      ui_out_text (uiout, " at ");
 	    }
-	  ui_out_field_string (uiout, "file", sal.symtab->filename);
+	  ui_out_field_string (uiout, "file", las.symtab->filename);
 	  ui_out_text (uiout, ":");
 
 	  if (ui_out_is_mi_like_p (uiout))
 	    {
-	      char *fullname = symtab_to_fullname (sal.symtab);
+	      char *fullname = symtab_to_fullname (las.symtab);
 
 	      if (fullname)
 		ui_out_field_string (uiout, "fullname", fullname);
 	    }
 
-	  ui_out_field_int (uiout, "line", sal.line);
+	  ui_out_field_int (uiout, "line", las.line);
 	  ui_out_text (uiout, "\n");
 
-	  b->line_number = sal.line;
+	  b->line_number = las.line;
 
 	  xfree (b->source_file);
 	  if (sym)
-	    b->source_file = xstrdup (sal.symtab->filename);
+	    b->source_file = xstrdup (las.symtab->filename);
 	  else
 	    b->source_file = NULL;
 
 	  xfree (b->addr_string);
 	  b->addr_string = xstrprintf ("%s:%d",
-				       sal.symtab->filename, b->line_number);
+				       las.symtab->filename, b->line_number);
 
 	  /* Might be nice to check if function changed, and warn if
 	     so.  */
 
-	  release_static_tracepoint_marker (marker);
+	  release_static_tracepoint_marker (tpmarker);
 	}
     }
   return sal;
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index 31880b8..93e898b 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -103,12 +103,12 @@ static int compare_line_numbers (const void *ln1p, const void *ln2p);
 void
 add_free_pendings (struct pending *list)
 {
-  struct pending *link = list;
+  struct pending *lstlink = list;
 
   if (list)
     {
-      while (link->next) link = link->next;
-      link->next = free_pendings;
+      while (lstlink->next) lstlink = lstlink->next;
+      lstlink->next = free_pendings;
       free_pendings = list;
     }
 }
@@ -121,7 +121,7 @@ add_free_pendings (struct pending *list)
 void
 add_symbol_to_list (struct symbol *symbol, struct pending **listhead)
 {
-  struct pending *link;
+  struct pending *lstlink;
 
   /* If this is an alias for another symbol, don't add it.  */
   if (symbol->ginfo.name && symbol->ginfo.name[0] == '#')
@@ -133,17 +133,17 @@ add_symbol_to_list (struct symbol *symbol, struct pending **listhead)
     {
       if (free_pendings)
 	{
-	  link = free_pendings;
-	  free_pendings = link->next;
+	  lstlink = free_pendings;
+	  free_pendings = lstlink->next;
 	}
       else
 	{
-	  link = (struct pending *) xmalloc (sizeof (struct pending));
+	  lstlink = (struct pending *) xmalloc (sizeof (struct pending));
 	}
 
-      link->next = *listhead;
-      *listhead = link;
-      link->nsyms = 0;
+      lstlink->next = *listhead;
+      *listhead = lstlink;
+      lstlink->nsyms = 0;
     }
 
   (*listhead)->symbol[(*listhead)->nsyms++] = symbol;
@@ -694,16 +694,16 @@ char *
 pop_subfile (void)
 {
   char *name;
-  struct subfile_stack *link = subfile_stack;
+  struct subfile_stack *lstlink = subfile_stack;
 
-  if (link == NULL)
+  if (lstlink == NULL)
     {
       internal_error (__FILE__, __LINE__,
 		      _("failed internal consistency check"));
     }
-  name = link->name;
-  subfile_stack = link->next;
-  xfree ((void *) link);
+  name = lstlink->name;
+  subfile_stack = lstlink->next;
+  xfree ((void *) lstlink);
   return (name);
 }
 
diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
index 0212232..586d16a 100644
--- a/gdb/c-typeprint.c
+++ b/gdb/c-typeprint.c
@@ -839,9 +839,10 @@ c_type_print_base (struct type *type, struct ui_file *stream,
 
 	  if (TYPE_DECLARED_CLASS (type))
 	    {
+	      const int nfields = TYPE_NFIELDS (type);
+
 	      QUIT;
-	      len = TYPE_NFIELDS (type);
-	      for (i = TYPE_N_BASECLASSES (type); i < len; i++)
+	      for (i = TYPE_N_BASECLASSES (type); i < nfields; i++)
 		if (!TYPE_FIELD_PRIVATE (type, i))
 		  {
 		    need_access_label = 1;
@@ -850,11 +851,11 @@ c_type_print_base (struct type *type, struct ui_file *stream,
 	      QUIT;
 	      if (!need_access_label)
 		{
-		  len2 = TYPE_NFN_FIELDS (type);
-		  for (j = 0; j < len2; j++)
+		  const int nfn_fields = TYPE_NFN_FIELDS (type);
+		  for (j = 0; j < nfn_fields; j++)
 		    {
-		      len = TYPE_FN_FIELDLIST_LENGTH (type, j);
-		      for (i = 0; i < len; i++)
+		      const int fn_fieldlist_length = TYPE_FN_FIELDLIST_LENGTH (type, j);
+		      for (i = 0; i < fn_fieldlist_length; i++)
 			if (!TYPE_FN_FIELD_PRIVATE (TYPE_FN_FIELDLIST1 (type,
 									j), i))
 			  {
@@ -868,9 +869,10 @@ c_type_print_base (struct type *type, struct ui_file *stream,
 	    }
 	  else
 	    {
+              const int nfields = TYPE_NFIELDS (type);
+
 	      QUIT;
-	      len = TYPE_NFIELDS (type);
-	      for (i = TYPE_N_BASECLASSES (type); i < len; i++)
+	      for (i = TYPE_N_BASECLASSES (type); i < nfields; i++)
 		if (TYPE_FIELD_PRIVATE (type, i)
 		    || TYPE_FIELD_PROTECTED (type, i))
 		  {
@@ -880,12 +882,14 @@ c_type_print_base (struct type *type, struct ui_file *stream,
 	      QUIT;
 	      if (!need_access_label)
 		{
-		  len2 = TYPE_NFN_FIELDS (type);
-		  for (j = 0; j < len2; j++)
+		  const int nfn_fields = TYPE_NFN_FIELDS (type);
+		  for (j = 0; j < nfn_fields; j++)
 		    {
+                      const int fn_fieldlist_length = TYPE_FN_FIELDLIST_LENGTH (type, j);
+                      
 		      QUIT;
-		      len = TYPE_FN_FIELDLIST_LENGTH (type, j);
-		      for (i = 0; i < len; i++)
+
+		      for (i = 0; i < fn_fieldlist_length; i++)
 			if (TYPE_FN_FIELD_PROTECTED (TYPE_FN_FIELDLIST1 (type,
 									 j), i)
 			    || TYPE_FN_FIELD_PRIVATE (TYPE_FN_FIELDLIST1 (type,
@@ -903,239 +907,240 @@ c_type_print_base (struct type *type, struct ui_file *stream,
 
 	  /* If there is a base class for this type,
 	     do not print the field that it occupies.  */
-
-	  len = TYPE_NFIELDS (type);
-	  vptr_fieldno = get_vptr_fieldno (type, &basetype);
-	  for (i = TYPE_N_BASECLASSES (type); i < len; i++)
-	    {
-	      QUIT;
-
-	      /* If we have a virtual table pointer, omit it.  Even if
-		 virtual table pointers are not specifically marked in
-		 the debug info, they should be artificial.  */
-	      if ((i == vptr_fieldno && type == basetype)
-		  || TYPE_FIELD_ARTIFICIAL (type, i))
-		continue;
-
-	      if (need_access_label)
-		{
-		  if (TYPE_FIELD_PROTECTED (type, i))
-		    {
-		      if (section_type != s_protected)
-			{
-			  section_type = s_protected;
-			  fprintfi_filtered (level + 2, stream,
-					     "protected:\n");
-			}
-		    }
-		  else if (TYPE_FIELD_PRIVATE (type, i))
-		    {
-		      if (section_type != s_private)
-			{
-			  section_type = s_private;
-			  fprintfi_filtered (level + 2, stream,
-					     "private:\n");
-			}
-		    }
-		  else
-		    {
-		      if (section_type != s_public)
-			{
-			  section_type = s_public;
-			  fprintfi_filtered (level + 2, stream,
-					     "public:\n");
-			}
-		    }
-		}
-
-	      print_spaces_filtered (level + 4, stream);
-	      if (field_is_static (&TYPE_FIELD (type, i)))
-		fprintf_filtered (stream, "static ");
-	      c_print_type (TYPE_FIELD_TYPE (type, i),
-			    TYPE_FIELD_NAME (type, i),
-			    stream, show - 1, level + 4);
-	      if (!field_is_static (&TYPE_FIELD (type, i))
-		  && TYPE_FIELD_PACKED (type, i))
-		{
-		  /* It is a bitfield.  This code does not attempt
-		     to look at the bitpos and reconstruct filler,
-		     unnamed fields.  This would lead to misleading
-		     results if the compiler does not put out fields
-		     for such things (I don't know what it does).  */
-		  fprintf_filtered (stream, " : %d",
-				    TYPE_FIELD_BITSIZE (type, i));
-		}
-	      fprintf_filtered (stream, ";\n");
-	    }
-
+          {
+            const int nfields = TYPE_NFIELDS (type);
+            vptr_fieldno = get_vptr_fieldno (type, &basetype);
+            for (i = TYPE_N_BASECLASSES (type); i < nfields; i++)
+              {
+                QUIT;
+
+                /* If we have a virtual table pointer, omit it.  Even if
+                   virtual table pointers are not specifically marked in
+                   the debug info, they should be artificial.  */
+                if ((i == vptr_fieldno && type == basetype)
+                    || TYPE_FIELD_ARTIFICIAL (type, i))
+                  continue;
+
+                if (need_access_label)
+                  {
+                    if (TYPE_FIELD_PROTECTED (type, i))
+                      {
+                        if (section_type != s_protected)
+                          {
+                            section_type = s_protected;
+                            fprintfi_filtered (level + 2, stream,
+                                               "protected:\n");
+                          }
+                      }
+                    else if (TYPE_FIELD_PRIVATE (type, i))
+                      {
+                        if (section_type != s_private)
+                          {
+                            section_type = s_private;
+                            fprintfi_filtered (level + 2, stream,
+                                               "private:\n");
+                          }
+                      }
+                    else
+                      {
+                        if (section_type != s_public)
+                          {
+                            section_type = s_public;
+                            fprintfi_filtered (level + 2, stream,
+                                               "public:\n");
+                          }
+                      }
+                  }
+
+                print_spaces_filtered (level + 4, stream);
+                if (field_is_static (&TYPE_FIELD (type, i)))
+                  fprintf_filtered (stream, "static ");
+                c_print_type (TYPE_FIELD_TYPE (type, i),
+                              TYPE_FIELD_NAME (type, i),
+                              stream, show - 1, level + 4);
+                if (!field_is_static (&TYPE_FIELD (type, i))
+                    && TYPE_FIELD_PACKED (type, i))
+                  {
+                    /* It is a bitfield.  This code does not attempt
+                       to look at the bitpos and reconstruct filler,
+                       unnamed fields.  This would lead to misleading
+                       results if the compiler does not put out fields
+                       for such things (I don't know what it does).  */
+                    fprintf_filtered (stream, " : %d",
+                                      TYPE_FIELD_BITSIZE (type, i));
+                  }
+                fprintf_filtered (stream, ";\n");
+              }
+          }
 	  /* If there are both fields and methods, put a blank line
 	     between them.  Make sure to count only method that we
 	     will display; artificial methods will be hidden.  */
-	  len = TYPE_NFN_FIELDS (type);
-	  real_len = 0;
-	  for (i = 0; i < len; i++)
-	    {
-	      struct fn_field *f = TYPE_FN_FIELDLIST1 (type, i);
-	      int len2 = TYPE_FN_FIELDLIST_LENGTH (type, i);
-	      int j;
-
-	      for (j = 0; j < len2; j++)
-		if (!TYPE_FN_FIELD_ARTIFICIAL (f, j))
-		  real_len++;
-	    }
-	  if (real_len > 0 && section_type != s_none)
-	    fprintf_filtered (stream, "\n");
-
-	  /* C++: print out the methods.  */
-	  for (i = 0; i < len; i++)
-	    {
-	      struct fn_field *f = TYPE_FN_FIELDLIST1 (type, i);
-	      int j, len2 = TYPE_FN_FIELDLIST_LENGTH (type, i);
-	      char *method_name = TYPE_FN_FIELDLIST_NAME (type, i);
-	      char *name = type_name_no_tag (type);
-	      int is_constructor = name && strcmp (method_name,
-						   name) == 0;
-
-	      for (j = 0; j < len2; j++)
-		{
-		  const char *mangled_name;
-		  char *demangled_name;
-		  struct cleanup *inner_cleanup;
-		  const char *physname = TYPE_FN_FIELD_PHYSNAME (f, j);
-		  int is_full_physname_constructor =
-		    is_constructor_name (physname) 
-		    || is_destructor_name (physname)
-		    || method_name[0] == '~';
-
-		  /* Do not print out artificial methods.  */
-		  if (TYPE_FN_FIELD_ARTIFICIAL (f, j))
-		    continue;
-
-		  inner_cleanup = make_cleanup (null_cleanup, NULL);
-
-		  QUIT;
-		  if (TYPE_FN_FIELD_PROTECTED (f, j))
-		    {
-		      if (section_type != s_protected)
-			{
-			  section_type = s_protected;
-			  fprintfi_filtered (level + 2, stream,
-					     "protected:\n");
-			}
-		    }
-		  else if (TYPE_FN_FIELD_PRIVATE (f, j))
-		    {
-		      if (section_type != s_private)
-			{
-			  section_type = s_private;
-			  fprintfi_filtered (level + 2, stream,
-					     "private:\n");
-			}
-		    }
-		  else
-		    {
-		      if (section_type != s_public)
-			{
-			  section_type = s_public;
-			  fprintfi_filtered (level + 2, stream,
-					     "public:\n");
-			}
-		    }
-
-		  print_spaces_filtered (level + 4, stream);
-		  if (TYPE_FN_FIELD_VIRTUAL_P (f, j))
-		    fprintf_filtered (stream, "virtual ");
-		  else if (TYPE_FN_FIELD_STATIC_P (f, j))
-		    fprintf_filtered (stream, "static ");
-		  if (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)) == 0)
-		    {
-		      /* Keep GDB from crashing here.  */
-		      fprintf_filtered (stream,
-					_("<undefined type> %s;\n"),
-					TYPE_FN_FIELD_PHYSNAME (f, j));
-		      break;
-		    }
-		  else if (!is_constructor	/* Constructors don't
+          {
+            const int nfn_fields = TYPE_NFN_FIELDS (type);
+            real_len = 0;
+            for (i = 0; i < nfn_fields; i++)
+              {
+                struct fn_field *f = TYPE_FN_FIELDLIST1 (type, i);
+                const int fn_fieldlist_length = TYPE_FN_FIELDLIST_LENGTH (type, i);
+
+                for (j = 0; j < fn_fieldlist_length; j++)
+                  if (!TYPE_FN_FIELD_ARTIFICIAL (f, j))
+                    real_len++;
+              }
+            if (real_len > 0 && section_type != s_none)
+              fprintf_filtered (stream, "\n");
+
+            /* C++: print out the methods.  */
+            for (i = 0; i < nfn_fields; i++)
+              {
+                struct fn_field *f = TYPE_FN_FIELDLIST1 (type, i);
+
+                const int fn_fieldlist_length = TYPE_FN_FIELDLIST_LENGTH (type, i);
+                char *method_name = TYPE_FN_FIELDLIST_NAME (type, i);
+                char *name = type_name_no_tag (type);
+                int is_constructor = name && strcmp (method_name,
+                                                     name) == 0;
+
+                for (j = 0; j < fn_fieldlist_length; j++)
+                  {
+                    const char *mangled_name;
+                    char *demangled_name;
+                    struct cleanup *inner_cleanup;
+                    const char *physname = TYPE_FN_FIELD_PHYSNAME (f, j);
+                    int is_full_physname_constructor =
+                      is_constructor_name (physname) 
+                      || is_destructor_name (physname)
+                      || method_name[0] == '~';
+
+                    /* Do not print out artificial methods.  */
+                    if (TYPE_FN_FIELD_ARTIFICIAL (f, j))
+                      continue;
+
+                    inner_cleanup = make_cleanup (null_cleanup, NULL);
+
+                    QUIT;
+                    if (TYPE_FN_FIELD_PROTECTED (f, j))
+                      {
+                        if (section_type != s_protected)
+                          {
+                            section_type = s_protected;
+                            fprintfi_filtered (level + 2, stream,
+                                               "protected:\n");
+                          }
+                      }
+                    else if (TYPE_FN_FIELD_PRIVATE (f, j))
+                      {
+                        if (section_type != s_private)
+                          {
+                            section_type = s_private;
+                            fprintfi_filtered (level + 2, stream,
+                                               "private:\n");
+                          }
+                      }
+                    else
+                      {
+                        if (section_type != s_public)
+                          {
+                            section_type = s_public;
+                            fprintfi_filtered (level + 2, stream,
+                                               "public:\n");
+                          }
+                      }
+
+                    print_spaces_filtered (level + 4, stream);
+                    if (TYPE_FN_FIELD_VIRTUAL_P (f, j))
+                      fprintf_filtered (stream, "virtual ");
+                    else if (TYPE_FN_FIELD_STATIC_P (f, j))
+                      fprintf_filtered (stream, "static ");
+                    if (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)) == 0)
+                      {
+                        /* Keep GDB from crashing here.  */
+                        fprintf_filtered (stream,
+                                          _("<undefined type> %s;\n"),
+                                          TYPE_FN_FIELD_PHYSNAME (f, j));
+                        break;
+                      }
+                    else if (!is_constructor	/* Constructors don't
 						   have declared
 						   types.  */
-			   && !is_full_physname_constructor  /* " " */
-			   && !is_type_conversion_operator (type, i, j))
-		    {
-		      type_print (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)),
-				  "", stream, -1);
-		      fputs_filtered (" ", stream);
-		    }
-		  if (TYPE_FN_FIELD_STUB (f, j))
-		    {
-		      char *tem;
-
-		      /* Build something we can demangle.  */
-		      tem = gdb_mangle_name (type, i, j);
-		      make_cleanup (xfree, tem);
-		      mangled_name = tem;
-		    }
-		  else
-		    mangled_name = TYPE_FN_FIELD_PHYSNAME (f, j);
-
-		  demangled_name =
-		    cplus_demangle (mangled_name,
-				    DMGL_ANSI | DMGL_PARAMS);
-		  if (demangled_name == NULL)
-		    {
-		      /* In some cases (for instance with the HP
-		         demangling), if a function has more than 10
-		         arguments, the demangling will fail.
-		         Let's try to reconstruct the function
-		         signature from the symbol information.  */
-		      if (!TYPE_FN_FIELD_STUB (f, j))
-			{
-			  int staticp = TYPE_FN_FIELD_STATIC_P (f, j);
-			  struct type *mtype = TYPE_FN_FIELD_TYPE (f, j);
-
-			  cp_type_print_method_args (mtype,
-						     "",
-						     method_name,
-						     staticp,
-						     stream);
-			}
-		      else
-			fprintf_filtered (stream,
-					  _("<badly mangled name '%s'>"),
-					  mangled_name);
-		    }
-		  else
-		    {
-		      char *p;
-		      char *demangled_no_class
-			= remove_qualifiers (demangled_name);
-
-		      /* Get rid of the `static' appended by the
-			 demangler.  */
-		      p = strstr (demangled_no_class, " static");
-		      if (p != NULL)
-			{
-			  int length = p - demangled_no_class;
-			  char *demangled_no_static;
-
-			  demangled_no_static
-			    = (char *) xmalloc (length + 1);
-			  strncpy (demangled_no_static,
-				   demangled_no_class, length);
-			  *(demangled_no_static + length) = '\0';
-			  fputs_filtered (demangled_no_static, stream);
-			  xfree (demangled_no_static);
-			}
-		      else
-			fputs_filtered (demangled_no_class, stream);
-		      xfree (demangled_name);
-		    }
-
-		  do_cleanups (inner_cleanup);
-
-		  fprintf_filtered (stream, ";\n");
-		}
-	    }
-
+                             && !is_full_physname_constructor  /* " " */
+                             && !is_type_conversion_operator (type, i, j))
+                      {
+                        type_print (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)),
+                                    "", stream, -1);
+                        fputs_filtered (" ", stream);
+                      }
+                    if (TYPE_FN_FIELD_STUB (f, j))
+                      {
+                        char *tem;
+
+                        /* Build something we can demangle.  */
+                        tem = gdb_mangle_name (type, i, j);
+                        make_cleanup (xfree, tem);
+                        mangled_name = tem;
+                      }
+                    else
+                      mangled_name = TYPE_FN_FIELD_PHYSNAME (f, j);
+
+                    demangled_name =
+                      cplus_demangle (mangled_name,
+                                      DMGL_ANSI | DMGL_PARAMS);
+                    if (demangled_name == NULL)
+                      {
+                        /* In some cases (for instance with the HP
+                           demangling), if a function has more than 10
+                           arguments, the demangling will fail.
+                           Let's try to reconstruct the function
+                           signature from the symbol information.  */
+                        if (!TYPE_FN_FIELD_STUB (f, j))
+                          {
+                            int staticp = TYPE_FN_FIELD_STATIC_P (f, j);
+                            struct type *mtype = TYPE_FN_FIELD_TYPE (f, j);
+
+                            cp_type_print_method_args (mtype,
+                                                       "",
+                                                       method_name,
+                                                       staticp,
+                                                       stream);
+                          }
+                        else
+                          fprintf_filtered (stream,
+                                            _("<badly mangled name '%s'>"),
+                                            mangled_name);
+                      }
+                    else
+                      {
+                        char *p;
+                        char *demangled_no_class
+                          = remove_qualifiers (demangled_name);
+
+                        /* Get rid of the `static' appended by the
+                           demangler.  */
+                        p = strstr (demangled_no_class, " static");
+                        if (p != NULL)
+                          {
+                            int length = p - demangled_no_class;
+                            char *demangled_no_static;
+
+                            demangled_no_static
+                              = (char *) xmalloc (length + 1);
+                            strncpy (demangled_no_static,
+                                     demangled_no_class, length);
+                            *(demangled_no_static + length) = '\0';
+                            fputs_filtered (demangled_no_static, stream);
+                            xfree (demangled_no_static);
+                          }
+                        else
+                          fputs_filtered (demangled_no_class, stream);
+                        xfree (demangled_name);
+                      }
+
+                    do_cleanups (inner_cleanup);
+
+                    fprintf_filtered (stream, ";\n");
+                  }
+              }
+          }
 	  /* Print typedefs defined in this class.  */
 
 	  if (TYPE_TYPEDEF_FIELD_COUNT (type) != 0)
@@ -1195,10 +1200,12 @@ c_type_print_base (struct type *type, struct ui_file *stream,
 	}
       else if (show > 0 || TYPE_TAG_NAME (type) == NULL)
 	{
+          const int nfields = TYPE_NFIELDS (type);
+
 	  fprintf_filtered (stream, "{");
-	  len = TYPE_NFIELDS (type);
+
 	  lastval = 0;
-	  for (i = 0; i < len; i++)
+	  for (i = 0; i < nfields; i++)
 	    {
 	      QUIT;
 	      if (i)
diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
index 3461b08..2d61209 100644
--- a/gdb/c-valprint.c
+++ b/gdb/c-valprint.c
@@ -270,10 +270,10 @@ c_val_print (struct type *type, const gdb_byte *valaddr,
 	  /* Print vtable entry - we only get here if we ARE using
 	     -fvtable_thunks.  (Otherwise, look under
 	     TYPE_CODE_STRUCT.)  */
-	  CORE_ADDR addr
+	  const CORE_ADDR addr1
 	    = extract_typed_address (valaddr + embedded_offset, type);
 
-	  print_function_pointer_address (gdbarch, addr, stream,
+	  print_function_pointer_address (gdbarch, addr1, stream,
 					  options->addressprint);
 	  break;
 	}
@@ -367,11 +367,11 @@ c_val_print (struct type *type, const gdb_byte *valaddr,
       elttype = check_typedef (TYPE_TARGET_TYPE (type));
       if (options->addressprint)
 	{
-	  CORE_ADDR addr
+	  const CORE_ADDR addr1
 	    = extract_typed_address (valaddr + embedded_offset, type);
 
 	  fprintf_filtered (stream, "@");
-	  fputs_filtered (paddress (gdbarch, addr), stream);
+	  fputs_filtered (paddress (gdbarch, addr1), stream);
 	  if (options->deref_ref)
 	    fputs_filtered (": ", stream);
 	}
@@ -417,15 +417,15 @@ c_val_print (struct type *type, const gdb_byte *valaddr,
 	  /* Print vtable entry - we only get here if NOT using
 	     -fvtable_thunks.  (Otherwise, look under
 	     TYPE_CODE_PTR.)  */
-	  int offset = (embedded_offset
+	  const int offset = (embedded_offset
 			+ TYPE_FIELD_BITPOS (type,
 					     VTBL_FNADDR_OFFSET) / 8);
 	  struct type *field_type = TYPE_FIELD_TYPE (type,
 						     VTBL_FNADDR_OFFSET);
-	  CORE_ADDR addr
+	  const CORE_ADDR addr1
 	    = extract_typed_address (valaddr + offset, field_type);
 
-	  print_function_pointer_address (gdbarch, addr, stream,
+	  print_function_pointer_address (gdbarch, addr1, stream,
 					  options->addressprint);
 	}
       else
diff --git a/gdb/coffread.c b/gdb/coffread.c
index cf8fb54..fc4dfec 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -325,15 +325,15 @@ cs_section_address (struct coff_symbol *cs, bfd *abfd)
    or for associating a new type with the index.  */
 
 static struct type **
-coff_lookup_type (int index)
+coff_lookup_type (int idx)
 {
-  if (index >= type_vector_length)
+  if (idx >= type_vector_length)
     {
       int old_vector_length = type_vector_length;
 
       type_vector_length *= 2;
-      if (index /* is still */  >= type_vector_length)
-	type_vector_length = index * 2;
+      if (idx /* is still */  >= type_vector_length)
+	type_vector_length = idx * 2;
 
       type_vector = (struct type **)
 	xrealloc ((char *) type_vector,
@@ -341,7 +341,7 @@ coff_lookup_type (int index)
       memset (&type_vector[old_vector_length], 0,
 	 (type_vector_length - old_vector_length) * sizeof (struct type *));
     }
-  return &type_vector[index];
+  return &type_vector[idx];
 }
 
 /* Make sure there is a type allocated for type number index
@@ -349,9 +349,9 @@ coff_lookup_type (int index)
    This can create an empty (zeroed) type object.  */
 
 static struct type *
-coff_alloc_type (int index)
+coff_alloc_type (int idx)
 {
-  struct type **type_addr = coff_lookup_type (index);
+  struct type **type_addr = coff_lookup_type (idx);
   struct type *type = *type_addr;
 
   /* If we are referring to a type not known at all yet,
@@ -519,7 +519,7 @@ coff_symfile_read (struct objfile *objfile, int symfile_flags)
 {
   struct coff_symfile_info *info;
   struct dbx_symfile_info *dbxinfo;
-  bfd *abfd = objfile->obfd;
+  struct bfd *abfd = objfile->obfd;
   coff_data_type *cdata = coff_data (abfd);
   char *name = bfd_get_filename (abfd);
   int val;
@@ -658,9 +658,9 @@ coff_symfile_read (struct objfile *objfile, int symfile_flags)
 
       if (debugfile)
 	{
-	  bfd *abfd = symfile_bfd_open (debugfile);
+	  struct bfd *dbgbfd = symfile_bfd_open (debugfile);
 
-	  symbol_file_add_separate (abfd, symfile_flags, objfile);
+	  symbol_file_add_separate (dbgbfd, symfile_flags, objfile);
 	  xfree (debugfile);
 	}
     }
@@ -1977,7 +1977,7 @@ decode_base_type (struct coff_symbol *cs,
    object describing the type.  */
 
 static struct type *
-coff_read_struct_type (int index, int length, int lastsym,
+coff_read_struct_type (int idx, int length, int lastsym,
 		       struct objfile *objfile)
 {
   struct nextfield
@@ -1998,7 +1998,7 @@ coff_read_struct_type (int index, int length, int lastsym,
   union internal_auxent sub_aux;
   int done = 0;
 
-  type = coff_alloc_type (index);
+  type = coff_alloc_type (idx);
   TYPE_CODE (type) = TYPE_CODE_STRUCT;
   INIT_CPLUS_SPECIFIC (type);
   TYPE_LENGTH (type) = length;
@@ -2070,7 +2070,7 @@ coff_read_struct_type (int index, int length, int lastsym,
    Also defines the symbols that represent the values of the type.  */
 
 static struct type *
-coff_read_enum_type (int index, int length, int lastsym,
+coff_read_enum_type (int idx, int length, int lastsym,
 		     struct objfile *objfile)
 {
   struct gdbarch *gdbarch = get_objfile_arch (objfile);
@@ -2089,7 +2089,7 @@ coff_read_enum_type (int index, int length, int lastsym,
   char *name;
   int unsigned_enum = 1;
 
-  type = coff_alloc_type (index);
+  type = coff_alloc_type (idx);
   if (within_function)
     symlist = &local_symbols;
   else
diff --git a/gdb/complaints.c b/gdb/complaints.c
index 9129b98..144083d 100644
--- a/gdb/complaints.c
+++ b/gdb/complaints.c
@@ -124,34 +124,34 @@ static struct complain * ATTRIBUTE_PRINTF (4, 0)
 find_complaint (struct complaints *complaints, const char *file,
 		int line, const char *fmt)
 {
-  struct complain *complaint;
+  struct complain *compl;
 
   /* Find the complaint in the table.  A more efficient search
      algorithm (based on hash table or something) could be used.  But
      that can wait until someone shows evidence that this lookup is
      a real bottle neck.  */
-  for (complaint = complaints->root;
-       complaint != NULL;
-       complaint = complaint->next)
+  for (compl = complaints->root;
+       compl != NULL;
+       compl = compl->next)
     {
-      if (complaint->fmt == fmt
-	  && complaint->file == file
-	  && complaint->line == line)
-	return complaint;
+      if (compl->fmt == fmt
+	  && compl->file == file
+	  && compl->line == line)
+	return compl;
     }
 
   /* Oops not seen before, fill in a new complaint.  */
-  complaint = XMALLOC (struct complain);
-  complaint->fmt = fmt;
-  complaint->file = file;
-  complaint->line = line;
-  complaint->counter = 0;
-  complaint->next = NULL;
+  compl = XMALLOC (struct complain);
+  compl->fmt = fmt;
+  compl->file = file;
+  compl->line = line;
+  compl->counter = 0;
+  compl->next = NULL;
 
   /* File it, return it.  */
-  complaint->next = complaints->root;
-  complaints->root = complaint;
-  return complaint;
+  compl->next = complaints->root;
+  complaints->root = compl;
+  return compl;
 }
 
 
@@ -170,14 +170,14 @@ vcomplaint (struct complaints **c, const char *file,
 	    va_list args)
 {
   struct complaints *complaints = get_complaints (c);
-  struct complain *complaint = find_complaint (complaints, file, 
+  struct complain *compl = find_complaint (complaints, file, 
 					       line, fmt);
   enum complaint_series series;
 
   gdb_assert (complaints != NULL);
 
-  complaint->counter++;
-  if (complaint->counter > stop_whining)
+  compl->counter++;
+  if (compl->counter > stop_whining)
     return;
 
   if (info_verbose)
@@ -185,21 +185,21 @@ vcomplaint (struct complaints **c, const char *file,
   else
     series = complaints->series;
 
-  if (complaint->file != NULL)
-    internal_vwarning (complaint->file, complaint->line, 
-		       complaint->fmt, args);
+  if (compl->file != NULL)
+    internal_vwarning (compl->file, compl->line, 
+		       compl->fmt, args);
   else if (deprecated_warning_hook)
-    (*deprecated_warning_hook) (complaint->fmt, args);
+    (*deprecated_warning_hook) (compl->fmt, args);
   else
     {
       if (complaints->explanation == NULL)
 	/* A [v]warning() call always appends a newline.  */
-	vwarning (complaint->fmt, args);
+	vwarning (compl->fmt, args);
       else
 	{
 	  char *msg;
 	  struct cleanup *cleanups;
-	  msg = xstrvprintf (complaint->fmt, args);
+	  msg = xstrvprintf (compl->fmt, args);
 	  cleanups = make_cleanup (xfree, msg);
 	  wrap_here ("");
 	  if (series != SUBSEQUENT_MESSAGE)
diff --git a/gdb/completer.c b/gdb/completer.c
index 606f78b..55a4b7a 100644
--- a/gdb/completer.c
+++ b/gdb/completer.c
@@ -863,7 +863,7 @@ line_completion_function (const char *text, int matches,
 			  char *line_buffer, int point)
 {
   static char **list = (char **) NULL;	/* Cache of completions.  */
-  static int index;			/* Next cached completion.  */
+  static int idx;			/* Next cached completion.  */
   char *output = NULL;
 
   if (matches == 0)
@@ -881,7 +881,7 @@ line_completion_function (const char *text, int matches,
 	  xfree (list);
 	  list = NULL;
 	}
-      index = 0;
+      idx = 0;
       list = complete_line (text, line_buffer, point);
     }
 
@@ -893,10 +893,10 @@ line_completion_function (const char *text, int matches,
 
   if (list)
     {
-      output = list[index];
+      output = list[idx];
       if (output)
 	{
-	  index++;
+	  idx++;
 	}
     }
 
diff --git a/gdb/cp-abi.c b/gdb/cp-abi.c
index 82a164e..9ff49f9 100644
--- a/gdb/cp-abi.c
+++ b/gdb/cp-abi.c
@@ -70,7 +70,7 @@ is_operator_name (const char *name)
 }
 
 int
-baseclass_offset (struct type *type, int index, const gdb_byte *valaddr,
+baseclass_offset (struct type *type, int idx, const gdb_byte *valaddr,
 		  int embedded_offset, CORE_ADDR address,
 		  const struct value *val)
 {
@@ -81,7 +81,7 @@ baseclass_offset (struct type *type, int index, const gdb_byte *valaddr,
 
   TRY_CATCH (ex, RETURN_MASK_ERROR)
     {
-      res = (*current_cp_abi.baseclass_offset) (type, index, valaddr,
+      res = (*current_cp_abi.baseclass_offset) (type, idx, valaddr,
 						embedded_offset,
 						address, val);
     }
diff --git a/gdb/cp-name-parser.y b/gdb/cp-name-parser.y
index f257370..65f607f 100644
--- a/gdb/cp-name-parser.y
+++ b/gdb/cp-name-parser.y
@@ -1295,9 +1295,9 @@ d_binary (const char *name, struct demangle_component *lhs, struct demangle_comp
 /* Find the end of a symbol name starting at LEXPTR.  */
 
 static const char *
-symbol_end (const char *lexptr)
+symbol_end (const char *lex)
 {
-  const char *p = lexptr;
+  const char *p = lex;
 
   while (*p && (ISALNUM (*p) || *p == '_' || *p == '$' || *p == '.'))
     p++;
diff --git a/gdb/cp-support.c b/gdb/cp-support.c
index 9e001b2..dc269ff 100644
--- a/gdb/cp-support.c
+++ b/gdb/cp-support.c
@@ -201,7 +201,7 @@ inspect_type (struct demangle_parse_info *info,
 	  long len;
 	  int is_anon;
 	  struct type *type;
-	  struct demangle_parse_info *i;
+	  struct demangle_parse_info *parseinfo;
 	  struct ui_file *buf;
 
 	  /* Get the real type of the typedef.  */
@@ -252,11 +252,11 @@ inspect_type (struct demangle_parse_info *info,
 	     tree will contain pointers into NAME, so NAME cannot
 	     be free'd until all typedef conversion is done and
 	     the final result is converted into a string.  */
-	  i = cp_demangled_name_to_comp (name, NULL);
-	  if (i != NULL)
+	  parseinfo = cp_demangled_name_to_comp (name, NULL);
+	  if (parseinfo != NULL)
 	    {
 	      /* Merge the two trees.  */
-	      cp_merge_demangle_parse_infos (info, ret_comp, i);
+	      cp_merge_demangle_parse_infos (info, ret_comp, parseinfo);
 
 	      /* Replace any newly introduced typedefs -- but not
 		 if the type is anonymous (that would lead to infinite
@@ -899,7 +899,7 @@ cp_find_first_component (const char *name)
 static unsigned int
 cp_find_first_component_aux (const char *name, int permissive)
 {
-  unsigned int index = 0;
+  unsigned int idx = 0;
   /* Operator names can show up in unexpected places.  Since these can
      contain parentheses or angle brackets, they can screw up the
      recursion.  But not every string 'operator' is part of an
@@ -908,49 +908,49 @@ cp_find_first_component_aux (const char *name, int permissive)
      'operator' as starting an operator.  */
   int operator_possible = 1;
 
-  for (;; ++index)
+  for (;; ++idx)
     {
-      switch (name[index])
+      switch (name[idx])
 	{
 	case '<':
 	  /* Template; eat it up.  The calls to cp_first_component
 	     should only return (I hope!) when they reach the '>'
 	     terminating the component or a '::' between two
 	     components.  (Hence the '+ 2'.)  */
-	  index += 1;
-	  for (index += cp_find_first_component_aux (name + index, 1);
-	       name[index] != '>';
-	       index += cp_find_first_component_aux (name + index, 1))
+	  idx += 1;
+	  for (idx += cp_find_first_component_aux (name + idx, 1);
+	       name[idx] != '>';
+	       idx += cp_find_first_component_aux (name + idx, 1))
 	    {
-	      if (name[index] != ':')
+	      if (name[idx] != ':')
 		{
 		  demangled_name_complaint (name);
 		  return strlen (name);
 		}
-	      index += 2;
+	      idx += 2;
 	    }
 	  operator_possible = 1;
 	  break;
 	case '(':
 	  /* Similar comment as to '<'.  */
-	  index += 1;
-	  for (index += cp_find_first_component_aux (name + index, 1);
-	       name[index] != ')';
-	       index += cp_find_first_component_aux (name + index, 1))
+	  idx += 1;
+	  for (idx += cp_find_first_component_aux (name + idx, 1);
+	       name[idx] != ')';
+	       idx += cp_find_first_component_aux (name + idx, 1))
 	    {
-	      if (name[index] != ':')
+	      if (name[idx] != ':')
 		{
 		  demangled_name_complaint (name);
 		  return strlen (name);
 		}
-	      index += 2;
+	      idx += 2;
 	    }
 	  operator_possible = 1;
 	  break;
 	case '>':
 	case ')':
 	  if (permissive)
-	    return index;
+	    return idx;
 	  else
 	    {
 	      demangled_name_complaint (name);
@@ -958,39 +958,39 @@ cp_find_first_component_aux (const char *name, int permissive)
 	    }
 	case '\0':
 	case ':':
-	  return index;
+	  return idx;
 	case 'o':
 	  /* Operator names can screw up the recursion.  */
 	  if (operator_possible
-	      && strncmp (name + index, "operator",
+	      && strncmp (name + idx, "operator",
 			  LENGTH_OF_OPERATOR) == 0)
 	    {
-	      index += LENGTH_OF_OPERATOR;
-	      while (ISSPACE(name[index]))
-		++index;
-	      switch (name[index])
+	      idx += LENGTH_OF_OPERATOR;
+	      while (ISSPACE(name[idx]))
+		++idx;
+	      switch (name[idx])
 		{
 		  /* Skip over one less than the appropriate number of
 		     characters: the for loop will skip over the last
 		     one.  */
 		case '<':
-		  if (name[index + 1] == '<')
-		    index += 1;
+		  if (name[idx + 1] == '<')
+		    idx += 1;
 		  else
-		    index += 0;
+		    idx += 0;
 		  break;
 		case '>':
 		case '-':
-		  if (name[index + 1] == '>')
-		    index += 1;
+		  if (name[idx + 1] == '>')
+		    idx += 1;
 		  else
-		    index += 0;
+		    idx += 0;
 		  break;
 		case '(':
-		  index += 1;
+		  idx += 1;
 		  break;
 		default:
-		  index += 0;
+		  idx += 0;
 		  break;
 		}
 	    }
diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c
index f8516d5..ab484bc 100644
--- a/gdb/cp-valprint.c
+++ b/gdb/cp-valprint.c
@@ -377,24 +377,25 @@ cp_print_value_fields (struct type *type, struct type *real_type,
 
       if (dont_print_statmem == 0)
 	{
-	  int obstack_final_size =
-           obstack_object_size (&dont_print_statmem_obstack);
-
-	  if (obstack_final_size > statmem_obstack_initial_size)
-	    {
-	      /* In effect, a pop of the printed-statics stack.  */
-
-	      void *free_to_ptr =
-		obstack_next_free (&dont_print_statmem_obstack) -
-		(obstack_final_size - statmem_obstack_initial_size);
-
-	      obstack_free (&dont_print_statmem_obstack,
-			    free_to_ptr);
-	    }
-
+          {
+            const int obstack_final_size =
+              obstack_object_size (&dont_print_statmem_obstack);
+
+            if (obstack_final_size > statmem_obstack_initial_size)
+              {
+                /* In effect, a pop of the printed-statics stack.  */
+                
+                void *free_to_ptr =
+                  obstack_next_free (&dont_print_statmem_obstack) -
+                  (obstack_final_size - statmem_obstack_initial_size);
+                
+                obstack_free (&dont_print_statmem_obstack,
+                              free_to_ptr);
+              }
+          }
 	  if (last_set_recurse != recurse)
 	    {
-	      int obstack_final_size =
+	      const int obstack_final_size =
 		obstack_object_size (&dont_print_stat_array_obstack);
 	      
 	      if (obstack_final_size > stat_array_obstack_initial_size)
@@ -496,7 +497,7 @@ cp_print_value (struct type *type, struct type *real_type,
       int boffset = 0;
       int skip;
       struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i));
-      char *basename = TYPE_NAME (baseclass);
+      const char *base_name = TYPE_NAME (baseclass);
       const gdb_byte *base_valaddr = NULL;
       const struct value *base_val = NULL;
       volatile struct gdb_exception ex;
@@ -577,7 +578,7 @@ cp_print_value (struct type *type, struct type *real_type,
       fputs_filtered ("<", stream);
       /* Not sure what the best notation is in the case where there is
          no baseclass name.  */
-      fputs_filtered (basename ? basename : "", stream);
+      fputs_filtered (base_name ? base_name : "", stream);
       fputs_filtered ("> = ", stream);
 
       if (skip < 0)
-- 
1.7.5.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]