From 99b23ed9eed7582cb1cfcd51706b78596f945501 Mon Sep 17 00:00:00 2001 From: Andrew Lalaev Date: Fri, 30 Aug 2024 16:48:10 +0200 Subject: [PATCH] riscv: batch.c: fix compilation error on macos --- src/target/riscv/batch.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/target/riscv/batch.c b/src/target/riscv/batch.c index bcdb77d91..543af84b3 100644 --- a/src/target/riscv/batch.c +++ b/src/target/riscv/batch.c @@ -191,15 +191,15 @@ size_t riscv_batch_add_dm_read(struct riscv_batch *batch, uint64_t address) assert(batch->used_scans < batch->allocated_scans); if (batch->emulated) { if (batch->queued_retval == ERROR_OK) { - uint32_t *data_in = (uint32_t *)batch->data_in; - data_in = &data_in[batch->used_scans]; + void *data_in = batch->data_in; + data_in = &(((uint32_t *) data_in)[batch->used_scans]); if (batch->ap) { uint32_t dmi_addr = 4 * riscv_get_dmi_address(batch->target, address); - batch->queued_retval = mem_ap_read_u32(batch->ap, dmi_addr, data_in); + batch->queued_retval = mem_ap_read_u32(batch->ap, dmi_addr, (uint32_t *) data_in); } else { uint32_t dmi_addr = riscv_get_dmi_address(batch->target, address); batch->queued_retval = riscv_dmi_read(batch->target, - data_in, dmi_addr); + (uint32_t *) data_in, dmi_addr); } } batch->read_keys[batch->read_keys_used] = batch->used_scans; @@ -240,8 +240,8 @@ uint32_t riscv_batch_get_dmi_read_data(const struct riscv_batch *batch, size_t k size_t index = batch->read_keys[key]; assert(index < batch->used_scans); if (batch->emulated) { - uint32_t *data_in = (uint32_t *)batch->data_in; - return data_in[index]; + void *data_in = batch->data_in; + return ((uint32_t*) data_in)[index]; } uint8_t *base = batch->data_in + DMI_SCAN_BUF_SIZE * index; /* extract "data" field from the DMI read result */ -- 2.39.3 (Apple Git-146)