diff --git a/expat/apply-clang-tidy.sh b/expat/apply-clang-tidy.sh index 405ab629..fd58b723 100755 --- a/expat/apply-clang-tidy.sh +++ b/expat/apply-clang-tidy.sh @@ -32,6 +32,11 @@ set -e -u -o pipefail cd "$(dirname "$(type -P "$0")")" +checks_to_enable=( + readability-avoid-const-params-in-decls +) +checks_to_enable_flat="${checks_to_enable[*]}" # i.e. flat string separated by spaces + checks_to_disable=( # Would need a closer look before any adjustments clang-analyzer-optin.performance.Padding @@ -42,8 +47,9 @@ checks_to_disable=( # Disabling because buggy, see https://github.com/llvm/llvm-project/issues/40656 clang-analyzer-valist.Uninitialized ) -checks="${checks_to_disable[*]}" # i.e. flat string separated by spaces -checks="-${checks// /,-}" +checks_to_disable_flat="${checks_to_disable[*]}" # i.e. flat string separated by spaces + +checks="${checks_to_enable_flat// /,},-${checks_to_disable_flat// /,-}" args=( --checks="${checks}" diff --git a/expat/tests/handlers.c b/expat/tests/handlers.c index 8c7d8488..0fb93eed 100644 --- a/expat/tests/handlers.c +++ b/expat/tests/handlers.c @@ -1715,8 +1715,8 @@ record_element_end_handler(void *userData, const XML_Char *name) { } const struct handler_record_entry * -_handler_record_get(const struct handler_record_list *storage, const int index, - const char *file, const int line) { +_handler_record_get(const struct handler_record_list *storage, int index, + const char *file, int line) { _assert_true(storage->count > index, file, line, "too few handler calls"); return &storage->entries[index]; } diff --git a/expat/tests/handlers.h b/expat/tests/handlers.h index 069982e7..a72d0491 100644 --- a/expat/tests/handlers.h +++ b/expat/tests/handlers.h @@ -499,8 +499,8 @@ extern void XMLCALL record_element_end_handler(void *userData, const XML_Char *name); extern const struct handler_record_entry * -_handler_record_get(const struct handler_record_list *storage, const int index, - const char *file, const int line); +_handler_record_get(const struct handler_record_list *storage, int index, + const char *file, int line); # define handler_record_get(storage, index) \ _handler_record_get((storage), (index), __FILE__, __LINE__)