summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-02-04 21:57:31 -0500
committerDavid Robillard <d@drobilla.net>2023-02-04 21:57:31 -0500
commitefb392e32da0bce28dbeb6fb728dcd9183f4611b (patch)
tree894466f01ab3d4b70f90f949c5fdbee69af35969
parent17b7c3b19f79d5b50e106d7e5003767db5b00fe3 (diff)
downloadlilv-efb392e32da0bce28dbeb6fb728dcd9183f4611b.tar.gz
lilv-efb392e32da0bce28dbeb6fb728dcd9183f4611b.tar.bz2
lilv-efb392e32da0bce28dbeb6fb728dcd9183f4611b.zip
Fix clang and clang-tidy warnings on Windows
-rw-r--r--.clang-tidy3
-rw-r--r--include/lilv/lilvmm.hpp2
-rw-r--r--meson/suppressions/meson.build6
-rw-r--r--src/.clang-tidy1
-rw-r--r--src/lilv_internal.h1
-rw-r--r--src/plugin.c10
-rw-r--r--src/util.c2
-rw-r--r--test/test_plugin.lv2/test_plugin.c2
8 files changed, 18 insertions, 9 deletions
diff --git a/.clang-tidy b/.clang-tidy
index dcc5245..5013b26 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -5,13 +5,14 @@ Checks: >
*,
-*-vararg,
-altera-*,
+ -bugprone-assignment-in-if-condition,
-bugprone-easily-swappable-parameters,
-bugprone-macro-parentheses,
-clang-diagnostic-unused-function,
-clang-diagnostic-unused-macros,
-llvmlibc-*,
+ -modernize-macro-to-enum,
-readability-identifier-length,
- -bugprone-assignment-in-if-condition,
CheckOptions:
- key: hicpp-uppercase-literal-suffix.NewSuffixes
value: 'L;U;UL;ULL'
diff --git a/include/lilv/lilvmm.hpp b/include/lilv/lilvmm.hpp
index 229ab93..6e270df 100644
--- a/include/lilv/lilvmm.hpp
+++ b/include/lilv/lilvmm.hpp
@@ -326,7 +326,7 @@ struct Plugin {
inline unsigned get_num_ports_of_class(LilvNode* class_1, ...) const
{
- va_list args;
+ va_list args; // NOLINT(cppcoreguidelines-init-variables)
va_start(args, class_1);
const uint32_t count =
diff --git a/meson/suppressions/meson.build b/meson/suppressions/meson.build
index 36d1597..8785c56 100644
--- a/meson/suppressions/meson.build
+++ b/meson/suppressions/meson.build
@@ -44,6 +44,12 @@ if is_variable('cc')
c_suppressions += [
'-Wno-c11-extensions',
]
+ elif host_machine.system() == 'windows'
+ c_suppressions += [
+ '-Wno-deprecated-declarations',
+ '-Wno-nonportable-system-include-path',
+ '-Wno-unused-macros',
+ ]
endif
elif cc.get_id() == 'gcc'
diff --git a/src/.clang-tidy b/src/.clang-tidy
index 8d229b6..0673649 100644
--- a/src/.clang-tidy
+++ b/src/.clang-tidy
@@ -15,6 +15,7 @@ Checks: >
-hicpp-multiway-paths-covered,
-hicpp-signed-bitwise,
-llvm-header-guard,
+ -performance-no-int-to-ptr,
-readability-function-cognitive-complexity,
-readability-suspicious-call-argument,
InheritParentConfig: true
diff --git a/src/lilv_internal.h b/src/lilv_internal.h
index 0f125e0..0a1f7d4 100644
--- a/src/lilv_internal.h
+++ b/src/lilv_internal.h
@@ -26,7 +26,6 @@ extern "C" {
# define dlopen(path, flags) LoadLibrary(path)
# define dlclose(lib) FreeLibrary((HMODULE)lib)
# ifdef _MSC_VER
-# define __func__ __FUNCTION__
# ifndef snprintf
# define snprintf _snprintf
# endif
diff --git a/src/plugin.c b/src/plugin.c
index 0600369..f191eda 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -567,9 +567,11 @@ lilv_plugin_get_port_ranges_float(const LilvPlugin* plugin,
}
uint32_t
-lilv_plugin_get_num_ports_of_class_va(const LilvPlugin* plugin,
- const LilvNode* class_1,
- va_list args)
+lilv_plugin_get_num_ports_of_class_va(
+ const LilvPlugin* plugin,
+ const LilvNode* class_1,
+ va_list args // NOLINT(readability-non-const-parameter)
+)
{
lilv_plugin_load_ports_if_necessary(plugin);
@@ -611,7 +613,7 @@ lilv_plugin_get_num_ports_of_class(const LilvPlugin* plugin,
const LilvNode* class_1,
...)
{
- va_list args;
+ va_list args; // NOLINT(cppcoreguidelines-init-variables)
va_start(args, class_1);
uint32_t count = lilv_plugin_get_num_ports_of_class_va(plugin, class_1, args);
diff --git a/src/util.c b/src/util.c
index 0904ce6..b7b62a4 100644
--- a/src/util.c
+++ b/src/util.c
@@ -37,7 +37,7 @@ lilv_strjoin(const char* first, ...)
memcpy(result, first, len);
- va_list args;
+ va_list args; // NOLINT(cppcoreguidelines-init-variables)
va_start(args, first);
while (1) {
const char* const s = va_arg(args, const char*);
diff --git a/test/test_plugin.lv2/test_plugin.c b/test/test_plugin.lv2/test_plugin.c
index d2906d6..81a6433 100644
--- a/test/test_plugin.lv2/test_plugin.c
+++ b/test/test_plugin.lv2/test_plugin.c
@@ -7,7 +7,7 @@
#include "lv2/urid/urid.h"
#ifdef _WIN32
-# define _WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
# include <windows.h>
#endif