Browse Source

Fix implicit and narrowing conversions

zrythm_meson
David Robillard 2 years ago
parent
commit
c8713e9231
  1. 4
      plugins/eg-metro.lv2/metro.c
  2. 2
      plugins/eg-params.lv2/params.c
  3. 2
      plugins/eg-sampler.lv2/sampler.c
  4. 4
      plugins/eg-sampler.lv2/sampler_ui.c
  5. 4
      plugins/eg-scope.lv2/examploscope.c
  6. 4
      plugins/eg-scope.lv2/examploscope_ui.c

4
plugins/eg-metro.lv2/metro.c

@ -235,7 +235,7 @@ play(Metro* self, uint32_t begin, uint32_t end) @@ -235,7 +235,7 @@ play(Metro* self, uint32_t begin, uint32_t end)
// Amplitude decreases from 1..0 until attack_len + decay_len
output[i] = 0.0f;
output[i] = self->wave[self->wave_offset] *
(1 - ((self->elapsed_len - self->attack_len) /
(1 - ((float)(self->elapsed_len - self->attack_len) /
(float)self->decay_len));
if (self->elapsed_len >= self->attack_len + self->decay_len) {
self->state = STATE_OFF;
@ -285,7 +285,7 @@ update_position(Metro* self, const LV2_Atom_Object* obj) @@ -285,7 +285,7 @@ update_position(Metro* self, const LV2_Atom_Object* obj)
if (beat && beat->type == uris->atom_Float) {
// Received a beat position, synchronise
// This hard sync may cause clicks, a real plugin would be more graceful
const float frames_per_beat = 60.0f / self->bpm * self->rate;
const float frames_per_beat = (float)(60.0 / self->bpm * self->rate);
const float bar_beats = ((LV2_Atom_Float*)beat)->body;
const float beat_beats = bar_beats - floorf(bar_beats);
self->elapsed_len = beat_beats * frames_per_beat;

2
plugins/eg-params.lv2/params.c

@ -482,7 +482,7 @@ run(LV2_Handle instance, uint32_t sample_count) @@ -482,7 +482,7 @@ run(LV2_Handle instance, uint32_t sample_count)
if (self->state.spring.body > 0.0f) {
const float spring = self->state.spring.body;
self->state.spring.body = (spring >= 0.001) ? spring - 0.001 : 0.0;
self->state.spring.body = (spring >= 0.001) ? spring - 0.001f : 0.0f;
lv2_atom_forge_frame_time(&self->forge, 0);
LV2_Atom_Forge_Frame frame;
lv2_atom_forge_object(&self->forge, &frame, 0, uris->patch_Set);

2
plugins/eg-sampler.lv2/sampler.c

@ -281,7 +281,7 @@ instantiate(const LV2_Descriptor* descriptor, @@ -281,7 +281,7 @@ instantiate(const LV2_Descriptor* descriptor,
lv2_atom_forge_init(&self->forge, self->map);
peaks_sender_init(&self->psend, self->map);
self->gain = 1.0;
self->gain = 1.0f;
return (LV2_Handle)self;
}

4
plugins/eg-sampler.lv2/sampler_ui.c

@ -168,7 +168,7 @@ on_canvas_expose(GtkWidget* widget, GdkEventExpose* event, gpointer data) @@ -168,7 +168,7 @@ on_canvas_expose(GtkWidget* widget, GdkEventExpose* event, gpointer data)
gtk_widget_get_allocation(widget, &size);
ui->width = size.width;
if ((uint32_t)ui->width > 2 * ui->requested_n_peaks) {
if (ui->width > 2 * ui->requested_n_peaks) {
request_peaks(ui, 2 * ui->requested_n_peaks);
}
@ -177,7 +177,7 @@ on_canvas_expose(GtkWidget* widget, GdkEventExpose* event, gpointer data) @@ -177,7 +177,7 @@ on_canvas_expose(GtkWidget* widget, GdkEventExpose* event, gpointer data)
cairo_set_line_width(cr, 1.0);
cairo_translate(cr, 0.5, 0.5);
const int mid_y = size.height / 2;
const double mid_y = size.height / 2.0;
const float* const peaks = ui->precv.peaks;
const int32_t n_peaks = ui->precv.n_peaks;

4
plugins/eg-scope.lv2/examploscope.c

@ -124,7 +124,7 @@ instantiate(const LV2_Descriptor* descriptor, @@ -124,7 +124,7 @@ instantiate(const LV2_Descriptor* descriptor,
// Set default UI settings
self->ui_spp = 50;
self->ui_amp = 1.0;
self->ui_amp = 1.0f;
// Map URIs and initialise forge/logger
map_sco_uris(self->map, &self->uris);
@ -252,7 +252,7 @@ run(LV2_Handle handle, uint32_t n_samples) @@ -252,7 +252,7 @@ run(LV2_Handle handle, uint32_t n_samples)
lv2_atom_forge_key(&self->forge, self->uris.ui_amp);
lv2_atom_forge_float(&self->forge, self->ui_amp);
lv2_atom_forge_key(&self->forge, self->uris.param_sampleRate);
lv2_atom_forge_float(&self->forge, self->rate);
lv2_atom_forge_float(&self->forge, (float)self->rate);
lv2_atom_forge_pop(&self->forge, &frame);
}

4
plugins/eg-scope.lv2/examploscope_ui.c

@ -353,8 +353,8 @@ process_channel(EgScopeUI* ui, @@ -353,8 +353,8 @@ process_channel(EgScopeUI* ui,
if (chn->idx == 0) {
++overflow;
}
chn->data_min[chn->idx] = 1.0;
chn->data_max[chn->idx] = -1.0;
chn->data_min[chn->idx] = 1.0f;
chn->data_max[chn->idx] = -1.0f;
}
}
*idx_end = chn->idx;

Loading…
Cancel
Save