[binutils-gdb] sim: m68hc11: tweak types to fix warnings

Michael Frysinger vapier@sourceware.org
Wed May 5 02:06:27 GMT 2021


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=bf06b2a2f9fdf4b267c22328ba0dc35c07919f5c

commit bf06b2a2f9fdf4b267c22328ba0dc35c07919f5c
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Sat May 1 22:37:49 2021 -0400

    sim: m68hc11: tweak types to fix warnings
    
    The hw attach API wants unsigned addresses.
    The write API wants signed chars.

Diff:
---
 sim/m68hc11/ChangeLog       | 5 +++++
 sim/m68hc11/dv-m68hc11.c    | 2 +-
 sim/m68hc11/dv-m68hc11sio.c | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/sim/m68hc11/ChangeLog b/sim/m68hc11/ChangeLog
index 77283424c89..6fd984dfa99 100644
--- a/sim/m68hc11/ChangeLog
+++ b/sim/m68hc11/ChangeLog
@@ -1,3 +1,8 @@
+2021-05-04  Mike Frysinger  <vapier@gentoo.org>
+
+	* dv-m68hc11.c (struct m68hc11cpu): Change attach_size to unsigned int.
+	* dv-m68hc11sio.c (m68hc11sio_tx_poll): Cast buffer to const char*.
+
 2021-05-04  Mike Frysinger  <vapier@gentoo.org>
 
 	* configure: Regenerate.
diff --git a/sim/m68hc11/dv-m68hc11.c b/sim/m68hc11/dv-m68hc11.c
index 3ec524a8e07..f4815883a33 100644
--- a/sim/m68hc11/dv-m68hc11.c
+++ b/sim/m68hc11/dv-m68hc11.c
@@ -142,7 +142,7 @@ struct m68hc11cpu {
   int              pending_level;
   struct hw_event  *event;
   unsigned_word    attach_address;
-  int              attach_size;
+  unsigned int     attach_size;
   int              attach_space;
   int              last_oscillator;
   struct input_osc oscillators[NR_OSC];
diff --git a/sim/m68hc11/dv-m68hc11sio.c b/sim/m68hc11/dv-m68hc11sio.c
index a5ee9a9d68a..b6eacb4883e 100644
--- a/sim/m68hc11/dv-m68hc11sio.c
+++ b/sim/m68hc11/dv-m68hc11sio.c
@@ -340,7 +340,7 @@ m68hc11sio_tx_poll (struct hw *me, void *data)
           break;
 
         case sio_stdio:
-          sim_io_write_stdout (sd, &controller->tx_char, 1);
+          sim_io_write_stdout (sd, (const char *)&controller->tx_char, 1);
           sim_io_flush_stdout (sd);
           break;


More information about the Gdb-cvs mailing list