aboutsummaryrefslogtreecommitdiff
path: root/sim/h8300
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2022-10-26 21:53:30 +0545
committerMike Frysinger <vapier@gentoo.org>2022-10-31 21:24:39 +0545
commit5b94c3808140206d3b5204a3780f294d590cc458 (patch)
tree4b5bea9bdc30a6ab503bd3d1c289b5e6f20af836 /sim/h8300
parentf2462532e24ebfc137598d73ee6541948121f040 (diff)
downloadbinutils-5b94c3808140206d3b5204a3780f294d590cc458.zip
binutils-5b94c3808140206d3b5204a3780f294d590cc458.tar.gz
binutils-5b94c3808140206d3b5204a3780f294d590cc458.tar.bz2
sim: common: change sim_read & sim_write to use void* buffers
When reading/writing arbitrary data to the system's memory, the unsigned char pointer type doesn't make that much sense. Switch it to void so we align a bit with standard C library read/write functions, and to avoid having to sprinkle casts everywhere.
Diffstat (limited to 'sim/h8300')
-rw-r--r--sim/h8300/compile.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c
index 5f64b47..f49e83d 100644
--- a/sim/h8300/compile.c
+++ b/sim/h8300/compile.c
@@ -4442,9 +4442,10 @@ sim_engine_run (SIM_DESC sd,
}
int
-sim_write (SIM_DESC sd, SIM_ADDR addr, const unsigned char *buffer, int size)
+sim_write (SIM_DESC sd, SIM_ADDR addr, const void *buffer, int size)
{
int i;
+ const unsigned char *data = buffer;
init_pointers (sd);
if (addr < 0)
@@ -4453,7 +4454,7 @@ sim_write (SIM_DESC sd, SIM_ADDR addr, const unsigned char *buffer, int size)
{
if (addr < memory_size)
{
- h8_set_memory (sd, addr + i, buffer[i]);
+ h8_set_memory (sd, addr + i, data[i]);
}
else
break;
@@ -4462,7 +4463,7 @@ sim_write (SIM_DESC sd, SIM_ADDR addr, const unsigned char *buffer, int size)
}
int
-sim_read (SIM_DESC sd, SIM_ADDR addr, unsigned char *buffer, int size)
+sim_read (SIM_DESC sd, SIM_ADDR addr, void *buffer, int size)
{
init_pointers (sd);
if (addr < 0)