diff options
149 files changed, 701 insertions, 851 deletions
diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..5dc550b --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,24 @@ +# Copyright 2020-2022 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: 0BSD OR ISC + +Checks: > + *, + -*-magic-numbers, + -altera-*, + -bugprone-assignment-in-if-condition, + -bugprone-easily-swappable-parameters, + -bugprone-macro-parentheses, + -clang-diagnostic-unused-function, + -clang-diagnostic-unused-macros, + -llvmlibc-restrict-system-libc-headers, + -modernize-macro-to-enum, + -performance-no-int-to-ptr, + -readability-identifier-length, +CheckOptions: + - key: hicpp-uppercase-literal-suffix.NewSuffixes + value: L;U;f + - key: readability-uppercase-literal-suffix.NewSuffixes + value: L;U;f +FormatStyle: file +HeaderFilterRegex: 'lv2/.*\.h' +WarningsAsErrors: '*' @@ -10,3 +10,6 @@ *.swp cscope.* tags + +# cached files when used as a meson subproject +.meson-subproject-wrap-hash.txt diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 82be218..f4f6be7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,166 +1,139 @@ -# Copyright 2018-2022 David Robillard <d@drobilla.net> +# Copyright 2018-2023 David Robillard <d@drobilla.net> # SPDX-License-Identifier: 0BSD OR ISC -arm32_dbg: - image: lv2plugin/debian-arm32 - script: - - meson setup build --cross-file=/usr/share/meson/cross/arm-linux-gnueabihf.ini -Dbuildtype=debug -Dstrict=true -Dwerror=true -Ddocs=disabled - - ninja -C build test - -arm32_rel: - image: lv2plugin/debian-arm32 - script: - - meson setup build --cross-file=/usr/share/meson/cross/arm-linux-gnueabihf.ini -Dbuildtype=release -Dstrict=true -Dwerror=true -Ddocs=disabled - - ninja -C build test - - -arm64_dbg: - image: lv2plugin/debian-arm64 - script: - - meson setup build --cross-file=/usr/share/meson/cross/aarch64-linux-gnu.ini -Dbuildtype=debug -Dstrict=true -Dwerror=true -Ddocs=disabled - - ninja -C build test - -arm64_rel: - image: lv2plugin/debian-arm64 - script: - - meson setup build --cross-file=/usr/share/meson/cross/aarch64-linux-gnu.ini -Dbuildtype=release -Dstrict=true -Dwerror=true -Ddocs=disabled - - ninja -C build test - - -x32_dbg: - image: lv2plugin/debian-x32 - script: - - meson setup build --cross-file=/usr/share/meson/cross/i686-linux-gnu.ini -Dbuildtype=debug -Dstrict=true -Dwerror=true -Ddocs=disabled - - ninja -C build test - -x32_rel: - image: lv2plugin/debian-x32 +default: + image: lv2plugin/debian-x64 script: - - meson setup build --cross-file=/usr/share/meson/cross/i686-linux-gnu.ini -Dbuildtype=release -Dstrict=true -Dwerror=true -Ddocs=disabled + - meson setup build -Dwerror=true - ninja -C build test - -x64_dbg: - image: lv2plugin/debian-x64 +dev: + image: lv2plugin/debian-x64-big script: - - meson setup build -Dbuildtype=debug -Dstrict=true -Dwerror=true -Db_coverage=true + - meson setup build -Dbuildtype=debug -Dwarning_level=3 -Dwerror=true -Db_coverage=true -Dlint=true - ninja -C build test - ninja -C build coverage-html + - meson configure -Dbuildtype=release -Db_coverage=false build + - ninja -C build test coverage: '/ *lines\.*: \d+\.\d+.*/' artifacts: paths: - build/meson-logs/coveragereport -x64_rel: +static: image: lv2plugin/debian-x64 script: - - meson setup build -Dbuildtype=release -Dstrict=true -Dwerror=true -Ddocs=disabled + - meson setup build -Ddefault_library=static -Dwarning_level=3 -Dwerror=true -Ddocs=disabled - ninja -C build test - -x64_static: - image: lv2plugin/debian-x64 - script: - - meson setup build -Ddefault_library=static -Dstrict=true -Dwerror=true -Ddocs=disabled - - ninja -C build test - - -x64_sanitize: +sanitize: image: lv2plugin/debian-x64-clang script: - - meson setup build -Db_lundef=false -Dbuildtype=plain -Dstrict=true -Dwerror=true -Ddocs=disabled + - meson setup build -Db_lundef=false -Dbuildtype=plain -Dwarning_level=3 -Dwerror=true -Ddocs=disabled - ninja -C build test variables: CC: "clang" CFLAGS: "-fno-sanitize-recover=all -fsanitize=address -fsanitize=undefined -fsanitize=float-divide-by-zero -fsanitize=unsigned-integer-overflow -fsanitize=implicit-conversion -fsanitize=local-bounds -fsanitize=nullability" LDFLAGS: "-fno-sanitize-recover=all -fsanitize=address -fsanitize=undefined -fsanitize=float-divide-by-zero -fsanitize=unsigned-integer-overflow -fsanitize=implicit-conversion -fsanitize=local-bounds -fsanitize=nullability" +# Linux Distributions -freebsd_dbg: - tags: [freebsd,meson] +fedora: + image: lv2plugin/fedora-big script: - - meson setup build -Dbuildtype=debug -Dstrict=true -Dwerror=true -Ddocs=disabled + - meson setup build -Dbuildtype=plain -Dwarning_level=3 -Ddocs=enabled -Dwerror=true - ninja -C build test + variables: + CFLAGS: -O2 -D_FORTIFY_SOURCE=2 + artifacts: + paths: + - build/doc -freebsd_rel: - tags: [freebsd,meson] +# Linux Platforms + +arm32: + image: lv2plugin/debian-arm32 script: - - meson setup build -Dbuildtype=release -Dstrict=true -Dwerror=true -Ddocs=disabled + - meson setup build --cross-file=/usr/share/meson/cross/arm-linux-gnueabihf.ini -Dbuildtype=debug -Dwarning_level=3 -Dwerror=true -Ddocs=disabled + - ninja -C build test + - meson configure -Dbuildtype=release build - ninja -C build test - -mingw32_dbg: - image: lv2plugin/debian-mingw32 +arm64: + image: lv2plugin/debian-arm64 script: - - meson setup build --cross-file=/usr/share/meson/cross/i686-w64-mingw32.ini -Dbuildtype=debug -Dstrict=true -Dwerror=true -Ddocs=disabled + - meson setup build --cross-file=/usr/share/meson/cross/aarch64-linux-gnu.ini -Dbuildtype=debug -Dwarning_level=3 -Dwerror=true -Ddocs=disabled + - ninja -C build test + - meson configure -Dbuildtype=release build - ninja -C build test -mingw32_rel: +mingw32: image: lv2plugin/debian-mingw32 script: - - meson setup build --cross-file=/usr/share/meson/cross/i686-w64-mingw32.ini -Dbuildtype=release -Dstrict=true -Dwerror=true -Ddocs=disabled + - meson setup build --cross-file=/usr/share/meson/cross/i686-w64-mingw32.ini -Dbuildtype=debug -Dwarning_level=everything -Dwerror=true -Ddocs=disabled - ninja -C build test - - -mingw64_dbg: - image: lv2plugin/debian-mingw64 - script: - - meson setup build --cross-file=/usr/share/meson/cross/x86_64-w64-mingw32.ini -Dbuildtype=debug -Dstrict=true -Dwerror=true -Ddocs=disabled + - meson configure -Dbuildtype=release build - ninja -C build test -mingw64_rel: +mingw64: image: lv2plugin/debian-mingw64 script: - - meson setup build --cross-file=/usr/share/meson/cross/x86_64-w64-mingw32.ini -Dbuildtype=release -Dstrict=true -Dwerror=true -Ddocs=disabled + - meson setup build --cross-file=/usr/share/meson/cross/x86_64-w64-mingw32.ini -Dbuildtype=debug -Dwarning_level=3 -Dwerror=true -Ddocs=disabled + - ninja -C build test + - meson configure -Dbuildtype=release build - ninja -C build test - -mac_dbg: - tags: [macos] +wasm: + image: lv2plugin/debian-wasm script: - - meson setup build -Dbuildtype=debug -Dstrict=true -Dwerror=true + - meson setup build --cross-file=/usr/share/meson/cross/wasm.ini -Dbuildtype=debug -Dwarning_level=3 -Dwerror=true -Ddefault_library=static -Ddocs=disabled -Dplugins=disabled + - ninja -C build test + - meson configure -Dbuildtype=release build - ninja -C build test -mac_rel: - tags: [macos] +x32: + image: lv2plugin/debian-x32 script: - - meson setup build -Dbuildtype=release -Dstrict=true -Dwerror=true + - meson setup build --cross-file=/usr/share/meson/cross/i686-linux-gnu.ini -Dbuildtype=debug -Dwarning_level=3 -Dwerror=true -Ddocs=disabled + - ninja -C build test + - meson configure -Dbuildtype=release build - ninja -C build test +# Non-Linux/Docker rows (not hosted) -win_dbg: - tags: [windows,meson] +freebsd: + tags: [freebsd,meson] script: - - meson setup build -Dbuildtype=debug -Dstrict=true -Dwerror=true -Ddocs=disabled + - meson setup build -Dbuildtype=debug -Dwarning_level=3 -Dwerror=true -Ddocs=disabled - ninja -C build test - -win_rel: - tags: [windows,meson] - script: - - meson setup build -Dbuildtype=release -Dstrict=true -Dwerror=true -Ddocs=disabled + - meson configure -Dbuildtype=release build - ninja -C build test - -wasm_dbg: - image: lv2plugin/debian-wasm +mac: + tags: [macos] script: - - meson setup build --cross-file=/usr/share/meson/cross/wasm.ini -Dbuildtype=debug -Dstrict=true -Dwerror=true -Ddefault_library=static -Ddocs=disabled -Dplugins=disabled + - meson setup build -Dbuildtype=debug -Dwarning_level=everything -Dwerror=true + - ninja -C build test + - meson configure -Dbuildtype=release build - ninja -C build test -wasm_rel: - image: lv2plugin/debian-wasm +win: + tags: [windows,meson] script: - - meson setup build --cross-file=/usr/share/meson/cross/wasm.ini -Dbuildtype=release -Dstrict=true -Dwerror=true -Ddefault_library=static -Ddocs=disabled -Dplugins=disabled + - meson setup build -Dbuildtype=debug -Dwarning_level=everything -Dwerror=true -Ddocs=disabled + - ninja -C build test + - meson configure -Dbuildtype=release build - ninja -C build test +# Documentation pages: stage: deploy script: - mkdir -p public - mv build/meson-logs/coveragereport/ public/coverage - dependencies: - - x64_dbg + needs: + - dev artifacts: paths: - public @@ -1,3 +1,12 @@ +lv2 (1.18.11) unstable; urgency=medium + + * Allow LV2_SYMBOL_EXPORT to be overridden + * Fix pylint warning in test script + * Override pkg-config dependency within meson + * Remove troublesome lv2_atom_assert_double_fits_in_64_bits + + -- David Robillard <d@drobilla.net> Thu, 15 Dec 2022 17:15:58 +0000 + lv2 (1.18.10) stable; urgency=medium * Fix includedir in pkg-config file diff --git a/doc/c/doxy-style.css b/doc/c/doxy-style.css index b44675e..6f15ee4 100644 --- a/doc/c/doxy-style.css +++ b/doc/c/doxy-style.css @@ -208,6 +208,10 @@ dl.el { font-family: "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace, fixed; } +.ttc { + display: none; +} + pre.fragment { border: 1px solid #C4C4C4; background-color: #F9F9F9; diff --git a/doc/c/meson.build b/doc/c/meson.build index 7285c60..da88b86 100644 --- a/doc/c/meson.build +++ b/doc/c/meson.build @@ -11,7 +11,7 @@ if doxygen.found() 'LV2_SRCDIR': lv2_source_root, 'LV2_BUILDDIR': lv2_build_root, 'LV2_VERSION': meson.project_version(), - } + }, ) reference_doxygen = configure_file( diff --git a/doc/c/reference.doxygen.in b/doc/c/reference.doxygen.in index 0b87d49..333fe1c 100644 --- a/doc/c/reference.doxygen.in +++ b/doc/c/reference.doxygen.in @@ -805,6 +805,7 @@ INPUT = @LV2_SRCDIR@/doc/c/mainpage.md \ @LV2_SRCDIR@/include/lv2/atom/util.h \ @LV2_SRCDIR@/include/lv2/buf-size/buf-size.h \ @LV2_SRCDIR@/include/lv2/core/lv2.h \ + @LV2_SRCDIR@/include/lv2/core/lv2_util.h \ @LV2_SRCDIR@/include/lv2/data-access/data-access.h \ @LV2_SRCDIR@/include/lv2/dynmanifest/dynmanifest.h \ @LV2_SRCDIR@/include/lv2/event/event-helpers.h \ @@ -1206,15 +1207,6 @@ HTML_COLORSTYLE_SAT = 30 HTML_COLORSTYLE_GAMMA = 100 -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting this -# to YES can help to show when doxygen was last run and thus if the -# documentation is up to date. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_TIMESTAMP = NO - # If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML # documentation will contain a main index with vertical navigation menus that # are dynamically created via JavaScript. If disabled, the navigation index will @@ -1502,17 +1494,6 @@ EXT_LINKS_IN_WINDOW = NO FORMULA_FONTSIZE = 10 -# Use the FORMULA_TRANSPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are not -# supported properly for IE 6.0, but are supported on all modern browsers. -# -# Note that when changing this option you need to delete any form_*.png files in -# the HTML output directory before the changes have effect. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_TRANSPARENT = YES - # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see # https://www.mathjax.org) which uses client side JavaScript for the rendering # instead of using pre-rendered bitmaps. Use this if you do not have LaTeX @@ -1822,14 +1803,6 @@ LATEX_HIDE_INDICES = NO LATEX_BIB_STYLE = plain -# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated -# page will contain the date and time when the page was generated. Setting this -# to NO can help when comparing the output of multiple runs. -# The default value is: NO. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_TIMESTAMP = NO - #--------------------------------------------------------------------------- # Configuration options related to the RTF output #--------------------------------------------------------------------------- @@ -2185,23 +2158,6 @@ HAVE_DOT = NO DOT_NUM_THREADS = 0 -# When you want a differently looking font in the dot files that doxygen -# generates you can specify the font name using DOT_FONTNAME. You need to make -# sure dot is able to find the font, which can be done by putting it in a -# standard location or by setting the DOTFONTPATH environment variable or by -# setting DOT_FONTPATH to the directory containing the font. -# The default value is: Helvetica. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_FONTNAME = - -# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of -# dot graphs. -# Minimum value: 4, maximum value: 24, default value: 10. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_FONTSIZE = 10 - # By default doxygen will tell dot to use the default font as specified with # DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set # the path where dot can find it using this tag. @@ -2417,18 +2373,6 @@ DOT_GRAPH_MAX_NODES = 50 MAX_DOT_GRAPH_DEPTH = 0 -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not seem -# to support this out of the box. -# -# Warning: Depending on the platform used, enabling this option may lead to -# badly anti-aliased labels on the edges of a graph (i.e. they become hard to -# read). -# The default value is: NO. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_TRANSPARENT = NO - # Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) support diff --git a/doc/ns/ext/meson.build b/doc/ns/ext/meson.build index c76f1a2..bf6431b 100644 --- a/doc/ns/ext/meson.build +++ b/doc/ns/ext/meson.build @@ -45,6 +45,7 @@ if build_docs command: lv2specgen_command_prefix + [ '--docdir=../../c/html', '--style-uri=../../style/style.css', + ] + [ '@INPUT@', '@OUTPUT@', ], diff --git a/doc/ns/extensions/meson.build b/doc/ns/extensions/meson.build index 599deb8..837f736 100644 --- a/doc/ns/extensions/meson.build +++ b/doc/ns/extensions/meson.build @@ -26,6 +26,7 @@ if build_docs command: lv2specgen_command_prefix + [ '--docdir=../../c/html', '--style-uri=../../style/style.css', + ] + [ '@INPUT@', '@OUTPUT@', ], diff --git a/doc/ns/meson.build b/doc/ns/meson.build index cda9ba0..126a100 100644 --- a/doc/ns/meson.build +++ b/doc/ns/meson.build @@ -24,6 +24,7 @@ if build_docs command: lv2specgen_command_prefix + [ '--docdir=../c/html', '--style-uri=../style/style.css', + ] + [ '@INPUT@', '@OUTPUT@', ], @@ -55,12 +56,14 @@ subdir('extensions') # Index # ######### -lv2_build_index = find_program(lv2_source_root / 'scripts' / 'lv2_build_index.py') +lv2_build_index = find_program( + lv2_source_root / 'scripts' / 'lv2_build_index.py', +) lv2_build_index_command = [ lv2_build_index, - '--lv2-version', meson.project_version(), - '--lv2-source-root', lv2_source_root, + ['--lv2-version', meson.project_version()], + ['--lv2-source-root', lv2_source_root], ] if get_option('online_docs') diff --git a/doc/style/meson.build b/doc/style/meson.build index 501c0fa..39e9242 100644 --- a/doc/style/meson.build +++ b/doc/style/meson.build @@ -1,10 +1,7 @@ # Copyright 2022 David Robillard <d@drobilla.net> # SPDX-License-Identifier: 0BSD OR ISC -style_files = files( - 'pygments.css', - 'style.css' -) +style_files = files('pygments.css', 'style.css') foreach file : style_files configure_file( diff --git a/include/lv2/atom/atom.h b/include/lv2/atom/atom.h index a6178cf..ca607d3 100644 --- a/include/lv2/atom/atom.h +++ b/include/lv2/atom/atom.h @@ -1,8 +1,8 @@ // Copyright 2008-2016 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC -#ifndef LV2_ATOM_H -#define LV2_ATOM_H +#ifndef LV2_ATOM_ATOM_H +#define LV2_ATOM_ATOM_H /** @defgroup atom Atom @@ -62,12 +62,6 @@ extern "C" { #endif -/** @cond */ -/** This expression will fail to compile if double does not fit in 64 bits. */ -typedef char lv2_atom_assert_double_fits_in_64_bits - [((sizeof(double) <= sizeof(uint64_t)) * 2) - 1]; -/** @endcond */ - /** Return a pointer to the contents of an Atom. The "contents" of an atom is the data past the complete type-specific header. @@ -221,7 +215,7 @@ typedef struct { | Event 1 (size 6) | Event 2 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - |FRAMES |TYPE |SIZE |DATADATADATAPAD|FRAMES |... + |FRAMES |SIZE |TYPE |DATADATADATAPAD|FRAMES |... </pre> */ typedef struct { @@ -244,4 +238,4 @@ typedef struct { @} */ -#endif /* LV2_ATOM_H */ +#endif // LV2_ATOM_ATOM_H diff --git a/include/lv2/atom/forge.h b/include/lv2/atom/forge.h index 5e9bef8..f894a5a 100644 --- a/include/lv2/atom/forge.h +++ b/include/lv2/atom/forge.h @@ -147,6 +147,7 @@ lv2_atom_forge_init(LV2_Atom_Forge* forge, LV2_URID_Map* map) static inline LV2_Atom* lv2_atom_forge_deref(LV2_Atom_Forge* forge, LV2_Atom_Forge_Ref ref) { + // NOLINTNEXTLINE(performance-no-int-to-ptr) return forge->buf ? (LV2_Atom*)ref : forge->deref(forge->handle, ref); } @@ -305,7 +306,7 @@ lv2_atom_forge_pad(LV2_Atom_Forge* forge, uint32_t written) static inline LV2_Atom_Forge_Ref lv2_atom_forge_write(LV2_Atom_Forge* forge, const void* data, uint32_t size) { - LV2_Atom_Forge_Ref out = lv2_atom_forge_raw(forge, data, size); + const LV2_Atom_Forge_Ref out = lv2_atom_forge_raw(forge, data, size); if (out) { lv2_atom_forge_pad(forge, size); } @@ -316,11 +317,18 @@ lv2_atom_forge_write(LV2_Atom_Forge* forge, const void* data, uint32_t size) static inline LV2_Atom_Forge_Ref lv2_atom_forge_string_body(LV2_Atom_Forge* forge, const char* str, uint32_t len) { - LV2_Atom_Forge_Ref out = lv2_atom_forge_raw(forge, str, len); - if (out && (out = lv2_atom_forge_raw(forge, "", 1))) { - lv2_atom_forge_pad(forge, len + 1); + const LV2_Atom_Forge_Ref s = lv2_atom_forge_raw(forge, str, len); + if (!s) { + return s; } - return out; + + const LV2_Atom_Forge_Ref t = lv2_atom_forge_raw(forge, "", 1); + if (!t) { + return t; + } + + lv2_atom_forge_pad(forge, len + 1U); + return t; } /** @@ -487,7 +495,7 @@ lv2_atom_forge_vector(LV2_Atom_Forge* forge, {(uint32_t)sizeof(LV2_Atom_Vector_Body) + n_elems * child_size, forge->Vector}, {child_size, child_type}}; - LV2_Atom_Forge_Ref out = lv2_atom_forge_write(forge, &a, sizeof(a)); + const LV2_Atom_Forge_Ref out = lv2_atom_forge_write(forge, &a, sizeof(a)); if (out) { lv2_atom_forge_write(forge, elems, child_size * n_elems); } @@ -667,4 +675,4 @@ LV2_RESTORE_WARNINGS @} */ -#endif /* LV2_ATOM_FORGE_H */ +#endif // LV2_ATOM_FORGE_H diff --git a/include/lv2/atom/util.h b/include/lv2/atom/util.h index f585f82..a2369da 100644 --- a/include/lv2/atom/util.h +++ b/include/lv2/atom/util.h @@ -13,7 +13,7 @@ */ /** - @defgroup util Utilities + @defgroup atom_util Utilities @ingroup atom Utilities for working with atoms. @@ -28,6 +28,8 @@ #include <stdint.h> #include <string.h> +// NOLINTBEGIN(bugprone-macro-parentheses) + #ifdef __cplusplus extern "C" { #endif @@ -36,7 +38,9 @@ extern "C" { static inline uint32_t lv2_atom_pad_size(uint32_t size) { - return (size + 7U) & (~7U); + static const uint32_t mask = 7U; + + return (size + mask) & ~mask; } /** Return the total size of `atom`, including the header. */ @@ -112,14 +116,14 @@ lv2_atom_sequence_next(const LV2_Atom_Event* i) @endcode */ #define LV2_ATOM_SEQUENCE_FOREACH(seq, iter) \ - for (LV2_Atom_Event * iter = lv2_atom_sequence_begin(&(seq)->body); \ + for (LV2_Atom_Event* iter = lv2_atom_sequence_begin(&(seq)->body); \ !lv2_atom_sequence_is_end(&(seq)->body, (seq)->atom.size, (iter)); \ (iter) = lv2_atom_sequence_next(iter)) /** Like LV2_ATOM_SEQUENCE_FOREACH but for a headerless sequence body. */ -#define LV2_ATOM_SEQUENCE_BODY_FOREACH(body, size, iter) \ - for (LV2_Atom_Event * iter = lv2_atom_sequence_begin(body); \ - !lv2_atom_sequence_is_end(body, size, (iter)); \ +#define LV2_ATOM_SEQUENCE_BODY_FOREACH(body, size, iter) \ + for (LV2_Atom_Event* iter = lv2_atom_sequence_begin(body); \ + !lv2_atom_sequence_is_end(body, size, (iter)); \ (iter) = lv2_atom_sequence_next(iter)) /** @@ -210,15 +214,14 @@ lv2_atom_tuple_next(const LV2_Atom* i) } @endcode */ -#define LV2_ATOM_TUPLE_FOREACH(tuple, iter) \ - for (LV2_Atom * iter = lv2_atom_tuple_begin(tuple); \ - !lv2_atom_tuple_is_end( \ - LV2_ATOM_BODY(tuple), (tuple)->atom.size, (iter)); \ +#define LV2_ATOM_TUPLE_FOREACH(tuple, iter) \ + for (LV2_Atom* iter = lv2_atom_tuple_begin(tuple); !lv2_atom_tuple_is_end( \ + LV2_ATOM_BODY(tuple), (tuple)->atom.size, (iter)); \ (iter) = lv2_atom_tuple_next(iter)) /** Like LV2_ATOM_TUPLE_FOREACH but for a headerless tuple body. */ #define LV2_ATOM_TUPLE_BODY_FOREACH(body, size, iter) \ - for (LV2_Atom * iter = (LV2_Atom*)(body); \ + for (LV2_Atom* iter = (LV2_Atom*)(body); \ !lv2_atom_tuple_is_end(body, size, (iter)); \ (iter) = lv2_atom_tuple_next(iter)) @@ -270,15 +273,15 @@ lv2_atom_object_next(const LV2_Atom_Property_Body* i) } @endcode */ -#define LV2_ATOM_OBJECT_FOREACH(obj, iter) \ - for (LV2_Atom_Property_Body * iter = lv2_atom_object_begin(&(obj)->body); \ - !lv2_atom_object_is_end(&(obj)->body, (obj)->atom.size, (iter)); \ +#define LV2_ATOM_OBJECT_FOREACH(obj, iter) \ + for (LV2_Atom_Property_Body* iter = lv2_atom_object_begin(&(obj)->body); \ + !lv2_atom_object_is_end(&(obj)->body, (obj)->atom.size, (iter)); \ (iter) = lv2_atom_object_next(iter)) /** Like LV2_ATOM_OBJECT_FOREACH but for a headerless object body. */ -#define LV2_ATOM_OBJECT_BODY_FOREACH(body, size, iter) \ - for (LV2_Atom_Property_Body * iter = lv2_atom_object_begin(body); \ - !lv2_atom_object_is_end(body, size, (iter)); \ +#define LV2_ATOM_OBJECT_BODY_FOREACH(body, size, iter) \ + for (LV2_Atom_Property_Body* iter = lv2_atom_object_begin(body); \ + !lv2_atom_object_is_end(body, size, (iter)); \ (iter) = lv2_atom_object_next(iter)) /** @@ -357,7 +360,7 @@ lv2_atom_object_body_get(uint32_t size, const LV2_Atom_Object_Body* body, ...) int n_queries = 0; /* Count number of keys so we can short-circuit when done */ - va_list args; + va_list args; // NOLINT(cppcoreguidelines-init-variables) va_start(args, body); for (n_queries = 0; va_arg(args, uint32_t); ++n_queries) { if (!va_arg(args, const LV2_Atom**)) { @@ -370,7 +373,7 @@ lv2_atom_object_body_get(uint32_t size, const LV2_Atom_Object_Body* body, ...) LV2_ATOM_OBJECT_BODY_FOREACH (body, size, prop) { va_start(args, body); for (int i = 0; i < n_queries; ++i) { - uint32_t qkey = va_arg(args, uint32_t); + const uint32_t qkey = va_arg(args, uint32_t); const LV2_Atom** qval = va_arg(args, const LV2_Atom**); if (qkey == prop->key && !*qval) { *qval = &prop->value; @@ -412,7 +415,7 @@ lv2_atom_object_get(const LV2_Atom_Object* object, ...) int n_queries = 0; /* Count number of keys so we can short-circuit when done */ - va_list args; + va_list args; // NOLINT(cppcoreguidelines-init-variables) va_start(args, object); for (n_queries = 0; va_arg(args, uint32_t); ++n_queries) { if (!va_arg(args, const LV2_Atom**)) { @@ -425,7 +428,7 @@ lv2_atom_object_get(const LV2_Atom_Object* object, ...) LV2_ATOM_OBJECT_FOREACH (object, prop) { va_start(args, object); for (int i = 0; i < n_queries; ++i) { - uint32_t qkey = va_arg(args, uint32_t); + const uint32_t qkey = va_arg(args, uint32_t); const LV2_Atom** qval = va_arg(args, const LV2_Atom**); if (qkey == prop->key && !*qval) { *qval = &prop->value; @@ -468,7 +471,7 @@ lv2_atom_object_get_typed(const LV2_Atom_Object* object, ...) int n_queries = 0; /* Count number of keys so we can short-circuit when done */ - va_list args; + va_list args; // NOLINT(cppcoreguidelines-init-variables) va_start(args, object); for (n_queries = 0; va_arg(args, uint32_t); ++n_queries) { if (!va_arg(args, const LV2_Atom**) || !va_arg(args, uint32_t)) { @@ -502,9 +505,11 @@ lv2_atom_object_get_typed(const LV2_Atom_Object* object, ...) } /* extern "C" */ #endif +// NOLINTEND(bugprone-macro-parentheses) + /** @} @} */ -#endif /* LV2_ATOM_UTIL_H */ +#endif // LV2_ATOM_UTIL_H diff --git a/include/lv2/buf-size/buf-size.h b/include/lv2/buf-size/buf-size.h index 17be7bc..c1a00e1 100644 --- a/include/lv2/buf-size/buf-size.h +++ b/include/lv2/buf-size/buf-size.h @@ -1,8 +1,8 @@ // Copyright 2007-2016 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC -#ifndef LV2_BUF_SIZE_H -#define LV2_BUF_SIZE_H +#ifndef LV2_BUF_SIZE_BUF_SIZE_H +#define LV2_BUF_SIZE_BUF_SIZE_H /** @defgroup buf-size Buffer Size @@ -35,4 +35,4 @@ @} */ -#endif /* LV2_BUF_SIZE_H */ +#endif // LV2_BUF_SIZE_BUF_SIZE_H diff --git a/include/lv2/core/attributes.h b/include/lv2/core/attributes.h index ab46931..2db876f 100644 --- a/include/lv2/core/attributes.h +++ b/include/lv2/core/attributes.h @@ -43,4 +43,4 @@ @} */ -#endif /* LV2_CORE_ATTRIBUTES_H */ +#endif // LV2_CORE_ATTRIBUTES_H diff --git a/include/lv2/core/lv2.h b/include/lv2/core/lv2.h index 06adea0..b085ac5 100644 --- a/include/lv2/core/lv2.h +++ b/include/lv2/core/lv2.h @@ -3,8 +3,8 @@ // Copyright 2000-2002 Richard W.E. Furse, Paul Barton-Davis, Stefan Westerfeld. // SPDX-License-Identifier: ISC -#ifndef LV2_H_INCLUDED -#define LV2_H_INCLUDED +#ifndef LV2_CORE_LV2_H +#define LV2_CORE_LV2_H /** @defgroup lv2 LV2 @@ -351,11 +351,13 @@ typedef struct LV2_Descriptor { Put this (LV2_SYMBOL_EXPORT) before any functions that are to be loaded by the host as a symbol from the dynamic library. */ -#ifdef _WIN32 -# define LV2_SYMBOL_EXPORT LV2_SYMBOL_EXTERN __declspec(dllexport) -#else -# define LV2_SYMBOL_EXPORT \ - LV2_SYMBOL_EXTERN __attribute__((visibility("default"))) +#ifndef LV2_SYMBOL_EXPORT +# ifdef _WIN32 +# define LV2_SYMBOL_EXPORT LV2_SYMBOL_EXTERN __declspec(dllexport) +# else +# define LV2_SYMBOL_EXPORT \ + LV2_SYMBOL_EXTERN __attribute__((visibility("default"))) +# endif #endif /** @@ -467,4 +469,4 @@ typedef const LV2_Lib_Descriptor* (*LV2_Lib_Descriptor_Function)( @} */ -#endif /* LV2_H_INCLUDED */ +#endif // LV2_CORE_LV2_H diff --git a/include/lv2/core/lv2_util.h b/include/lv2/core/lv2_util.h index 8cd2872..2bac3c9 100644 --- a/include/lv2/core/lv2_util.h +++ b/include/lv2/core/lv2_util.h @@ -1,8 +1,11 @@ // Copyright 2016 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC +#ifndef LV2_CORE_LV2_UTIL_H +#define LV2_CORE_LV2_UTIL_H + /** - @defgroup util Utilities + @defgroup lv2_util Utilities @ingroup lv2core @{ */ @@ -62,13 +65,13 @@ lv2_features_data(const LV2_Feature* const* features, const char* const uri) static inline const char* lv2_features_query(const LV2_Feature* const* features, ...) { - va_list args; + va_list args; // NOLINT(cppcoreguidelines-init-variables) va_start(args, features); const char* uri = NULL; while ((uri = va_arg(args, const char*))) { - void** data = va_arg(args, void**); - bool required = (bool)va_arg(args, int); + void** data = va_arg(args, void**); + const bool required = (bool)va_arg(args, int); *data = lv2_features_data(features, uri); if (required && !*data) { @@ -88,3 +91,5 @@ lv2_features_query(const LV2_Feature* const* features, ...) /** @} */ + +#endif // LV2_CORE_LV2_UTIL_H diff --git a/include/lv2/data-access/data-access.h b/include/lv2/data-access/data-access.h index 2809d93..4586273 100644 --- a/include/lv2/data-access/data-access.h +++ b/include/lv2/data-access/data-access.h @@ -1,8 +1,8 @@ // Copyright 2008-2016 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC -#ifndef LV2_DATA_ACCESS_H -#define LV2_DATA_ACCESS_H +#ifndef LV2_DATA_ACCESS_DATA_ACCESS_H +#define LV2_DATA_ACCESS_DATA_ACCESS_H /** @defgroup data-access Data Access @@ -57,4 +57,4 @@ typedef struct { @} */ -#endif /* LV2_DATA_ACCESS_H */ +#endif // LV2_DATA_ACCESS_DATA_ACCESS_H diff --git a/include/lv2/dynmanifest/dynmanifest.h b/include/lv2/dynmanifest/dynmanifest.h index d67c750..b1a273c 100644 --- a/include/lv2/dynmanifest/dynmanifest.h +++ b/include/lv2/dynmanifest/dynmanifest.h @@ -1,8 +1,8 @@ // Copyright 2008-2011 Stefano D'Angelo <zanga.mail@gmail.com> // SPDX-License-Identifier: ISC -#ifndef LV2_DYN_MANIFEST_H_INCLUDED -#define LV2_DYN_MANIFEST_H_INCLUDED +#ifndef LV2_DYNMANIFEST_DYNMANIFEST_H +#define LV2_DYNMANIFEST_DYNMANIFEST_H /** @defgroup dynmanifest Dynamic Manifest @@ -56,6 +56,7 @@ typedef void* LV2_Dyn_Manifest_Handle; evaluate the result of the operation by examining the returned value and MUST NOT try to interpret the value of handle. */ +LV2_SYMBOL_EXPORT int lv2_dyn_manifest_open(LV2_Dyn_Manifest_Handle* handle, const LV2_Feature* const* features); @@ -83,6 +84,7 @@ lv2_dyn_manifest_open(LV2_Dyn_Manifest_Handle* handle, @return 0 on success, otherwise a non-zero error code. */ +LV2_SYMBOL_EXPORT int lv2_dyn_manifest_get_subjects(LV2_Dyn_Manifest_Handle handle, FILE* fp); @@ -116,6 +118,7 @@ lv2_dyn_manifest_get_subjects(LV2_Dyn_Manifest_Handle handle, FILE* fp); @return 0 on success, otherwise a non-zero error code. */ +LV2_SYMBOL_EXPORT int lv2_dyn_manifest_get_data(LV2_Dyn_Manifest_Handle handle, FILE* fp, @@ -132,6 +135,7 @@ lv2_dyn_manifest_get_data(LV2_Dyn_Manifest_Handle handle, @param handle Dynamic manifest generator handle. */ +LV2_SYMBOL_EXPORT void lv2_dyn_manifest_close(LV2_Dyn_Manifest_Handle handle); @@ -143,4 +147,4 @@ lv2_dyn_manifest_close(LV2_Dyn_Manifest_Handle handle); @} */ -#endif /* LV2_DYN_MANIFEST_H_INCLUDED */ +#endif // LV2_DYNMANIFEST_DYNMANIFEST_H diff --git a/include/lv2/event/event-helpers.h b/include/lv2/event/event-helpers.h index 0bf352f..a9eb423 100644 --- a/include/lv2/event/event-helpers.h +++ b/include/lv2/event/event-helpers.h @@ -1,8 +1,8 @@ // Copyright 2008-2015 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC -#ifndef LV2_EVENT_HELPERS_H -#define LV2_EVENT_HELPERS_H +#ifndef LV2_EVENT_EVENT_HELPERS_H +#define LV2_EVENT_EVENT_HELPERS_H /** @file event-helpers.h Helper functions for the LV2 Event extension @@ -239,4 +239,4 @@ LV2_RESTORE_WARNINGS } /* extern "C" */ #endif -#endif /* LV2_EVENT_HELPERS_H */ +#endif // LV2_EVENT_EVENT_HELPERS_H diff --git a/include/lv2/event/event.h b/include/lv2/event/event.h index b880de1..e255291 100644 --- a/include/lv2/event/event.h +++ b/include/lv2/event/event.h @@ -2,8 +2,8 @@ // Copyright 2006-2007 Lars Luthman <lars.luthman@gmail.com> // SPDX-License-Identifier: ISC -#ifndef LV2_EVENT_H -#define LV2_EVENT_H +#ifndef LV2_EVENT_EVENT_H +#define LV2_EVENT_EVENT_H /** @defgroup event Event @@ -282,4 +282,4 @@ LV2_RESTORE_WARNINGS @} */ -#endif /* LV2_EVENT_H */ +#endif // LV2_EVENT_EVENT_H diff --git a/include/lv2/instance-access/instance-access.h b/include/lv2/instance-access/instance-access.h index a87ecaf..70c2789 100644 --- a/include/lv2/instance-access/instance-access.h +++ b/include/lv2/instance-access/instance-access.h @@ -1,8 +1,8 @@ // Copyright 2008-2016 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC -#ifndef LV2_INSTANCE_ACCESS_H -#define LV2_INSTANCE_ACCESS_H +#ifndef LV2_INSTANCE_ACCESS_INSTANCE_ACCESS_H +#define LV2_INSTANCE_ACCESS_INSTANCE_ACCESS_H /** @defgroup instance-access Instance Access @@ -25,4 +25,4 @@ @} */ -#endif /* LV2_INSTANCE_ACCESS_H */ +#endif // LV2_INSTANCE_ACCESS_INSTANCE_ACCESS_H diff --git a/include/lv2/log/log.h b/include/lv2/log/log.h index cdaa6d3..b460f45 100644 --- a/include/lv2/log/log.h +++ b/include/lv2/log/log.h @@ -1,8 +1,8 @@ // Copyright 2012-2016 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC -#ifndef LV2_LOG_H -#define LV2_LOG_H +#ifndef LV2_LOG_LOG_H +#define LV2_LOG_LOG_H /** @defgroup log Log @@ -97,4 +97,4 @@ typedef struct { @} */ -#endif /* LV2_LOG_H */ +#endif // LV2_LOG_LOG_H diff --git a/include/lv2/log/logger.h b/include/lv2/log/logger.h index b7d2856..37fe564 100644 --- a/include/lv2/log/logger.h +++ b/include/lv2/log/logger.h @@ -1,8 +1,8 @@ // Copyright 2012-2016 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC -#ifndef LV2_ATOM_LOGGER_H -#define LV2_ATOM_LOGGER_H +#ifndef LV2_LOG_LOGGER_H +#define LV2_LOG_LOGGER_H /** @defgroup logger Logger @@ -90,7 +90,7 @@ LV2_LOG_FUNC(2, 3) static inline int lv2_log_error(LV2_Log_Logger* logger, const char* fmt, ...) { - va_list args; + va_list args; // NOLINT(cppcoreguidelines-init-variables) va_start(args, fmt); const int ret = lv2_log_vprintf(logger, logger->Error, fmt, args); va_end(args); @@ -102,7 +102,7 @@ LV2_LOG_FUNC(2, 3) static inline int lv2_log_note(LV2_Log_Logger* logger, const char* fmt, ...) { - va_list args; + va_list args; // NOLINT(cppcoreguidelines-init-variables) va_start(args, fmt); const int ret = lv2_log_vprintf(logger, logger->Note, fmt, args); va_end(args); @@ -114,7 +114,7 @@ LV2_LOG_FUNC(2, 3) static inline int lv2_log_trace(LV2_Log_Logger* logger, const char* fmt, ...) { - va_list args; + va_list args; // NOLINT(cppcoreguidelines-init-variables) va_start(args, fmt); const int ret = lv2_log_vprintf(logger, logger->Trace, fmt, args); va_end(args); @@ -126,7 +126,7 @@ LV2_LOG_FUNC(2, 3) static inline int lv2_log_warning(LV2_Log_Logger* logger, const char* fmt, ...) { - va_list args; + va_list args; // NOLINT(cppcoreguidelines-init-variables) va_start(args, fmt); const int ret = lv2_log_vprintf(logger, logger->Warning, fmt, args); va_end(args); @@ -141,4 +141,4 @@ lv2_log_warning(LV2_Log_Logger* logger, const char* fmt, ...) @} */ -#endif /* LV2_LOG_LOGGER_H */ +#endif // LV2_LOG_LOGGER_H diff --git a/include/lv2/midi/midi.h b/include/lv2/midi/midi.h index cef7bc8..2a687fb 100644 --- a/include/lv2/midi/midi.h +++ b/include/lv2/midi/midi.h @@ -1,8 +1,8 @@ // Copyright 2012-2016 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC -#ifndef LV2_MIDI_H -#define LV2_MIDI_H +#ifndef LV2_MIDI_MIDI_H +#define LV2_MIDI_MIDI_H /** @defgroup midi MIDI @@ -232,4 +232,4 @@ lv2_midi_message_type(const uint8_t* msg) @} */ -#endif /* LV2_MIDI_H */ +#endif // LV2_MIDI_MIDI_H diff --git a/include/lv2/morph/morph.h b/include/lv2/morph/morph.h index e60a7d5..88bfe81 100644 --- a/include/lv2/morph/morph.h +++ b/include/lv2/morph/morph.h @@ -1,8 +1,8 @@ // Copyright 2012-2016 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC -#ifndef LV2_MORPH_H -#define LV2_MORPH_H +#ifndef LV2_MORPH_MORPH_H +#define LV2_MORPH_MORPH_H /** @defgroup morph Morph @@ -32,4 +32,4 @@ @} */ -#endif /* LV2_MORPH_H */ +#endif // LV2_MORPH_MORPH_H diff --git a/include/lv2/options/options.h b/include/lv2/options/options.h index 48f7bfb..0169b46 100644 --- a/include/lv2/options/options.h +++ b/include/lv2/options/options.h @@ -1,8 +1,8 @@ // Copyright 2012-2016 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC -#ifndef LV2_OPTIONS_H -#define LV2_OPTIONS_H +#ifndef LV2_OPTIONS_OPTIONS_H +#define LV2_OPTIONS_OPTIONS_H /** @defgroup options Options @@ -133,4 +133,4 @@ typedef struct { @} */ -#endif /* LV2_OPTIONS_H */ +#endif // LV2_OPTIONS_OPTIONS_H diff --git a/include/lv2/parameters/parameters.h b/include/lv2/parameters/parameters.h index 6c17a1c..b20c83e 100644 --- a/include/lv2/parameters/parameters.h +++ b/include/lv2/parameters/parameters.h @@ -1,8 +1,8 @@ // Copyright 2012-2016 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC -#ifndef LV2_PARAMETERS_H -#define LV2_PARAMETERS_H +#ifndef LV2_PARAMETERS_PARAMETERS_H +#define LV2_PARAMETERS_PARAMETERS_H /** @defgroup parameters Parameters @@ -52,4 +52,4 @@ @} */ -#endif /* LV2_PARAMETERS_H */ +#endif // LV2_PARAMETERS_PARAMETERS_H diff --git a/include/lv2/patch/patch.h b/include/lv2/patch/patch.h index 16b7889..99fd8e9 100644 --- a/include/lv2/patch/patch.h +++ b/include/lv2/patch/patch.h @@ -1,8 +1,8 @@ // Copyright 2012-2016 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC -#ifndef LV2_PATCH_H -#define LV2_PATCH_H +#ifndef LV2_PATCH_PATCH_H +#define LV2_PATCH_PATCH_H /** @defgroup patch Patch @@ -57,4 +57,4 @@ @} */ -#endif /* LV2_PATCH_H */ +#endif // LV2_PATCH_PATCH_H diff --git a/include/lv2/port-groups/port-groups.h b/include/lv2/port-groups/port-groups.h index 303890a..ff00533 100644 --- a/include/lv2/port-groups/port-groups.h +++ b/include/lv2/port-groups/port-groups.h @@ -1,8 +1,8 @@ // Copyright 2012-2016 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC -#ifndef LV2_PORT_GROUPS_H -#define LV2_PORT_GROUPS_H +#ifndef LV2_PORT_GROUPS_PORT_GROUPS_H +#define LV2_PORT_GROUPS_PORT_GROUPS_H /** @defgroup port-groups Port Groups @@ -61,4 +61,4 @@ @} */ -#endif /* LV2_PORT_GROUPS_H */ +#endif // LV2_PORT_GROUPS_PORT_GROUPS_H diff --git a/include/lv2/port-props/port-props.h b/include/lv2/port-props/port-props.h index ff45140..6007f4b 100644 --- a/include/lv2/port-props/port-props.h +++ b/include/lv2/port-props/port-props.h @@ -1,8 +1,8 @@ // Copyright 2012-2016 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC -#ifndef LV2_PORT_PROPS_H -#define LV2_PORT_PROPS_H +#ifndef LV2_PORT_PROPS_PORT_PROPS_H +#define LV2_PORT_PROPS_PORT_PROPS_H /** @defgroup port-props Port Properties @@ -37,4 +37,4 @@ @} */ -#endif /* LV2_PORT_PROPS_H */ +#endif // LV2_PORT_PROPS_PORT_PROPS_H diff --git a/include/lv2/presets/presets.h b/include/lv2/presets/presets.h index 7100605..ecd23a2 100644 --- a/include/lv2/presets/presets.h +++ b/include/lv2/presets/presets.h @@ -1,8 +1,8 @@ // Copyright 2012-2016 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC -#ifndef LV2_PRESETS_H -#define LV2_PRESETS_H +#ifndef LV2_PRESETS_PRESETS_H +#define LV2_PRESETS_PRESETS_H /** @defgroup presets Presets @@ -32,4 +32,4 @@ @} */ -#endif /* LV2_PRESETS_H */ +#endif // LV2_PRESETS_PRESETS_H diff --git a/include/lv2/resize-port/resize-port.h b/include/lv2/resize-port/resize-port.h index cd4828e..7593a6d 100644 --- a/include/lv2/resize-port/resize-port.h +++ b/include/lv2/resize-port/resize-port.h @@ -1,8 +1,8 @@ // Copyright 2007-2016 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC -#ifndef LV2_RESIZE_PORT_H -#define LV2_RESIZE_PORT_H +#ifndef LV2_RESIZE_PORT_RESIZE_PORT_H +#define LV2_RESIZE_PORT_RESIZE_PORT_H /** @defgroup resize-port Resize Port @@ -73,4 +73,4 @@ typedef struct { @} */ -#endif /* LV2_RESIZE_PORT_H */ +#endif // LV2_RESIZE_PORT_RESIZE_PORT_H diff --git a/include/lv2/state/state.h b/include/lv2/state/state.h index 9c5d9d8..a44f3cc 100644 --- a/include/lv2/state/state.h +++ b/include/lv2/state/state.h @@ -2,8 +2,8 @@ // Copyright 2010 Leonard Ritter <paniq@paniq.org> // SPDX-License-Identifier: ISC -#ifndef LV2_STATE_H -#define LV2_STATE_H +#ifndef LV2_STATE_STATE_H +#define LV2_STATE_STATE_H /** @defgroup state State @@ -376,4 +376,4 @@ typedef struct { @} */ -#endif /* LV2_STATE_H */ +#endif // LV2_STATE_STATE_H diff --git a/include/lv2/time/time.h b/include/lv2/time/time.h index 83408c9..2d81dc7 100644 --- a/include/lv2/time/time.h +++ b/include/lv2/time/time.h @@ -1,8 +1,8 @@ // Copyright 2011-2016 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC -#ifndef LV2_TIME_H -#define LV2_TIME_H +#ifndef LV2_TIME_TIME_H +#define LV2_TIME_TIME_H /** @defgroup time Time @@ -43,4 +43,4 @@ @} */ -#endif /* LV2_TIME_H */ +#endif // LV2_TIME_TIME_H diff --git a/include/lv2/ui/ui.h b/include/lv2/ui/ui.h index 5ef75a3..4d2fed7 100644 --- a/include/lv2/ui/ui.h +++ b/include/lv2/ui/ui.h @@ -2,8 +2,8 @@ // Copyright 2006-2011 Lars Luthman <lars.luthman@gmail.com> // SPDX-License-Identifier: ISC -#ifndef LV2_UI_H -#define LV2_UI_H +#ifndef LV2_UI_UI_H +#define LV2_UI_UI_H /** @defgroup ui User Interfaces @@ -526,4 +526,4 @@ typedef const LV2UI_Descriptor* (*LV2UI_DescriptorFunction)(uint32_t index); @} */ -#endif /* LV2_UI_H */ +#endif // LV2_UI_UI_H diff --git a/include/lv2/units/units.h b/include/lv2/units/units.h index 0b8d416..a6ac4c5 100644 --- a/include/lv2/units/units.h +++ b/include/lv2/units/units.h @@ -1,8 +1,8 @@ // Copyright 2012-2016 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC -#ifndef LV2_UNITS_H -#define LV2_UNITS_H +#ifndef LV2_UNITS_UNITS_H +#define LV2_UNITS_UNITS_H /** @defgroup units Units @@ -59,4 +59,4 @@ @} */ -#endif /* LV2_UNITS_H */ +#endif // LV2_UNITS_UNITS_H diff --git a/include/lv2/uri-map/uri-map.h b/include/lv2/uri-map/uri-map.h index 0c683d0..dc25a55 100644 --- a/include/lv2/uri-map/uri-map.h +++ b/include/lv2/uri-map/uri-map.h @@ -1,8 +1,8 @@ // Copyright 2008-2016 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC -#ifndef LV2_URI_MAP_H -#define LV2_URI_MAP_H +#ifndef LV2_URI_MAP_URI_MAP_H +#define LV2_URI_MAP_URI_MAP_H /** @defgroup uri-map URI Map @@ -105,4 +105,4 @@ LV2_RESTORE_WARNINGS @} */ -#endif /* LV2_URI_MAP_H */ +#endif // LV2_URI_MAP_URI_MAP_H diff --git a/include/lv2/urid/urid.h b/include/lv2/urid/urid.h index 5890307..8dc4332 100644 --- a/include/lv2/urid/urid.h +++ b/include/lv2/urid/urid.h @@ -2,8 +2,8 @@ // Copyright 2011 Gabriel M. Beddingfield <gabrbedd@gmail.com> // SPDX-License-Identifier: ISC -#ifndef LV2_URID_H -#define LV2_URID_H +#ifndef LV2_URID_URID_H +#define LV2_URID_URID_H /** @defgroup urid URID @@ -124,4 +124,4 @@ typedef struct { @} */ -#endif /* LV2_URID_H */ +#endif // LV2_URID_URID_H diff --git a/include/lv2/worker/worker.h b/include/lv2/worker/worker.h index 0b0e792..613198b 100644 --- a/include/lv2/worker/worker.h +++ b/include/lv2/worker/worker.h @@ -1,8 +1,8 @@ // Copyright 2012-2016 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC -#ifndef LV2_WORKER_H -#define LV2_WORKER_H +#ifndef LV2_WORKER_WORKER_H +#define LV2_WORKER_WORKER_H /** @defgroup worker Worker @@ -167,4 +167,4 @@ typedef struct { @} */ -#endif /* LV2_WORKER_H */ +#endif // LV2_WORKER_WORKER_H diff --git a/lv2/atom.lv2/atom.meta.ttl b/lv2/atom.lv2/atom.meta.ttl index 81c3482..e2902c5 100644 --- a/lv2/atom.lv2/atom.meta.ttl +++ b/lv2/atom.lv2/atom.meta.ttl @@ -447,4 +447,3 @@ This protocol applies to atom ports. The host must transfer the complete atom contained in the port, including header. """^^lv2:Markdown . - diff --git a/lv2/atom.lv2/atom.ttl b/lv2/atom.lv2/atom.ttl index bdeaebf..03d3531 100644 --- a/lv2/atom.lv2/atom.ttl +++ b/lv2/atom.lv2/atom.ttl @@ -244,4 +244,3 @@ atom:atomTransfer a ui:PortProtocol ; rdfs:label "atom transfer" ; rdfs:comment "A port protocol for transferring atoms." . - diff --git a/lv2/atom.lv2/manifest.ttl b/lv2/atom.lv2/manifest.ttl index 3cb5134..8875a20 100644 --- a/lv2/atom.lv2/manifest.ttl +++ b/lv2/atom.lv2/manifest.ttl @@ -6,4 +6,3 @@ lv2:minorVersion 2 ; lv2:microVersion 4 ; rdfs:seeAlso <atom.ttl> . - diff --git a/lv2/buf-size.lv2/buf-size.meta.ttl b/lv2/buf-size.lv2/buf-size.meta.ttl index ba08b29..dbce35b 100644 --- a/lv2/buf-size.lv2/buf-size.meta.ttl +++ b/lv2/buf-size.lv2/buf-size.meta.ttl @@ -120,4 +120,3 @@ This should be provided as an option by hosts that support event ports auxiliary buffers large enough to copy the input. """^^lv2:Markdown . - diff --git a/lv2/buf-size.lv2/buf-size.ttl b/lv2/buf-size.lv2/buf-size.ttl index 4f6bd52..be18fbe 100644 --- a/lv2/buf-size.lv2/buf-size.ttl +++ b/lv2/buf-size.lv2/buf-size.ttl @@ -65,4 +65,3 @@ bufsz:sequenceSize rdfs:label "sequence size" ; rdfs:comment "The maximum size of a sequence, in bytes." ; rdfs:range xsd:nonNegativeInteger . - diff --git a/lv2/buf-size.lv2/manifest.ttl b/lv2/buf-size.lv2/manifest.ttl index d242f97..b9cd1ec 100644 --- a/lv2/buf-size.lv2/manifest.ttl +++ b/lv2/buf-size.lv2/manifest.ttl @@ -6,4 +6,3 @@ lv2:minorVersion 1 ; lv2:microVersion 4 ; rdfs:seeAlso <buf-size.ttl> . - diff --git a/lv2/core.lv2/lv2core.meta.ttl b/lv2/core.lv2/lv2core.meta.ttl index 9844b29..e593d2e 100644 --- a/lv2/core.lv2/lv2core.meta.ttl +++ b/lv2/core.lv2/lv2core.meta.ttl @@ -702,4 +702,3 @@ but should not be considered a part of the main signal chain. Sidechain ports SHOULD be lv2:connectionOptional, and may be ignored by hosts. """^^lv2:Markdown . - diff --git a/lv2/core.lv2/lv2core.ttl b/lv2/core.lv2/lv2core.ttl index 7722cac..669ca2a 100644 --- a/lv2/core.lv2/lv2core.ttl +++ b/lv2/core.lv2/lv2core.ttl @@ -670,4 +670,3 @@ lv2:MIDIPlugin rdfs:subClassOf lv2:Plugin ; rdfs:label "MIDI Plugin" ; rdfs:comment "A plugin that primarily processes MIDI messages." . - diff --git a/lv2/core.lv2/manifest.ttl b/lv2/core.lv2/manifest.ttl index 7f5e37e..27793dc 100644 --- a/lv2/core.lv2/manifest.ttl +++ b/lv2/core.lv2/manifest.ttl @@ -12,4 +12,3 @@ a doap:Project ; rdfs:seeAlso <meta.ttl> , <people.ttl> . - diff --git a/lv2/core.lv2/meta.ttl b/lv2/core.lv2/meta.ttl index 75a13ac..014285c 100644 --- a/lv2/core.lv2/meta.ttl +++ b/lv2/core.lv2/meta.ttl @@ -32,4 +32,3 @@ THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH R meta:daste , meta:kfoltman , meta:paniq . - diff --git a/lv2/core.lv2/people.ttl b/lv2/core.lv2/people.ttl index 52d0384..c735af6 100644 --- a/lv2/core.lv2/people.ttl +++ b/lv2/core.lv2/people.ttl @@ -48,4 +48,3 @@ meta:bmwiedemann a foaf:Person ; foaf:name "Bernhard M. Wiedemann" ; foaf:mbox <bwiedemann@suse.de> . - diff --git a/lv2/data-access.lv2/data-access.meta.ttl b/lv2/data-access.lv2/data-access.meta.ttl index 7d0e622..735bf0b 100644 --- a/lv2/data-access.lv2/data-access.meta.ttl +++ b/lv2/data-access.lv2/data-access.meta.ttl @@ -27,4 +27,3 @@ LV2_Descriptor::extension_data() with URI LV2_DATA_ACCESS_URI and data pointed to an instance of LV2_Extension_Data_Feature. """^^lv2:Markdown . - diff --git a/lv2/data-access.lv2/data-access.ttl b/lv2/data-access.lv2/data-access.ttl index b0dc6f4..b75cc81 100644 --- a/lv2/data-access.lv2/data-access.ttl +++ b/lv2/data-access.lv2/data-access.ttl @@ -7,4 +7,3 @@ rdfs:label "data access" ; rdfs:comment "A feature that provides access to plugin extension data." ; rdfs:seeAlso <data-access.meta.ttl> . - diff --git a/lv2/data-access.lv2/manifest.ttl b/lv2/data-access.lv2/manifest.ttl index 9585a5e..54fcace 100644 --- a/lv2/data-access.lv2/manifest.ttl +++ b/lv2/data-access.lv2/manifest.ttl @@ -6,4 +6,3 @@ lv2:minorVersion 1 ; lv2:microVersion 6 ; rdfs:seeAlso <data-access.ttl> . - diff --git a/lv2/dynmanifest.lv2/dynmanifest.meta.ttl b/lv2/dynmanifest.lv2/dynmanifest.meta.ttl index 5d365c6..9c2919d 100644 --- a/lv2/dynmanifest.lv2/dynmanifest.meta.ttl +++ b/lv2/dynmanifest.lv2/dynmanifest.meta.ttl @@ -86,4 +86,3 @@ All relative URIs in the generated data MUST be relative to the base path that would be used to parse a normal LV2 manifest (the bundle path). """^^lv2:Markdown . - diff --git a/lv2/dynmanifest.lv2/dynmanifest.ttl b/lv2/dynmanifest.lv2/dynmanifest.ttl index b46d694..12be4dc 100644 --- a/lv2/dynmanifest.lv2/dynmanifest.ttl +++ b/lv2/dynmanifest.lv2/dynmanifest.ttl @@ -21,4 +21,3 @@ dman:DynManifest rdfs:comment "A DynManifest MUST have at least one lv2:binary." ] ; rdfs:comment "Dynamic manifest for an LV2 binary." . - diff --git a/lv2/dynmanifest.lv2/manifest.ttl b/lv2/dynmanifest.lv2/manifest.ttl index db27a73..2c072a3 100644 --- a/lv2/dynmanifest.lv2/manifest.ttl +++ b/lv2/dynmanifest.lv2/manifest.ttl @@ -6,4 +6,3 @@ lv2:minorVersion 1 ; lv2:microVersion 6 ; rdfs:seeAlso <dynmanifest.ttl> . - diff --git a/lv2/event.lv2/event.meta.ttl b/lv2/event.lv2/event.meta.ttl index f573a15..4492d2b 100644 --- a/lv2/event.lv2/event.meta.ttl +++ b/lv2/event.lv2/event.meta.ttl @@ -157,4 +157,3 @@ their output type on an input port so the host can make more sense of the plugin and provide a more sensible interface. """^^lv2:Markdown . - diff --git a/lv2/event.lv2/event.ttl b/lv2/event.lv2/event.ttl index 2d871f6..ebcbd3a 100644 --- a/lv2/event.lv2/event.ttl +++ b/lv2/event.lv2/event.ttl @@ -82,4 +82,3 @@ ev:inheritsTimeStamp rdfs:range lv2:Port ; rdfs:label "inherits time stamp type" ; rdfs:comment "Output port inherits time stamp types from an input port." . - diff --git a/lv2/event.lv2/manifest.ttl b/lv2/event.lv2/manifest.ttl index 230fe73..15b095b 100644 --- a/lv2/event.lv2/manifest.ttl +++ b/lv2/event.lv2/manifest.ttl @@ -6,4 +6,3 @@ lv2:minorVersion 1 ; lv2:microVersion 14 ; rdfs:seeAlso <event.ttl> . - diff --git a/lv2/instance-access.lv2/instance-access.meta.ttl b/lv2/instance-access.lv2/instance-access.meta.ttl index 8d33100..b9cdfc4 100644 --- a/lv2/instance-access.lv2/instance-access.meta.ttl +++ b/lv2/instance-access.lv2/instance-access.meta.ttl @@ -26,4 +26,3 @@ instantiate method with URI LV2_INSTANCE_ACCESS_URI and data pointed directly to the LV2_Handle of the plugin instance. """^^lv2:Markdown . - diff --git a/lv2/instance-access.lv2/instance-access.ttl b/lv2/instance-access.lv2/instance-access.ttl index 637f4e0..068ef4f 100644 --- a/lv2/instance-access.lv2/instance-access.ttl +++ b/lv2/instance-access.lv2/instance-access.ttl @@ -7,4 +7,3 @@ rdfs:label "instance access" ; rdfs:comment "A feature that provides access to a plugin instance." ; rdfs:seeAlso <instance-access.meta.ttl> . - diff --git a/lv2/instance-access.lv2/manifest.ttl b/lv2/instance-access.lv2/manifest.ttl index e6c8810..3da863d 100644 --- a/lv2/instance-access.lv2/manifest.ttl +++ b/lv2/instance-access.lv2/manifest.ttl @@ -6,4 +6,3 @@ lv2:minorVersion 1 ; lv2:microVersion 6 ; rdfs:seeAlso <instance-access.ttl> . - diff --git a/lv2/log.lv2/log.meta.ttl b/lv2/log.lv2/log.meta.ttl index 06d9f63..0c74e6c 100644 --- a/lv2/log.lv2/log.meta.ttl +++ b/lv2/log.lv2/log.meta.ttl @@ -81,4 +81,3 @@ the host must pass an LV2_Feature to LV2_Descriptor::instantiate() with URI LV2_LOG__log and data pointed to an instance of LV2_Log_Log. """^^lv2:Markdown . - diff --git a/lv2/log.lv2/log.ttl b/lv2/log.lv2/log.ttl index 0b334ed..10f0acc 100644 --- a/lv2/log.lv2/log.ttl +++ b/lv2/log.lv2/log.ttl @@ -45,4 +45,3 @@ log:log a lv2:Feature ; rdfs:label "log" ; rdfs:comment "Logging feature." . - diff --git a/lv2/log.lv2/manifest.ttl b/lv2/log.lv2/manifest.ttl index bcaeff3..f448ffe 100644 --- a/lv2/log.lv2/manifest.ttl +++ b/lv2/log.lv2/manifest.ttl @@ -6,4 +6,3 @@ lv2:minorVersion 2 ; lv2:microVersion 4 ; rdfs:seeAlso <log.ttl> . - diff --git a/lv2/midi.lv2/manifest.ttl b/lv2/midi.lv2/manifest.ttl index f141936..7c9efcd 100644 --- a/lv2/midi.lv2/manifest.ttl +++ b/lv2/midi.lv2/manifest.ttl @@ -6,4 +6,3 @@ lv2:minorVersion 1 ; lv2:microVersion 10 ; rdfs:seeAlso <midi.ttl> . - diff --git a/lv2/midi.lv2/midi.meta.ttl b/lv2/midi.lv2/midi.meta.ttl index b3dfd44..8afb944 100644 --- a/lv2/midi.lv2/midi.meta.ttl +++ b/lv2/midi.lv2/midi.meta.ttl @@ -70,4 +70,3 @@ midi:statusMask This is a status byte with the lower nibble set to zero. """^^lv2:Markdown . - diff --git a/lv2/midi.lv2/midi.ttl b/lv2/midi.lv2/midi.ttl index 4a0e8c9..5dfdbc7 100644 --- a/lv2/midi.lv2/midi.ttl +++ b/lv2/midi.lv2/midi.ttl @@ -362,4 +362,3 @@ midi:velocity rdfs:label "velocity" ; rdfs:range midi:HexByte ; rdfs:comment "The velocity of a note message (0 to 127)." . - diff --git a/lv2/morph.lv2/manifest.ttl b/lv2/morph.lv2/manifest.ttl index 7c85cfd..c63317b 100644 --- a/lv2/morph.lv2/manifest.ttl +++ b/lv2/morph.lv2/manifest.ttl @@ -6,4 +6,3 @@ lv2:minorVersion 1 ; lv2:microVersion 0 ; rdfs:seeAlso <morph.ttl> . - diff --git a/lv2/morph.lv2/morph.meta.ttl b/lv2/morph.lv2/morph.meta.ttl index f161557..09945c0 100644 --- a/lv2/morph.lv2/morph.meta.ttl +++ b/lv2/morph.lv2/morph.meta.ttl @@ -75,4 +75,3 @@ The currently active type of the port. This is for dynamic use as an option and SHOULD NOT be listed in the static plugin data. """^^lv2:Markdown . - diff --git a/lv2/morph.lv2/morph.ttl b/lv2/morph.lv2/morph.ttl index 9b8ef51..cd21dd9 100644 --- a/lv2/morph.lv2/morph.ttl +++ b/lv2/morph.lv2/morph.ttl @@ -43,4 +43,3 @@ morph:currentType rdfs:domain morph:MorphPort ; rdfs:label "current type" ; rdfs:comment "The currently active type of the port." . - diff --git a/lv2/options.lv2/manifest.ttl b/lv2/options.lv2/manifest.ttl index 18db448..c54456c 100644 --- a/lv2/options.lv2/manifest.ttl +++ b/lv2/options.lv2/manifest.ttl @@ -6,4 +6,3 @@ lv2:minorVersion 1 ; lv2:microVersion 4 ; rdfs:seeAlso <options.ttl> . - diff --git a/lv2/options.lv2/options.meta.ttl b/lv2/options.lv2/options.meta.ttl index 10ca296..33946f4 100644 --- a/lv2/options.lv2/options.meta.ttl +++ b/lv2/options.lv2/options.meta.ttl @@ -94,4 +94,3 @@ The host SHOULD provide a value for the specified option if one is known, or provide the user an opportunity to specify one if possible. """^^lv2:Markdown . - diff --git a/lv2/options.lv2/options.ttl b/lv2/options.lv2/options.ttl index 5f9fcc9..7233180 100644 --- a/lv2/options.lv2/options.ttl +++ b/lv2/options.lv2/options.ttl @@ -41,4 +41,3 @@ opts:supportedOption rdfs:range rdf:Property ; rdfs:label "supported option" ; rdfs:comment "An option supported or by the instance." . - diff --git a/lv2/parameters.lv2/manifest.ttl b/lv2/parameters.lv2/manifest.ttl index 57f5d2e..4889ae5 100644 --- a/lv2/parameters.lv2/manifest.ttl +++ b/lv2/parameters.lv2/manifest.ttl @@ -6,4 +6,3 @@ lv2:minorVersion 1 ; lv2:microVersion 4 ; rdfs:seeAlso <parameters.ttl> . - diff --git a/lv2/parameters.lv2/parameters.meta.ttl b/lv2/parameters.lv2/parameters.meta.ttl index ffb3507..653f715 100644 --- a/lv2/parameters.lv2/parameters.meta.ttl +++ b/lv2/parameters.lv2/parameters.meta.ttl @@ -36,4 +36,3 @@ and wet percentages can be calculated from the following equations: Typically, maximum value of 1 or 100 and minimum value of 0 should be used. """^^lv2:Markdown . - diff --git a/lv2/parameters.lv2/parameters.ttl b/lv2/parameters.lv2/parameters.ttl index 9987812..2e2c5df 100644 --- a/lv2/parameters.lv2/parameters.ttl +++ b/lv2/parameters.lv2/parameters.ttl @@ -202,4 +202,3 @@ param:CompressorControls ] , [ lv2:designation param:ratio ] . - diff --git a/lv2/patch.lv2/manifest.ttl b/lv2/patch.lv2/manifest.ttl index 4bf9cfb..fee2375 100644 --- a/lv2/patch.lv2/manifest.ttl +++ b/lv2/patch.lv2/manifest.ttl @@ -6,4 +6,3 @@ lv2:minorVersion 2 ; lv2:microVersion 10 ; rdfs:seeAlso <patch.ttl> . - diff --git a/lv2/patch.lv2/patch.meta.ttl b/lv2/patch.lv2/patch.meta.ttl index 976034f..edbb5dc 100644 --- a/lv2/patch.lv2/patch.meta.ttl +++ b/lv2/patch.lv2/patch.meta.ttl @@ -303,4 +303,3 @@ interfaces to present appropriate controls. For example: patch:writable eg:title . """^^lv2:Markdown . - diff --git a/lv2/patch.lv2/patch.ttl b/lv2/patch.lv2/patch.ttl index 33d04d1..59ca118 100644 --- a/lv2/patch.lv2/patch.ttl +++ b/lv2/patch.lv2/patch.ttl @@ -245,4 +245,3 @@ patch:writable rdfs:label "writable" ; rdfs:range rdf:Property ; rdfs:comment "A property that can be set with a patch:Set or patch:Patch message." . - diff --git a/lv2/port-groups.lv2/manifest.ttl b/lv2/port-groups.lv2/manifest.ttl index a887cb0..7df99a8 100644 --- a/lv2/port-groups.lv2/manifest.ttl +++ b/lv2/port-groups.lv2/manifest.ttl @@ -6,4 +6,3 @@ lv2:minorVersion 1 ; lv2:microVersion 4 ; rdfs:seeAlso <port-groups.ttl> . - diff --git a/lv2/port-groups.lv2/port-groups.meta.ttl b/lv2/port-groups.lv2/port-groups.meta.ttl index 4e3a158..a76d783 100644 --- a/lv2/port-groups.lv2/port-groups.meta.ttl +++ b/lv2/port-groups.lv2/port-groups.meta.ttl @@ -107,4 +107,3 @@ does not depend on a particular speaker configuration; a decoder can be used to convert an ambisonic stream for any speaker configuration. """^^lv2:Markdown . - diff --git a/lv2/port-groups.lv2/port-groups.ttl b/lv2/port-groups.lv2/port-groups.ttl index 2806821..9fc5c34 100644 --- a/lv2/port-groups.lv2/port-groups.ttl +++ b/lv2/port-groups.lv2/port-groups.ttl @@ -805,4 +805,3 @@ pg:AmbisonicBH3P3Group lv2:index 15 ; lv2:designation pg:ACN15 ] . - diff --git a/lv2/port-props.lv2/manifest.ttl b/lv2/port-props.lv2/manifest.ttl index 45f598d..dd12797 100644 --- a/lv2/port-props.lv2/manifest.ttl +++ b/lv2/port-props.lv2/manifest.ttl @@ -6,4 +6,3 @@ lv2:minorVersion 1 ; lv2:microVersion 2 ; rdfs:seeAlso <port-props.ttl> . - diff --git a/lv2/port-props.lv2/port-props.meta.ttl b/lv2/port-props.lv2/port-props.meta.ttl index 6f65843..e97de45 100644 --- a/lv2/port-props.lv2/port-props.meta.ttl +++ b/lv2/port-props.lv2/port-props.meta.ttl @@ -177,4 +177,3 @@ where: * `lower` and <code>upper</code> are the bounds. """^^lv2:Markdown . - diff --git a/lv2/port-props.lv2/port-props.ttl b/lv2/port-props.lv2/port-props.ttl index ea25c6b..063996a 100644 --- a/lv2/port-props.lv2/port-props.ttl +++ b/lv2/port-props.lv2/port-props.ttl @@ -77,4 +77,3 @@ pprops:rangeSteps rdfs:range xsd:nonNegativeInteger ; rdfs:label "range steps" ; rdfs:comment "The number of even steps the range should be divided into." . - diff --git a/lv2/presets.lv2/manifest.ttl b/lv2/presets.lv2/manifest.ttl index b9cacf5..1508770 100644 --- a/lv2/presets.lv2/manifest.ttl +++ b/lv2/presets.lv2/manifest.ttl @@ -6,4 +6,3 @@ lv2:minorVersion 2 ; lv2:microVersion 8 ; rdfs:seeAlso <presets.ttl> . - diff --git a/lv2/presets.lv2/presets.meta.ttl b/lv2/presets.lv2/presets.meta.ttl index 53b8ee9..d3e1ef9 100644 --- a/lv2/presets.lv2/presets.meta.ttl +++ b/lv2/presets.lv2/presets.meta.ttl @@ -79,4 +79,3 @@ be useful for saving state, or notifying a plugin instance at run-time about a preset change. """^^lv2:Markdown . - diff --git a/lv2/presets.lv2/presets.ttl b/lv2/presets.lv2/presets.ttl index 60189ea..8de997b 100644 --- a/lv2/presets.lv2/presets.ttl +++ b/lv2/presets.lv2/presets.ttl @@ -58,4 +58,3 @@ pset:preset rdfs:range pset:Preset ; rdfs:label "preset" ; rdfs:comment "The preset currently applied to a plugin instance." . - diff --git a/lv2/resize-port.lv2/manifest.ttl b/lv2/resize-port.lv2/manifest.ttl index 9fae8b8..fb8da8a 100644 --- a/lv2/resize-port.lv2/manifest.ttl +++ b/lv2/resize-port.lv2/manifest.ttl @@ -6,4 +6,3 @@ lv2:minorVersion 1 ; lv2:microVersion 0 ; rdfs:seeAlso <resize-port.ttl> . - diff --git a/lv2/resize-port.lv2/resize-port.meta.ttl b/lv2/resize-port.lv2/resize-port.meta.ttl index 74bd534..ffd1b9b 100644 --- a/lv2/resize-port.lv2/resize-port.meta.ttl +++ b/lv2/resize-port.lv2/resize-port.meta.ttl @@ -59,4 +59,3 @@ property. Any host, especially those that do NOT support dynamic port resizing, SHOULD do so or reduced functionality may result. """^^lv2:Markdown . - diff --git a/lv2/resize-port.lv2/resize-port.ttl b/lv2/resize-port.lv2/resize-port.ttl index 6f42c8f..ffdeda2 100644 --- a/lv2/resize-port.lv2/resize-port.ttl +++ b/lv2/resize-port.lv2/resize-port.ttl @@ -33,4 +33,3 @@ rsz:minimumSize rdfs:range xsd:nonNegativeInteger ; rdfs:label "minimum size" ; rdfs:comment "Minimum buffer size required by a port, in bytes." . - diff --git a/lv2/state.lv2/manifest.ttl b/lv2/state.lv2/manifest.ttl index e56c4e5..6b17b52 100644 --- a/lv2/state.lv2/manifest.ttl +++ b/lv2/state.lv2/manifest.ttl @@ -6,4 +6,3 @@ lv2:minorVersion 2 ; lv2:microVersion 10 ; rdfs:seeAlso <state.ttl> . - diff --git a/lv2/state.lv2/state.meta.ttl b/lv2/state.lv2/state.meta.ttl index b7b6855..1cd0544 100644 --- a/lv2/state.lv2/state.meta.ttl +++ b/lv2/state.lv2/state.meta.ttl @@ -390,4 +390,3 @@ a change which it knows is likely to have that effect, such as changing a parameter. """^^lv2:Markdown . - diff --git a/lv2/state.lv2/state.ttl b/lv2/state.lv2/state.ttl index 463fdb9..9a5ddcb 100644 --- a/lv2/state.lv2/state.ttl +++ b/lv2/state.lv2/state.ttl @@ -57,4 +57,3 @@ state:StateChanged a rdfs:Class ; rdfs:label "State Changed" ; rdfs:comment "A notification that the internal state of the plugin has changed." . - diff --git a/lv2/time.lv2/manifest.ttl b/lv2/time.lv2/manifest.ttl index d80aa75..ece8679 100644 --- a/lv2/time.lv2/manifest.ttl +++ b/lv2/time.lv2/manifest.ttl @@ -6,4 +6,3 @@ lv2:minorVersion 1 ; lv2:microVersion 6 ; rdfs:seeAlso <time.ttl> . - diff --git a/lv2/time.lv2/time.meta.ttl b/lv2/time.lv2/time.meta.ttl index c0543c3..723a61b 100644 --- a/lv2/time.lv2/time.meta.ttl +++ b/lv2/time.lv2/time.meta.ttl @@ -67,4 +67,3 @@ rate of 0.0 is stopped, 1.0 is rolling at normal speed, 0.5 is rolling at half speed, -1.0 is reverse, and so on. """^^lv2:Markdown . - diff --git a/lv2/time.lv2/time.ttl b/lv2/time.lv2/time.ttl index f3da9b0..f9c65ee 100644 --- a/lv2/time.lv2/time.ttl +++ b/lv2/time.lv2/time.ttl @@ -118,4 +118,3 @@ time:speed rdfs:range xsd:float ; rdfs:label "speed" ; rdfs:comment "The rate of the progress of time as a fraction of normal speed." . - diff --git a/lv2/ui.lv2/manifest.ttl b/lv2/ui.lv2/manifest.ttl index d3b12b5..4f5ed48 100644 --- a/lv2/ui.lv2/manifest.ttl +++ b/lv2/ui.lv2/manifest.ttl @@ -6,4 +6,3 @@ lv2:minorVersion 2 ; lv2:microVersion 24 ; rdfs:seeAlso <ui.ttl> . - diff --git a/lv2/ui.lv2/ui.meta.ttl b/lv2/ui.lv2/ui.meta.ttl index fd4d11d..ede80ae 100644 --- a/lv2/ui.lv2/ui.meta.ttl +++ b/lv2/ui.lv2/ui.meta.ttl @@ -476,4 +476,3 @@ Write Effect : None. """^^lv2:Markdown . - diff --git a/lv2/ui.lv2/ui.ttl b/lv2/ui.lv2/ui.ttl index 1c2e455..a59b069 100644 --- a/lv2/ui.lv2/ui.ttl +++ b/lv2/ui.lv2/ui.ttl @@ -246,4 +246,3 @@ ui:peakProtocol a ui:PortProtocol ; rdfs:label "peak protocol" ; rdfs:comment "A protocol for sending continuous peak measurements of an audio signal." . - diff --git a/lv2/units.lv2/manifest.ttl b/lv2/units.lv2/manifest.ttl index c6c9286..8b84346 100644 --- a/lv2/units.lv2/manifest.ttl +++ b/lv2/units.lv2/manifest.ttl @@ -6,4 +6,3 @@ lv2:minorVersion 5 ; lv2:microVersion 12 ; rdfs:seeAlso <units.ttl> . - diff --git a/lv2/units.lv2/units.meta.ttl b/lv2/units.lv2/units.meta.ttl index 910bf46..0e03b35 100644 --- a/lv2/units.lv2/units.meta.ttl +++ b/lv2/units.lv2/units.meta.ttl @@ -55,4 +55,3 @@ units defined in this extension include conversion definitions where it makes sense to do so. """^^lv2:Markdown . - diff --git a/lv2/units.lv2/units.ttl b/lv2/units.lv2/units.ttl index 21a1898..0f94cc3 100644 --- a/lv2/units.lv2/units.ttl +++ b/lv2/units.lv2/units.ttl @@ -375,4 +375,3 @@ units:midiNote rdfs:comment "A MIDI note number." ; units:render "MIDI note %d" ; units:symbol "note" . - diff --git a/lv2/uri-map.lv2/manifest.ttl b/lv2/uri-map.lv2/manifest.ttl index a64e4fb..3824435 100644 --- a/lv2/uri-map.lv2/manifest.ttl +++ b/lv2/uri-map.lv2/manifest.ttl @@ -6,4 +6,3 @@ lv2:minorVersion 1 ; lv2:microVersion 6 ; rdfs:seeAlso <uri-map.ttl> . - diff --git a/lv2/uri-map.lv2/uri-map.meta.ttl b/lv2/uri-map.lv2/uri-map.meta.ttl index d531899..9615f31 100644 --- a/lv2/uri-map.lv2/uri-map.meta.ttl +++ b/lv2/uri-map.lv2/uri-map.meta.ttl @@ -26,4 +26,3 @@ extensibility of RDF with the performance of integers (or centrally defined enumerations). """^^lv2:Markdown . - diff --git a/lv2/uri-map.lv2/uri-map.ttl b/lv2/uri-map.lv2/uri-map.ttl index 7a7d6e3..8a7a043 100644 --- a/lv2/uri-map.lv2/uri-map.ttl +++ b/lv2/uri-map.lv2/uri-map.ttl @@ -10,4 +10,3 @@ rdfs:label "LV2 URI Map" ; rdfs:comment "A feature for mapping URIs to integers." ; rdfs:seeAlso <uri-map.meta.ttl> . - diff --git a/lv2/urid.lv2/manifest.ttl b/lv2/urid.lv2/manifest.ttl index 772e2b6..7dc919f 100644 --- a/lv2/urid.lv2/manifest.ttl +++ b/lv2/urid.lv2/manifest.ttl @@ -6,4 +6,3 @@ lv2:minorVersion 1 ; lv2:microVersion 4 ; rdfs:seeAlso <urid.ttl> . - diff --git a/lv2/urid.lv2/urid.meta.ttl b/lv2/urid.lv2/urid.meta.ttl index 6f64e69..cbc5153 100644 --- a/lv2/urid.lv2/urid.meta.ttl +++ b/lv2/urid.lv2/urid.meta.ttl @@ -47,4 +47,3 @@ LV2_Descriptor::instantiate() with URI LV2_URID__unmap and data pointed to an instance of LV2_URID_Unmap. """^^lv2:Markdown . - diff --git a/lv2/urid.lv2/urid.ttl b/lv2/urid.lv2/urid.ttl index 6ce666a..e875fba 100644 --- a/lv2/urid.lv2/urid.ttl +++ b/lv2/urid.lv2/urid.ttl @@ -19,4 +19,3 @@ urid:unmap a lv2:Feature ; rdfs:label "unmap" ; rdfs:comment "A feature to unmap URIDs back to strings." . - diff --git a/lv2/worker.lv2/manifest.ttl b/lv2/worker.lv2/manifest.ttl index 692720d..cf4a83f 100644 --- a/lv2/worker.lv2/manifest.ttl +++ b/lv2/worker.lv2/manifest.ttl @@ -6,4 +6,3 @@ lv2:minorVersion 1 ; lv2:microVersion 2 ; rdfs:seeAlso <worker.ttl> . - diff --git a/lv2/worker.lv2/worker.meta.ttl b/lv2/worker.lv2/worker.meta.ttl index 0918446..b9d651a 100644 --- a/lv2/worker.lv2/worker.meta.ttl +++ b/lv2/worker.lv2/worker.meta.ttl @@ -57,4 +57,3 @@ the plugin MAY use it to schedule work in the calling context. The plugin MUST NOT assume any relationship between different schedule features. """^^lv2:Markdown . - diff --git a/lv2/worker.lv2/worker.ttl b/lv2/worker.lv2/worker.ttl index 581be71..be07105 100644 --- a/lv2/worker.lv2/worker.ttl +++ b/lv2/worker.lv2/worker.ttl @@ -21,4 +21,3 @@ work:schedule a lv2:Feature ; rdfs:label "work schedule" ; rdfs:comment "The work scheduling feature provided by a host." . - diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py index 95702a5..d6e86f8 100755 --- a/lv2specgen/lv2specgen.py +++ b/lv2specgen/lv2specgen.py @@ -111,15 +111,15 @@ def getLiteralString(s): def isResource(n): - return type(n) == rdflib.URIRef + return isinstance(n, rdflib.URIRef) def isBlank(n): - return type(n) == rdflib.BNode + return isinstance(n, rdflib.BNode) def isLiteral(n): - return type(n) == rdflib.Literal + return isinstance(n, rdflib.Literal) def niceName(uri): @@ -1112,7 +1112,6 @@ def load_tags(path, docdir): and cn.tagName == "compound" and cn.getAttribute("kind") != "page" ): - name = getChildText(cn, "name") filename = getChildText(cn, "filename") anchor = getChildText(cn, "anchor") diff --git a/lv2specgen/meson.build b/lv2specgen/meson.build index 5407d69..69b029b 100644 --- a/lv2specgen/meson.build +++ b/lv2specgen/meson.build @@ -11,12 +11,13 @@ lv2specgen_command_prefix = [ '--list-email=' + lv2_list_email, '--list-page=' + lv2_list_page, '--style-dir=' + lv2_source_root / 'doc' / 'style', - '--template', files('template.html'), + '--template', + files('template.html'), ] if is_variable('lv2_tags') lv2specgen_command_prefix += [ - '--tags', lv2_tags.full_path(), # TODO: Remove full_path() in meson 0.60.0 + ['--tags', lv2_tags.full_path()], # TODO: Remove full_path() in meson 0.60.0 ] endif diff --git a/meson.build b/meson.build index a202df5..aa9963f 100644 --- a/meson.build +++ b/meson.build @@ -1,15 +1,18 @@ # Copyright 2021-2022 David Robillard <d@drobilla.net> # SPDX-License-Identifier: 0BSD OR ISC -project('lv2', ['c'], - version: '1.18.10', - license: 'ISC', - meson_version: '>= 0.56.0', - default_options: [ - 'b_ndebug=if-release', - 'buildtype=release', - 'c_std=c99', - ]) +project( + 'lv2', + ['c'], + default_options: [ + 'b_ndebug=if-release', + 'buildtype=release', + 'c_std=c99', + ], + license: 'ISC', + meson_version: '>= 0.56.0', + version: '1.18.11', +) lv2_docdir = get_option('datadir') / 'doc' / 'lv2' lv2_source_root = meson.current_source_dir() @@ -32,9 +35,6 @@ if not get_option('tests').disabled() endif # Set global warning flags -if get_option('strict') and not meson.is_subproject() - subdir('meson/warnings') -endif subdir('meson/suppressions') ########################## @@ -81,6 +81,9 @@ lv2_dep = declare_dependency( version: meson.project_version(), ) +# Override pkg-config dependency for internal meson dependants +meson.override_dependency('lv2', lv2_dep) + ################## # Specifications # ################## @@ -185,8 +188,10 @@ check_python = pymod.find_installation( required: get_option('tests'), ) -if (check_python.found() and - check_python.language_version().version_compare('<3.7')) +if ( + check_python.found() + and check_python.language_version().version_compare('<3.7') +) warning('Python 3.7 is required for tests') check_python = disabler() endif @@ -343,12 +348,26 @@ endif subdir('util') # Data and build tests -subdir('test') +if not get_option('tests').disabled() + subdir('test') +endif if not meson.is_subproject() - summary('Tests', not get_option('tests').disabled(), bool_yn: true) - summary('Documentation', build_docs, bool_yn: true) - summary('Prefix', get_option('prefix'), section: 'Paths') - summary('LV2 bundles', lv2dir, section: 'Paths') - summary('Headers', get_option('prefix') / get_option('includedir'), section: 'Paths') + summary( + { + 'Tests': not get_option('tests').disabled(), + 'Documentation': build_docs, + }, + bool_yn: true, + section: 'Components', + ) + + summary( + { + 'Install prefix': get_option('prefix'), + 'Headers': get_option('prefix') / get_option('includedir'), + 'LV2 bundles': lv2dir, + }, + section: 'Directories', + ) endif diff --git a/meson/library/meson.build b/meson/library/meson.build deleted file mode 100644 index 81aab96..0000000 --- a/meson/library/meson.build +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2020-2022 David Robillard <d@drobilla.net> -# SPDX-License-Identifier: 0BSD OR ISC - -# General definitions for building libraries. -# -# These are essentially workarounds for meson and/or MSVC. Unfortunately, -# meson's default_library option doesn't support shared and static builds very -# well. In particular, it's often necessary to define different symbols for -# static and shared builds of libraries so that symbols can be exported. To -# work around this, we do not support default_library=both on Windows. On -# other platforms with GCC-like compilers, we can support both because symbols -# can safely be exported in the same way (giving them default visibility) in -# both static and shared builds. - -# Abort on Windows with default_library=both -if get_option('default_library') == 'both' - if host_machine.system() == 'windows' - error('default_library=both is not supported on Windows') - endif -endif - -# Set library_suffix to the suffix for libraries -if cc.get_id() == 'msvc' - # Meson appends a version to the name only on MS, which leads to inconsistent - # library names, like `mylib-1-1`. So, provide no suffix to ultimately get - # the same name as on other platforms, like `mylib-1`. - library_suffix = '' -else - library_suffix = '-@0@'.format(meson.project_version().split('.')[0]) -endif diff --git a/meson/suppressions/meson.build b/meson/suppressions/meson.build index 66510f9..96ff2ab 100644 --- a/meson/suppressions/meson.build +++ b/meson/suppressions/meson.build @@ -1,11 +1,9 @@ -# Copyright 2020-2022 David Robillard <d@drobilla.net> +# Copyright 2020-2023 David Robillard <d@drobilla.net> # SPDX-License-Identifier: 0BSD OR ISC -# Project-specific warning suppressions. -# -# This should be used in conjunction with the generic "warnings" sibling that -# enables all reasonable warnings for the compiler. It lives here just to keep -# the top-level meson.build more readable. +# Project-specific warning suppressions + +warning_level = get_option('warning_level') ##### # C # @@ -14,11 +12,12 @@ if is_variable('cc') c_suppressions = [] - if get_option('strict') + if warning_level == 'everything' if cc.get_id() in ['clang', 'emscripten'] c_suppressions += [ '-Wno-bad-function-cast', '-Wno-cast-align', + '-Wno-cast-function-type-strict', '-Wno-cast-qual', '-Wno-declaration-after-statement', '-Wno-documentation-unknown-command', @@ -31,8 +30,21 @@ if is_variable('cc') '-Wno-shorten-64-to-32', '-Wno-sign-conversion', '-Wno-switch-enum', - '-Wno-unused-parameter', + '-Wno-unsafe-buffer-usage', ] + + if not meson.is_cross_build() + c_suppressions += [ + '-Wno-poison-system-directories', + ] + endif + + if host_machine.system() == 'windows' + c_suppressions += [ + '-Wno-format-nonliteral', + ] + endif + elif cc.get_id() == 'gcc' c_suppressions += [ '-Wno-bad-function-cast', @@ -50,7 +62,6 @@ if is_variable('cc') '-Wno-switch-enum', '-Wno-unsuffixed-float-constants', '-Wno-unused-const-variable', - '-Wno-unused-parameter', ] if target_machine.system() == 'windows' @@ -62,7 +73,6 @@ if is_variable('cc') elif cc.get_id() == 'msvc' c_suppressions += [ '/wd4061', # enumerator in switch is not explicitly handled - '/wd4100', # unreferenced formal parameter '/wd4244', # conversion with possible loss of data '/wd4267', # conversion from size_t to a smaller type '/wd4310', # cast truncates constant value @@ -79,6 +89,16 @@ if is_variable('cc') endif endif + if cc.get_id() in ['clang', 'emscripten'] + c_suppressions += ['-Wno-unused-parameter'] + elif cc.get_id() == 'gcc' + c_suppressions += ['-Wno-unused-parameter'] + elif cc.get_id() == 'msvc' + c_suppressions += [ + '/wd4100', # unreferenced formal parameter + ] + endif + c_suppressions = cc.get_supported_arguments(c_suppressions) endif @@ -89,19 +109,33 @@ endif if is_variable('cpp') cpp_suppressions = [] - if get_option('strict') + if warning_level == 'everything' if cpp.get_id() in ['clang', 'emscripten'] - cpp_suppressions = [ + cpp_suppressions += [ + '-Wno-c++98-compat', '-Wno-cast-align', '-Wno-cast-qual', '-Wno-documentation-unknown-command', '-Wno-nullability-extension', '-Wno-padded', '-Wno-reserved-id-macro', + '-Wno-unsafe-buffer-usage', ] + if not meson.is_cross_build() + cpp_suppressions += [ + '-Wno-poison-system-directories', + ] + endif + + if host_machine.system() == 'windows' + cpp_suppressions += [ + '-Wno-format-nonliteral', + ] + endif + elif cpp.get_id() == 'gcc' - cpp_suppressions = [ + cpp_suppressions += [ '-Wno-cast-align', '-Wno-cast-qual', '-Wno-inline', @@ -117,13 +151,14 @@ if is_variable('cpp') endif elif cpp.get_id() == 'msvc' - cpp_suppressions = [ + cpp_suppressions += [ '/wd4514', # unreferenced inline function has been removed '/wd4706', # assignment within conditional expression '/wd4710', # function not inlined '/wd4711', # function selected for automatic inline expansion '/wd4820', # padding added after data member '/wd5045', # will insert Spectre mitigation + '/wd5264', # const variable is not used ] endif endif diff --git a/meson/warnings/meson.build b/meson/warnings/meson.build deleted file mode 100644 index 089f292..0000000 --- a/meson/warnings/meson.build +++ /dev/null @@ -1,256 +0,0 @@ -# Copyright 2020-2022 David Robillard <d@drobilla.net> -# SPDX-License-Identifier: 0BSD OR ISC - -# General code to enable approximately all warnings in GCC 12, clang, and MSVC. -# -# This is trivial for clang and MSVC, but GCC doesn't have an "everything" -# option, so we need to enable everything we want explicitly. Wall is assumed, -# but Wextra is not, for stability. -# -# These are collected from common.opt and c.opt in the GCC source, and manually -# curated with the help of the GCC documentation. Warnings that are -# application-specific, historical, or about compatibility between specific -# language revisions are omitted. The intent here is to have roughly the same -# meaning as clang's Weverything: extremely strict, but general. Specifically -# omitted are: -# -# General: -# -# Wabi= -# Waggregate-return -# Walloc-size-larger-than=BYTES -# Walloca-larger-than=BYTES -# Wframe-larger-than=BYTES -# Wlarger-than=BYTES -# Wstack-usage=BYTES -# Wsystem-headers -# Wtraditional -# Wtraditional-conversion -# Wtrampolines -# Wvla-larger-than=BYTES -# -# Build specific: -# -# Wpoison-system-directories -# -# C Specific: -# -# Wc11-c2x-compat -# Wc90-c99-compat -# Wc99-c11-compat -# Wdeclaration-after-statement -# Wtraditional -# Wtraditional-conversion -# -# C++ Specific: -# -# Wc++0x-compat -# Wc++1z-compat -# Wc++2a-compat -# Wctad-maybe-unsupported -# Wnamespaces -# Wtemplates - -# GCC warnings that apply to all C-family languages -gcc_common_warnings = [ - '-Walloc-zero', - '-Walloca', - '-Wanalyzer-too-complex', - '-Warith-conversion', - '-Warray-bounds=2', - '-Wattribute-alias=2', - '-Wbidi-chars=ucn', - '-Wcast-align=strict', - '-Wcast-function-type', - '-Wcast-qual', - '-Wclobbered', - '-Wconversion', - '-Wdate-time', - '-Wdisabled-optimization', - '-Wdouble-promotion', - '-Wduplicated-branches', - '-Wduplicated-cond', - '-Wempty-body', - '-Wendif-labels', - '-Wfloat-equal', - '-Wformat-overflow=2', - '-Wformat-signedness', - '-Wformat-truncation=2', - '-Wformat=2', - '-Wignored-qualifiers', - '-Wimplicit-fallthrough=3', - '-Winit-self', - '-Winline', - '-Winvalid-pch', - '-Wlogical-op', - '-Wmissing-declarations', - '-Wmissing-field-initializers', - '-Wmissing-include-dirs', - '-Wmultichar', - '-Wnormalized=nfc', - '-Wnull-dereference', - '-Wopenacc-parallelism', - '-Woverlength-strings', - '-Wpacked', - '-Wpacked-bitfield-compat', - '-Wpadded', - '-Wpointer-arith', - '-Wredundant-decls', - '-Wshadow', - '-Wshift-negative-value', - '-Wshift-overflow=2', - '-Wstack-protector', - '-Wstrict-aliasing=3', - '-Wstrict-overflow=5', - '-Wstring-compare', - '-Wstringop-overflow=3', - '-Wsuggest-attribute=cold', - '-Wsuggest-attribute=const', - '-Wsuggest-attribute=format', - '-Wsuggest-attribute=malloc', - '-Wsuggest-attribute=noreturn', - '-Wsuggest-attribute=pure', - '-Wswitch-default', - '-Wswitch-enum', - '-Wtrampolines', - '-Wtrivial-auto-var-init', - '-Wtype-limits', - '-Wundef', - '-Wuninitialized', - '-Wunsafe-loop-optimizations', - '-Wunused', - '-Wunused-const-variable=2', - '-Wunused-macros', - '-Wvector-operation-performance', - '-Wvla', - '-Wwrite-strings', -] - -##### -# C # -##### - -if is_variable('cc') and not is_variable('all_c_warnings') - # Set all_c_warnings for the current C compiler - all_c_warnings = [] - - if get_option('strict') - if cc.get_id() == 'clang' - all_c_warnings += ['-Weverything'] - - if not meson.is_cross_build() - all_c_warnings += [ - '-Wno-poison-system-directories', - ] - endif - - elif cc.get_id() == 'gcc' - all_c_warnings += gcc_common_warnings + [ - '-Wabsolute-value', - '-Wbad-function-cast', - '-Wc++-compat', - '-Wenum-conversion', - '-Wjump-misses-init', - '-Wmissing-parameter-type', - '-Wmissing-prototypes', - '-Wnested-externs', - '-Wold-style-declaration', - '-Wold-style-definition', - '-Woverride-init', - '-Wsign-compare', - '-Wstrict-prototypes', - '-Wunsuffixed-float-constants', - ] - - elif cc.get_id() == 'msvc' - all_c_warnings += [ - '/Wall', - '/experimental:external', - '/external:W0', - '/external:anglebrackets', - ] - endif - endif - - all_c_warnings = cc.get_supported_arguments(all_c_warnings) - add_global_arguments(all_c_warnings, language: ['c']) -endif - -####### -# C++ # -####### - -if is_variable('cpp') and not is_variable('all_cpp_warnings') - # Set all_cpp_warnings for the current C++ compiler - all_cpp_warnings = [] - - if get_option('strict') - if cpp.get_id() == 'clang' - all_cpp_warnings += [ - '-Weverything', - '-Wno-c++98-compat', - '-Wno-c++98-compat-pedantic', - ] - - if not meson.is_cross_build() - all_cpp_warnings += [ - '-Wno-poison-system-directories', - ] - endif - - elif cpp.get_id() == 'gcc' - all_cpp_warnings += gcc_common_warnings + [ - '-Wabi-tag', - '-Waligned-new=all', - '-Wcatch-value=3', - '-Wcomma-subscript', - '-Wconditionally-supported', - '-Wctor-dtor-privacy', - '-Wdelete-non-virtual-dtor', - '-Wdeprecated', - '-Wdeprecated-copy', - '-Wdeprecated-copy-dtor', - '-Wdeprecated-enum-enum-conversion', - '-Wdeprecated-enum-float-conversion', - '-Weffc++', - '-Wexpansion-to-defined', - '-Wextra-semi', - '-Wimport', - '-Winvalid-imported-macros', - '-Wmismatched-tags', - '-Wmultiple-inheritance', - '-Wnoexcept', - '-Wnoexcept-type', - '-Wnon-virtual-dtor', - '-Wold-style-cast', - '-Woverloaded-virtual', - '-Wplacement-new=2', - '-Wredundant-move', - '-Wredundant-tags', - '-Wregister', - '-Wsign-compare', - '-Wsign-promo', - '-Wsized-deallocation', - '-Wstrict-null-sentinel', - '-Wsuggest-final-methods', - '-Wsuggest-final-types', - '-Wsuggest-override', - '-Wuseless-cast', - '-Wvirtual-inheritance', - '-Wvolatile', - '-Wzero-as-null-pointer-constant', - ] - - elif cpp.get_id() == 'msvc' - all_cpp_warnings += [ - '/Wall', - '/experimental:external', - '/external:W0', - '/external:anglebrackets', - ] - endif - endif - - all_cpp_warnings = cpp.get_supported_arguments(all_cpp_warnings) - add_global_arguments(all_cpp_warnings, language: ['cpp']) -endif diff --git a/meson_options.txt b/meson_options.txt index 278cf12..0a8c145 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -4,21 +4,21 @@ option('docs', type: 'feature', value: 'auto', yield: true, description: 'Build documentation') +option('lint', type: 'boolean', value: false, yield: true, + description: 'Run code quality checks') + option('lv2dir', type: 'string', value: '', yield: true, description: 'LV2 bundle installation directory') option('old_headers', type: 'boolean', value: true, yield: true, description: 'Install backwards compatible headers at URI-style paths') -option('online_docs', type: 'boolean', value: 'false', yield: true, +option('online_docs', type: 'boolean', value: false, yield: true, description: 'Build documentation for online hosting') option('plugins', type: 'feature', value: 'auto', yield: true, description: 'Build example plugins') -option('strict', type: 'boolean', value: false, yield: true, - description: 'Enable ultra-strict warnings') - option('tests', type: 'feature', value: 'auto', yield: true, description: 'Build tests') diff --git a/plugins/.clang-tidy b/plugins/.clang-tidy index bff0bfd..5fc86ab 100644 --- a/plugins/.clang-tidy +++ b/plugins/.clang-tidy @@ -1,26 +1,14 @@ -# Copyright 2020-2022 David Robillard <d@drobilla.net> +# Copyright 2020-2023 David Robillard <d@drobilla.net> # SPDX-License-Identifier: 0BSD OR ISC Checks: > - *, - -*-magic-numbers, -*-narrowing-conversions, - -altera-*, + -bugprone-assignment-in-if-condition, -bugprone-easily-swappable-parameters, - -bugprone-macro-parentheses, + -bugprone-suspicious-realloc-usage, -cert-err33-c, -hicpp-signed-bitwise, -llvm-header-guard, - -llvmlibc-*, -misc-unused-parameters, - -performance-no-int-to-ptr, -readability-function-cognitive-complexity, - -readability-identifier-length, -WarningsAsErrors: '*' -HeaderFilterRegex: '.*' -FormatStyle: file -CheckOptions: - - key: hicpp-uppercase-literal-suffix.NewSuffixes - value: L;U;f - - key: readability-uppercase-literal-suffix.NewSuffixes - value: L;U;f +InheritParentConfig: true diff --git a/plugins/eg-amp.lv2/meson.build b/plugins/eg-amp.lv2/meson.build index bc222d2..726038e 100644 --- a/plugins/eg-amp.lv2/meson.build +++ b/plugins/eg-amp.lv2/meson.build @@ -19,7 +19,7 @@ module = shared_library( config = configuration_data( { 'LIB_EXT': '.' + module.full_path().split('.')[-1], - } + }, ) foreach filename : data_filenames diff --git a/plugins/eg-fifths.lv2/meson.build b/plugins/eg-fifths.lv2/meson.build index 0fa8525..bba21ce 100644 --- a/plugins/eg-fifths.lv2/meson.build +++ b/plugins/eg-fifths.lv2/meson.build @@ -19,7 +19,7 @@ module = shared_library( config = configuration_data( { 'LIB_EXT': '.' + module.full_path().split('.')[-1], - } + }, ) foreach filename : data_filenames diff --git a/plugins/eg-fifths.lv2/uris.h b/plugins/eg-fifths.lv2/uris.h index 0406937..7cbbd94 100644 --- a/plugins/eg-fifths.lv2/uris.h +++ b/plugins/eg-fifths.lv2/uris.h @@ -37,4 +37,4 @@ map_fifths_uris(LV2_URID_Map* map, FifthsURIs* uris) uris->patch_value = map->map(map->handle, LV2_PATCH__value); } -#endif /* FIFTHS_URIS_H */ +#endif // FIFTHS_URIS_H diff --git a/plugins/eg-metro.lv2/meson.build b/plugins/eg-metro.lv2/meson.build index def9e0b..5d83c9e 100644 --- a/plugins/eg-metro.lv2/meson.build +++ b/plugins/eg-metro.lv2/meson.build @@ -19,7 +19,7 @@ module = shared_library( config = configuration_data( { 'LIB_EXT': '.' + module.full_path().split('.')[-1], - } + }, ) foreach filename : data_filenames diff --git a/plugins/eg-midigate.lv2/meson.build b/plugins/eg-midigate.lv2/meson.build index 609ee3a..9f0a5ac 100644 --- a/plugins/eg-midigate.lv2/meson.build +++ b/plugins/eg-midigate.lv2/meson.build @@ -19,7 +19,7 @@ module = shared_library( config = configuration_data( { 'LIB_EXT': '.' + module.full_path().split('.')[-1], - } + }, ) foreach filename : data_filenames diff --git a/plugins/eg-params.lv2/meson.build b/plugins/eg-params.lv2/meson.build index 5b06709..00602bc 100644 --- a/plugins/eg-params.lv2/meson.build +++ b/plugins/eg-params.lv2/meson.build @@ -19,7 +19,7 @@ module = shared_library( config = configuration_data( { 'LIB_EXT': '.' + module.full_path().split('.')[-1], - } + }, ) foreach filename : data_filenames diff --git a/plugins/eg-params.lv2/state_map.h b/plugins/eg-params.lv2/state_map.h index a223243..2a29e09 100644 --- a/plugins/eg-params.lv2/state_map.h +++ b/plugins/eg-params.lv2/state_map.h @@ -68,7 +68,7 @@ state_map_init( { // Set dict entries from parameters unsigned i = 0; - va_list args; + va_list args; // NOLINT(cppcoreguidelines-init-variables) va_start(args, handle); for (const char* uri = NULL; (uri = va_arg(args, const char*)); ++i) { const char* type = va_arg(args, const char*); diff --git a/plugins/eg-sampler.lv2/meson.build b/plugins/eg-sampler.lv2/meson.build index 0916ff6..9700df2 100644 --- a/plugins/eg-sampler.lv2/meson.build +++ b/plugins/eg-sampler.lv2/meson.build @@ -6,18 +6,24 @@ ui_sources = files('sampler_ui.c') bundle_name = 'eg-sampler.lv2' data_filenames = ['manifest.ttl.in', 'sampler.ttl', 'click.wav'] -samplerate_dep = dependency('samplerate', - version: '>= 0.1.0', - required: get_option('plugins')) +samplerate_dep = dependency( + 'samplerate', + required: get_option('plugins'), + version: '>= 0.1.0', +) -sndfile_dep = dependency('sndfile', - version: '>= 1.0.0', - required: get_option('plugins')) +sndfile_dep = dependency( + 'sndfile', + required: get_option('plugins'), + version: '>= 1.0.0', +) -gtk2_dep = dependency('gtk+-2.0', - include_type: 'system', - required: get_option('plugins'), - version: '>= 2.18.0') +gtk2_dep = dependency( + 'gtk+-2.0', + include_type: 'system', + required: get_option('plugins'), + version: '>= 2.18.0', +) if samplerate_dep.found() and sndfile_dep.found() module = shared_library( @@ -57,7 +63,7 @@ if samplerate_dep.found() and sndfile_dep.found() if cc.get_id() == 'gcc' ui_suppressions += ['-Wno-strict-overflow'] endif - + shared_library( 'sampler_ui', ui_sources, diff --git a/plugins/eg-scope.lv2/meson.build b/plugins/eg-scope.lv2/meson.build index 773a3d0..d776ee7 100644 --- a/plugins/eg-scope.lv2/meson.build +++ b/plugins/eg-scope.lv2/meson.build @@ -6,10 +6,12 @@ ui_sources = files('examploscope_ui.c') bundle_name = 'eg-scope.lv2' data_filenames = ['manifest.ttl.in', 'examploscope.ttl.in'] -gtk2_dep = dependency('gtk+-2.0', - include_type: 'system', - required: get_option('plugins'), - version: '>= 2.18.0') +gtk2_dep = dependency( + 'gtk+-2.0', + include_type: 'system', + required: get_option('plugins'), + version: '>= 2.18.0', +) module = shared_library( 'examploscope', @@ -25,7 +27,7 @@ module = shared_library( config = configuration_data( { 'LIB_EXT': '.' + module.full_path().split('.')[-1], - } + }, ) foreach filename : data_filenames diff --git a/plugins/meson.build b/plugins/meson.build index 098f585..ff70af1 100644 --- a/plugins/meson.build +++ b/plugins/meson.build @@ -18,8 +18,8 @@ if not get_option('docs').disabled() asciidoc = find_program('asciidoc', required: get_option('docs')) if asciidoc.found() - book_inputs = files( - 'README.txt', + book_inputs = files('README.txt') + book_inputs += files( 'eg-amp.lv2/README.txt', 'eg-amp.lv2/amp.c', 'eg-amp.lv2/amp.ttl', diff --git a/schemas.lv2/dcterms.ttl b/schemas.lv2/dcterms.ttl index f6a5d06..d8fd196 100644 --- a/schemas.lv2/dcterms.ttl +++ b/schemas.lv2/dcterms.ttl @@ -337,4 +337,3 @@ dcterms:title rdfs:isDefinedBy dcterms: ; rdfs:label "title"@en-us ; rdfs:range rdfs:Literal . - diff --git a/schemas.lv2/doap.ttl b/schemas.lv2/doap.ttl index b806d31..160cda5 100644 --- a/schemas.lv2/doap.ttl +++ b/schemas.lv2/doap.ttl @@ -706,4 +706,3 @@ doap:wiki "wiki"@en , "wiki"@es , "wiki"@fr . - diff --git a/schemas.lv2/foaf.ttl b/schemas.lv2/foaf.ttl index 17dcc13..5aec41e 100644 --- a/schemas.lv2/foaf.ttl +++ b/schemas.lv2/foaf.ttl @@ -609,4 +609,3 @@ foaf:yahooChatID rdfs:label "Yahoo chat ID" ; rdfs:range rdfs:Literal ; rdfs:subPropertyOf foaf:nick . - diff --git a/schemas.lv2/manifest.ttl b/schemas.lv2/manifest.ttl index dd41f58..813d254 100644 --- a/schemas.lv2/manifest.ttl +++ b/schemas.lv2/manifest.ttl @@ -28,4 +28,3 @@ rdfs: <http://www.w3.org/2001/XMLSchema#> a owl:Ontology ; rdfs:seeAlso <xsd.ttl> . - diff --git a/schemas.lv2/owl.ttl b/schemas.lv2/owl.ttl index 26bd0e8..e5f4fa2 100644 --- a/schemas.lv2/owl.ttl +++ b/schemas.lv2/owl.ttl @@ -618,4 +618,3 @@ owl:withRestrictions rdfs:isDefinedBy owl: ; rdfs:label "with restrictions" ; rdfs:range rdf:List . - diff --git a/schemas.lv2/rdf.ttl b/schemas.lv2/rdf.ttl index cb758cb..0fdeed0 100644 --- a/schemas.lv2/rdf.ttl +++ b/schemas.lv2/rdf.ttl @@ -126,4 +126,3 @@ rdf:value rdfs:isDefinedBy rdf: ; rdfs:label "value" ; rdfs:range rdfs:Resource . - diff --git a/schemas.lv2/rdfs.ttl b/schemas.lv2/rdfs.ttl index 10cfbb7..09ba907 100644 --- a/schemas.lv2/rdfs.ttl +++ b/schemas.lv2/rdfs.ttl @@ -121,4 +121,3 @@ rdfs:subPropertyOf rdfs:isDefinedBy rdfs: ; rdfs:label "sub-property of" ; rdfs:range rdf:Property . - diff --git a/schemas.lv2/xsd.ttl b/schemas.lv2/xsd.ttl index cb98363..38bae58 100644 --- a/schemas.lv2/xsd.ttl +++ b/schemas.lv2/xsd.ttl @@ -45,7 +45,8 @@ xsd:byte owl:withRestrictions ( [ xsd:maxInclusive "127"^^xsd:byte - ] [ + ] + [ xsd:minInclusive "-128"^^xsd:byte ] ) . @@ -99,7 +100,8 @@ xsd:duration owl:withRestrictions ( [ xsd:pattern "-?P([0-9]+Y)?([0-9]+M)?([0-9]+D)?(T([0-9]+H)?([0-9]+M)?([0-9]+(\\.[0-9]+)?S)?)?" - ] [ + ] + [ xsd:whiteSpace "collapse" ] ) . @@ -112,7 +114,8 @@ xsd:float owl:withRestrictions ( [ xsd:pattern "-?INF|NaN|[+-]?(([0-9]+[.]?[0-9]*)|([0-9]*[.]?[0-9]+))([eE][-+]?[0-9]+)?" - ] [ + ] + [ xsd:whiteSpace "collapse" ] ) . @@ -142,7 +145,8 @@ xsd:int owl:withRestrictions ( [ xsd:maxInclusive "2147483647"^^xsd:int - ] [ + ] + [ xsd:minInclusive "-2147483648"^^xsd:int ] ) . @@ -154,7 +158,8 @@ xsd:integer owl:withRestrictions ( [ xsd:pattern "[-+]?[0-9]+" - ] [ + ] + [ xsd:fractionDigits 0 ] ) . @@ -176,7 +181,8 @@ xsd:long owl:withRestrictions ( [ xsd:maxInclusive "9223372036854775807"^^xsd:long - ] [ + ] + [ xsd:minInclusive "-9223372036854775808"^^xsd:long ] ) . @@ -222,7 +228,8 @@ xsd:nonNegativeInteger owl:withRestrictions ( [ xsd:pattern "[+]?[0-9]+" - ] [ + ] + [ xsd:minInclusive 0 ] ) . @@ -234,7 +241,8 @@ xsd:nonPositiveInteger owl:withRestrictions ( [ xsd:pattern "(0|-[0-9]+)" - ] [ + ] + [ xsd:maxInclusive 0 ] ) . @@ -258,7 +266,8 @@ xsd:positiveInteger owl:withRestrictions ( [ xsd:pattern "[+]?[0-9]*[1-9]+[0-9]*" - ] [ + ] + [ xsd:minInclusive 1 ] ) . @@ -270,7 +279,8 @@ xsd:short owl:withRestrictions ( [ xsd:maxInclusive "32767"^^xsd:short - ] [ + ] + [ xsd:minInclusive "-32768"^^xsd:short ] ) . @@ -351,4 +361,3 @@ xsd:whiteSpace ] ) ] . - diff --git a/scripts/lv2_check_specification.py b/scripts/lv2_check_specification.py index 0cd296e..41611ef 100755 --- a/scripts/lv2_check_specification.py +++ b/scripts/lv2_check_specification.py @@ -150,8 +150,8 @@ def _check_specification(checker, spec_dir, is_stable=False): # Get all subjects that have an explicit rdf:type typed_subjects = set() - for typing in model.triples([None, rdf.type, None]): - typed_subjects.add(typing[0]) + for subject in model.subjects(rdf.type, None): + typed_subjects.add(subject) # Check that all named and typed resources have labels and comments for subject in typed_subjects: diff --git a/test/.clang-tidy b/test/.clang-tidy index ca868be..f6fe1d6 100644 --- a/test/.clang-tidy +++ b/test/.clang-tidy @@ -2,25 +2,14 @@ # SPDX-License-Identifier: 0BSD OR ISC Checks: > - *, -*-else-after-return, - -*-magic-numbers, - -altera-*, -bugprone-easily-swappable-parameters, - -bugprone-macro-parentheses, -bugprone-suspicious-include, - -llvm-header-guard, + -cert-err33-c, + -clang-diagnostic-unused-parameter, + -cppcoreguidelines-avoid-non-const-global-variables, -llvmlibc-implementation-in-namespace, - -llvmlibc-restrict-system-libc-headers, + -misc-unused-parameters, -modernize-use-trailing-return-type, - -performance-no-int-to-ptr, -readability-function-cognitive-complexity, - -readability-identifier-length, -WarningsAsErrors: '*' -HeaderFilterRegex: '.*' -FormatStyle: file -CheckOptions: - - key: hicpp-uppercase-literal-suffix.NewSuffixes - value: L;U;f - - key: readability-uppercase-literal-suffix.NewSuffixes - value: L;U;f +InheritParentConfig: true diff --git a/test/cpp/.clang-tidy b/test/cpp/.clang-tidy new file mode 100644 index 0000000..02d730c --- /dev/null +++ b/test/cpp/.clang-tidy @@ -0,0 +1,26 @@ +# Copyright 2020-2022 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: 0BSD OR ISC + +Checks: > + -*-avoid-c-arrays, + -*-deprecated-headers, + -*-no-malloc, + -*-use-auto, + -bugprone-reserved-identifier, + -cert-dcl37-c, + -cert-dcl50-cpp, + -cert-dcl51-cpp, + -cppcoreguidelines-macro-usage, + -cppcoreguidelines-owning-memory, + -cppcoreguidelines-pro-bounds-array-to-pointer-decay, + -cppcoreguidelines-pro-bounds-pointer-arithmetic, + -cppcoreguidelines-pro-type-cstyle-cast, + -cppcoreguidelines-pro-type-vararg, + -hicpp-no-array-decay, + -hicpp-vararg, + -llvmlibc-callee-namespace, + -modernize-use-nullptr, + -modernize-use-using, + -readability-implicit-bool-conversion, +InheritParentConfig: true + diff --git a/test/test_build.cpp b/test/cpp/test_build.cpp index c8b2ca0..c8b2ca0 100644 --- a/test/test_build.cpp +++ b/test/cpp/test_build.cpp diff --git a/test/headers/.clang-tidy b/test/headers/.clang-tidy new file mode 100644 index 0000000..dd0b95f --- /dev/null +++ b/test/headers/.clang-tidy @@ -0,0 +1,22 @@ +# Copyright 2020-2022 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: 0BSD OR ISC + +Checks: > + *, + -*-magic-numbers, + -altera-*, + -bugprone-assignment-in-if-condition, + -bugprone-easily-swappable-parameters, + -bugprone-macro-parentheses, + -llvmlibc-restrict-system-libc-headers, + -modernize-macro-to-enum, + -performance-no-int-to-ptr, + -readability-identifier-length, +CheckOptions: + - key: hicpp-uppercase-literal-suffix.NewSuffixes + value: L;U;f + - key: readability-uppercase-literal-suffix.NewSuffixes + value: L;U;f +FormatStyle: file +HeaderFilterRegex: 'lv2/.*\.h' +WarningsAsErrors: '*' diff --git a/test/headers/meson.build b/test/headers/meson.build new file mode 100644 index 0000000..b1ec805 --- /dev/null +++ b/test/headers/meson.build @@ -0,0 +1,68 @@ +# Copyright 2020-2022 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: 0BSD OR ISC + +header_c_suppressions = [] + +if get_option('warning_level') == 'everything' + if cc.get_id() == 'clang' + header_c_suppressions += [ + '-Wno-cast-align', + '-Wno-cast-qual', + '-Wno-declaration-after-statement', + '-Wno-padded', + '-Wno-unsafe-buffer-usage', + ] + + if not meson.is_cross_build() + header_c_suppressions += [ + '-Wno-poison-system-directories', + ] + endif + + if host_machine.system() == 'windows' + header_c_suppressions += [ + '-Wno-format-nonliteral', + ] + endif + + elif cc.get_id() == 'gcc' + header_c_suppressions += [ + '-Wno-cast-align', + '-Wno-cast-qual', + '-Wno-padded', + '-Wno-sign-conversion', + '-Wno-suggest-attribute=format', + '-Wno-unused-const-variable', + ] + + if host_machine.system() == 'windows' + header_c_suppressions += [ + '-Wno-sign-conversion', + ] + endif + + elif cc.get_id() == 'msvc' + header_c_suppressions += [ + '/wd4820', # padding added after construct + ] + endif +endif + +if cc.get_id() == 'clang' + header_c_suppressions += [ + '-Wno-nullability-extension', + ] +endif + +header_c_suppressions = cc.get_supported_arguments(header_c_suppressions) + +test( + 'headers', + executable( + 'test_headers', + files('test_headers.c'), + c_args: header_c_suppressions, + dependencies: [lv2_dep], + ), + suite: 'unit', +) diff --git a/test/headers/test_headers.c b/test/headers/test_headers.c new file mode 100644 index 0000000..5736b44 --- /dev/null +++ b/test/headers/test_headers.c @@ -0,0 +1,42 @@ +// Copyright 2022 David Robillard <d@drobilla.net> +// SPDX-License-Identifier: ISC + +#include "lv2/atom/atom.h" // IWYU pragma: keep +#include "lv2/atom/forge.h" // IWYU pragma: keep +#include "lv2/atom/util.h" // IWYU pragma: keep +#include "lv2/buf-size/buf-size.h" // IWYU pragma: keep +#include "lv2/core/attributes.h" // IWYU pragma: keep +#include "lv2/core/lv2.h" // IWYU pragma: keep +#include "lv2/core/lv2_util.h" // IWYU pragma: keep +#include "lv2/data-access/data-access.h" // IWYU pragma: keep +#include "lv2/dynmanifest/dynmanifest.h" // IWYU pragma: keep +#include "lv2/event/event-helpers.h" // IWYU pragma: keep +#include "lv2/event/event.h" // IWYU pragma: keep +#include "lv2/instance-access/instance-access.h" // IWYU pragma: keep +#include "lv2/log/log.h" // IWYU pragma: keep +#include "lv2/log/logger.h" // IWYU pragma: keep +#include "lv2/midi/midi.h" // IWYU pragma: keep +#include "lv2/morph/morph.h" // IWYU pragma: keep +#include "lv2/options/options.h" // IWYU pragma: keep +#include "lv2/parameters/parameters.h" // IWYU pragma: keep +#include "lv2/patch/patch.h" // IWYU pragma: keep +#include "lv2/port-groups/port-groups.h" // IWYU pragma: keep +#include "lv2/port-props/port-props.h" // IWYU pragma: keep +#include "lv2/presets/presets.h" // IWYU pragma: keep +#include "lv2/resize-port/resize-port.h" // IWYU pragma: keep +#include "lv2/state/state.h" // IWYU pragma: keep +#include "lv2/time/time.h" // IWYU pragma: keep +#include "lv2/ui/ui.h" // IWYU pragma: keep +#include "lv2/units/units.h" // IWYU pragma: keep +#include "lv2/uri-map/uri-map.h" // IWYU pragma: keep +#include "lv2/urid/urid.h" // IWYU pragma: keep +#include "lv2/worker/worker.h" // IWYU pragma: keep + +#ifdef __GNUC__ +__attribute__((const)) +#endif +int +main(void) +{ + return 0; +} diff --git a/test/meson.build b/test/meson.build index 092499a..4790a48 100644 --- a/test/meson.build +++ b/test/meson.build @@ -5,51 +5,61 @@ # Data # ######## -# Check for spelling errors -codespell = find_program('codespell', required: get_option('tests')) -if codespell.found() - ignore = [ - lv2_source_root / 'doc' / 'style' / 'pygments.css', - lv2_source_root / 'lv2specgen' / 'DTD', - lv2_source_root / 'schemas.lv2' / 'doap.ttl', - ] +if get_option('lint') + # Check for spelling errors + codespell = find_program('codespell', required: get_option('tests')) + if codespell.found() + ignore = [ + lv2_source_root / 'doc' / 'style' / 'pygments.css', + lv2_source_root / 'lv2specgen' / 'DTD', + lv2_source_root / 'schemas.lv2' / 'doap.ttl', + ] - test( - 'codespell', - codespell, - args: [ - '-d', - '-q', '3', - '-S', ','.join(ignore), - lv2_source_root / 'doc', - lv2_source_root / 'lv2', - lv2_source_root / 'lv2specgen', - lv2_source_root / 'plugins', - lv2_source_root / 'schemas.lv2', - ], - suite: 'data', - ) -endif + test( + 'codespell', + codespell, + args: [ + '-d', + ['-q', '3'], + ['-S', ','.join(ignore)], + lv2_source_root / 'doc', + lv2_source_root / 'lv2', + lv2_source_root / 'lv2specgen', + lv2_source_root / 'plugins', + lv2_source_root / 'schemas.lv2', + ], + suite: 'data', + ) + endif -# Check that specification data is strictly formatted -serdi = find_program('serdi', required: get_option('tests')) -native_build = not meson.is_cross_build() and host_machine.system() != 'windows' -if serdi.found() and native_build - lv2_check_syntax = files(lv2_source_root / 'scripts' / 'lv2_check_syntax.py') + # Check that specification data is strictly formatted + serdi = find_program( + 'serdi', + required: get_option('tests'), + version: '>= 0.31.5', + ) + native_build = ( + not meson.is_cross_build() + and host_machine.system() != 'windows' + ) + if serdi.found() and native_build + lv2_check_syntax = files( + lv2_source_root / 'scripts' / 'lv2_check_syntax.py', + ) - test('syntax', - lv2_check_syntax, - args: ['--serdi', serdi.full_path()] + spec_files + schema_data, - suite: 'data') -endif + test( + 'syntax', + lv2_check_syntax, + args: ['--serdi', serdi.full_path()] + spec_files + schema_data, + suite: 'data', + ) + endif -# Check that specification data validates -sord_validate = find_program('sord_validate', required: get_option('tests')) -if sord_validate.found() - test('valid', - sord_validate, - args: spec_files + schema_data, - suite: 'data') + # Check that specification data validates + sord_validate = find_program('sord_validate', required: get_option('tests')) + if sord_validate.found() + test('valid', sord_validate, args: spec_files + schema_data, suite: 'data') + endif endif ######## @@ -57,36 +67,36 @@ endif ######## # Check that all the headers compile cleanly in C -test('c', - executable( - 'test_build_c', - files('test_build.c'), - c_args: c_suppressions, - dependencies: lv2_dep, - ), - suite: 'build') +test( + 'c', + executable( + 'test_build_c', + files('test_build.c'), + c_args: c_suppressions, + dependencies: [lv2_dep], + ), + suite: 'build', +) # Check that all the headers compile cleanly in C++ if is_variable('cpp') - test('cpp', - executable( - 'test_build_cpp', - files('test_build.cpp'), - cpp_args: cpp_suppressions, - dependencies: lv2_dep, - ), - suite: 'build') + test( + 'cpp', + executable( + 'test_build_cpp', + files('cpp/test_build.cpp'), + cpp_args: cpp_suppressions, + dependencies: [lv2_dep], + ), + suite: 'build', + ) endif ########## # Python # ########## -if get_option('strict') - flake8 = find_program('flake8', required: get_option('tests')) - pylint = find_program('pylint', required: get_option('tests')) - black = find_program('black', required: get_option('tests')) - +if get_option('lint') # Scripts that don't pass with pylint lax_python_scripts = files( '../lv2specgen/lv2docgen.py', @@ -98,20 +108,46 @@ if get_option('strict') all_python_scripts = lax_python_scripts + strict_python_scripts - if is_variable('black') and black.found() + # Check script formatting + black = find_program('black', required: get_option('tests')) + if black.found() black_opts = ['-l', '79', '-q', '--check'] - test('black', black, args: black_opts + all_python_scripts, suite: 'scripts') + test( + 'black', + black, + args: black_opts + all_python_scripts, + suite: 'scripts', + ) endif - if is_variable('flake8') and flake8.found() + # Check scripts for errors with flake8 + flake8 = find_program('flake8', required: get_option('tests')) + if flake8.found() test('flake8', flake8, args: all_python_scripts, suite: 'scripts') endif - if is_variable('pylint') and pylint.found() - test('pylint', pylint, args: strict_python_scripts, suite: 'scripts') + # Check scripts for errors with pylint + pylint = find_program('pylint', required: get_option('tests')) + if pylint.found() + pymod = import('python') + lint_py = pymod.find_installation( + 'python3', + modules: ['pygments', 'rdflib'], + required: false, + ) + + if lint_py.found() + test('pylint', pylint, args: strict_python_scripts, suite: 'scripts') + endif endif endif +################### +# Header Warnings # +################### + +subdir('headers') + ############## # Unit Tests # ############## @@ -122,17 +158,15 @@ test_names = [ ] # Build and run tests -if not get_option('tests').disabled() - foreach test_name : test_names - test( +foreach test_name : test_names + test( + test_name, + executable( test_name, - executable( - test_name, - files('test_@0@.c'.format(test_name)), - c_args: c_suppressions, - dependencies: lv2_dep, - ), - suite: 'unit', - ) - endforeach -endif + files('test_@0@.c'.format(test_name)), + c_args: c_suppressions, + dependencies: [lv2_dep], + ), + suite: 'unit', + ) +endforeach |