From 190df9bce72a8c7c7c839714205cd090c1b7fb3b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 29 Sep 2024 19:20:06 -0400 Subject: Use exhaustive switch statements everywhere --- src/jack.c | 8 ++++---- src/portaudio.c | 7 ++----- 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/jack.c b/src/jack.c index de8517a..047662d 100644 --- a/src/jack.c +++ b/src/jack.c @@ -129,6 +129,8 @@ jack_process_cb(jack_nframes_t nframes, void* data) jalv->rolling = rolling; switch (jalv->play_state) { + case JALV_RUNNING: + break; case JALV_PAUSE_REQUESTED: jalv->play_state = JALV_PAUSED; zix_sem_post(&jalv->paused); @@ -146,8 +148,6 @@ jack_process_cb(jack_nframes_t nframes, void* data) } } return 0; - default: - break; } // Prepare port buffers @@ -415,6 +415,8 @@ jalv_backend_activate_port(Jalv* jalv, uint32_t port_index) // Connect the port based on its type switch (port->type) { + case TYPE_UNKNOWN: + break; case TYPE_CONTROL: lilv_instance_connect_port(jalv->instance, port_index, &port->control); break; @@ -445,8 +447,6 @@ jalv_backend_activate_port(Jalv* jalv, uint32_t port_index) 0); } break; - default: - break; } #if USE_JACK_METADATA diff --git a/src/portaudio.c b/src/portaudio.c index f9283dd..bfc1e2d 100644 --- a/src/portaudio.c +++ b/src/portaudio.c @@ -196,11 +196,8 @@ void jalv_backend_activate_port(Jalv* jalv, uint32_t port_index) { struct Port* const port = &jalv->ports[port_index]; - switch (port->type) { - case TYPE_CONTROL: + + if (port->type == TYPE_CONTROL) { lilv_instance_connect_port(jalv->instance, port_index, &port->control); - break; - default: - break; } } -- cgit v1.2.1