From 5b94c3808140206d3b5204a3780f294d590cc458 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 26 Oct 2022 21:53:30 +0545 Subject: 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. --- sim/h8300/compile.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sim/h8300') 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) -- cgit v1.1