From 0cf9b6d7db1d3c829b40cabebd3a81ef6eeb550e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 4 Feb 2023 21:54:23 -0500 Subject: Fix clang and clang-tidy warnings on Windows --- src/.clang-tidy | 1 + src/reader.c | 2 +- src/serdi.c | 2 +- src/writer.c | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/.clang-tidy b/src/.clang-tidy index 8f408ddc..638041cc 100644 --- a/src/.clang-tidy +++ b/src/.clang-tidy @@ -14,5 +14,6 @@ Checks: > -hicpp-signed-bitwise, -llvm-header-guard, -misc-no-recursion, + -modernize-macro-to-enum, -readability-function-cognitive-complexity, InheritParentConfig: true diff --git a/src/reader.c b/src/reader.c index 113c3e57..b386a76e 100644 --- a/src/reader.c +++ b/src/reader.c @@ -19,7 +19,7 @@ SerdStatus r_err(SerdReader* const reader, const SerdStatus st, const char* const fmt, ...) { - va_list args; + va_list args; // NOLINT(cppcoreguidelines-init-variables) va_start(args, fmt); const Cursor* const cur = &reader->source.cur; const SerdError e = {st, cur->filename, cur->line, cur->col, fmt, &args}; diff --git a/src/serdi.c b/src/serdi.c index a5a00c57..462d7909 100644 --- a/src/serdi.c +++ b/src/serdi.c @@ -8,7 +8,7 @@ #ifdef _WIN32 # ifdef _MSC_VER -# define WIN32_LEAN_AND_MEAN 1 +# define WIN32_LEAN_AND_MEAN # endif # include # include diff --git a/src/writer.c b/src/writer.c index 341ee79b..575d3fb9 100644 --- a/src/writer.c +++ b/src/writer.c @@ -130,7 +130,7 @@ w_err(SerdWriter* writer, SerdStatus st, const char* fmt, ...) add a Cursor parameter so the source can notify the writer of the statement origin for better error reporting. */ - va_list args; + va_list args; // NOLINT(cppcoreguidelines-init-variables) va_start(args, fmt); const SerdError e = {st, (const uint8_t*)"", 0, 0, fmt, &args}; serd_error(writer->error_sink, writer->error_handle, &e); -- cgit v1.2.1