diff options
author | David Robillard <d@drobilla.net> | 2024-09-29 19:20:06 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2024-10-12 11:10:39 -0400 |
commit | 190df9bce72a8c7c7c839714205cd090c1b7fb3b (patch) | |
tree | 66563eb19da4c1d5fb813bbc9a1c4b2145b5ca23 | |
parent | d62d74fab2bd221e349b1a60dcc25e2e20904d70 (diff) | |
download | jalv-190df9bce72a8c7c7c839714205cd090c1b7fb3b.tar.gz jalv-190df9bce72a8c7c7c839714205cd090c1b7fb3b.tar.bz2 jalv-190df9bce72a8c7c7c839714205cd090c1b7fb3b.zip |
Use exhaustive switch statements everywhere
-rw-r--r-- | .clang-tidy | 1 | ||||
-rw-r--r-- | meson/suppressions/meson.build | 3 | ||||
-rw-r--r-- | src/jack.c | 8 | ||||
-rw-r--r-- | src/portaudio.c | 7 |
4 files changed, 6 insertions, 13 deletions
diff --git a/.clang-tidy b/.clang-tidy index 096921e..bc11068 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -25,7 +25,6 @@ Checks: > -cppcoreguidelines-pro-type-static-cast-downcast, -fuchsia-default-arguments-calls, -google-readability-todo, - -hicpp-multiway-paths-covered, -hicpp-signed-bitwise, -llvm-header-guard, -llvmlibc-*, diff --git a/meson/suppressions/meson.build b/meson/suppressions/meson.build index 7f70ee1..04341bd 100644 --- a/meson/suppressions/meson.build +++ b/meson/suppressions/meson.build @@ -32,7 +32,6 @@ if is_variable('cc') '-Wno-shorten-64-to-32', '-Wno-sign-conversion', '-Wno-switch-default', - '-Wno-switch-enum', '-Wno-unsafe-buffer-usage', ] @@ -76,7 +75,6 @@ if is_variable('cc') '-Wno-suggest-attribute=const', '-Wno-suggest-attribute=pure', '-Wno-switch-default', - '-Wno-switch-enum', '-Wno-unsuffixed-float-constants', '-Wno-unused-const-variable', ] @@ -85,7 +83,6 @@ if is_variable('cc') elif cc.get_id() == 'msvc' if warning_level == 'everything' c_suppressions += [ - '/wd4061', # enumerator in switch is not explicitly handled '/wd4191', # unsafe function conversion '/wd4200', # zero-sized array in struct/union '/wd4242', # possible loss of data from float conversion @@ -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; } } |