[PATCH/committed] sim: m32c: rename open symbol to avoid collisions

Message ID 20210529160423.15699-1-vapier@gentoo.org
State New
Headers show
Series
  • [PATCH/committed] sim: m32c: rename open symbol to avoid collisions
Related show

Commit Message

Zoran Zaric via Gdb-patches May 29, 2021, 4:04 p.m.
If the header files define open(), make sure our local open var
doesn't shadow it.
---
 sim/m32c/ChangeLog | 6 ++++++
 sim/m32c/gdb-if.c  | 8 ++++----
 2 files changed, 10 insertions(+), 4 deletions(-)

-- 
2.31.1

Patch

diff --git a/sim/m32c/ChangeLog b/sim/m32c/ChangeLog
index 591d8b9ddd1e..eec489f29dbd 100644
--- a/sim/m32c/ChangeLog
+++ b/sim/m32c/ChangeLog
@@ -1,3 +1,9 @@ 
+2021-05-28  Mike Frysinger  <vapier@gentoo.org>
+
+	* gdb-if.c (open): Rename to ...
+	(is_open): ... this.
+	(sim_open, sim_close): Rename open to is_open.
+
 2021-05-16  Mike Frysinger  <vapier@gentoo.org>
 
 	* int.c, misc.c, opc2c.c, reg.c, srcdest.c: Include defs.h.
diff --git a/sim/m32c/gdb-if.c b/sim/m32c/gdb-if.c
index b00d878f0bea..b154fe6d3148 100644
--- a/sim/m32c/gdb-if.c
+++ b/sim/m32c/gdb-if.c
@@ -58,7 +58,7 @@  static struct sim_state the_minisim = {
   "This is the sole m32c minisim instance.  See libsim.a's global variables."
 };
 
-static int open;
+static int is_open;
 
 SIM_DESC
 sim_open (SIM_OPEN_KIND kind,
@@ -66,7 +66,7 @@  sim_open (SIM_OPEN_KIND kind,
 	  struct bfd *abfd, char * const *argv)
 {
   setbuf (stdout, 0);
-  if (open)
+  if (is_open)
     fprintf (stderr, "m32c minisim: re-opened sim\n");
 
   /* The 'run' interface doesn't use this function, so we don't care
@@ -88,7 +88,7 @@  sim_open (SIM_OPEN_KIND kind,
   init_mem ();
   init_regs ();
 
-  open = 1;
+  is_open = 1;
   return &the_minisim;
 }
 
@@ -107,7 +107,7 @@  sim_close (SIM_DESC sd, int quitting)
   /* Not much to do.  At least free up our memory.  */
   init_mem ();
 
-  open = 0;
+  is_open = 0;
 }
 
 static bfd *