From f4d87ee8683599002916d554d26f6292e55aaa49 Mon Sep 17 00:00:00 2001 From: Marcus Holland-Moritz Date: Sat, 15 Mar 2025 23:47:06 +0100 Subject: [PATCH] chore: suppress some clang-tidy issues --- include/dwarfs/performance_monitor.h | 2 ++ include/dwarfs/writer/fragment_category.h | 1 + src/internal/unicode_case_folding.cpp | 2 ++ src/internal/wcwidth.c | 1 + 4 files changed, 6 insertions(+) diff --git a/include/dwarfs/performance_monitor.h b/include/dwarfs/performance_monitor.h index 6872fbf3..96b7a6c5 100644 --- a/include/dwarfs/performance_monitor.h +++ b/include/dwarfs/performance_monitor.h @@ -134,6 +134,7 @@ class performance_monitor_proxy { std::shared_ptr monitor = \ performance_monitor::create(enabled_namespaces); +// NOLINTBEGIN(bugprone-macro-parentheses) #define PERFMON_PROXY_DECL(instname) performance_monitor_proxy instname; #define PERFMON_PROXY_INIT(instname, monitor, name_space) \ , instname { monitor, name_space } @@ -145,6 +146,7 @@ class performance_monitor_proxy { auto perfmon_scoped_section_ = instname.scoped_section(perfmon_##id##_id_); #define PERFMON_PROXY_SETUP(instname, monitor, name_space) \ instname = performance_monitor_proxy(monitor, name_space); +// NOLINTEND(bugprone-macro-parentheses) #define PERFMON_SECTION_ARG perfmon_scoped_section_ #define PERFMON_SECTION_ARG_ perfmon_scoped_section_, diff --git a/include/dwarfs/writer/fragment_category.h b/include/dwarfs/writer/fragment_category.h index 5c39de1d..35aa8452 100644 --- a/include/dwarfs/writer/fragment_category.h +++ b/include/dwarfs/writer/fragment_category.h @@ -46,6 +46,7 @@ class fragment_category { explicit fragment_category(value_type v) : value_{v} {} + // NOLINTNEXTLINE(bugprone-easily-swappable-parameters) fragment_category(value_type v, value_type subcategory) : value_{v} , subcategory_{subcategory} {} diff --git a/src/internal/unicode_case_folding.cpp b/src/internal/unicode_case_folding.cpp index 3e607c1d..e3f0afe3 100644 --- a/src/internal/unicode_case_folding.cpp +++ b/src/internal/unicode_case_folding.cpp @@ -32,6 +32,7 @@ namespace dwarfs::internal { namespace { char32_t case_fold_char_slow(char32_t in) { + // NOLINTBEGIN(bugprone-branch-clone) switch (in) { case 0x00B5: return 0x03BC; // [C] MICRO SIGN @@ -2977,6 +2978,7 @@ char32_t case_fold_char_slow(char32_t in) { default: return in; } + // NOLINTEND(bugprone-branch-clone) } inline char32_t case_fold_char(char32_t in) { diff --git a/src/internal/wcwidth.c b/src/internal/wcwidth.c index 6edcbb16..be3de31b 100644 --- a/src/internal/wcwidth.c +++ b/src/internal/wcwidth.c @@ -499,6 +499,7 @@ static const struct width_interval WIDE_EASTASIAN[] = { {0x30000, 0x3fffd}, // Cjk Unified Ideograph-30..(nil) }; +// NOLINTNEXTLINE(bugprone-easily-swappable-parameters) static bool intable(struct width_interval const* table, int table_length, int c) { // First quick check for Latin1 etc. characters. if (c < table[0].start) return false;