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 03/18] poison "this"
Date: Wed, 09 Oct 2013 17:17:00 -0000	[thread overview]
Message-ID: <1381339053-14519-4-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>

    bfd/
       * libbfd-in.h (item) : Renamed from this. Update copyright year.
       * libbfd.h (item) : Renamed from this. Update copyright year.

    gdb/
       * addrmap.c (self) : Renamed from this.
       * cp-namespace.c (this_sym) : Likewise.
       * frame.c (self) : Likewise.
       * gdbarch.c (self) : Likewise.
       * gdbarch.sh (self) : Likewise.
---
 bfd/ChangeLog      |  5 +++++
 bfd/libbfd-in.h    |  8 ++++----
 bfd/libbfd.h       |  8 ++++----
 gdb/ChangeLog      | 13 +++++++++++--
 gdb/addrmap.c      | 50 +++++++++++++++++++++++++-------------------------
 gdb/cp-namespace.c |  9 +++++----
 gdb/frame.c        |  8 ++++----
 gdb/gdbarch.c      | 22 +++++++++++-----------
 gdb/gdbarch.sh     | 22 +++++++++++-----------
 9 files changed, 80 insertions(+), 65 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 6162114..0c1a326 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -15,6 +15,11 @@
 
 2013-10-09  Tom Tromey  <tromey@redhat.com>
 
+ * libbfd-in.h (item) : Renamed from this. Update copyright year.
+ * libbfd.h (item) : Renamed from this. Update copyright year.
+
+2013-10-09  Tom Tromey  <tromey@redhat.com>
+
 	* bfd-in2.h: Rebuild.
 	* opncls.c (bfd_get_alt_debug_link_info): Change type of
 	buildid_len to bfd_size_type.
diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h
index 52c1f5f..b991d1b 100644
--- a/bfd/libbfd-in.h
+++ b/bfd/libbfd-in.h
@@ -3,7 +3,7 @@
 
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
    1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
-   2010, 2011, 2012
+   2010, 2011, 2012, 2013
    Free Software Foundation, Inc.
 
    Written by Cygnus Support.
@@ -31,9 +31,9 @@
    E.g. align to an 8-byte boundary with argument of 8.  Take care never
    to wrap around if the address is within boundary-1 of the end of the
    address space.  */
-#define BFD_ALIGN(this, boundary)					  \
-  ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this))		  \
-   ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \
+#define BFD_ALIGN(item, boundary)					  \
+  ((((bfd_vma) (item) + (boundary) - 1) >= (bfd_vma) (item))		  \
+   ? (((bfd_vma) (item) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \
    : ~ (bfd_vma) 0)
 
 /* If you want to read and write large blocks, you might want to do it
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
index 1381803..487b10a 100644
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -8,7 +8,7 @@
 
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
    1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
-   2010, 2011, 2012
+   2010, 2011, 2012, 2013
    Free Software Foundation, Inc.
 
    Written by Cygnus Support.
@@ -36,9 +36,9 @@
    E.g. align to an 8-byte boundary with argument of 8.  Take care never
    to wrap around if the address is within boundary-1 of the end of the
    address space.  */
-#define BFD_ALIGN(this, boundary)					  \
-  ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this))		  \
-   ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \
+#define BFD_ALIGN(item, boundary)					  \
+  ((((bfd_vma) (item) + (boundary) - 1) >= (bfd_vma) (item))		  \
+   ? (((bfd_vma) (item) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \
    : ~ (bfd_vma) 0)
 
 /* If you want to read and write large blocks, you might want to do it
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8cb2a86..be3cf66 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -17,8 +17,11 @@
 
 2013-10-09  Tom Tromey  <tromey@redhat.com>
 
-	* dwarf2read.c (dwarf2_get_dwz_file): Update for type change in
-	bfd_get_alt_debug_link_info.
+ * addrmap.c (self) : Renamed from this.
+ * cp-namespace.c (this_sym) : Likewise.
+ * frame.c (self) : Likewise.
+ * gdbarch.c (self) : Likewise.
+ * gdbarch.sh (self) : Likewise.
 
 2013-10-09  Tom Tromey  <tromey@redhat.com>
 
@@ -74,6 +77,12 @@
  * python/py-symbol.c(klass) : Likewise.
  * top.c(klass) : Likewise.
 
+2013-10-09  Tom Tromey  <tromey@redhat.com>
+
+	* dwarf2read.c (dwarf2_get_dwz_file): Update for type change in
+	bfd_get_alt_debug_link_info.
+
+
 2013-10-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
 	New flag OBJF_NOT_FILENAME.
diff --git a/gdb/addrmap.c b/gdb/addrmap.c
index 22694ed..348fd43 100644
--- a/gdb/addrmap.c
+++ b/gdb/addrmap.c
@@ -34,14 +34,14 @@
    implementation.  */
 struct addrmap_funcs
 {
-  void (*set_empty) (struct addrmap *this,
+  void (*set_empty) (struct addrmap *self,
                      CORE_ADDR start, CORE_ADDR end_inclusive,
                      void *obj);
-  void *(*find) (struct addrmap *this, CORE_ADDR addr);
-  struct addrmap *(*create_fixed) (struct addrmap *this,
+  void *(*find) (struct addrmap *self, CORE_ADDR addr);
+  struct addrmap *(*create_fixed) (struct addrmap *self,
                                    struct obstack *obstack);
-  void (*relocate) (struct addrmap *this, CORE_ADDR offset);
-  int (*foreach) (struct addrmap *this, addrmap_foreach_fn fn, void *data);
+  void (*relocate) (struct addrmap *self, CORE_ADDR offset);
+  int (*foreach) (struct addrmap *self, addrmap_foreach_fn fn, void *data);
 };
 
 
@@ -118,7 +118,7 @@ struct addrmap_fixed
 
 
 static void
-addrmap_fixed_set_empty (struct addrmap *this,
+addrmap_fixed_set_empty (struct addrmap *self,
                    CORE_ADDR start, CORE_ADDR end_inclusive,
                    void *obj)
 {
@@ -129,9 +129,9 @@ addrmap_fixed_set_empty (struct addrmap *this,
 
 
 static void *
-addrmap_fixed_find (struct addrmap *this, CORE_ADDR addr)
+addrmap_fixed_find (struct addrmap *self, CORE_ADDR addr)
 {
-  struct addrmap_fixed *map = (struct addrmap_fixed *) this;
+  struct addrmap_fixed *map = (struct addrmap_fixed *) self;
   struct addrmap_transition *bottom = &map->transitions[0];
   struct addrmap_transition *top = &map->transitions[map->num_transitions - 1];
 
@@ -162,7 +162,7 @@ addrmap_fixed_find (struct addrmap *this, CORE_ADDR addr)
 
 
 static struct addrmap *
-addrmap_fixed_create_fixed (struct addrmap *this, struct obstack *obstack)
+addrmap_fixed_create_fixed (struct addrmap *self, struct obstack *obstack)
 {
   internal_error (__FILE__, __LINE__,
                   _("addrmap_create_fixed is not implemented yet "
@@ -171,9 +171,9 @@ addrmap_fixed_create_fixed (struct addrmap *this, struct obstack *obstack)
 
 
 static void
-addrmap_fixed_relocate (struct addrmap *this, CORE_ADDR offset)
+addrmap_fixed_relocate (struct addrmap *self, CORE_ADDR offset)
 {
-  struct addrmap_fixed *map = (struct addrmap_fixed *) this;
+  struct addrmap_fixed *map = (struct addrmap_fixed *) self;
   size_t i;
 
   for (i = 0; i < map->num_transitions; i++)
@@ -182,10 +182,10 @@ addrmap_fixed_relocate (struct addrmap *this, CORE_ADDR offset)
 
 
 static int
-addrmap_fixed_foreach (struct addrmap *this, addrmap_foreach_fn fn,
+addrmap_fixed_foreach (struct addrmap *self, addrmap_foreach_fn fn,
 		       void *data)
 {
-  struct addrmap_fixed *map = (struct addrmap_fixed *) this;
+  struct addrmap_fixed *map = (struct addrmap_fixed *) self;
   size_t i;
 
   for (i = 0; i < map->num_transitions; i++)
@@ -320,26 +320,26 @@ addrmap_splay_tree_insert (struct addrmap_mutable *map,
    tree node at ADDR, even if it would represent a "transition" from
    one value to the same value.  */
 static void
-force_transition (struct addrmap_mutable *this, CORE_ADDR addr)
+force_transition (struct addrmap_mutable *self, CORE_ADDR addr)
 {
   splay_tree_node n
-    = addrmap_splay_tree_lookup (this, addr);
+    = addrmap_splay_tree_lookup (self, addr);
 
   if (! n)
     {
-      n = addrmap_splay_tree_predecessor (this, addr);
-      addrmap_splay_tree_insert (this, addr,
+      n = addrmap_splay_tree_predecessor (self, addr);
+      addrmap_splay_tree_insert (self, addr,
                                  n ? addrmap_node_value (n) : NULL);
     }
 }
 
 
 static void
-addrmap_mutable_set_empty (struct addrmap *this,
+addrmap_mutable_set_empty (struct addrmap *self,
                            CORE_ADDR start, CORE_ADDR end_inclusive,
                            void *obj)
 {
-  struct addrmap_mutable *map = (struct addrmap_mutable *) this;
+  struct addrmap_mutable *map = (struct addrmap_mutable *) self;
   splay_tree_node n, next;
   void *prior_value;
 
@@ -389,7 +389,7 @@ addrmap_mutable_set_empty (struct addrmap *this,
 
 
 static void *
-addrmap_mutable_find (struct addrmap *this, CORE_ADDR addr)
+addrmap_mutable_find (struct addrmap *self, CORE_ADDR addr)
 {
   /* Not needed yet.  */
   internal_error (__FILE__, __LINE__,
@@ -427,9 +427,9 @@ splay_foreach_copy (splay_tree_node n, void *closure)
 
 
 static struct addrmap *
-addrmap_mutable_create_fixed (struct addrmap *this, struct obstack *obstack)
+addrmap_mutable_create_fixed (struct addrmap *self, struct obstack *obstack)
 {
-  struct addrmap_mutable *mutable = (struct addrmap_mutable *) this;
+  struct addrmap_mutable *mutable = (struct addrmap_mutable *) self;
   struct addrmap_fixed *fixed;
   size_t num_transitions;
 
@@ -462,7 +462,7 @@ addrmap_mutable_create_fixed (struct addrmap *this, struct obstack *obstack)
 
 
 static void
-addrmap_mutable_relocate (struct addrmap *this, CORE_ADDR offset)
+addrmap_mutable_relocate (struct addrmap *self, CORE_ADDR offset)
 {
   /* Not needed yet.  */
   internal_error (__FILE__, __LINE__,
@@ -493,10 +493,10 @@ addrmap_mutable_foreach_worker (splay_tree_node node, void *data)
 
 
 static int
-addrmap_mutable_foreach (struct addrmap *this, addrmap_foreach_fn fn,
+addrmap_mutable_foreach (struct addrmap *self, addrmap_foreach_fn fn,
 			 void *data)
 {
-  struct addrmap_mutable *mutable = (struct addrmap_mutable *) this;
+  struct addrmap_mutable *mutable = (struct addrmap_mutable *) self;
   struct mutable_foreach_data foreach_data;
 
   foreach_data.fn = fn;
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
index f7db48c..bc5ea10 100644
--- a/gdb/cp-namespace.c
+++ b/gdb/cp-namespace.c
@@ -660,16 +660,17 @@ lookup_symbol_file (const char *name,
       if (prefix_len == 0)
 	{
 	  struct type *type;
-	  struct symbol *this;
+	  struct symbol *this_sym;
 
-	  this = lookup_language_this (language_def (language_cplus), block);
-	  if (this == NULL)
+	  this_sym = lookup_language_this (language_def (language_cplus),
+					   block);
+	  if (this_sym == NULL)
 	    {
 	      do_cleanups (cleanup);
 	      return NULL;
 	    }
 
-	  type = check_typedef (TYPE_TARGET_TYPE (SYMBOL_TYPE (this)));
+	  type = check_typedef (TYPE_TARGET_TYPE (SYMBOL_TYPE (this_sym)));
 	  klass = xstrdup (TYPE_NAME (type));
 	  nested = xstrdup (name);
 	}
diff --git a/gdb/frame.c b/gdb/frame.c
index 59e31db..fd56c84 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -667,9 +667,9 @@ frame_find_by_id (struct frame_id id)
 
   for (frame = get_current_frame (); ; frame = prev_frame)
     {
-      struct frame_id this = get_frame_id (frame);
+      struct frame_id self = get_frame_id (frame);
 
-      if (frame_id_eq (id, this))
+      if (frame_id_eq (id, self))
 	/* An exact match.  */
 	return frame;
 
@@ -683,7 +683,7 @@ frame_find_by_id (struct frame_id id)
 	 frame in the current frame chain can have this ID.  See the
 	 comment at frame_id_inner for details.   */
       if (get_frame_type (frame) == NORMAL_FRAME
-	  && !frame_id_inner (get_frame_arch (frame), id, this)
+	  && !frame_id_inner (get_frame_arch (frame), id, self)
 	  && frame_id_inner (get_frame_arch (prev_frame), id,
 			     get_frame_id (prev_frame)))
 	return NULL;
@@ -704,7 +704,7 @@ frame_unwind_pc_if_available (struct frame_info *this_frame, CORE_ADDR *pc)
 
 	  /* The right way.  The `pure' way.  The one true way.  This
 	     method depends solely on the register-unwind code to
-	     determine the value of registers in THIS frame, and hence
+	     determine the value of registers in SELF frame, and hence
 	     the value of this frame's PC (resume address).  A typical
 	     implementation is no more than:
 	   
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 1f3380e..396bb67 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -4744,7 +4744,7 @@ gdbarch_find_by_info (struct gdbarch_info info)
   if (new_gdbarch->initialized_p)
     {
       struct gdbarch_list **list;
-      struct gdbarch_list *this;
+      struct gdbarch_list *self;
       if (gdbarch_debug)
 	fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
 			    "Previous architecture %s (%s) selected\n",
@@ -4756,12 +4756,12 @@ gdbarch_find_by_info (struct gdbarch_info info)
 	   list = &(*list)->next);
       /* It had better be in the list of architectures.  */
       gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch);
-      /* Unlink THIS.  */
-      this = (*list);
-      (*list) = this->next;
-      /* Insert THIS at the front.  */
-      this->next = rego->arches;
-      rego->arches = this;
+      /* Unlink SELF.  */
+      self = (*list);
+      (*list) = self->next;
+      /* Insert SELF at the front.  */
+      self->next = rego->arches;
+      rego->arches = self;
       /* Return it.  */
       return new_gdbarch;
     }
@@ -4776,10 +4776,10 @@ gdbarch_find_by_info (struct gdbarch_info info)
   /* Insert the new architecture into the front of the architecture
      list (keep the list sorted Most Recently Used).  */
   {
-    struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
-    this->next = rego->arches;
-    this->gdbarch = new_gdbarch;
-    rego->arches = this;
+    struct gdbarch_list *self = XMALLOC (struct gdbarch_list);
+    self->next = rego->arches;
+    self->gdbarch = new_gdbarch;
+    rego->arches = self;
   }    
 
   /* Check that the newly installed architecture is valid.  Plug in
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 5e46788..e24b6b5 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -2248,7 +2248,7 @@ gdbarch_find_by_info (struct gdbarch_info info)
   if (new_gdbarch->initialized_p)
     {
       struct gdbarch_list **list;
-      struct gdbarch_list *this;
+      struct gdbarch_list *self;
       if (gdbarch_debug)
 	fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
 			    "Previous architecture %s (%s) selected\n",
@@ -2260,12 +2260,12 @@ gdbarch_find_by_info (struct gdbarch_info info)
 	   list = &(*list)->next);
       /* It had better be in the list of architectures.  */
       gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch);
-      /* Unlink THIS.  */
-      this = (*list);
-      (*list) = this->next;
-      /* Insert THIS at the front.  */
-      this->next = rego->arches;
-      rego->arches = this;
+      /* Unlink SELF.  */
+      self = (*list);
+      (*list) = self->next;
+      /* Insert SELF at the front.  */
+      self->next = rego->arches;
+      rego->arches = self;
       /* Return it.  */
       return new_gdbarch;
     }
@@ -2280,10 +2280,10 @@ gdbarch_find_by_info (struct gdbarch_info info)
   /* Insert the new architecture into the front of the architecture
      list (keep the list sorted Most Recently Used).  */
   {
-    struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
-    this->next = rego->arches;
-    this->gdbarch = new_gdbarch;
-    rego->arches = this;
+    struct gdbarch_list *self = XMALLOC (struct gdbarch_list);
+    self->next = rego->arches;
+    self->gdbarch = new_gdbarch;
+    rego->arches = self;
   }    
 
   /* Check that the newly installed architecture is valid.  Plug in
-- 
1.8.3.1

  parent reply	other threads:[~2013-10-09 17:17 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 ` Ondrej Oprala [this message]
2013-10-09 17:25   ` [PATCH 03/18] poison "this" Tom Tromey
2013-10-10 12:25   ` Pedro Alves
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 14/18] poison "using" Ondrej Oprala
2013-10-13 17:25   ` 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: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 09/18] poison "namespace" Ondrej Oprala
2013-10-13 17:18   ` Jan Kratochvil
2013-10-09 17:18 ` [PATCH 13/18] poison "typename" Ondrej Oprala
2013-10-13 17:24   ` 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 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: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 03/18] poison "this" 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-4-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).