aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/eg03-metro.lv2
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-01-24 01:49:18 +0000
committerDavid Robillard <d@drobilla.net>2014-01-24 01:49:18 +0000
commit0824237942af542431a8348c55c367242d1bf49a (patch)
treeab9afb3a202b434c2198a071bcb8336f2976f2a3 /plugins/eg03-metro.lv2
parent1cb9f77d07c998108d0ba54811ac4604a2b49725 (diff)
downloadlv2-0824237942af542431a8348c55c367242d1bf49a.tar.xz
Fix -Wconversion warnings in headers.
Diffstat (limited to 'plugins/eg03-metro.lv2')
-rw-r--r--plugins/eg03-metro.lv2/metro.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/eg03-metro.lv2/metro.c b/plugins/eg03-metro.lv2/metro.c
index c2e18af..e7f8ead 100644
--- a/plugins/eg03-metro.lv2/metro.c
+++ b/plugins/eg03-metro.lv2/metro.c
@@ -179,17 +179,17 @@ instantiate(const LV2_Descriptor* descriptor,
// Initialise instance fields
self->rate = rate;
self->bpm = 120.0f;
- self->attack_len = attack_s * rate;
- self->decay_len = decay_s * rate;
+ self->attack_len = (uint32_t)(attack_s * rate);
+ self->decay_len = (uint32_t)(decay_s * rate);
self->state = STATE_OFF;
// Generate one cycle of a sine wave at the desired frequency
const double freq = 440.0 * 2.0;
const double amp = 0.5;
- self->wave_len = rate / freq;
+ self->wave_len = (uint32_t)(rate / freq);
self->wave = (float*)malloc(self->wave_len * sizeof(float));
for (uint32_t i = 0; i < self->wave_len; ++i) {
- self->wave[i] = sin(i * 2 * M_PI * freq / rate) * amp;
+ self->wave[i] = (float)(sin(i * 2 * M_PI * freq / rate) * amp);
}
return (LV2_Handle)self;