diff options
41 files changed, 453 insertions, 482 deletions
diff --git a/.clang-format b/.clang-format index 8ee2675..c40ad9c 100644 --- a/.clang-format +++ b/.clang-format @@ -1,37 +1,38 @@ -# Copyright 2020-2022 David Robillard <d@drobilla.net> +# Copyright 2020-2024 David Robillard <d@drobilla.net> # SPDX-License-Identifier: 0BSD OR ISC --- AlignConsecutiveAssignments: true AlignConsecutiveDeclarations: true -AlignEscapedNewlinesLeft: true +AlignEscapedNewlines: Left +AttributeMacros: + - LV2_DEPRECATED + - LV2_SYMBOL_EXPORT BasedOnStyle: Mozilla BraceWrapping: - AfterNamespace: false AfterClass: true AfterEnum: false AfterExternBlock: false AfterFunction: true + AfterNamespace: false AfterStruct: false SplitEmptyFunction: false SplitEmptyRecord: false BreakBeforeBraces: Custom Cpp11BracedListStyle: true +ForEachMacros: + - LV2_ATOM_OBJECT_BODY_FOREACH + - LV2_ATOM_OBJECT_FOREACH + - LV2_ATOM_SEQUENCE_BODY_FOREACH + - LV2_ATOM_SEQUENCE_FOREACH + - LV2_ATOM_TUPLE_BODY_FOREACH + - LV2_ATOM_TUPLE_FOREACH IndentCaseLabels: false IndentPPDirectives: AfterHash KeepEmptyLinesAtTheStartOfBlocks: false SpacesInContainerLiterals: false StatementMacros: - - LV2_DEPRECATED - LV2_DISABLE_DEPRECATION_WARNINGS - LV2_RESTORE_WARNINGS - - LV2_SYMBOL_EXPORT - _Pragma -ForEachMacros: - - LV2_ATOM_OBJECT_BODY_FOREACH - - LV2_ATOM_OBJECT_FOREACH - - LV2_ATOM_SEQUENCE_BODY_FOREACH - - LV2_ATOM_SEQUENCE_FOREACH - - LV2_ATOM_TUPLE_BODY_FOREACH - - LV2_ATOM_TUPLE_FOREACH ... diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f4f6be7..a67a043 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -138,4 +138,4 @@ pages: paths: - public only: - - master + - main @@ -37,12 +37,12 @@ Other projects may extend LV2, but must place their headers elsewhere. Headers are installed to `includedir` with paths like: - #include "lv2/urid/urid.h" + #include <lv2/urid/urid.h> For backwards compatibility, if the `old_headers` option is set, then headers are also installed to the older URI-based paths: - #include "lv2/lv2plug.in/ns/ext/urid/urid.h" + #include <lv2/lv2plug.in/ns/ext/urid/urid.h> Projects still using this style are encourated to migrate to the shorter style above. diff --git a/include/lv2/atom/forge.h b/include/lv2/atom/forge.h index f894a5a..b9dff85 100644 --- a/include/lv2/atom/forge.h +++ b/include/lv2/atom/forge.h @@ -38,10 +38,10 @@ @{ */ -#include "lv2/atom/atom.h" -#include "lv2/atom/util.h" -#include "lv2/core/attributes.h" -#include "lv2/urid/urid.h" +#include <lv2/atom/atom.h> +#include <lv2/atom/util.h> +#include <lv2/core/attributes.h> +#include <lv2/urid/urid.h> #include <assert.h> #include <stdbool.h> @@ -90,24 +90,24 @@ typedef struct { LV2_Atom_Forge_Frame* stack; - LV2_URID Blank LV2_DEPRECATED; - LV2_URID Bool; - LV2_URID Chunk; - LV2_URID Double; - LV2_URID Float; - LV2_URID Int; - LV2_URID Long; - LV2_URID Literal; - LV2_URID Object; - LV2_URID Path; - LV2_URID Property; + LV2_URID Blank LV2_DEPRECATED; + LV2_URID Bool; + LV2_URID Chunk; + LV2_URID Double; + LV2_URID Float; + LV2_URID Int; + LV2_URID Long; + LV2_URID Literal; + LV2_URID Object; + LV2_URID Path; + LV2_URID Property; LV2_URID Resource LV2_DEPRECATED; - LV2_URID Sequence; - LV2_URID String; - LV2_URID Tuple; - LV2_URID URI; - LV2_URID URID; - LV2_URID Vector; + LV2_URID Sequence; + LV2_URID String; + LV2_URID Tuple; + LV2_URID URI; + LV2_URID URID; + LV2_URID Vector; } LV2_Atom_Forge; static inline void @@ -569,8 +569,7 @@ lv2_atom_forge_object(LV2_Atom_Forge* forge, This function is deprecated and should not be used in new code. Use lv2_atom_forge_object() directly instead. */ -LV2_DEPRECATED -static inline LV2_Atom_Forge_Ref +LV2_DEPRECATED static inline LV2_Atom_Forge_Ref lv2_atom_forge_resource(LV2_Atom_Forge* forge, LV2_Atom_Forge_Frame* frame, LV2_URID id, @@ -588,8 +587,7 @@ lv2_atom_forge_resource(LV2_Atom_Forge* forge, This function is deprecated and should not be used in new code. Use lv2_atom_forge_object() directly instead. */ -LV2_DEPRECATED -static inline LV2_Atom_Forge_Ref +LV2_DEPRECATED static inline LV2_Atom_Forge_Ref lv2_atom_forge_blank(LV2_Atom_Forge* forge, LV2_Atom_Forge_Frame* frame, uint32_t id, diff --git a/include/lv2/atom/util.h b/include/lv2/atom/util.h index b8bb295..4b9e80d 100644 --- a/include/lv2/atom/util.h +++ b/include/lv2/atom/util.h @@ -1,4 +1,4 @@ -// Copyright 2008-2015 David Robillard <d@drobilla.net> +// Copyright 2008-2024 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC #ifndef LV2_ATOM_UTIL_H @@ -21,7 +21,7 @@ @{ */ -#include "lv2/atom/atom.h" +#include <lv2/atom/atom.h> #include <stdarg.h> #include <stdbool.h> @@ -61,8 +61,7 @@ lv2_atom_is_null(const LV2_Atom* atom) static inline bool lv2_atom_equals(const LV2_Atom* a, const LV2_Atom* b) { - return (a == b) || ((a->type == b->type) && (a->size == b->size) && - !memcmp(a + 1, b + 1, a->size)); + return (a == b) || !memcmp(a, b, sizeof(LV2_Atom) + a->size); } /** diff --git a/include/lv2/core/lv2.h b/include/lv2/core/lv2.h index c70a4c2..6fbb1ec 100644 --- a/include/lv2/core/lv2.h +++ b/include/lv2/core/lv2.h @@ -384,8 +384,7 @@ typedef struct LV2_Descriptor { Note that `index` has no meaning, hosts MUST NOT depend on it remaining consistent between loads of the plugin library. */ -LV2_SYMBOL_EXPORT -const LV2_Descriptor* +LV2_SYMBOL_EXPORT const LV2_Descriptor* lv2_descriptor(uint32_t index); /** @@ -450,8 +449,7 @@ typedef struct { be destroyed (using LV2_Lib_Descriptor::cleanup()) until all plugins loaded from that library have been destroyed. */ -LV2_SYMBOL_EXPORT -const LV2_Lib_Descriptor* +LV2_SYMBOL_EXPORT const LV2_Lib_Descriptor* lv2_lib_descriptor(const char* bundle_path, const LV2_Feature* const* features); /** diff --git a/include/lv2/core/lv2_util.h b/include/lv2/core/lv2_util.h index 2bac3c9..82c5e1e 100644 --- a/include/lv2/core/lv2_util.h +++ b/include/lv2/core/lv2_util.h @@ -10,7 +10,7 @@ @{ */ -#include "lv2/core/lv2.h" +#include <lv2/core/lv2.h> #include <stdarg.h> #include <stdbool.h> diff --git a/include/lv2/dynmanifest/dynmanifest.h b/include/lv2/dynmanifest/dynmanifest.h index b1a273c..7a6854d 100644 --- a/include/lv2/dynmanifest/dynmanifest.h +++ b/include/lv2/dynmanifest/dynmanifest.h @@ -15,7 +15,7 @@ @{ */ -#include "lv2/core/lv2.h" +#include <lv2/core/lv2.h> #include <stdio.h> @@ -56,8 +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_SYMBOL_EXPORT int lv2_dyn_manifest_open(LV2_Dyn_Manifest_Handle* handle, const LV2_Feature* const* features); @@ -84,8 +83,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_SYMBOL_EXPORT int lv2_dyn_manifest_get_subjects(LV2_Dyn_Manifest_Handle handle, FILE* fp); /** @@ -118,8 +116,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_SYMBOL_EXPORT int lv2_dyn_manifest_get_data(LV2_Dyn_Manifest_Handle handle, FILE* fp, const char* uri); @@ -135,8 +132,7 @@ lv2_dyn_manifest_get_data(LV2_Dyn_Manifest_Handle handle, @param handle Dynamic manifest generator handle. */ -LV2_SYMBOL_EXPORT -void +LV2_SYMBOL_EXPORT void lv2_dyn_manifest_close(LV2_Dyn_Manifest_Handle handle); #ifdef __cplusplus diff --git a/include/lv2/event/event-helpers.h b/include/lv2/event/event-helpers.h index 5ec9a84..de386ca 100644 --- a/include/lv2/event/event-helpers.h +++ b/include/lv2/event/event-helpers.h @@ -9,8 +9,8 @@ <http://lv2plug.in/ns/ext/event>. */ -#include "lv2/core/attributes.h" -#include "lv2/event/event.h" +#include <lv2/core/attributes.h> +#include <lv2/event/event.h> #include <stdbool.h> #include <stdint.h> diff --git a/include/lv2/event/event.h b/include/lv2/event/event.h index e255291..42ba54f 100644 --- a/include/lv2/event/event.h +++ b/include/lv2/event/event.h @@ -36,7 +36,7 @@ #define LV2_EVENT_AUDIO_STAMP 0 ///< Special timestamp type for audio frames -#include "lv2/core/attributes.h" +#include <lv2/core/attributes.h> #include <stdint.h> @@ -51,8 +51,7 @@ LV2_DISABLE_DEPRECATION_WARNINGS Equal to 2^12 * 5 * 7 * 9 * 11 * 13 * 17, which is evenly divisible by all integers from 1 through 18 inclusive, and powers of 2 up to 2^12. */ -LV2_DEPRECATED -static const uint32_t LV2_EVENT_PPQN = 3136573440U; +LV2_DEPRECATED static const uint32_t LV2_EVENT_PPQN = 3136573440U; /** An LV2 event (header only). @@ -67,8 +66,7 @@ static const uint32_t LV2_EVENT_PPQN = 3136573440U; memcpy(ev_copy, ev, sizeof(LV2_Event) + ev->size); (or equivalent) */ -LV2_DEPRECATED -typedef struct { +LV2_DEPRECATED typedef struct { /** The frames portion of timestamp. The units used here can optionally be set for a port (with the lv2ev:timeUnits property), otherwise this is @@ -127,8 +125,7 @@ typedef struct { | | | | | | | | | | | | | | | | | | | | | | | | | |FRAMES |SUBFRMS|TYP|LEN|DATA..DATA..PAD|FRAMES | ... */ -LV2_DEPRECATED -typedef struct { +LV2_DEPRECATED typedef struct { /** The contents of the event buffer. This may or may not reside in the same block of memory as this header, plugins must not assume either. @@ -210,8 +207,7 @@ typedef struct { /** Opaque pointer to host data. */ -LV2_DEPRECATED -typedef void* LV2_Event_Callback_Data; +LV2_DEPRECATED typedef void* LV2_Event_Callback_Data; /** Non-POD events feature. @@ -221,8 +217,7 @@ typedef void* LV2_Event_Callback_Data; and data pointed to an instance of this struct. Note this feature is not mandatory to support the event extension. */ -LV2_DEPRECATED -typedef struct { +LV2_DEPRECATED typedef struct { /** Opaque pointer to host data. diff --git a/include/lv2/log/log.h b/include/lv2/log/log.h index b460f45..2616ffe 100644 --- a/include/lv2/log/log.h +++ b/include/lv2/log/log.h @@ -29,7 +29,7 @@ // clang-format on -#include "lv2/urid/urid.h" +#include <lv2/urid/urid.h> #include <stdarg.h> diff --git a/include/lv2/log/logger.h b/include/lv2/log/logger.h index 37fe564..83e2132 100644 --- a/include/lv2/log/logger.h +++ b/include/lv2/log/logger.h @@ -15,8 +15,8 @@ @{ */ -#include "lv2/log/log.h" -#include "lv2/urid/urid.h" +#include <lv2/log/log.h> +#include <lv2/urid/urid.h> #include <stdarg.h> #include <stdio.h> diff --git a/include/lv2/options/options.h b/include/lv2/options/options.h index 0169b46..5dea9f3 100644 --- a/include/lv2/options/options.h +++ b/include/lv2/options/options.h @@ -15,8 +15,8 @@ @{ */ -#include "lv2/core/lv2.h" -#include "lv2/urid/urid.h" +#include <lv2/core/lv2.h> +#include <lv2/urid/urid.h> #include <stdint.h> diff --git a/include/lv2/state/state.h b/include/lv2/state/state.h index a44f3cc..c1a357a 100644 --- a/include/lv2/state/state.h +++ b/include/lv2/state/state.h @@ -16,7 +16,7 @@ @{ */ -#include "lv2/core/lv2.h" +#include <lv2/core/lv2.h> #include <stddef.h> #include <stdint.h> diff --git a/include/lv2/ui/ui.h b/include/lv2/ui/ui.h index d17edcb..408b570 100644 --- a/include/lv2/ui/ui.h +++ b/include/lv2/ui/ui.h @@ -16,8 +16,8 @@ @{ */ -#include "lv2/core/lv2.h" -#include "lv2/urid/urid.h" +#include <lv2/core/lv2.h> +#include <lv2/urid/urid.h> #include <stdbool.h> #include <stdint.h> @@ -511,8 +511,7 @@ typedef struct { This is the entry point to a UI library, which works in the same way as lv2_descriptor() but for UIs rather than plugins. */ -LV2_SYMBOL_EXPORT -const LV2UI_Descriptor* +LV2_SYMBOL_EXPORT const LV2UI_Descriptor* lv2ui_descriptor(uint32_t index); /** diff --git a/include/lv2/uri-map/uri-map.h b/include/lv2/uri-map/uri-map.h index dc25a55..90bc9bd 100644 --- a/include/lv2/uri-map/uri-map.h +++ b/include/lv2/uri-map/uri-map.h @@ -30,7 +30,7 @@ // clang-format on -#include "lv2/core/attributes.h" +#include <lv2/core/attributes.h> #include <stdint.h> @@ -43,8 +43,7 @@ LV2_DISABLE_DEPRECATION_WARNINGS /** Opaque pointer to host data. */ -LV2_DEPRECATED -typedef void* LV2_URI_Map_Callback_Data; +LV2_DEPRECATED typedef void* LV2_URI_Map_Callback_Data; /** URI Map Feature. @@ -53,8 +52,7 @@ typedef void* LV2_URI_Map_Callback_Data; plugin's instantiate method with URI "http://lv2plug.in/ns/ext/uri-map" and data pointed to an instance of this struct. */ -LV2_DEPRECATED -typedef struct { +LV2_DEPRECATED typedef struct { /** Opaque pointer to host data. diff --git a/include/lv2/worker/worker.h b/include/lv2/worker/worker.h index 613198b..2cfd052 100644 --- a/include/lv2/worker/worker.h +++ b/include/lv2/worker/worker.h @@ -15,7 +15,7 @@ @{ */ -#include "lv2/core/lv2.h" +#include <lv2/core/lv2.h> #include <stdint.h> diff --git a/meson.build b/meson.build index aa9963f..90fad9a 100644 --- a/meson.build +++ b/meson.build @@ -18,9 +18,9 @@ lv2_docdir = get_option('datadir') / 'doc' / 'lv2' lv2_source_root = meson.current_source_dir() lv2_build_root = meson.current_build_dir() -####################### -# Compilers and Flags # -####################### +############################# +# Compilers and Build Tools # +############################# # Required tools pkg = import('pkgconfig') @@ -34,8 +34,165 @@ if not get_option('tests').disabled() endif endif -# Set global warning flags -subdir('meson/suppressions') +######################## +# Warning Suppressions # +######################## + +warning_level = get_option('warning_level') + +# C +c_suppressions = [] +if cc.get_id() in ['clang', 'emscripten'] + if warning_level == 'everything' + 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', + '-Wno-double-promotion', + '-Wno-float-conversion', + '-Wno-float-equal', + '-Wno-implicit-float-conversion', + '-Wno-padded', + '-Wno-reserved-id-macro', + '-Wno-shorten-64-to-32', + '-Wno-sign-conversion', + '-Wno-switch-default', + '-Wno-switch-enum', + '-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 + endif + + if warning_level in ['everything', '3', '2'] + c_suppressions += ['-Wno-unused-parameter'] + endif + +elif cc.get_id() == 'gcc' + if warning_level == 'everything' + c_suppressions += [ + '-Wno-bad-function-cast', + '-Wno-cast-align', + '-Wno-cast-qual', + '-Wno-conversion', + '-Wno-double-promotion', + '-Wno-float-equal', + '-Wno-inline', + '-Wno-padded', + '-Wno-suggest-attribute=const', + '-Wno-suggest-attribute=malloc', + '-Wno-suggest-attribute=pure', + '-Wno-switch-default', + '-Wno-switch-enum', + '-Wno-unsuffixed-float-constants', + '-Wno-unused-const-variable', + ] + + if target_machine.system() == 'windows' + c_suppressions += ['-Wno-suggest-attribute=format'] + endif + endif + + if warning_level in ['everything', '3', '2'] + c_suppressions += ['-Wno-unused-parameter'] + endif + +elif cc.get_id() == 'msvc' + if warning_level == 'everything' + c_suppressions += [ + '/wd4061', # enumerator in switch is not explicitly handled + '/wd4244', # conversion with possible loss of data + '/wd4310', # cast truncates constant value + '/wd4365', # signed/unsigned mismatch + '/wd4464', # relative include path contains ".." + '/wd4514', # unreferenced inline function has been removed + '/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 construct + '/wd5045', # will insert Spectre mitigation for memory load + ] + endif + + if warning_level in ['everything', '3'] + c_suppressions += [ + '/wd4100', # unreferenced formal parameter + ] + endif + + if warning_level in ['everything', '3', '2'] + c_suppressions += [ + '/wd4267', # conversion from size_t to a smaller type + ] + endif +endif + +c_suppressions = cc.get_supported_arguments(c_suppressions) + +# C++ +if is_variable('cpp') + cpp_suppressions = [] + + if warning_level == 'everything' + if cpp.get_id() in ['clang', 'emscripten'] + 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 += [ + '-Wno-cast-align', + '-Wno-cast-qual', + '-Wno-inline', + '-Wno-padded', + '-Wno-unused-const-variable', + '-Wno-useless-cast', + ] + + if target_machine.system() == 'windows' + cpp_suppressions += ['-Wno-suggest-attribute=format'] + endif + + elif cpp.get_id() == 'msvc' + 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 + + cpp_suppressions = cpp.get_supported_arguments(cpp_suppressions) +endif ########################## # LV2 Path Configuration # diff --git a/meson/suppressions/meson.build b/meson/suppressions/meson.build deleted file mode 100644 index 9d9a38a..0000000 --- a/meson/suppressions/meson.build +++ /dev/null @@ -1,168 +0,0 @@ -# Copyright 2020-2024 David Robillard <d@drobilla.net> -# SPDX-License-Identifier: 0BSD OR ISC - -# Project-specific warning suppressions - -warning_level = get_option('warning_level') - -##### -# C # -##### - -if is_variable('cc') - c_suppressions = [] - - 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', - '-Wno-double-promotion', - '-Wno-float-conversion', - '-Wno-float-equal', - '-Wno-implicit-float-conversion', - '-Wno-padded', - '-Wno-reserved-id-macro', - '-Wno-shorten-64-to-32', - '-Wno-sign-conversion', - '-Wno-switch-default', - '-Wno-switch-enum', - '-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', - '-Wno-cast-align', - '-Wno-cast-qual', - '-Wno-conversion', - '-Wno-double-promotion', - '-Wno-float-equal', - '-Wno-inline', - '-Wno-padded', - '-Wno-suggest-attribute=const', - '-Wno-suggest-attribute=malloc', - '-Wno-suggest-attribute=pure', - '-Wno-switch-default', - '-Wno-switch-enum', - '-Wno-unsuffixed-float-constants', - '-Wno-unused-const-variable', - ] - - if target_machine.system() == 'windows' - c_suppressions += [ - '-Wno-suggest-attribute=format', - ] - endif - - elif cc.get_id() == 'msvc' - c_suppressions += [ - '/wd4061', # enumerator in switch is not explicitly handled - '/wd4244', # conversion with possible loss of data - '/wd4267', # conversion from size_t to a smaller type - '/wd4310', # cast truncates constant value - '/wd4365', # signed/unsigned mismatch - '/wd4464', # relative include path contains ".." - '/wd4514', # unreferenced inline function has been removed - '/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 construct - '/wd5045', # will insert Spectre mitigation for memory load - ] - 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 - -####### -# C++ # -####### - -if is_variable('cpp') - cpp_suppressions = [] - - if warning_level == 'everything' - if cpp.get_id() in ['clang', 'emscripten'] - 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 += [ - '-Wno-cast-align', - '-Wno-cast-qual', - '-Wno-inline', - '-Wno-padded', - '-Wno-unused-const-variable', - '-Wno-useless-cast', - ] - - if target_machine.system() == 'windows' - cpp_suppressions += [ - '-Wno-suggest-attribute=format', - ] - endif - - elif cpp.get_id() == 'msvc' - 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 - - cpp_suppressions = cpp.get_supported_arguments(cpp_suppressions) -endif diff --git a/plugins/eg-amp.lv2/amp.c b/plugins/eg-amp.lv2/amp.c index 9c22049..c85d6ab 100644 --- a/plugins/eg-amp.lv2/amp.c +++ b/plugins/eg-amp.lv2/amp.c @@ -9,7 +9,7 @@ replacing `http:/` with `lv2` any header in the specification bundle can be included, in this case `lv2.h`. */ -#include "lv2/core/lv2.h" +#include <lv2/core/lv2.h> /** Include standard C headers */ #include <math.h> @@ -196,8 +196,7 @@ static const LV2_Descriptor descriptor = {AMP_URI, This method is in the ``discovery'' threading class, so no other functions or methods in this plugin library will be called concurrently with it. */ -LV2_SYMBOL_EXPORT -const LV2_Descriptor* +LV2_SYMBOL_EXPORT const LV2_Descriptor* lv2_descriptor(uint32_t index) { return index == 0 ? &descriptor : NULL; diff --git a/plugins/eg-fifths.lv2/fifths.c b/plugins/eg-fifths.lv2/fifths.c index d2400b4..22d5f8a 100644 --- a/plugins/eg-fifths.lv2/fifths.c +++ b/plugins/eg-fifths.lv2/fifths.c @@ -1,16 +1,16 @@ // Copyright 2014-2016 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC -#include "./uris.h" +#include "uris.h" -#include "lv2/atom/atom.h" -#include "lv2/atom/util.h" -#include "lv2/core/lv2.h" -#include "lv2/core/lv2_util.h" -#include "lv2/log/log.h" -#include "lv2/log/logger.h" -#include "lv2/midi/midi.h" -#include "lv2/urid/urid.h" +#include <lv2/atom/atom.h> +#include <lv2/atom/util.h> +#include <lv2/core/lv2.h> +#include <lv2/core/lv2_util.h> +#include <lv2/log/log.h> +#include <lv2/log/logger.h> +#include <lv2/midi/midi.h> +#include <lv2/urid/urid.h> #include <stdbool.h> #include <stdint.h> @@ -160,8 +160,7 @@ static const LV2_Descriptor descriptor = {EG_FIFTHS_URI, cleanup, extension_data}; -LV2_SYMBOL_EXPORT -const LV2_Descriptor* +LV2_SYMBOL_EXPORT const LV2_Descriptor* lv2_descriptor(uint32_t index) { return index == 0 ? &descriptor : NULL; diff --git a/plugins/eg-fifths.lv2/uris.h b/plugins/eg-fifths.lv2/uris.h index 7cbbd94..f32a6bd 100644 --- a/plugins/eg-fifths.lv2/uris.h +++ b/plugins/eg-fifths.lv2/uris.h @@ -4,10 +4,10 @@ #ifndef FIFTHS_URIS_H #define FIFTHS_URIS_H -#include "lv2/atom/atom.h" -#include "lv2/midi/midi.h" -#include "lv2/patch/patch.h" -#include "lv2/urid/urid.h" +#include <lv2/atom/atom.h> +#include <lv2/midi/midi.h> +#include <lv2/patch/patch.h> +#include <lv2/urid/urid.h> #define EG_FIFTHS_URI "http://lv2plug.in/plugins/eg-fifths" diff --git a/plugins/eg-metro.lv2/metro.c b/plugins/eg-metro.lv2/metro.c index f3fe164..e60a33f 100644 --- a/plugins/eg-metro.lv2/metro.c +++ b/plugins/eg-metro.lv2/metro.c @@ -1,14 +1,14 @@ // Copyright 2012-2016 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC -#include "lv2/atom/atom.h" -#include "lv2/atom/util.h" -#include "lv2/core/lv2.h" -#include "lv2/core/lv2_util.h" -#include "lv2/log/log.h" -#include "lv2/log/logger.h" -#include "lv2/time/time.h" -#include "lv2/urid/urid.h" +#include <lv2/atom/atom.h> +#include <lv2/atom/util.h> +#include <lv2/core/lv2.h> +#include <lv2/core/lv2_util.h> +#include <lv2/log/log.h> +#include <lv2/log/logger.h> +#include <lv2/time/time.h> +#include <lv2/urid/urid.h> #include <math.h> #include <stdbool.h> @@ -199,6 +199,7 @@ play(Metro* self, uint32_t begin, uint32_t end) { float* const output = self->ports.output; const uint32_t frames_per_beat = (uint32_t)(60.0f / self->bpm * self->rate); + const float attack_den = self->attack_len ? (float)self->attack_len : 1.0f; if (self->speed == 0.0f) { memset(output, 0, (end - begin) * sizeof(float)); @@ -209,8 +210,8 @@ play(Metro* self, uint32_t begin, uint32_t end) switch (self->state) { case STATE_ATTACK: // Amplitude increases from 0..1 until attack_len - output[i] = self->wave[self->wave_offset] * (float)self->elapsed_len / - (float)self->attack_len; + output[i] = + self->wave[self->wave_offset] * (float)self->elapsed_len / attack_den; if (self->elapsed_len >= self->attack_len) { self->state = STATE_DECAY; } @@ -331,8 +332,7 @@ static const LV2_Descriptor descriptor = { NULL, // extension_data }; -LV2_SYMBOL_EXPORT -const LV2_Descriptor* +LV2_SYMBOL_EXPORT const LV2_Descriptor* lv2_descriptor(uint32_t index) { return index == 0 ? &descriptor : NULL; diff --git a/plugins/eg-midigate.lv2/midigate.c b/plugins/eg-midigate.lv2/midigate.c index db2fdea..b4861db 100644 --- a/plugins/eg-midigate.lv2/midigate.c +++ b/plugins/eg-midigate.lv2/midigate.c @@ -1,14 +1,14 @@ // Copyright 2013-2016 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC -#include "lv2/atom/atom.h" -#include "lv2/atom/util.h" -#include "lv2/core/lv2.h" -#include "lv2/core/lv2_util.h" -#include "lv2/log/log.h" -#include "lv2/log/logger.h" -#include "lv2/midi/midi.h" -#include "lv2/urid/urid.h" +#include <lv2/atom/atom.h> +#include <lv2/atom/util.h> +#include <lv2/core/lv2.h> +#include <lv2/core/lv2_util.h> +#include <lv2/log/log.h> +#include <lv2/log/logger.h> +#include <lv2/midi/midi.h> +#include <lv2/urid/urid.h> #include <stdbool.h> #include <stdint.h> @@ -213,8 +213,7 @@ static const LV2_Descriptor descriptor = {MIDIGATE_URI, cleanup, extension_data}; -LV2_SYMBOL_EXPORT -const LV2_Descriptor* +LV2_SYMBOL_EXPORT const LV2_Descriptor* lv2_descriptor(uint32_t index) { return index == 0 ? &descriptor : NULL; diff --git a/plugins/eg-params.lv2/params.c b/plugins/eg-params.lv2/params.c index 742c48b..9fbaa46 100644 --- a/plugins/eg-params.lv2/params.c +++ b/plugins/eg-params.lv2/params.c @@ -3,17 +3,17 @@ #include "state_map.h" -#include "lv2/atom/atom.h" -#include "lv2/atom/forge.h" -#include "lv2/atom/util.h" -#include "lv2/core/lv2.h" -#include "lv2/core/lv2_util.h" -#include "lv2/log/log.h" -#include "lv2/log/logger.h" -#include "lv2/midi/midi.h" -#include "lv2/patch/patch.h" -#include "lv2/state/state.h" -#include "lv2/urid/urid.h" +#include <lv2/atom/atom.h> +#include <lv2/atom/forge.h> +#include <lv2/atom/util.h> +#include <lv2/core/lv2.h> +#include <lv2/core/lv2_util.h> +#include <lv2/log/log.h> +#include <lv2/log/logger.h> +#include <lv2/midi/midi.h> +#include <lv2/patch/patch.h> +#include <lv2/state/state.h> +#include <lv2/urid/urid.h> #include <stdbool.h> #include <stdint.h> @@ -512,8 +512,7 @@ static const LV2_Descriptor descriptor = {EG_PARAMS_URI, cleanup, extension_data}; -LV2_SYMBOL_EXPORT -const LV2_Descriptor* +LV2_SYMBOL_EXPORT const LV2_Descriptor* lv2_descriptor(uint32_t index) { return (index == 0) ? &descriptor : NULL; diff --git a/plugins/eg-params.lv2/state_map.h b/plugins/eg-params.lv2/state_map.h index 2a29e09..c81ea29 100644 --- a/plugins/eg-params.lv2/state_map.h +++ b/plugins/eg-params.lv2/state_map.h @@ -1,8 +1,8 @@ // Copyright 2016 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC -#include "lv2/atom/atom.h" -#include "lv2/urid/urid.h" +#include <lv2/atom/atom.h> +#include <lv2/urid/urid.h> #include <stdarg.h> #include <stdint.h> diff --git a/plugins/eg-sampler.lv2/atom_sink.h b/plugins/eg-sampler.lv2/atom_sink.h index 8966eb2..3319767 100644 --- a/plugins/eg-sampler.lv2/atom_sink.h +++ b/plugins/eg-sampler.lv2/atom_sink.h @@ -1,9 +1,9 @@ // Copyright 2016 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC -#include "lv2/atom/atom.h" -#include "lv2/atom/forge.h" -#include "lv2/atom/util.h" +#include <lv2/atom/atom.h> +#include <lv2/atom/forge.h> +#include <lv2/atom/util.h> #include <stdint.h> #include <string.h> diff --git a/plugins/eg-sampler.lv2/peaks.h b/plugins/eg-sampler.lv2/peaks.h index 47d6616..ff91546 100644 --- a/plugins/eg-sampler.lv2/peaks.h +++ b/plugins/eg-sampler.lv2/peaks.h @@ -14,10 +14,10 @@ requested, with reasonably sized incremental updates sent over plugin ports. */ -#include "lv2/atom/atom.h" -#include "lv2/atom/forge.h" -#include "lv2/atom/util.h" -#include "lv2/urid/urid.h" +#include <lv2/atom/atom.h> +#include <lv2/atom/forge.h> +#include <lv2/atom/util.h> +#include <lv2/urid/urid.h> #include <math.h> #include <stdbool.h> diff --git a/plugins/eg-sampler.lv2/sampler.c b/plugins/eg-sampler.lv2/sampler.c index 4c5a92a..6fc04c5 100644 --- a/plugins/eg-sampler.lv2/sampler.c +++ b/plugins/eg-sampler.lv2/sampler.c @@ -7,17 +7,17 @@ #include "peaks.h" #include "uris.h" -#include "lv2/atom/atom.h" -#include "lv2/atom/forge.h" -#include "lv2/atom/util.h" -#include "lv2/core/lv2.h" -#include "lv2/core/lv2_util.h" -#include "lv2/log/log.h" -#include "lv2/log/logger.h" -#include "lv2/midi/midi.h" -#include "lv2/state/state.h" -#include "lv2/urid/urid.h" -#include "lv2/worker/worker.h" +#include <lv2/atom/atom.h> +#include <lv2/atom/forge.h> +#include <lv2/atom/util.h> +#include <lv2/core/lv2.h> +#include <lv2/core/lv2_util.h> +#include <lv2/log/log.h> +#include <lv2/log/logger.h> +#include <lv2/midi/midi.h> +#include <lv2/state/state.h> +#include <lv2/urid/urid.h> +#include <lv2/worker/worker.h> #include <samplerate.h> #include <sndfile.h> @@ -688,8 +688,7 @@ static const LV2_Descriptor descriptor = {EG_SAMPLER_URI, cleanup, extension_data}; -LV2_SYMBOL_EXPORT -const LV2_Descriptor* +LV2_SYMBOL_EXPORT const LV2_Descriptor* lv2_descriptor(uint32_t index) { return index == 0 ? &descriptor : NULL; diff --git a/plugins/eg-sampler.lv2/sampler_ui.c b/plugins/eg-sampler.lv2/sampler_ui.c index fc879eb..b02082a 100644 --- a/plugins/eg-sampler.lv2/sampler_ui.c +++ b/plugins/eg-sampler.lv2/sampler_ui.c @@ -4,16 +4,16 @@ #include "peaks.h" #include "uris.h" -#include "lv2/atom/atom.h" -#include "lv2/atom/forge.h" -#include "lv2/atom/util.h" -#include "lv2/core/lv2.h" -#include "lv2/core/lv2_util.h" -#include "lv2/log/log.h" -#include "lv2/log/logger.h" -#include "lv2/midi/midi.h" -#include "lv2/ui/ui.h" -#include "lv2/urid/urid.h" +#include <lv2/atom/atom.h> +#include <lv2/atom/forge.h> +#include <lv2/atom/util.h> +#include <lv2/core/lv2.h> +#include <lv2/core/lv2_util.h> +#include <lv2/log/log.h> +#include <lv2/log/logger.h> +#include <lv2/midi/midi.h> +#include <lv2/ui/ui.h> +#include <lv2/urid/urid.h> #include <cairo.h> #include <gdk/gdk.h> @@ -451,8 +451,7 @@ static const LV2UI_Descriptor descriptor = {SAMPLER_UI_URI, port_event, extension_data}; -LV2_SYMBOL_EXPORT -const LV2UI_Descriptor* +LV2_SYMBOL_EXPORT const LV2UI_Descriptor* lv2ui_descriptor(uint32_t index) { return index == 0 ? &descriptor : NULL; diff --git a/plugins/eg-sampler.lv2/uris.h b/plugins/eg-sampler.lv2/uris.h index 3d3ac10..9922f51 100644 --- a/plugins/eg-sampler.lv2/uris.h +++ b/plugins/eg-sampler.lv2/uris.h @@ -4,13 +4,13 @@ #ifndef SAMPLER_URIS_H #define SAMPLER_URIS_H -#include "lv2/atom/atom.h" -#include "lv2/atom/forge.h" -#include "lv2/atom/util.h" -#include "lv2/midi/midi.h" -#include "lv2/parameters/parameters.h" -#include "lv2/patch/patch.h" -#include "lv2/urid/urid.h" +#include <lv2/atom/atom.h> +#include <lv2/atom/forge.h> +#include <lv2/atom/util.h> +#include <lv2/midi/midi.h> +#include <lv2/parameters/parameters.h> +#include <lv2/patch/patch.h> +#include <lv2/urid/urid.h> #include <stdint.h> #include <stdio.h> diff --git a/plugins/eg-scope.lv2/examploscope.c b/plugins/eg-scope.lv2/examploscope.c index 918fca2..5cdb610 100644 --- a/plugins/eg-scope.lv2/examploscope.c +++ b/plugins/eg-scope.lv2/examploscope.c @@ -2,17 +2,17 @@ // Copyright 2013 Robin Gareus <robin@gareus.org> // SPDX-License-Identifier: ISC -#include "./uris.h" - -#include "lv2/atom/atom.h" -#include "lv2/atom/forge.h" -#include "lv2/atom/util.h" -#include "lv2/core/lv2.h" -#include "lv2/core/lv2_util.h" -#include "lv2/log/log.h" -#include "lv2/log/logger.h" -#include "lv2/state/state.h" -#include "lv2/urid/urid.h" +#include "uris.h" + +#include <lv2/atom/atom.h> +#include <lv2/atom/forge.h> +#include <lv2/atom/util.h> +#include <lv2/core/lv2.h> +#include <lv2/core/lv2_util.h> +#include <lv2/log/log.h> +#include <lv2/log/logger.h> +#include <lv2/state/state.h> +#include <lv2/urid/urid.h> #include <stdbool.h> #include <stdint.h> @@ -398,8 +398,7 @@ static const LV2_Descriptor descriptor_stereo = {SCO_URI "#Stereo", cleanup, extension_data}; -LV2_SYMBOL_EXPORT -const LV2_Descriptor* +LV2_SYMBOL_EXPORT const LV2_Descriptor* lv2_descriptor(uint32_t index) { switch (index) { diff --git a/plugins/eg-scope.lv2/examploscope_ui.c b/plugins/eg-scope.lv2/examploscope_ui.c index 7b49967..2ad42dc 100644 --- a/plugins/eg-scope.lv2/examploscope_ui.c +++ b/plugins/eg-scope.lv2/examploscope_ui.c @@ -1,14 +1,14 @@ // Copyright 2013 Robin Gareus <robin@gareus.org> // SPDX-License-Identifier: ISC -#include "./uris.h" +#include "uris.h" -#include "lv2/atom/atom.h" -#include "lv2/atom/forge.h" -#include "lv2/atom/util.h" -#include "lv2/core/lv2.h" -#include "lv2/ui/ui.h" -#include "lv2/urid/urid.h" +#include <lv2/atom/atom.h> +#include <lv2/atom/forge.h> +#include <lv2/atom/util.h> +#include <lv2/core/lv2.h> +#include <lv2/ui/ui.h> +#include <lv2/urid/urid.h> #include <cairo.h> #include <gdk/gdk.h> @@ -206,6 +206,7 @@ on_expose_event(GtkWidget* widget, GdkEventExpose* ev, gpointer data) assert(start < DAWIDTH); assert(end <= DAWIDTH); assert(start < end); + assert(ui->n_channels <= 2U); for (uint32_t c = 0; c < ui->n_channels; ++c) { ScoChan* chn = &ui->chn[c]; @@ -655,8 +656,7 @@ static const LV2UI_Descriptor descriptor = {SCO_URI "#ui", port_event, NULL}; -LV2_SYMBOL_EXPORT -const LV2UI_Descriptor* +LV2_SYMBOL_EXPORT const LV2UI_Descriptor* lv2ui_descriptor(uint32_t index) { return index == 0 ? &descriptor : NULL; diff --git a/plugins/eg-scope.lv2/uris.h b/plugins/eg-scope.lv2/uris.h index 86778ce..d9d94be 100644 --- a/plugins/eg-scope.lv2/uris.h +++ b/plugins/eg-scope.lv2/uris.h @@ -4,9 +4,9 @@ #ifndef SCO_URIS_H #define SCO_URIS_H -#include "lv2/atom/atom.h" -#include "lv2/parameters/parameters.h" -#include "lv2/urid/urid.h" +#include <lv2/atom/atom.h> +#include <lv2/parameters/parameters.h> +#include <lv2/urid/urid.h> #define SCO_URI "http://lv2plug.in/plugins/eg-scope" diff --git a/test/atom_test_utils.c b/test/atom_test_utils.c index bffa2ea..5c313a5 100644 --- a/test/atom_test_utils.c +++ b/test/atom_test_utils.c @@ -3,11 +3,11 @@ #undef NDEBUG -#include "lv2/atom/atom.h" -#include "lv2/atom/forge.h" -#include "lv2/atom/util.h" -#include "lv2/log/log.h" -#include "lv2/urid/urid.h" +#include <lv2/atom/atom.h> +#include <lv2/atom/forge.h> +#include <lv2/atom/util.h> +#include <lv2/log/log.h> +#include <lv2/urid/urid.h> #include <assert.h> #include <stdarg.h> diff --git a/test/cpp/test_build.cpp b/test/cpp/test_build.cpp index c8b2ca0..73868a4 100644 --- a/test/cpp/test_build.cpp +++ b/test/cpp/test_build.cpp @@ -10,36 +10,36 @@ _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wsuggest-attribute=const\"") #endif -#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 +#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 int main() diff --git a/test/headers/test_headers.c b/test/headers/test_headers.c index 5736b44..d62b000 100644 --- a/test/headers/test_headers.c +++ b/test/headers/test_headers.c @@ -1,36 +1,36 @@ // 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 +#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)) diff --git a/test/meson.build b/test/meson.build index f782441..2fec667 100644 --- a/test/meson.build +++ b/test/meson.build @@ -157,6 +157,11 @@ test_names = [ 'forge_overflow', ] +atom_test_suppressions = [] +if cc.get_id() == 'gcc' + atom_test_suppressions += ['-Wno-stringop-overflow'] +endif + # Build and run tests foreach test_name : test_names test( @@ -164,7 +169,7 @@ foreach test_name : test_names executable( test_name, files('test_@0@.c'.format(test_name)), - c_args: c_suppressions, + c_args: c_suppressions + atom_test_suppressions, dependencies: [lv2_dep], ), suite: 'unit', diff --git a/test/test_atom.c b/test/test_atom.c index ffe73a1..f88c4c7 100644 --- a/test/test_atom.c +++ b/test/test_atom.c @@ -3,10 +3,10 @@ #include "atom_test_utils.c" -#include "lv2/atom/atom.h" -#include "lv2/atom/forge.h" -#include "lv2/atom/util.h" -#include "lv2/urid/urid.h" +#include <lv2/atom/atom.h> +#include <lv2/atom/forge.h> +#include <lv2/atom/util.h> +#include <lv2/urid/urid.h> #include <stdbool.h> #include <stdint.h> diff --git a/test/test_build.c b/test/test_build.c index bdc47f6..83a69df 100644 --- a/test/test_build.c +++ b/test/test_build.c @@ -1,36 +1,36 @@ // 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 +#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 int main(void) diff --git a/test/test_forge_overflow.c b/test/test_forge_overflow.c index 95e9b87..8f6ee03 100644 --- a/test/test_forge_overflow.c +++ b/test/test_forge_overflow.c @@ -3,9 +3,9 @@ #include "atom_test_utils.c" -#include "lv2/atom/atom.h" -#include "lv2/atom/forge.h" -#include "lv2/urid/urid.h" +#include <lv2/atom/atom.h> +#include <lv2/atom/forge.h> +#include <lv2/urid/urid.h> #include <assert.h> #include <stdint.h> |