mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-06 06:45:56 +08:00
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.
This commit is contained in:
@ -153,15 +153,16 @@ ARMul_ConsolePrint (ARMul_State * state,
|
||||
int
|
||||
sim_write (SIM_DESC sd ATTRIBUTE_UNUSED,
|
||||
SIM_ADDR addr,
|
||||
const unsigned char * buffer,
|
||||
const void * buffer,
|
||||
int size)
|
||||
{
|
||||
int i;
|
||||
const unsigned char * data = buffer;
|
||||
|
||||
init ();
|
||||
|
||||
for (i = 0; i < size; i++)
|
||||
ARMul_SafeWriteByte (state, addr + i, buffer[i]);
|
||||
ARMul_SafeWriteByte (state, addr + i, data[i]);
|
||||
|
||||
return size;
|
||||
}
|
||||
@ -169,15 +170,16 @@ sim_write (SIM_DESC sd ATTRIBUTE_UNUSED,
|
||||
int
|
||||
sim_read (SIM_DESC sd ATTRIBUTE_UNUSED,
|
||||
SIM_ADDR addr,
|
||||
unsigned char * buffer,
|
||||
void * buffer,
|
||||
int size)
|
||||
{
|
||||
int i;
|
||||
unsigned char * data = buffer;
|
||||
|
||||
init ();
|
||||
|
||||
for (i = 0; i < size; i++)
|
||||
buffer[i] = ARMul_SafeReadByte (state, addr + i);
|
||||
data[i] = ARMul_SafeReadByte (state, addr + i);
|
||||
|
||||
return size;
|
||||
}
|
||||
|
Reference in New Issue
Block a user