aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.git-blame-ignore-revs5
-rw-r--r--include/lv2/atom/forge.h2
-rw-r--r--include/lv2/atom/util.h2
-rwxr-xr-xlv2specgen/lv2specgen.py9
-rw-r--r--meson.build2
-rw-r--r--plugins/.clang-tidy3
-rw-r--r--plugins/eg-amp.lv2/meson.build1
-rw-r--r--plugins/eg-fifths.lv2/meson.build1
-rw-r--r--plugins/eg-metro.lv2/meson.build1
-rw-r--r--plugins/eg-midigate.lv2/meson.build1
-rw-r--r--plugins/eg-params.lv2/meson.build1
-rw-r--r--plugins/eg-sampler.lv2/meson.build2
-rw-r--r--plugins/eg-sampler.lv2/sampler_ui.c4
-rw-r--r--plugins/eg-scope.lv2/examploscope_ui.c18
-rw-r--r--plugins/eg-scope.lv2/meson.build2
-rw-r--r--test/headers/meson.build1
-rw-r--r--test/meson.build3
-rw-r--r--test/test_forge_overflow.c8
18 files changed, 40 insertions, 26 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
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..9a3d8a3 100644
--- a/include/lv2/atom/util.h
+++ b/include/lv2/atom/util.h
@@ -251,7 +251,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..07698de 100644
--- a/meson.build
+++ b/meson.build
@@ -216,7 +216,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/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-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