summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-12-22 15:24:01 +0100
committerDavid Robillard <d@drobilla.net>2020-12-22 15:24:01 +0100
commitc2e45d3b8338447be4b4cb10b1c43871a5a49460 (patch)
tree3a7a1bff652be934b626889a048ffb9e99396de1
parentea28ade6ad7ec94dd35b0f24aef35850b56d0cbb (diff)
downloadsratom-c2e45d3b8338447be4b4cb10b1c43871a5a49460.tar.gz
sratom-c2e45d3b8338447be4b4cb10b1c43871a5a49460.tar.bz2
sratom-c2e45d3b8338447be4b4cb10b1c43871a5a49460.zip
Remove cloned branches
-rw-r--r--.clang-tidy1
-rw-r--r--src/sratom.c4
-rw-r--r--tests/sratom_test.c11
3 files changed, 5 insertions, 11 deletions
diff --git a/.clang-tidy b/.clang-tidy
index a9f54b5..c4e4efb 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -4,7 +4,6 @@ Checks: >
-*-magic-numbers,
-*-narrowing-conversions,
-*-uppercase-literal-suffix,
- -bugprone-branch-clone,
-bugprone-suspicious-string-compare,
-cert-err34-c,
-clang-analyzer-unix.Malloc,
diff --git a/src/sratom.c b/src/sratom.c
index 57f4667..4f09846 100644
--- a/src/sratom.c
+++ b/src/sratom.c
@@ -554,7 +554,7 @@ read_resource(Sratom* sratom,
static uint32_t
atom_size(Sratom* sratom, uint32_t type_urid)
{
- if (type_urid == sratom->forge.Int) {
+ if (type_urid == sratom->forge.Int || type_urid == sratom->forge.Bool) {
return sizeof(int32_t);
} else if (type_urid == sratom->forge.Long) {
return sizeof(int64_t);
@@ -562,8 +562,6 @@ atom_size(Sratom* sratom, uint32_t type_urid)
return sizeof(float);
} else if (type_urid == sratom->forge.Double) {
return sizeof(double);
- } else if (type_urid == sratom->forge.Bool) {
- return sizeof(int32_t);
} else if (type_urid == sratom->forge.URID) {
return sizeof(uint32_t);
}
diff --git a/tests/sratom_test.c b/tests/sratom_test.c
index 1738e3d..bd54326 100644
--- a/tests/sratom_test.c
+++ b/tests/sratom_test.c
@@ -383,13 +383,10 @@ test(SerdEnv* env, bool top_level, bool pretty_numbers)
static int
test_env(SerdEnv* env)
{
- if (test(env, false, false)) {
- return 1;
- } else if (test(env, true, false)) {
- return 1;
- } else if (test(env, false, true)) {
- return 1;
- } else if (test(env, true, true)) {
+ if (test(env, false, false) || //
+ test(env, true, false) || //
+ test(env, false, true) || //
+ test(env, true, true)) {
return 1;
}