forked from Imagelibrary/binutils-gdb
sim: common: change sim_{fetch,store}_register helpers 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.
This commit is contained in:
@@ -1600,8 +1600,10 @@ sim_read (SIM_DESC sd, SIM_ADDR addr, void *buffer, int size)
|
||||
}
|
||||
|
||||
static int
|
||||
avr_reg_store (SIM_CPU *cpu, int rn, const unsigned char *memory, int length)
|
||||
avr_reg_store (SIM_CPU *cpu, int rn, const void *buf, int length)
|
||||
{
|
||||
const unsigned char *memory = buf;
|
||||
|
||||
if (rn < 32 && length == 1)
|
||||
{
|
||||
sram[rn] = *memory;
|
||||
@@ -1629,8 +1631,10 @@ avr_reg_store (SIM_CPU *cpu, int rn, const unsigned char *memory, int length)
|
||||
}
|
||||
|
||||
static int
|
||||
avr_reg_fetch (SIM_CPU *cpu, int rn, unsigned char *memory, int length)
|
||||
avr_reg_fetch (SIM_CPU *cpu, int rn, void *buf, int length)
|
||||
{
|
||||
unsigned char *memory = buf;
|
||||
|
||||
if (rn < 32 && length == 1)
|
||||
{
|
||||
*memory = sram[rn];
|
||||
|
||||
Reference in New Issue
Block a user