public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Ondrej Oprala <ooprala@redhat.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@redhat.com>
Subject: [PATCH 13/18] poison "typename"
Date: Wed, 09 Oct 2013 17:18:00 -0000	[thread overview]
Message-ID: <1381339053-14519-14-git-send-email-ooprala@redhat.com> (raw)
In-Reply-To: <1381339053-14519-1-git-send-email-ooprala@redhat.com>

From: Tom Tromey <tromey@redhat.com>

 * ada-lang.c (type_name) : Renamed from typename.
 * break-catch-throw.c (type_name) : Likewise.
 * cp-valprint.c (type_name) : Likewise.
 * dwarf2read.c (type_name) : Likewise.
 * gdbtypes.c (type_name) : Likewise.
 * gnu-v3-abi.c (type_name) : Likewise.
 * p-valprint.c (type_name) : Likewise.
 * stabsread.c (type_name) : Likewise.
 * typeprint.c (type_name) : Likewise.
---
 gdb/ChangeLog           | 12 ++++++++++++
 gdb/ada-lang.c          |  8 ++++----
 gdb/break-catch-throw.c | 14 +++++++-------
 gdb/cp-valprint.c       |  4 ++--
 gdb/dwarf2read.c        | 10 +++++-----
 gdb/gdbtypes.c          | 20 ++++++++++----------
 gdb/gnu-v3-abi.c        | 26 +++++++++++++-------------
 gdb/p-valprint.c        |  6 +++---
 gdb/stabsread.c         |  6 +++---
 gdb/typeprint.c         | 12 ++++++------
 10 files changed, 65 insertions(+), 53 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 03d8538..43e9cc5 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -17,6 +17,18 @@
 
 2013-10-09  Tom Tromey  <tromey@redhat.com>
 
+ * ada-lang.c (type_name) : Renamed from typename.
+ * break-catch-throw.c (type_name) : Likewise.
+ * cp-valprint.c (type_name) : Likewise.
+ * dwarf2read.c (type_name) : Likewise.
+ * gdbtypes.c (type_name) : Likewise.
+ * gnu-v3-abi.c (type_name) : Likewise.
+ * p-valprint.c (type_name) : Likewise.
+ * stabsread.c (type_name) : Likewise.
+ * typeprint.c (type_name) : Likewise.
+
+2013-10-09  Tom Tromey  <tromey@redhat.com>
+
  * hppa-linux-tdep.c (attempt) : Renamed from try.
  * i386-nat.c (attempt) : Likewise.
  * remote-mips.c (attempt) : Likewise.
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 1150fd6..515164f 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -7480,17 +7480,17 @@ struct type *
 ada_find_parallel_type (struct type *type, const char *suffix)
 {
   char *name;
-  const char *typename = ada_type_name (type);
+  const char *type_name = ada_type_name (type);
   int len;
 
-  if (typename == NULL)
+  if (type_name == NULL)
     return NULL;
 
-  len = strlen (typename);
+  len = strlen (type_name);
 
   name = (char *) alloca (len + strlen (suffix) + 1);
 
-  strcpy (name, typename);
+  strcpy (name, type_name);
   strcpy (name + len, suffix);
 
   return ada_find_parallel_type_with_name (type, name);
diff --git a/gdb/break-catch-throw.c b/gdb/break-catch-throw.c
index fb24725..afeca1e 100644
--- a/gdb/break-catch-throw.c
+++ b/gdb/break-catch-throw.c
@@ -168,7 +168,7 @@ check_status_exception_catchpoint (struct bpstats *bs)
 {
   struct exception_catchpoint *self
     = (struct exception_catchpoint *) bs->breakpoint_at;
-  char *typename = NULL;
+  char *type_name = NULL;
   volatile struct gdb_exception e;
 
   bkpt_breakpoint_ops.check_status (bs);
@@ -184,22 +184,22 @@ check_status_exception_catchpoint (struct bpstats *bs)
       char *canon;
 
       fetch_probe_arguments (NULL, &typeinfo_arg);
-      typename = cplus_typename_from_type_info (typeinfo_arg);
+      type_name = cplus_typename_from_type_info (typeinfo_arg);
 
-      canon = cp_canonicalize_string (typename);
+      canon = cp_canonicalize_string (type_name);
       if (canon != NULL)
 	{
-	  xfree (typename);
-	  typename = canon;
+	  xfree (type_name);
+	  type_name = canon;
 	}
     }
 
   if (e.reason < 0)
     exception_print (gdb_stderr, e);
-  else if (regexec (self->pattern, typename, 0, NULL, 0) != 0)
+  else if (regexec (self->pattern, type_name, 0, NULL, 0) != 0)
     bs->stop = 0;
 
-  xfree (typename);
+  xfree (type_name);
 }
 
 /* Implement the 're_set' method.  */
diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c
index 1d7147c..8734bb7 100644
--- a/gdb/cp-valprint.c
+++ b/gdb/cp-valprint.c
@@ -98,9 +98,9 @@ const char vtbl_ptr_name[] = "__vtbl_ptr_type";
 int
 cp_is_vtbl_ptr_type (struct type *type)
 {
-  const char *typename = type_name_no_tag (type);
+  const char *type_name = type_name_no_tag (type);
 
-  return (typename != NULL && !strcmp (typename, vtbl_ptr_name));
+  return (type_name != NULL && !strcmp (type_name, vtbl_ptr_name));
 }
 
 /* Return truth value for the assertion that TYPE is of the type
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 0fb607c..d4d4866 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -12263,7 +12263,7 @@ static int
 dwarf2_is_constructor (struct die_info *die, struct dwarf2_cu *cu)
 {
   const char *fieldname;
-  const char *typename;
+  const char *type_name;
   int len;
 
   if (die->parent == NULL)
@@ -12275,13 +12275,13 @@ dwarf2_is_constructor (struct die_info *die, struct dwarf2_cu *cu)
     return 0;
 
   fieldname = dwarf2_name (die, cu);
-  typename = dwarf2_name (die->parent, cu);
-  if (fieldname == NULL || typename == NULL)
+  type_name = dwarf2_name (die->parent, cu);
+  if (fieldname == NULL || type_name == NULL)
     return 0;
 
   len = strlen (fieldname);
-  return (strncmp (fieldname, typename, len) == 0
-	  && (typename[len] == '\0' || typename[len] == '<'));
+  return (strncmp (fieldname, type_name, len) == 0
+	  && (type_name[len] == '\0' || type_name[len] == '<'));
 }
 
 /* Add a member function to the proper fieldlist.  */
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 592e142..4ab47ec 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -1356,7 +1356,7 @@ struct type *
 lookup_struct_elt_type (struct type *type, const char *name, int noerr)
 {
   int i;
-  char *typename;
+  char *type_name;
 
   for (;;)
     {
@@ -1370,9 +1370,9 @@ lookup_struct_elt_type (struct type *type, const char *name, int noerr)
   if (TYPE_CODE (type) != TYPE_CODE_STRUCT 
       && TYPE_CODE (type) != TYPE_CODE_UNION)
     {
-      typename = type_to_string (type);
-      make_cleanup (xfree, typename);
-      error (_("Type %s is not a structure or union type."), typename);
+      type_name = type_to_string (type);
+      make_cleanup (xfree, type_name);
+      error (_("Type %s is not a structure or union type."), type_name);
     }
 
 #if 0
@@ -1381,10 +1381,10 @@ lookup_struct_elt_type (struct type *type, const char *name, int noerr)
      I.e. when doing "ptype bell->bar" for "struct foo { int bar; int
      foo; } bell;" Disabled by fnf.  */
   {
-    char *typename;
+    char *type_name;
 
-    typename = type_name_no_tag (type);
-    if (typename != NULL && strcmp (typename, name) == 0)
+    type_name = type_name_no_tag (type);
+    if (type_name != NULL && strcmp (type_name, name) == 0)
       return type;
   }
 #endif
@@ -1424,9 +1424,9 @@ lookup_struct_elt_type (struct type *type, const char *name, int noerr)
       return NULL;
     }
 
-  typename = type_to_string (type);
-  make_cleanup (xfree, typename);
-  error (_("Type %s has no component named %s."), typename, name);
+  type_name = type_to_string (type);
+  make_cleanup (xfree, type_name);
+  error (_("Type %s has no component named %s."), type_name, name);
 }
 
 /* Lookup the vptr basetype/fieldno values for TYPE.
diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c
index 1821f18..4bc7645 100644
--- a/gdb/gnu-v3-abi.c
+++ b/gdb/gnu-v3-abi.c
@@ -1066,7 +1066,7 @@ gnuv3_get_typeid (struct value *value)
   struct gdbarch *gdbarch;
   struct cleanup *cleanup;
   struct value *result;
-  char *typename, *canonical;
+  char *type_name, *canonical;
 
   /* We have to handle values a bit trickily here, to allow this code
      to work properly with non_lvalue values that are really just
@@ -1085,20 +1085,20 @@ gnuv3_get_typeid (struct value *value)
   type = make_cv_type (0, 0, type, NULL);
   gdbarch = get_type_arch (type);
 
-  typename = type_to_string (type);
-  if (typename == NULL)
+  type_name = type_to_string (type);
+  if (type_name == NULL)
     error (_("cannot find typeinfo for unnamed type"));
-  cleanup = make_cleanup (xfree, typename);
+  cleanup = make_cleanup (xfree, type_name);
 
   /* We need to canonicalize the type name here, because we do lookups
      using the demangled name, and so we must match the format it
      uses.  E.g., GDB tends to use "const char *" as a type name, but
      the demangler uses "char const *".  */
-  canonical = cp_canonicalize_string (typename);
+  canonical = cp_canonicalize_string (type_name);
   if (canonical != NULL)
     {
       make_cleanup (xfree, canonical);
-      typename = canonical;
+      type_name = canonical;
     }
 
   typeinfo_type = gnuv3_get_typeid_type (gdbarch);
@@ -1114,7 +1114,7 @@ gnuv3_get_typeid (struct value *value)
 
       vtable = gnuv3_get_vtable (gdbarch, type, address);
       if (vtable == NULL)
-	error (_("cannot find typeinfo for object of type '%s'"), typename);
+	error (_("cannot find typeinfo for object of type '%s'"), type_name);
       typeinfo_value = value_field (vtable, vtable_field_type_info);
       result = value_ind (value_cast (make_pointer_type (typeinfo_type, NULL),
 				      typeinfo_value));
@@ -1124,12 +1124,12 @@ gnuv3_get_typeid (struct value *value)
       char *sym_name;
       struct minimal_symbol *minsym;
 
-      sym_name = concat ("typeinfo for ", typename, (char *) NULL);
+      sym_name = concat ("typeinfo for ", type_name, (char *) NULL);
       make_cleanup (xfree, sym_name);
       minsym = lookup_minimal_symbol (sym_name, NULL, NULL);
 
       if (minsym == NULL)
-	error (_("could not find typeinfo symbol for '%s'"), typename);
+	error (_("could not find typeinfo symbol for '%s'"), type_name);
 
       result = value_at_lazy (typeinfo_type, SYMBOL_VALUE_ADDRESS (minsym));
     }
@@ -1177,21 +1177,21 @@ gnuv3_get_typename_from_type_info (struct value *type_info_ptr)
 static struct type *
 gnuv3_get_type_from_type_info (struct value *type_info_ptr)
 {
-  char *typename;
+  char *type_name;
   struct cleanup *cleanup;
   struct value *type_val;
   struct expression *expr;
   struct type *result;
 
-  typename = gnuv3_get_typename_from_type_info (type_info_ptr);
-  cleanup = make_cleanup (xfree, typename);
+  type_name = gnuv3_get_typename_from_type_info (type_info_ptr);
+  cleanup = make_cleanup (xfree, type_name);
 
   /* We have to parse the type name, since in general there is not a
      symbol for a type.  This is somewhat bogus since there may be a
      mis-parse.  Another approach might be to re-use the demangler's
      internal form to reconstruct the type somehow.  */
 
-  expr = parse_expression (typename);
+  expr = parse_expression (type_name);
   make_cleanup (xfree, expr);
 
   type_val = evaluate_type (expr);
diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c
index e6d4b91..e71b0c0 100644
--- a/gdb/p-valprint.c
+++ b/gdb/p-valprint.c
@@ -483,10 +483,10 @@ const char pascal_vtbl_ptr_name[] =
 int
 pascal_object_is_vtbl_ptr_type (struct type *type)
 {
-  const char *typename = type_name_no_tag (type);
+  const char *type_name = type_name_no_tag (type);
 
-  return (typename != NULL
-	  && strcmp (typename, pascal_vtbl_ptr_name) == 0);
+  return (type_name != NULL
+	  && strcmp (type_name, pascal_vtbl_ptr_name) == 0);
 }
 
 /* Return truth value for the assertion that TYPE is of the type
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index b6c78be..93f23b1 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -4548,9 +4548,9 @@ cleanup_undefined_types_1 (void)
 		struct pending *ppt;
 		int i;
 		/* Name of the type, without "struct" or "union".  */
-		const char *typename = TYPE_TAG_NAME (*type);
+		const char *type_name = TYPE_TAG_NAME (*type);
 
-		if (typename == NULL)
+		if (type_name == NULL)
 		  {
 		    complaint (&symfile_complaints, _("need a type name"));
 		    break;
@@ -4568,7 +4568,7 @@ cleanup_undefined_types_1 (void)
 			    && (TYPE_INSTANCE_FLAGS (*type) ==
 				TYPE_INSTANCE_FLAGS (SYMBOL_TYPE (sym)))
 			    && strcmp (SYMBOL_LINKAGE_NAME (sym),
-				       typename) == 0)
+				       type_name) == 0)
                           replace_type (*type, SYMBOL_TYPE (sym));
 		      }
 		  }
diff --git a/gdb/typeprint.c b/gdb/typeprint.c
index 36b2f47..3569ad0 100644
--- a/gdb/typeprint.c
+++ b/gdb/typeprint.c
@@ -500,12 +500,12 @@ whatis_command (char *exp, int from_tty)
   whatis_exp (exp, -1);
 }
 
-/* TYPENAME is either the name of a type, or an expression.  */
+/* TYPE_NAME is either the name of a type, or an expression.  */
 
 static void
-ptype_command (char *typename, int from_tty)
+ptype_command (char *type_name, int from_tty)
 {
-  whatis_exp (typename, 1);
+  whatis_exp (type_name, 1);
 }
 
 /* Print integral scalar data VAL, of type TYPE, onto stdio stream STREAM.
@@ -596,16 +596,16 @@ print_type_scalar (struct type *type, LONGEST val, struct ui_file *stream)
    and whatis_command().  */
 
 void
-maintenance_print_type (char *typename, int from_tty)
+maintenance_print_type (char *type_name, int from_tty)
 {
   struct value *val;
   struct type *type;
   struct cleanup *old_chain;
   struct expression *expr;
 
-  if (typename != NULL)
+  if (type_name != NULL)
     {
-      expr = parse_expression (typename);
+      expr = parse_expression (type_name);
       old_chain = make_cleanup (free_current_contents, &expr);
       if (expr->elts[0].opcode == OP_TYPE)
 	{
-- 
1.8.3.1

  parent reply	other threads:[~2013-10-09 17:18 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-09 17:17 [PATCH 00/18] -Wc++-compat patches Ondrej Oprala
2013-10-09 17:17 ` [PATCH 02/18] poison "new" Ondrej Oprala
2013-10-10 12:23   ` Pedro Alves
2013-10-10 19:15   ` Jan Kratochvil
2013-10-09 17:17 ` [PATCH 01/18] poison "class" Ondrej Oprala
2013-10-09 21:45   ` Stan Shebs
2013-10-20 19:13   ` Mark Kettenis
2013-10-24 17:57     ` Joel Brobecker
2013-10-24 18:21       ` Stan Shebs
2013-10-09 17:17 ` [PATCH 03/18] poison "this" Ondrej Oprala
2013-10-09 17:25   ` Tom Tromey
2013-10-10 12:25   ` Pedro Alves
2013-10-09 17:18 ` Ondrej Oprala [this message]
2013-10-13 17:24   ` [PATCH 13/18] poison "typename" Jan Kratochvil
2013-10-09 17:18 ` [PATCH 09/18] poison "namespace" Ondrej Oprala
2013-10-13 17:18   ` Jan Kratochvil
2013-10-09 17:18 ` [PATCH 07/18] poison "explicit" Ondrej Oprala
2013-10-13 16:58   ` Jan Kratochvil
2013-10-09 17:18 ` [PATCH 18/18] un-nest enum pvk Ondrej Oprala
2013-10-13 17:37   ` Jan Kratochvil
2013-10-09 17:18 ` [PATCH 17/18] fix gdbarch buglet Ondrej Oprala
2013-10-13 17:35   ` Jan Kratochvil
2013-10-09 17:18 ` [PATCH 16/18] fix up gdbtypes.h Ondrej Oprala
2013-10-13 17:32   ` Jan Kratochvil
2013-10-09 17:18 ` [PATCH 12/18] poison "try" Ondrej Oprala
2013-10-13 17:22   ` Jan Kratochvil
2013-10-09 17:18 ` [PATCH 14/18] poison "using" Ondrej Oprala
2013-10-13 17:25   ` Jan Kratochvil
2013-10-09 17:18 ` [PATCH 10/18] poison "operator" Ondrej Oprala
2013-10-13 17:20   ` Jan Kratochvil
2013-10-09 17:18 ` [PATCH 04/18] poison "public" Ondrej Oprala
2013-10-13 16:39   ` Jan Kratochvil
2013-10-09 17:18 ` [PATCH 06/18] poison "delete" Ondrej Oprala
2013-10-13 16:47   ` Jan Kratochvil
2013-10-09 17:18 ` [PATCH 15/18] fix up vec Ondrej Oprala
2013-10-13 17:29   ` Jan Kratochvil
2013-10-09 17:18 ` [PATCH 11/18] poison "template" Ondrej Oprala
2013-10-13 17:21   ` Jan Kratochvil
2013-10-09 17:53 ` [PATCH 08/18] poison "mutable" Ondrej Oprala
2013-10-13 17:00   ` Jan Kratochvil
2013-10-13 17:16     ` Jan Kratochvil
2013-10-09 18:09 ` [PATCH 05/18] poison "private" Ondrej Oprala
2013-10-13 16:45   ` Jan Kratochvil
2013-10-14  8:49   ` Pedro Alves
2013-10-14 15:36     ` Tom Tromey
2013-10-14 16:19       ` Pedro Alves
2013-10-09 18:56 ` [PATCH 00/18] -Wc++-compat patches Tom Tromey
2013-10-09 19:43   ` Ondrej Oprala
2013-10-21 15:37 [PATCH 00/18] -Wc++-compat patches v2.0 Ondrej Oprala
2013-10-21 15:37 ` [PATCH 13/18] poison "typename" Ondrej Oprala

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1381339053-14519-14-git-send-email-ooprala@redhat.com \
    --to=ooprala@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).