diff options
author | David Robillard <d@drobilla.net> | 2022-03-12 18:44:51 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-03-12 18:44:51 -0500 |
commit | 8e4ec24cbf69ea0a40d6981e69320a10ee19529f (patch) | |
tree | 56539320de10b13e9bfafcb5bf9d174966b0c13d | |
parent | ca6a33d9f9a45ead274904595c49365483cac8ea (diff) | |
download | suil-8e4ec24cbf69ea0a40d6981e69320a10ee19529f.tar.gz suil-8e4ec24cbf69ea0a40d6981e69320a10ee19529f.tar.bz2 suil-8e4ec24cbf69ea0a40d6981e69320a10ee19529f.zip |
fixup! WIP: Switch to Meson
-rw-r--r-- | .clang-tidy | 7 | ||||
-rw-r--r-- | meson.build | 3 | ||||
-rw-r--r-- | src/suil_internal.h | 32 | ||||
-rw-r--r-- | src/x11_in_qt5.cpp | 1 |
4 files changed, 28 insertions, 15 deletions
diff --git a/.clang-tidy b/.clang-tidy index 1a009ab..0dc64c0 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -5,14 +5,19 @@ Checks: > -*-no-malloc, -*-uppercase-literal-suffix, -*-vararg, + -altera-*, + -bugprone-easily-swappable-parameters, -bugprone-suspicious-string-compare, -clang-analyzer-core.CallAndMessage, -clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling, + -clang-analyzer-security.insecureAPI.strcpy, + -concurrency-mt-unsafe, -cppcoreguidelines-avoid-non-const-global-variables, -cppcoreguidelines-macro-usage, -cppcoreguidelines-owning-memory, -cppcoreguidelines-pro-bounds-pointer-arithmetic, -cppcoreguidelines-pro-type-cstyle-cast, + -cppcoreguidelines-pro-type-reinterpret-cast, -fuchsia-default-arguments, -fuchsia-default-arguments-calls, -google-runtime-int, @@ -20,6 +25,8 @@ Checks: > -llvm-header-guard, -llvmlibc-*, -modernize-use-trailing-return-type, + -performance-no-int-to-ptr, + -readability-function-cognitive-complexity, -readability-implicit-bool-conversion, -readability-non-const-parameter, WarningsAsErrors: '*' diff --git a/meson.build b/meson.build index 9b02789..781a9d4 100644 --- a/meson.build +++ b/meson.build @@ -38,15 +38,16 @@ if get_option('strict') '-Wno-disabled-macro-expansion', '-Wno-padded', '-Wno-reserved-id-macro', + '-Wno-reserved-identifier', # Glib headers '-Wno-variadic-macros', ] elif cc.get_id() == 'gcc' c_warnings += [ + '-Wno-extra-semi', # Qt headers '-Wno-padded', '-Wno-pragmas', '-Wno-suggest-attribute=const', '-Wno-suggest-attribute=pure', - '-Wno-extra-semi', # Qt headers ] elif cc.get_id() == 'msvc' c_warnings += [ diff --git a/src/suil_internal.h b/src/suil_internal.h index ac6e563..d9449d5 100644 --- a/src/suil_internal.h +++ b/src/suil_internal.h @@ -115,19 +115,25 @@ suil_open_module(const char* module_name) { const char* const env_dir = getenv("SUIL_MODULE_DIR"); const char* const mod_dir = env_dir ? env_dir : SUIL_MODULE_DIR; - const size_t path_len = - strlen(mod_dir) + strlen(SUIL_DIR_SEP SUIL_MODULE_PREFIX SUIL_MODULE_EXT) + - strlen(module_name) + 2; - - char* const path = (char*)calloc(path_len, 1); - snprintf(path, - path_len, - "%s%s%s%s%s", - mod_dir, - SUIL_DIR_SEP, - SUIL_MODULE_PREFIX, - module_name, - SUIL_MODULE_EXT); + + const size_t path_len = strlen(mod_dir) + strlen(SUIL_DIR_SEP) + + strlen(SUIL_MODULE_PREFIX) + strlen(module_name) + + strlen(SUIL_MODULE_EXT); + + char* const path = (char*)calloc(path_len + 1, 1); + strcat(path, mod_dir); + strcat(path, SUIL_DIR_SEP); + strcat(path, SUIL_MODULE_PREFIX); + strcat(path, module_name); + strcat(path, SUIL_MODULE_EXT); + /* snprintf(path, */ + /* path_len + 1, */ + /* "%s%s%s%s%s", */ + /* mod_dir, */ + /* SUIL_DIR_SEP, */ + /* SUIL_MODULE_PREFIX, */ + /* module_name, */ + /* SUIL_MODULE_EXT); */ dylib_error(); void* lib = dylib_open(path, DYLIB_NOW); diff --git a/src/x11_in_qt5.cpp b/src/x11_in_qt5.cpp index a288319..fe8e473 100644 --- a/src/x11_in_qt5.cpp +++ b/src/x11_in_qt5.cpp @@ -34,7 +34,6 @@ SUIL_DISABLE_QT_WARNINGS #include <X11/Xutil.h> SUIL_RESTORE_WARNINGS -#include <cstdint> #include <cstdlib> #undef signals |