[SCM] calf/master: fix some conversion warnings.
js at users.alioth.debian.org
js at users.alioth.debian.org
Tue May 7 15:39:07 UTC 2013
The following commit has been merged in the master branch:
commit a4a0b1c460e5007652fbc29eeb9fbc7e61db7491
Author: Torben Hohn <torbenh at gmx.de>
Date: Sat Jan 24 21:56:52 2009 +0100
fix some conversion warnings.
diff --git a/src/calf/modules.h b/src/calf/modules.h
index c08c1a7..e1a0fbc 100644
--- a/src/calf/modules.h
+++ b/src/calf/modules.h
@@ -212,7 +212,7 @@ public:
left_hi.set_hp(dsp::clip(*params[par_basscut], 20.f, (float)(srate * 0.49f)), srate);
right_lo.copy_coeffs(left_lo);
right_hi.copy_coeffs(left_hi);
- predelay_amt = srate * (*params[par_predelay]) * (1.0f / 1000.0f) + 1;
+ predelay_amt = (int) (srate * (*params[par_predelay]) * (1.0f / 1000.0f) + 1);
}
uint32_t process(uint32_t offset, uint32_t numsamples, uint32_t inputs_mask, uint32_t outputs_mask) {
numsamples += offset;
@@ -432,7 +432,7 @@ public:
{
// premature optimization is a root of all evil; it can be done with integers only - but later :)
double v = counter * (1.0 / (65536.0 * 32768.0));
- return 32768 + 32768 * (v - v*v*v) * (1.0 / 0.3849);
+ return (int) (32768 + 32768 * (v - v*v*v) * (1.0 / 0.3849));
}
/// Increase or decrease aspeed towards raspeed, with required negative and positive rate
inline bool incr_towards(float &aspeed, float raspeed, float delta_decc, float delta_acc)
diff --git a/src/calf/organ.h b/src/calf/organ.h
index 2c7dbd5..a9a8d0e 100644
--- a/src/calf/organ.h
+++ b/src/calf/organ.h
@@ -156,8 +156,8 @@ public:
void update_pitch()
{
float phase = dsp::midi_note_to_phase(note, 100 * parameters->global_transpose + parameters->global_detune, sample_rate_ref);
- dpphase.set(phase * parameters->percussion_harmonic * parameters->pitch_bend);
- moddphase.set(phase * parameters->percussion_fm_harmonic * parameters->pitch_bend);
+ dpphase.set((long int) (phase * parameters->percussion_harmonic * parameters->pitch_bend));
+ moddphase.set((long int) (phase * parameters->percussion_fm_harmonic * parameters->pitch_bend));
}
// this doesn't really have a voice interface
void render_percussion_to(float (*buf)[2], int nsamples);
diff --git a/src/ctl_keyboard.cpp b/src/ctl_keyboard.cpp
index 86879fb..9933912 100644
--- a/src/ctl_keyboard.cpp
+++ b/src/ctl_keyboard.cpp
@@ -176,7 +176,7 @@ calf_keyboard_button_press (GtkWidget *widget, GdkEventButton *event)
return FALSE;
gtk_widget_grab_focus(widget);
int vel = 127;
- self->last_key = calf_keyboard_pos_to_note(self, event->x, event->y, &vel);
+ self->last_key = calf_keyboard_pos_to_note(self, (int)event->x, (int)event->y, &vel);
if (self->last_key != -1)
self->sink->note_on(self->last_key, vel);
return FALSE;
@@ -202,7 +202,7 @@ calf_keyboard_pointer_motion (GtkWidget *widget, GdkEventMotion *event)
if (!self->interactive)
return FALSE;
int vel = 127;
- int key = calf_keyboard_pos_to_note(self, event->x, event->y, &vel);
+ int key = calf_keyboard_pos_to_note(self, (int)event->x, (int)event->y, &vel);
if (key != self->last_key)
{
if (self->last_key != -1)
--
calf audio plugins packaging
More information about the pkg-multimedia-commits
mailing list