diff options
| -rw-r--r-- | .git-blame-ignore-revs | 5 | ||||
| -rw-r--r-- | NEWS | 4 | ||||
| -rw-r--r-- | include/lv2/atom/forge.h | 2 | ||||
| -rw-r--r-- | include/lv2/atom/util.h | 6 | ||||
| -rwxr-xr-x | lv2specgen/lv2specgen.py | 9 | ||||
| -rw-r--r-- | meson.build | 6 | ||||
| -rw-r--r-- | meson_options.txt | 16 | ||||
| -rw-r--r-- | plugins/.clang-tidy | 3 | ||||
| -rw-r--r-- | plugins/eg-amp.lv2/meson.build | 1 | ||||
| -rw-r--r-- | plugins/eg-fifths.lv2/meson.build | 1 | ||||
| -rw-r--r-- | plugins/eg-metro.lv2/meson.build | 1 | ||||
| -rw-r--r-- | plugins/eg-metro.lv2/metro.c | 4 | ||||
| -rw-r--r-- | plugins/eg-midigate.lv2/meson.build | 1 | ||||
| -rw-r--r-- | plugins/eg-params.lv2/meson.build | 1 | ||||
| -rw-r--r-- | plugins/eg-sampler.lv2/meson.build | 2 | ||||
| -rw-r--r-- | plugins/eg-sampler.lv2/sampler_ui.c | 4 | ||||
| -rw-r--r-- | plugins/eg-scope.lv2/examploscope_ui.c | 18 | ||||
| -rw-r--r-- | plugins/eg-scope.lv2/meson.build | 2 | ||||
| -rw-r--r-- | test/headers/meson.build | 1 | ||||
| -rw-r--r-- | test/meson.build | 3 | ||||
| -rw-r--r-- | test/test_forge_overflow.c | 8 |
21 files changed, 58 insertions, 40 deletions
diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 0000000..6f45828 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,5 @@ +# Copyright 2025 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: 0BSD OR ISC + +# Format all code with clang-format +882b9446cbf7316345de391188e68c2a7333da5b @@ -1,12 +1,14 @@ lv2 (1.18.11) unstable; urgency=medium * Allow LV2_SYMBOL_EXPORT to be overridden + * Avoid over-use of yielding meson options * Fix pylint warning in test script * Override pkg-config dependency within meson * Remove troublesome lv2_atom_assert_double_fits_in_64_bits + * eg-metro: Fix memory leak * ui: Add types for Gtk4UI and Qt6UI - -- David Robillard <d@drobilla.net> Thu, 11 Jul 2024 23:58:50 +0000 + -- David Robillard <d@drobilla.net> Sun, 28 Sep 2025 23:27:21 +0000 lv2 (1.18.10) stable; urgency=medium diff --git a/include/lv2/atom/forge.h b/include/lv2/atom/forge.h index b9dff85..58b7512 100644 --- a/include/lv2/atom/forge.h +++ b/include/lv2/atom/forge.h @@ -492,7 +492,7 @@ lv2_atom_forge_vector(LV2_Atom_Forge* forge, const void* elems) { const LV2_Atom_Vector a = { - {(uint32_t)sizeof(LV2_Atom_Vector_Body) + n_elems * child_size, + {(uint32_t)sizeof(LV2_Atom_Vector_Body) + (n_elems * child_size), forge->Vector}, {child_size, child_type}}; const LV2_Atom_Forge_Ref out = lv2_atom_forge_write(forge, &a, sizeof(a)); diff --git a/include/lv2/atom/util.h b/include/lv2/atom/util.h index 4b9e80d..32e8b6a 100644 --- a/include/lv2/atom/util.h +++ b/include/lv2/atom/util.h @@ -38,9 +38,7 @@ extern "C" { static inline uint32_t lv2_atom_pad_size(uint32_t size) { - static const uint32_t mask = 7U; - - return (size + mask) & ~mask; + return (size + 7U) & ~(7U); } /** Return the total size of `atom`, including the header. */ @@ -251,7 +249,7 @@ static inline LV2_Atom_Property_Body* lv2_atom_object_next(const LV2_Atom_Property_Body* i) { const LV2_Atom* const value = - (const LV2_Atom*)((const uint8_t*)i + 2 * sizeof(uint32_t)); + (const LV2_Atom*)((const uint8_t*)i + (2 * sizeof(uint32_t))); return (LV2_Atom_Property_Body*)((const uint8_t*)i + lv2_atom_pad_size( (uint32_t)sizeof(LV2_Atom_Property_Body) + diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py index 2226f43..28c1500 100755 --- a/lv2specgen/lv2specgen.py +++ b/lv2specgen/lv2specgen.py @@ -123,7 +123,6 @@ def isLiteral(n): def niceName(uri): - global spec_bundle if uri.startswith(spec_ns_str): return uri.replace(spec_ns_str, "") elif uri == str(rdfs.seeAlso): @@ -382,8 +381,6 @@ def endProperties(first): def rdfsPropertyInfo(term, m): """Generate HTML for properties: Domain, range""" - global classranges - global classdomains doc = "" label = getLabel(m, term) @@ -537,8 +534,6 @@ def owlRestrictionInfo(term, m): def rdfsClassInfo(term, m): """Generate rdfs-type information for Classes: ranges, and domains.""" - global classranges - global classdomains doc = "" label = getLabel(m, term) @@ -900,8 +895,6 @@ def specInformation(m, ns): and proplist. Global variables classranges and classdomains are also filled as appropriate. """ - global classranges - global classdomains # Find the class information: Ranges, domains, and list of all names. classtypes = [rdfs.Class, owl.Class, rdfs.Datatype] @@ -1151,8 +1144,6 @@ def specgen( global spec_ns_str global spec_ns global spec_pre - global ns_list - global specgendir global linkmap spec_bundle = "file://%s/" % os.path.abspath(os.path.dirname(specloc)) diff --git a/meson.build b/meson.build index 90fad9a..925b7c0 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,4 @@ -# Copyright 2021-2022 David Robillard <d@drobilla.net> +# Copyright 2021-2025 David Robillard <d@drobilla.net> # SPDX-License-Identifier: 0BSD OR ISC project( @@ -8,6 +8,8 @@ project( 'b_ndebug=if-release', 'buildtype=release', 'c_std=c99', + 'c_winlibs=', + 'cpp_winlibs=', ], license: 'ISC', meson_version: '>= 0.56.0', @@ -216,7 +218,7 @@ endif # Package/Dependency # ###################### -# Generage pkg-config file for external dependants +# Generate pkg-config file for external dependants pkg.generate( description: 'Plugin standard for audio systems', filebase: 'lv2', diff --git a/meson_options.txt b/meson_options.txt index 2661999..91882da 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,25 +1,25 @@ -# Copyright 2021-2022 David Robillard <d@drobilla.net> +# Copyright 2021-2025 David Robillard <d@drobilla.net> # SPDX-License-Identifier: 0BSD OR ISC -option('docs', type: 'feature', yield: true, +option('docs', type: 'feature', description: 'Build documentation') -option('lint', type: 'boolean', value: false, yield: true, +option('lint', type: 'boolean', value: false, description: 'Run code quality checks') -option('lv2dir', type: 'string', value: '', yield: true, +option('lv2dir', type: 'string', value: '', description: 'LV2 bundle installation directory') -option('old_headers', type: 'boolean', value: true, yield: true, +option('old_headers', type: 'boolean', value: 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, description: 'Build documentation for online hosting') -option('plugins', type: 'feature', yield: true, +option('plugins', type: 'feature', description: 'Build example plugins') -option('tests', type: 'feature', yield: true, +option('tests', type: 'feature', description: 'Build tests') option('title', type: 'string', value: 'LV2', diff --git a/plugins/.clang-tidy b/plugins/.clang-tidy index 44bac70..b327b36 100644 --- a/plugins/.clang-tidy +++ b/plugins/.clang-tidy @@ -1,4 +1,4 @@ -# Copyright 2020-2023 David Robillard <d@drobilla.net> +# Copyright 2020-2025 David Robillard <d@drobilla.net> # SPDX-License-Identifier: 0BSD OR ISC Checks: > @@ -8,6 +8,7 @@ Checks: > -bugprone-multi-level-implicit-pointer-conversion, -bugprone-suspicious-realloc-usage, -cert-err33-c, + -clang-analyzer-core.NullDereference, -hicpp-signed-bitwise, -llvm-header-guard, -misc-unused-parameters, diff --git a/plugins/eg-amp.lv2/meson.build b/plugins/eg-amp.lv2/meson.build index 726038e..2912e3f 100644 --- a/plugins/eg-amp.lv2/meson.build +++ b/plugins/eg-amp.lv2/meson.build @@ -11,6 +11,7 @@ module = shared_library( c_args: c_suppressions, dependencies: [lv2_dep, m_dep], gnu_symbol_visibility: 'hidden', + implicit_include_directories: false, install: true, install_dir: lv2dir / bundle_name, name_prefix: '', diff --git a/plugins/eg-fifths.lv2/meson.build b/plugins/eg-fifths.lv2/meson.build index bba21ce..d0cbc6a 100644 --- a/plugins/eg-fifths.lv2/meson.build +++ b/plugins/eg-fifths.lv2/meson.build @@ -11,6 +11,7 @@ module = shared_library( c_args: c_suppressions, dependencies: [lv2_dep, m_dep], gnu_symbol_visibility: 'hidden', + implicit_include_directories: false, install: true, install_dir: lv2dir / bundle_name, name_prefix: '', diff --git a/plugins/eg-metro.lv2/meson.build b/plugins/eg-metro.lv2/meson.build index 5d83c9e..ee4016e 100644 --- a/plugins/eg-metro.lv2/meson.build +++ b/plugins/eg-metro.lv2/meson.build @@ -11,6 +11,7 @@ module = shared_library( c_args: c_suppressions, dependencies: [lv2_dep, m_dep], gnu_symbol_visibility: 'hidden', + implicit_include_directories: false, install: true, install_dir: lv2dir / bundle_name, name_prefix: '', diff --git a/plugins/eg-metro.lv2/metro.c b/plugins/eg-metro.lv2/metro.c index e60a33f..8e4c738 100644 --- a/plugins/eg-metro.lv2/metro.c +++ b/plugins/eg-metro.lv2/metro.c @@ -187,7 +187,9 @@ instantiate(const LV2_Descriptor* descriptor, static void cleanup(LV2_Handle instance) { - free(instance); + Metro* self = (Metro*)instance; + free(self->wave); + free(self); } /** diff --git a/plugins/eg-midigate.lv2/meson.build b/plugins/eg-midigate.lv2/meson.build index 9f0a5ac..fc6010b 100644 --- a/plugins/eg-midigate.lv2/meson.build +++ b/plugins/eg-midigate.lv2/meson.build @@ -11,6 +11,7 @@ module = shared_library( c_args: c_suppressions, dependencies: [lv2_dep, m_dep], gnu_symbol_visibility: 'hidden', + implicit_include_directories: false, install: true, install_dir: lv2dir / bundle_name, name_prefix: '', diff --git a/plugins/eg-params.lv2/meson.build b/plugins/eg-params.lv2/meson.build index 00602bc..83c6ef9 100644 --- a/plugins/eg-params.lv2/meson.build +++ b/plugins/eg-params.lv2/meson.build @@ -11,6 +11,7 @@ module = shared_library( c_args: c_suppressions, dependencies: [lv2_dep, m_dep], gnu_symbol_visibility: 'hidden', + implicit_include_directories: false, install: true, install_dir: lv2dir / bundle_name, name_prefix: '', diff --git a/plugins/eg-sampler.lv2/meson.build b/plugins/eg-sampler.lv2/meson.build index fe81918..a0f8799 100644 --- a/plugins/eg-sampler.lv2/meson.build +++ b/plugins/eg-sampler.lv2/meson.build @@ -34,6 +34,7 @@ if samplerate_dep.found() and sndfile_dep.found() c_args: c_suppressions, dependencies: [lv2_dep, m_dep, samplerate_dep, sndfile_dep], gnu_symbol_visibility: 'hidden', + implicit_include_directories: false, install: true, install_dir: lv2dir / bundle_name, name_prefix: '', @@ -72,6 +73,7 @@ if samplerate_dep.found() and sndfile_dep.found() c_args: ui_suppressions, dependencies: [lv2_dep, gtk2_dep], gnu_symbol_visibility: 'hidden', + implicit_include_directories: false, install: true, install_dir: lv2dir / bundle_name, name_prefix: '', diff --git a/plugins/eg-sampler.lv2/sampler_ui.c b/plugins/eg-sampler.lv2/sampler_ui.c index b02082a..769dde0 100644 --- a/plugins/eg-sampler.lv2/sampler_ui.c +++ b/plugins/eg-sampler.lv2/sampler_ui.c @@ -183,13 +183,13 @@ on_canvas_expose(GtkWidget* widget, GdkEventExpose* event, gpointer data) // Draw line through top peaks for (int i = 0; i < n_peaks; ++i) { const float peak = peaks[i]; - cairo_line_to(cr, i * scale, mid_y + (peak / 2.0f) * size.height); + cairo_line_to(cr, i * scale, mid_y + ((peak / 2.0f) * size.height)); } // Continue through bottom peaks for (int i = n_peaks - 1; i >= 0; --i) { const float peak = peaks[i]; - cairo_line_to(cr, i * scale, mid_y - (peak / 2.0f) * size.height); + cairo_line_to(cr, i * scale, mid_y - ((peak / 2.0f) * size.height)); } // Close shape diff --git a/plugins/eg-scope.lv2/examploscope_ui.c b/plugins/eg-scope.lv2/examploscope_ui.c index 2ad42dc..4f366aa 100644 --- a/plugins/eg-scope.lv2/examploscope_ui.c +++ b/plugins/eg-scope.lv2/examploscope_ui.c @@ -110,6 +110,8 @@ send_ui_state(LV2UI_Handle handle) lv2_atom_total_size(msg), ui->uris.atom_eventTransfer, msg); + + lv2_atom_forge_set_buffer(&ui->forge, NULL, 0); } /** Notify backend that UI is closed. */ @@ -134,6 +136,8 @@ send_ui_disable(LV2UI_Handle handle) lv2_atom_total_size(msg), ui->uris.atom_eventTransfer, msg); + + lv2_atom_forge_set_buffer(&ui->forge, NULL, 0); } /** @@ -220,10 +224,10 @@ on_expose_event(GtkWidget* widget, GdkEventExpose* ev, gpointer data) * - (DAHEIGHT / 2) * (VAL) * (GAIN) * ) */ - const float chn_y_offset = DAHEIGHT * c + DAHEIGHT * 0.5f - 0.5f; - const float chn_y_scale = DAHEIGHT * 0.5f * gain; + const float chn_y_offset = (DAHEIGHT * c) + (DAHEIGHT * 0.5f) - 0.5f; + const float chn_y_scale = (DAHEIGHT * 0.5f) * gain; -#define CYPOS(VAL) (chn_y_offset - (VAL) * chn_y_scale) +#define CYPOS(VAL) (chn_y_offset - ((VAL) * chn_y_scale)) cairo_save(cr); @@ -293,15 +297,15 @@ on_expose_event(GtkWidget* widget, GdkEventExpose* ev, gpointer data) // Channel separator if (c > 0) { cairo_set_source_rgba(cr, .5, .5, .5, 1.0); - cairo_move_to(cr, 0, DAHEIGHT * c - .5); - cairo_line_to(cr, DAWIDTH, DAHEIGHT * c - .5); + cairo_move_to(cr, 0, (DAHEIGHT * c) - .5); + cairo_line_to(cr, DAWIDTH, (DAHEIGHT * c) - .5); cairo_stroke(cr); } // Zero scale line cairo_set_source_rgba(cr, .3, .3, .7, .5); - cairo_move_to(cr, 0, DAHEIGHT * (c + .5) - .5); - cairo_line_to(cr, DAWIDTH, DAHEIGHT * (c + .5) - .5); + cairo_move_to(cr, 0, (DAHEIGHT * (c + .5)) - .5); + cairo_line_to(cr, DAWIDTH, (DAHEIGHT * (c + .5)) - .5); cairo_stroke(cr); } diff --git a/plugins/eg-scope.lv2/meson.build b/plugins/eg-scope.lv2/meson.build index d776ee7..84e17ba 100644 --- a/plugins/eg-scope.lv2/meson.build +++ b/plugins/eg-scope.lv2/meson.build @@ -19,6 +19,7 @@ module = shared_library( c_args: c_suppressions, dependencies: [lv2_dep, m_dep], gnu_symbol_visibility: 'hidden', + implicit_include_directories: false, install: true, install_dir: lv2dir / bundle_name, name_prefix: '', @@ -55,6 +56,7 @@ if gtk2_dep.found() c_args: c_suppressions, dependencies: [lv2_dep, gtk2_dep], gnu_symbol_visibility: 'hidden', + implicit_include_directories: false, install: true, install_dir: lv2dir / bundle_name, name_prefix: '', diff --git a/test/headers/meson.build b/test/headers/meson.build index b1ec805..89ee4b8 100644 --- a/test/headers/meson.build +++ b/test/headers/meson.build @@ -63,6 +63,7 @@ test( files('test_headers.c'), c_args: header_c_suppressions, dependencies: [lv2_dep], + implicit_include_directories: false, ), suite: 'unit', ) diff --git a/test/meson.build b/test/meson.build index 2fec667..cddb05a 100644 --- a/test/meson.build +++ b/test/meson.build @@ -74,6 +74,7 @@ test( files('test_build.c'), c_args: c_suppressions, dependencies: [lv2_dep], + implicit_include_directories: false, ), suite: 'build', ) @@ -87,6 +88,7 @@ if is_variable('cpp') files('cpp/test_build.cpp'), cpp_args: cpp_suppressions, dependencies: [lv2_dep], + implicit_include_directories: false, ), suite: 'build', ) @@ -171,6 +173,7 @@ foreach test_name : test_names files('test_@0@.c'.format(test_name)), c_args: c_suppressions + atom_test_suppressions, dependencies: [lv2_dep], + implicit_include_directories: false, ), suite: 'unit', ) diff --git a/test/test_forge_overflow.c b/test/test_forge_overflow.c index 8f6ee03..7e97ae4 100644 --- a/test/test_forge_overflow.c +++ b/test/test_forge_overflow.c @@ -90,7 +90,7 @@ test_literal_overflow(void) static int test_sequence_overflow(void) { - static const size_t size = sizeof(LV2_Atom_Sequence) + 6 * sizeof(LV2_Atom); + static const size_t size = sizeof(LV2_Atom_Sequence) + (6 * sizeof(LV2_Atom)); LV2_URID_Map map = {NULL, urid_map}; // Test over a range that fails in the sequence header and event components @@ -121,7 +121,7 @@ test_sequence_overflow(void) static int test_vector_head_overflow(void) { - static const size_t size = sizeof(LV2_Atom_Vector) + 3 * sizeof(LV2_Atom); + static const size_t size = sizeof(LV2_Atom_Vector) + (3 * sizeof(LV2_Atom)); LV2_URID_Map map = {NULL, urid_map}; // Test over a range that fails in the vector header and elements @@ -154,7 +154,7 @@ test_vector_head_overflow(void) static int test_vector_overflow(void) { - static const size_t size = sizeof(LV2_Atom_Vector) + 3 * sizeof(LV2_Atom); + static const size_t size = sizeof(LV2_Atom_Vector) + (3 * sizeof(LV2_Atom)); static const int32_t vec[] = {1, 2, 3}; LV2_URID_Map map = {NULL, urid_map}; @@ -181,7 +181,7 @@ test_vector_overflow(void) static int test_tuple_overflow(void) { - static const size_t size = sizeof(LV2_Atom_Tuple) + 3 * sizeof(LV2_Atom); + static const size_t size = sizeof(LV2_Atom_Tuple) + (3 * sizeof(LV2_Atom)); LV2_URID_Map map = {NULL, urid_map}; // Test over a range that fails in the tuple header and elements |