aboutsummaryrefslogtreecommitdiffstats
path: root/src/comparison.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-07-31 18:03:25 -0400
committerDavid Robillard <d@drobilla.net>2016-07-31 18:03:25 -0400
commit4686e5199e359425fb11013ebf75dab423db3f8c (patch)
treed9913cf94779b7d72ee98de85ebf3fa87c128143 /src/comparison.c
parent3e3b61724b16437a3181e80fcb75cc6f6b0a97ba (diff)
Fix compilation with C++
Diffstat (limited to 'src/comparison.c')
-rw-r--r--src/comparison.c31
1 files changed, 12 insertions, 19 deletions
diff --git a/src/comparison.c b/src/comparison.c
index ea8c97d..1d0af9b 100644
--- a/src/comparison.c
+++ b/src/comparison.c
@@ -54,43 +54,36 @@ instantiate(const LV2_Descriptor* descriptor,
const char* bundle_path,
const LV2_Feature* const* features)
{
- Comp* plugin = malloc(sizeof(Comp));
- plugin->a_buffer = NULL;
- plugin->b_buffer = NULL;
- plugin->larger_buffer = NULL;
- plugin->smaller_buffer = NULL;
- plugin->a_larger_buffer = NULL;
- plugin->equal_buffer = NULL;
+ Comp* plugin = (Comp*)calloc(1, sizeof(Comp));
+
return (LV2_Handle)plugin;
}
/* Connect a port to a data location */
static void
connect_port(LV2_Handle instance,
- uint32_t port,
- void* location)
+ uint32_t port,
+ void* data)
{
- Comp* plugin;
-
- plugin = (Comp*)instance;
+ Comp* plugin = (Comp*)instance;
switch (port) {
case COMP_A:
- plugin->a_buffer = location;
+ plugin->a_buffer = (float*)data;
break;
case COMP_B:
- plugin->b_buffer = location;
+ plugin->b_buffer = (float*)data;
break;
case COMP_LARGER:
- plugin->larger_buffer = location;
+ plugin->larger_buffer = (float*)data;
break;
case COMP_SMALLER:
- plugin->smaller_buffer = location;
+ plugin->smaller_buffer = (float*)data;
break;
case COMP_A_LARGER:
- plugin->a_larger_buffer = location;
+ plugin->a_larger_buffer = (float*)data;
break;
case COMP_EQUAL:
- plugin->equal_buffer = location;
+ plugin->equal_buffer = (float*)data;
break;
}
}
@@ -98,7 +91,7 @@ connect_port(LV2_Handle instance,
static void
run(LV2_Handle instance, uint32_t nframes)
{
- Comp* const plugin = (Comp*)instance;
+ Comp* const plugin = (Comp*)instance;
const float* const a = plugin->a_buffer;
const float* const b = plugin->b_buffer;
float* const larger = plugin->larger_buffer;