diff options
author | David Robillard <d@drobilla.net> | 2022-08-10 11:09:55 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-08-17 13:50:54 -0400 |
commit | e4880c661a1cb0273d6bbc3cfbc0c4a26bf6c4ab (patch) | |
tree | b06cb10a9cdf6b9b468ddc1df26f01ddb605419e /src | |
parent | 1b808ae2d23f4abb8251d69b5fe555cc6923a566 (diff) | |
download | jalv-e4880c661a1cb0273d6bbc3cfbc0c4a26bf6c4ab.tar.gz jalv-e4880c661a1cb0273d6bbc3cfbc0c4a26bf6c4ab.tar.bz2 jalv-e4880c661a1cb0273d6bbc3cfbc0c4a26bf6c4ab.zip |
Remove unnecessary casts
Diffstat (limited to 'src')
-rw-r--r-- | src/jalv.c | 6 | ||||
-rw-r--r-- | src/worker.c | 8 |
2 files changed, 7 insertions, 7 deletions
@@ -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); |