From 92928586a32a122b5aae69bcc212e98d56a34cc0 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 13 Aug 2020 17:25:58 +0200 Subject: Fix narrowing conversions --- .clang-tidy | 1 - test/sorted_array_test.c | 4 ++-- test/tree_test.c | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index b77d9ae..91058d9 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,7 +1,6 @@ Checks: > *, -*-magic-numbers, - -*-narrowing-conversions, -*-uppercase-literal-suffix, -android-cloexec-fopen, -bugprone-branch-clone, diff --git a/test/sorted_array_test.c b/test/sorted_array_test.c index 30ff139..4bfd515 100644 --- a/test/sorted_array_test.c +++ b/test/sorted_array_test.c @@ -41,7 +41,7 @@ int_cmp(const void* a, const void* b, const void* ZIX_UNUSED(user_data)) } static intptr_t -ith_elem(int test_num, unsigned n_elems, int i) +ith_elem(unsigned test_num, unsigned n_elems, unsigned i) { switch (test_num % 3) { case 0: @@ -61,7 +61,7 @@ test_fail(void) } static int -stress(int test_num, unsigned n_elems) +stress(unsigned test_num, unsigned n_elems) { intptr_t r; ZixSortedArrayIter ti; diff --git a/test/tree_test.c b/test/tree_test.c index 5331344..3e35fb3 100644 --- a/test/tree_test.c +++ b/test/tree_test.c @@ -42,7 +42,7 @@ int_cmp(const void* a, const void* b, const void* ZIX_UNUSED(user_data)) } static uintptr_t -ith_elem(int test_num, size_t n_elems, size_t i) +ith_elem(unsigned test_num, size_t n_elems, size_t i) { switch (test_num % 3) { case 0: @@ -62,7 +62,7 @@ test_fail(void) } static int -stress(int test_num, size_t n_elems) +stress(unsigned test_num, size_t n_elems) { intptr_t r; ZixTreeIter* ti; -- cgit v1.2.1