Merge branch 'use-more-const' of https://github.com/radare/unicorn into radare-use-more-const
This commit is contained in:
commit
84e01e6c05
@ -28,7 +28,7 @@ typedef int (*reg_access_t)(uch handle, unsigned int regid, void *value);
|
||||
|
||||
typedef void (*reg_reset_t)(uch handle);
|
||||
|
||||
typedef bool (*uc_write_mem_t)(AddressSpace *as, hwaddr addr, uint8_t *buf, int len);
|
||||
typedef bool (*uc_write_mem_t)(AddressSpace *as, hwaddr addr, const uint8_t *buf, int len);
|
||||
|
||||
typedef bool (*uc_read_mem_t)(AddressSpace *as, hwaddr addr, uint8_t *buf, int len);
|
||||
|
||||
|
@ -303,7 +303,7 @@ uc_err uc_reg_read(uch handle, int regid, void *value);
|
||||
for detailed error).
|
||||
*/
|
||||
UNICORN_EXPORT
|
||||
uc_err uc_mem_write(uch handle, uint64_t address, uint8_t *bytes, size_t size);
|
||||
uc_err uc_mem_write(uch handle, uint64_t address, const uint8_t *bytes, size_t size);
|
||||
|
||||
/*
|
||||
Read a range of bytes in memory.
|
||||
|
@ -14,7 +14,7 @@ static inline bool cpu_physical_mem_read(AddressSpace *as, hwaddr addr,
|
||||
}
|
||||
|
||||
static inline bool cpu_physical_mem_write(AddressSpace *as, hwaddr addr,
|
||||
uint8_t *buf, int len)
|
||||
const uint8_t *buf, int len)
|
||||
{
|
||||
return !cpu_physical_memory_rw(as, addr, (void *)buf, len, 1);
|
||||
}
|
||||
|
2
uc.c
2
uc.c
@ -356,7 +356,7 @@ uc_err uc_mem_read(uch handle, uint64_t address, uint8_t *bytes, size_t size)
|
||||
|
||||
|
||||
UNICORN_EXPORT
|
||||
uc_err uc_mem_write(uch handle, uint64_t address, uint8_t *bytes, size_t size)
|
||||
uc_err uc_mem_write(uch handle, uint64_t address, const uint8_t *bytes, size_t size)
|
||||
{
|
||||
struct uc_struct *uc = (struct uc_struct *)(uintptr_t)handle;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user