Browse Source

Don't use else after return

zrythm_meson
David Robillard 3 years ago
parent
commit
9e46d4a832
  1. 1
      .clang-tidy
  2. 8
      lv2/midi/midi.h
  3. 5
      plugins/eg-params.lv2/state_map.h
  4. 12
      plugins/eg-sampler.lv2/uris.h

1
.clang-tidy

@ -8,7 +8,6 @@ Checks: > @@ -8,7 +8,6 @@ Checks: >
-clang-diagnostic-unused-macros,
-hicpp-signed-bitwise,
-llvm-header-guard,
-readability-else-after-return,
WarningsAsErrors: '*'
HeaderFilterRegex: '.*'
FormatStyle: file

8
lv2/midi/midi.h

@ -216,11 +216,13 @@ static inline LV2_Midi_Message_Type @@ -216,11 +216,13 @@ static inline LV2_Midi_Message_Type
lv2_midi_message_type(const uint8_t* msg) {
if (lv2_midi_is_voice_message(msg)) {
return (LV2_Midi_Message_Type)(msg[0] & 0xF0);
} else if (lv2_midi_is_system_message(msg)) {
}
if (lv2_midi_is_system_message(msg)) {
return (LV2_Midi_Message_Type)msg[0];
} else {
return LV2_MIDI_MSG_INVALID;
}
return LV2_MIDI_MSG_INVALID;
}
#ifdef __cplusplus

5
plugins/eg-params.lv2/state_map.h

@ -36,9 +36,12 @@ state_map_cmp(const void* a, const void* b) @@ -36,9 +36,12 @@ state_map_cmp(const void* a, const void* b)
const StateMapItem* kb = (const StateMapItem*)b;
if (ka->urid < kb->urid) {
return -1;
} else if (kb->urid < ka->urid) {
}
if (kb->urid < ka->urid) {
return 1;
}
return 0;
}

12
plugins/eg-sampler.lv2/uris.h

@ -127,10 +127,14 @@ read_set_file(const SamplerURIs* uris, @@ -127,10 +127,14 @@ read_set_file(const SamplerURIs* uris,
if (!property) {
fprintf(stderr, "Malformed set message has no body.\n");
return NULL;
} else if (property->type != uris->atom_URID) {
}
if (property->type != uris->atom_URID) {
fprintf(stderr, "Malformed set message has non-URID property.\n");
return NULL;
} else if (((const LV2_Atom_URID*)property)->body != uris->eg_sample) {
}
if (((const LV2_Atom_URID*)property)->body != uris->eg_sample) {
fprintf(stderr, "Set message for unknown property.\n");
return NULL;
}
@ -141,7 +145,9 @@ read_set_file(const SamplerURIs* uris, @@ -141,7 +145,9 @@ read_set_file(const SamplerURIs* uris,
if (!value) {
fprintf(stderr, "Malformed set message has no value.\n");
return NULL;
} else if (value->type != uris->atom_Path) {
}
if (value->type != uris->atom_Path) {
fprintf(stderr, "Set message value is not a Path.\n");
return NULL;
}

Loading…
Cancel
Save