diff options
-rw-r--r-- | .clang-tidy | 5 | ||||
-rw-r--r-- | src/sratom.c | 6 | ||||
-rw-r--r-- | test/.clang-tidy | 2 |
3 files changed, 10 insertions, 3 deletions
diff --git a/.clang-tidy b/.clang-tidy index 40c511c..db3091a 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,7 +1,10 @@ Checks: > *, -*-magic-numbers, + -*-narrowing-conversions, -*-uppercase-literal-suffix, + -altera-*, + -bugprone-easily-swappable-parameters, -bugprone-suspicious-string-compare, -cert-err34-c, -clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling, @@ -10,6 +13,8 @@ Checks: > -llvm-header-guard, -llvmlibc-*, -misc-no-recursion, + -performance-no-int-to-ptr, + -readability-function-cognitive-complexity, WarningsAsErrors: '*' HeaderFilterRegex: '.*' FormatStyle: file diff --git a/src/sratom.c b/src/sratom.c index 53fa017..e4d306b 100644 --- a/src/sratom.c +++ b/src/sratom.c @@ -334,11 +334,11 @@ sratom_write(Sratom* sratom, new_node = true; datatype = serd_node_from_string(SERD_URI, USTR(LV2_MIDI__MidiEvent)); - const size_t len = size * 2; + const size_t len = size * 2ul; uint8_t* const str = (uint8_t*)calloc(len + 1, 1); for (uint32_t i = 0; i < size; ++i) { - snprintf((char*)str + (2 * i), - len - (2 * i) + 1, + snprintf((char*)str + (2ul * i), + len - (2ul * i) + 1ul, "%02X", (unsigned)*((const uint8_t*)body + i)); } diff --git a/test/.clang-tidy b/test/.clang-tidy index 0b8f64b..6f36a17 100644 --- a/test/.clang-tidy +++ b/test/.clang-tidy @@ -2,11 +2,13 @@ Checks: > *, -*-magic-numbers, -*-uppercase-literal-suffix, + -altera-*, -bugprone-suspicious-string-compare, -clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling, -hicpp-signed-bitwise, -llvm-header-guard, -llvmlibc-*, + -performance-no-int-to-ptr, WarningsAsErrors: '*' HeaderFilterRegex: '.*' FormatStyle: file |