summaryrefslogtreecommitdiffstats
path: root/bindings/test/bindings_test_plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'bindings/test/bindings_test_plugin.c')
-rw-r--r--bindings/test/bindings_test_plugin.c80
1 files changed, 36 insertions, 44 deletions
diff --git a/bindings/test/bindings_test_plugin.c b/bindings/test/bindings_test_plugin.c
index 1945c0d..18907d5 100644
--- a/bindings/test/bindings_test_plugin.c
+++ b/bindings/test/bindings_test_plugin.c
@@ -1,19 +1,6 @@
-/*
- Copyright 2006-2019 David Robillard <d@drobilla.net>
- Copyright 2006 Steve Harris <steve@plugin.org.uk>
-
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
-
- THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-*/
+// Copyright 2006-2019 David Robillard <d@drobilla.net>
+// Copyright 2006 Steve Harris <steve@plugin.org.uk>
+// SPDX-License-Identifier: ISC
/**
LV2 headers are based on the URI of the specification they come from, so a
@@ -42,10 +29,10 @@
should be defined for readability.
*/
typedef enum {
- TEST_CONTROL_IN = 0,
- TEST_CONTROL_OUT = 1,
- TEST_AUDIO_IN = 2,
- TEST_AUDIO_OUT = 3
+ TEST_CONTROL_IN = 0,
+ TEST_CONTROL_OUT = 1,
+ TEST_AUDIO_IN = 2,
+ TEST_AUDIO_OUT = 3
} PortIndex;
/**
@@ -54,7 +41,7 @@ typedef enum {
every instance method. In this simple plugin, only port buffers need to be
stored, since there is no additional instance data. */
typedef struct {
- float* buf;
+ float* buf;
} Test;
/**
@@ -73,9 +60,14 @@ instantiate(const LV2_Descriptor* descriptor,
const char* bundle_path,
const LV2_Feature* const* features)
{
- Test* test = (Test*)malloc(sizeof(Test));
+ (void)descriptor;
+ (void)rate;
+ (void)bundle_path;
+ (void)features;
+
+ Test* test = (Test*)malloc(sizeof(Test));
- return (LV2_Handle)test;
+ return (LV2_Handle)test;
}
/**
@@ -87,10 +79,11 @@ instantiate(const LV2_Descriptor* descriptor,
context as run().
*/
static void
-connect_port(LV2_Handle instance,
- uint32_t port,
- void* data)
+connect_port(LV2_Handle instance, uint32_t port, void* data)
{
+ (void)instance;
+ (void)port;
+ (void)data;
}
/**
@@ -105,12 +98,15 @@ connect_port(LV2_Handle instance,
static void
activate(LV2_Handle instance)
{
+ (void)instance;
}
/** Process a block of audio (audio thread, must be RT safe). */
static void
run(LV2_Handle instance, uint32_t n_samples)
{
+ (void)instance;
+ (void)n_samples;
}
/**
@@ -127,6 +123,7 @@ run(LV2_Handle instance, uint32_t n_samples)
static void
deactivate(LV2_Handle instance)
{
+ (void)instance;
}
/**
@@ -138,7 +135,7 @@ deactivate(LV2_Handle instance)
static void
cleanup(LV2_Handle instance)
{
- free(instance);
+ free(instance);
}
/**
@@ -154,7 +151,9 @@ cleanup(LV2_Handle instance)
static const void*
extension_data(const char* uri)
{
- return NULL;
+ (void)uri;
+
+ return NULL;
}
/**
@@ -162,16 +161,14 @@ extension_data(const char* uri)
statically to avoid leaking memory and non-portable shared library
constructors and destructors to clean up properly.
*/
-static const LV2_Descriptor descriptor = {
- TEST_URI,
- instantiate,
- connect_port,
- activate,
- run,
- deactivate,
- cleanup,
- extension_data
-};
+static const LV2_Descriptor descriptor = {TEST_URI,
+ instantiate,
+ connect_port,
+ activate,
+ run,
+ deactivate,
+ cleanup,
+ extension_data};
/**
The lv2_descriptor() function is the entry point to the plugin library. The
@@ -187,10 +184,5 @@ LV2_SYMBOL_EXPORT
const LV2_Descriptor*
lv2_descriptor(uint32_t index)
{
- switch (index) {
- case 0:
- return &descriptor;
- default:
- return NULL;
- }
+ return index ? NULL : &descriptor;
}