diff options
author | David Robillard <d@drobilla.net> | 2020-12-16 16:48:43 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-12-16 16:48:43 +0100 |
commit | 37ec8d59b349b9b735b58134a72e7372f36345dc (patch) | |
tree | d420f7a419fdfff739ba3d549008d3ffe97d233a /plugins | |
parent | c51699efe9064ff3b59ee40db81a0b92e3d01272 (diff) | |
download | lv2-37ec8d59b349b9b735b58134a72e7372f36345dc.tar.xz |
Simplify degenerate switches
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/eg-amp.lv2/amp.c | 5 | ||||
-rw-r--r-- | plugins/eg-fifths.lv2/fifths.c | 7 | ||||
-rw-r--r-- | plugins/eg-metro.lv2/metro.c | 7 | ||||
-rw-r--r-- | plugins/eg-midigate.lv2/midigate.c | 7 | ||||
-rw-r--r-- | plugins/eg-sampler.lv2/sampler.c | 7 | ||||
-rw-r--r-- | plugins/eg-sampler.lv2/sampler_ui.c | 7 | ||||
-rw-r--r-- | plugins/eg-scope.lv2/examploscope_ui.c | 7 |
7 files changed, 7 insertions, 40 deletions
diff --git a/plugins/eg-amp.lv2/amp.c b/plugins/eg-amp.lv2/amp.c index c3ba279..77cf83f 100644 --- a/plugins/eg-amp.lv2/amp.c +++ b/plugins/eg-amp.lv2/amp.c @@ -223,8 +223,5 @@ LV2_SYMBOL_EXPORT const LV2_Descriptor* lv2_descriptor(uint32_t index) { - switch (index) { - case 0: return &descriptor; - default: return NULL; - } + return index == 0 ? &descriptor : NULL; } diff --git a/plugins/eg-fifths.lv2/fifths.c b/plugins/eg-fifths.lv2/fifths.c index 0abcfbd..f289026 100644 --- a/plugins/eg-fifths.lv2/fifths.c +++ b/plugins/eg-fifths.lv2/fifths.c @@ -184,10 +184,5 @@ static const LV2_Descriptor descriptor = { LV2_SYMBOL_EXPORT const LV2_Descriptor* lv2_descriptor(uint32_t index) { - switch (index) { - case 0: - return &descriptor; - default: - return NULL; - } + return index == 0 ? &descriptor : NULL; } diff --git a/plugins/eg-metro.lv2/metro.c b/plugins/eg-metro.lv2/metro.c index a7231d2..060060c 100644 --- a/plugins/eg-metro.lv2/metro.c +++ b/plugins/eg-metro.lv2/metro.c @@ -346,10 +346,5 @@ static const LV2_Descriptor descriptor = { LV2_SYMBOL_EXPORT const LV2_Descriptor* lv2_descriptor(uint32_t index) { - switch (index) { - case 0: - return &descriptor; - default: - return NULL; - } + return index == 0 ? &descriptor : NULL; } diff --git a/plugins/eg-midigate.lv2/midigate.c b/plugins/eg-midigate.lv2/midigate.c index 70901f6..4d1385e 100644 --- a/plugins/eg-midigate.lv2/midigate.c +++ b/plugins/eg-midigate.lv2/midigate.c @@ -231,10 +231,5 @@ LV2_SYMBOL_EXPORT const LV2_Descriptor* lv2_descriptor(uint32_t index) { - switch (index) { - case 0: - return &descriptor; - default: - return NULL; - } + return index == 0 ? &descriptor : NULL; } diff --git a/plugins/eg-sampler.lv2/sampler.c b/plugins/eg-sampler.lv2/sampler.c index 17f62a8..1ed23fa 100644 --- a/plugins/eg-sampler.lv2/sampler.c +++ b/plugins/eg-sampler.lv2/sampler.c @@ -594,10 +594,5 @@ static const LV2_Descriptor descriptor = { LV2_SYMBOL_EXPORT const LV2_Descriptor* lv2_descriptor(uint32_t index) { - switch (index) { - case 0: - return &descriptor; - default: - return NULL; - } + return index == 0 ? &descriptor : NULL; } diff --git a/plugins/eg-sampler.lv2/sampler_ui.c b/plugins/eg-sampler.lv2/sampler_ui.c index 13a8cd4..a6fa36f 100644 --- a/plugins/eg-sampler.lv2/sampler_ui.c +++ b/plugins/eg-sampler.lv2/sampler_ui.c @@ -456,10 +456,5 @@ LV2_SYMBOL_EXPORT const LV2UI_Descriptor* lv2ui_descriptor(uint32_t index) { - switch (index) { - case 0: - return &descriptor; - default: - return NULL; - } + return index == 0 ? &descriptor : NULL; } diff --git a/plugins/eg-scope.lv2/examploscope_ui.c b/plugins/eg-scope.lv2/examploscope_ui.c index ce0000c..33f1b0a 100644 --- a/plugins/eg-scope.lv2/examploscope_ui.c +++ b/plugins/eg-scope.lv2/examploscope_ui.c @@ -667,10 +667,5 @@ LV2_SYMBOL_EXPORT const LV2UI_Descriptor* lv2ui_descriptor(uint32_t index) { - switch (index) { - case 0: - return &descriptor; - default: - return NULL; - } + return index == 0 ? &descriptor : NULL; } |