diff options
author | Mike Frysinger <vapier@gentoo.org> | 2022-10-26 21:53:30 +0545 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2022-10-31 21:24:39 +0545 |
commit | 5b94c3808140206d3b5204a3780f294d590cc458 (patch) | |
tree | 4b5bea9bdc30a6ab503bd3d1c289b5e6f20af836 /sim/iq2000 | |
parent | f2462532e24ebfc137598d73ee6541948121f040 (diff) | |
download | fsf-binutils-gdb-5b94c3808140206d3b5204a3780f294d590cc458.zip fsf-binutils-gdb-5b94c3808140206d3b5204a3780f294d590cc458.tar.gz fsf-binutils-gdb-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/iq2000')
-rw-r--r-- | sim/iq2000/iq2000.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sim/iq2000/iq2000.c b/sim/iq2000/iq2000.c index 2c01434..9b1f4bd 100644 --- a/sim/iq2000/iq2000.c +++ b/sim/iq2000/iq2000.c @@ -47,8 +47,7 @@ fetch_str (SIM_CPU *current_cpu, PCADDR pc, DI addr) pc, read_map, CPU2DATA(addr + nr)) != 0) nr++; buf = NZALLOC (char, nr + 1); - sim_read (CPU_STATE (current_cpu), CPU2DATA(addr), (unsigned char *) buf, - nr); + sim_read (CPU_STATE (current_cpu), CPU2DATA(addr), buf, nr); return buf; } @@ -83,8 +82,7 @@ do_syscall (SIM_CPU *current_cpu, PCADDR pc) case TARGET_NEWLIB_SYS_write: buf = zalloc (PARM3); - sim_read (CPU_STATE (current_cpu), CPU2DATA(PARM2), - (unsigned char *) buf, PARM3); + sim_read (CPU_STATE (current_cpu), CPU2DATA(PARM2), buf, PARM3); SET_H_GR (ret_reg, sim_io_write (CPU_STATE (current_cpu), PARM1, buf, PARM3)); |