summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-12-10 13:52:22 -0500
committerDavid Robillard <d@drobilla.net>2022-12-10 19:04:45 -0500
commitb917c984b15a9583326fa6318be6632850817994 (patch)
tree2b6a95232ef08e01c2242c7c9320e91abdc16d25
parent708911daa222ac5f1423a02ebc89eeaf21548f5a (diff)
downloadlilv-b917c984b15a9583326fa6318be6632850817994.tar.gz
lilv-b917c984b15a9583326fa6318be6632850817994.tar.bz2
lilv-b917c984b15a9583326fa6318be6632850817994.zip
Avoid "else" after "return"
-rw-r--r--test/.clang-tidy1
-rw-r--r--test/test_state.c18
2 files changed, 11 insertions, 8 deletions
diff --git a/test/.clang-tidy b/test/.clang-tidy
index 4ef27ee..aab3384 100644
--- a/test/.clang-tidy
+++ b/test/.clang-tidy
@@ -2,7 +2,6 @@
# SPDX-License-Identifier: 0BSD OR ISC
Checks: >
- -*-else-after-return,
-*-magic-numbers,
-android-cloexec-fopen,
-bugprone-branch-clone,
diff --git a/test/test_state.c b/test/test_state.c
index 798fb6e..cb84fb4 100644
--- a/test/test_state.c
+++ b/test/test_state.c
@@ -182,20 +182,24 @@ get_port_value(const char* port_symbol,
*size = sizeof(float);
*type = ctx->atom_Float;
return &ctx->in;
- } else if (!strcmp(port_symbol, "output")) {
+ }
+
+ if (!strcmp(port_symbol, "output")) {
*size = sizeof(float);
*type = ctx->atom_Float;
return &ctx->out;
- } else if (!strcmp(port_symbol, "control")) {
+ }
+
+ if (!strcmp(port_symbol, "control")) {
*size = sizeof(float);
*type = ctx->atom_Float;
return &ctx->control;
- } else {
- fprintf(
- stderr, "error: get_port_value for nonexistent port `%s'\n", port_symbol);
- *size = *type = 0;
- return NULL;
}
+
+ fprintf(
+ stderr, "error: get_port_value for nonexistent port `%s'\n", port_symbol);
+ *size = *type = 0;
+ return NULL;
}
static void