From e4880c661a1cb0273d6bbc3cfbc0c4a26bf6c4ab Mon Sep 17 00:00:00 2001 From: David Robillard <d@drobilla.net> Date: Wed, 10 Aug 2022 11:09:55 -0400 Subject: Remove unnecessary casts --- src/jalv.c | 6 +++--- src/worker.c | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/jalv.c b/src/jalv.c index 66d4407..8a3920f 100644 --- a/src/jalv.c +++ b/src/jalv.c @@ -540,7 +540,7 @@ jalv_apply_ui_events(Jalv* jalv, uint32_t nframes) ControlChange ev; const size_t space = zix_ring_read_space(jalv->ui_to_plugin); for (size_t i = 0; i < space; i += sizeof(ev) + ev.size) { - zix_ring_read(jalv->ui_to_plugin, (char*)&ev, sizeof(ev)); + zix_ring_read(jalv->ui_to_plugin, &ev, sizeof(ev)); char body[MSG_BUFFER_SIZE]; if (zix_ring_read(jalv->ui_to_plugin, body, ev.size) != ev.size) { @@ -679,14 +679,14 @@ jalv_update(Jalv* jalv) const size_t space = zix_ring_read_space(jalv->plugin_to_ui); for (size_t i = 0; i + sizeof(ev) < space; i += sizeof(ev) + ev.size) { // Read event header to get the size - zix_ring_read(jalv->plugin_to_ui, (char*)&ev, sizeof(ev)); + zix_ring_read(jalv->plugin_to_ui, &ev, sizeof(ev)); // Resize read buffer if necessary jalv->ui_event_buf = realloc(jalv->ui_event_buf, ev.size); void* const buf = jalv->ui_event_buf; // Read event body - zix_ring_read(jalv->plugin_to_ui, (char*)buf, ev.size); + zix_ring_read(jalv->plugin_to_ui, buf, ev.size); if (jalv->opts.dump && ev.protocol == jalv->urids.atom_eventTransfer) { // Dump event in Turtle to the console diff --git a/src/worker.c b/src/worker.c index 2db0992..c7b7143 100644 --- a/src/worker.c +++ b/src/worker.c @@ -35,7 +35,7 @@ worker_func(void* data) } uint32_t size = 0; - zix_ring_read(worker->requests, (char*)&size, sizeof(size)); + zix_ring_read(worker->requests, &size, sizeof(size)); void* const new_buf = realloc(buf, size); if (!new_buf) { @@ -43,7 +43,7 @@ worker_func(void* data) } buf = new_buf; - zix_ring_read(worker->requests, (char*)buf, size); + zix_ring_read(worker->requests, buf, size); zix_sem_wait(worker->lock); worker->iface->work(worker->handle, jalv_worker_respond, worker, size, buf); @@ -122,8 +122,8 @@ jalv_worker_emit_responses(JalvWorker* worker, LV2_Handle lv2_handle) uint32_t read_space = zix_ring_read_space(worker->responses); while (read_space) { uint32_t size = 0; - zix_ring_read(worker->responses, (char*)&size, sizeof(size)); - zix_ring_read(worker->responses, (char*)worker->response, size); + zix_ring_read(worker->responses, &size, sizeof(size)); + zix_ring_read(worker->responses, worker->response, size); worker->iface->work_response(lv2_handle, size, worker->response); -- cgit v1.2.1