From e271414476309ef4491444376cf0050936816a24 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 11 Aug 2012 03:38:07 +0000 Subject: Improve const correctness. --- plugins/eg-amp.lv2/amp.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'plugins/eg-amp.lv2') diff --git a/plugins/eg-amp.lv2/amp.c b/plugins/eg-amp.lv2/amp.c index 7f7cacc..86f7a81 100644 --- a/plugins/eg-amp.lv2/amp.c +++ b/plugins/eg-amp.lv2/amp.c @@ -41,9 +41,9 @@ typedef enum { /** Plugin instance. */ typedef struct { // Port buffers - float* gain; - float* input; - float* output; + const float* gain; + const float* input; + float* output; } Amp; /** Create a new plugin instance. */ @@ -68,10 +68,10 @@ connect_port(LV2_Handle instance, switch ((PortIndex)port) { case AMP_GAIN: - amp->gain = (float*)data; + amp->gain = (const float*)data; break; case AMP_INPUT: - amp->input = (float*)data; + amp->input = (const float*)data; break; case AMP_OUTPUT: amp->output = (float*)data; @@ -92,7 +92,7 @@ activate(LV2_Handle instance) static void run(LV2_Handle instance, uint32_t n_samples) { - Amp* amp = (Amp*)instance; + const Amp* amp = (const Amp*)instance; const float gain = *(amp->gain); const float* const input = amp->input; -- cgit v1.2.1